@graphql-hive/laboratory
Version:
[Hive](https://the-guild.dev/graphql/hive) is a fully open-source schema registry, analytics, metrics and gateway for [GraphQL federation](https://the-guild.dev/graphql/hive/federation) and other GraphQL APIs.
40,843 lines • 1.75 MB
JavaScript
"use strict";
(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x2)(function(x2) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x2 + '" is not supported');
});
var __esm = (fn2, res, err) => function __init() {
if (err) throw err[0];
try {
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
} catch (e) {
throw err = [e], e;
}
};
var __commonJS = (cb, mod) => function __require2() {
try {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
} catch (e) {
throw mod = 0, e;
}
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to2, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to2, key) && key !== except)
__defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to2;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/errors.js
function onUnexpectedError(e) {
if (!isCancellationError(e)) {
errorHandler.onUnexpectedError(e);
}
return void 0;
}
function transformErrorForSerialization(error) {
if (error instanceof Error) {
const { name, message } = error;
const stack = error.stacktrace || error.stack;
return {
$isError: true,
name,
message,
stack,
noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error)
};
}
return error;
}
function isCancellationError(error) {
if (error instanceof CancellationError) {
return true;
}
return error instanceof Error && error.name === canceledName && error.message === canceledName;
}
var ErrorHandler, errorHandler, canceledName, CancellationError, ErrorNoTelemetry, BugIndicatingError;
var init_errors = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/errors.js"() {
ErrorHandler = class {
constructor() {
this.listeners = [];
this.unexpectedErrorHandler = function(e) {
setTimeout(() => {
if (e.stack) {
if (ErrorNoTelemetry.isErrorNoTelemetry(e)) {
throw new ErrorNoTelemetry(e.message + "\n\n" + e.stack);
}
throw new Error(e.message + "\n\n" + e.stack);
}
throw e;
}, 0);
};
}
emit(e) {
this.listeners.forEach((listener) => {
listener(e);
});
}
onUnexpectedError(e) {
this.unexpectedErrorHandler(e);
this.emit(e);
}
// For external errors, we don't want the listeners to be called
onUnexpectedExternalError(e) {
this.unexpectedErrorHandler(e);
}
};
errorHandler = new ErrorHandler();
canceledName = "Canceled";
CancellationError = class extends Error {
constructor() {
super(canceledName);
this.name = this.message;
}
};
ErrorNoTelemetry = class _ErrorNoTelemetry extends Error {
constructor(msg) {
super(msg);
this.name = "CodeExpectedError";
}
static fromError(err) {
if (err instanceof _ErrorNoTelemetry) {
return err;
}
const result = new _ErrorNoTelemetry();
result.message = err.message;
result.stack = err.stack;
return result;
}
static isErrorNoTelemetry(err) {
return err.name === "CodeExpectedError";
}
};
BugIndicatingError = class _BugIndicatingError extends Error {
constructor(message) {
super(message || "An unexpected bug occurred.");
Object.setPrototypeOf(this, _BugIndicatingError.prototype);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/functional.js
function createSingleCallFunction(fn2, fnDidRunCallback) {
const _this = this;
let didCall = false;
let result;
return function() {
if (didCall) {
return result;
}
didCall = true;
if (fnDidRunCallback) {
try {
result = fn2.apply(_this, arguments);
} finally {
fnDidRunCallback();
}
} else {
result = fn2.apply(_this, arguments);
}
return result;
};
}
var init_functional = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/functional.js"() {
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/iterator.js
var Iterable;
var init_iterator = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/iterator.js"() {
(function(Iterable2) {
function is(thing) {
return thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function";
}
Iterable2.is = is;
const _empty2 = Object.freeze([]);
function empty() {
return _empty2;
}
Iterable2.empty = empty;
function* single(element) {
yield element;
}
Iterable2.single = single;
function wrap2(iterableOrElement) {
if (is(iterableOrElement)) {
return iterableOrElement;
} else {
return single(iterableOrElement);
}
}
Iterable2.wrap = wrap2;
function from(iterable) {
return iterable || _empty2;
}
Iterable2.from = from;
function* reverse(array) {
for (let i = array.length - 1; i >= 0; i--) {
yield array[i];
}
}
Iterable2.reverse = reverse;
function isEmpty(iterable) {
return !iterable || iterable[Symbol.iterator]().next().done === true;
}
Iterable2.isEmpty = isEmpty;
function first(iterable) {
return iterable[Symbol.iterator]().next().value;
}
Iterable2.first = first;
function some(iterable, predicate) {
let i = 0;
for (const element of iterable) {
if (predicate(element, i++)) {
return true;
}
}
return false;
}
Iterable2.some = some;
function find(iterable, predicate) {
for (const element of iterable) {
if (predicate(element)) {
return element;
}
}
return void 0;
}
Iterable2.find = find;
function* filter(iterable, predicate) {
for (const element of iterable) {
if (predicate(element)) {
yield element;
}
}
}
Iterable2.filter = filter;
function* map(iterable, fn2) {
let index = 0;
for (const element of iterable) {
yield fn2(element, index++);
}
}
Iterable2.map = map;
function* flatMap(iterable, fn2) {
let index = 0;
for (const element of iterable) {
yield* fn2(element, index++);
}
}
Iterable2.flatMap = flatMap;
function* concat(...iterables) {
for (const iterable of iterables) {
yield* iterable;
}
}
Iterable2.concat = concat;
function reduce2(iterable, reducer, initialValue) {
let value = initialValue;
for (const element of iterable) {
value = reducer(value, element);
}
return value;
}
Iterable2.reduce = reduce2;
function* slice(arr, from2, to2 = arr.length) {
if (from2 < 0) {
from2 += arr.length;
}
if (to2 < 0) {
to2 += arr.length;
} else if (to2 > arr.length) {
to2 = arr.length;
}
for (; from2 < to2; from2++) {
yield arr[from2];
}
}
Iterable2.slice = slice;
function consume(iterable, atMost = Number.POSITIVE_INFINITY) {
const consumed = [];
if (atMost === 0) {
return [consumed, iterable];
}
const iterator = iterable[Symbol.iterator]();
for (let i = 0; i < atMost; i++) {
const next = iterator.next();
if (next.done) {
return [consumed, Iterable2.empty()];
}
consumed.push(next.value);
}
return [consumed, { [Symbol.iterator]() {
return iterator;
} }];
}
Iterable2.consume = consume;
async function asyncToArray(iterable) {
const result = [];
for await (const item of iterable) {
result.push(item);
}
return Promise.resolve(result);
}
Iterable2.asyncToArray = asyncToArray;
})(Iterable || (Iterable = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/lifecycle.js
function setDisposableTracker(tracker) {
disposableTracker = tracker;
}
function trackDisposable(x2) {
disposableTracker?.trackDisposable(x2);
return x2;
}
function markAsDisposed(disposable) {
disposableTracker?.markAsDisposed(disposable);
}
function setParentOfDisposable(child, parent) {
disposableTracker?.setParent(child, parent);
}
function setParentOfDisposables(children, parent) {
if (!disposableTracker) {
return;
}
for (const child of children) {
disposableTracker.setParent(child, parent);
}
}
function dispose(arg) {
if (Iterable.is(arg)) {
const errors = [];
for (const d of arg) {
if (d) {
try {
d.dispose();
} catch (e) {
errors.push(e);
}
}
}
if (errors.length === 1) {
throw errors[0];
} else if (errors.length > 1) {
throw new AggregateError(errors, "Encountered errors while disposing of store");
}
return Array.isArray(arg) ? [] : arg;
} else if (arg) {
arg.dispose();
return arg;
}
}
function combinedDisposable(...disposables) {
const parent = toDisposable(() => dispose(disposables));
setParentOfDisposables(disposables, parent);
return parent;
}
function toDisposable(fn2) {
const self2 = trackDisposable({
dispose: createSingleCallFunction(() => {
markAsDisposed(self2);
fn2();
})
});
return self2;
}
var TRACK_DISPOSABLES, disposableTracker, DisposableStore, Disposable;
var init_lifecycle = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/lifecycle.js"() {
init_functional();
init_iterator();
TRACK_DISPOSABLES = false;
disposableTracker = null;
if (TRACK_DISPOSABLES) {
const __is_disposable_tracked__ = "__is_disposable_tracked__";
setDisposableTracker(new class {
trackDisposable(x2) {
const stack = new Error("Potentially leaked disposable").stack;
setTimeout(() => {
if (!x2[__is_disposable_tracked__]) {
console.log(stack);
}
}, 3e3);
}
setParent(child, parent) {
if (child && child !== Disposable.None) {
try {
child[__is_disposable_tracked__] = true;
} catch {
}
}
}
markAsDisposed(disposable) {
if (disposable && disposable !== Disposable.None) {
try {
disposable[__is_disposable_tracked__] = true;
} catch {
}
}
}
markAsSingleton(disposable) {
}
}());
}
DisposableStore = class _DisposableStore {
static {
this.DISABLE_DISPOSED_WARNING = false;
}
constructor() {
this._toDispose = /* @__PURE__ */ new Set();
this._isDisposed = false;
trackDisposable(this);
}
/**
* Dispose of all registered disposables and mark this object as disposed.
*
* Any future disposables added to this object will be disposed of on `add`.
*/
dispose() {
if (this._isDisposed) {
return;
}
markAsDisposed(this);
this._isDisposed = true;
this.clear();
}
/**
* @return `true` if this object has been disposed of.
*/
get isDisposed() {
return this._isDisposed;
}
/**
* Dispose of all registered disposables but do not mark this object as disposed.
*/
clear() {
if (this._toDispose.size === 0) {
return;
}
try {
dispose(this._toDispose);
} finally {
this._toDispose.clear();
}
}
/**
* Add a new {@link IDisposable disposable} to the collection.
*/
add(o) {
if (!o) {
return o;
}
if (o === this) {
throw new Error("Cannot register a disposable on itself!");
}
setParentOfDisposable(o, this);
if (this._isDisposed) {
if (!_DisposableStore.DISABLE_DISPOSED_WARNING) {
console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack);
}
} else {
this._toDispose.add(o);
}
return o;
}
/**
* Deletes the value from the store, but does not dispose it.
*/
deleteAndLeak(o) {
if (!o) {
return;
}
if (this._toDispose.has(o)) {
this._toDispose.delete(o);
setParentOfDisposable(o, null);
}
}
};
Disposable = class {
static {
this.None = Object.freeze({ dispose() {
} });
}
constructor() {
this._store = new DisposableStore();
trackDisposable(this);
setParentOfDisposable(this._store, this);
}
dispose() {
markAsDisposed(this);
this._store.dispose();
}
/**
* Adds `o` to the collection of disposables managed by this object.
*/
_register(o) {
if (o === this) {
throw new Error("Cannot register a disposable on itself!");
}
return this._store.add(o);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/linkedList.js
var Node, LinkedList;
var init_linkedList = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/linkedList.js"() {
Node = class _Node {
static {
this.Undefined = new _Node(void 0);
}
constructor(element) {
this.element = element;
this.next = _Node.Undefined;
this.prev = _Node.Undefined;
}
};
LinkedList = class {
constructor() {
this._first = Node.Undefined;
this._last = Node.Undefined;
this._size = 0;
}
get size() {
return this._size;
}
isEmpty() {
return this._first === Node.Undefined;
}
clear() {
let node = this._first;
while (node !== Node.Undefined) {
const next = node.next;
node.prev = Node.Undefined;
node.next = Node.Undefined;
node = next;
}
this._first = Node.Undefined;
this._last = Node.Undefined;
this._size = 0;
}
unshift(element) {
return this._insert(element, false);
}
push(element) {
return this._insert(element, true);
}
_insert(element, atTheEnd) {
const newNode = new Node(element);
if (this._first === Node.Undefined) {
this._first = newNode;
this._last = newNode;
} else if (atTheEnd) {
const oldLast = this._last;
this._last = newNode;
newNode.prev = oldLast;
oldLast.next = newNode;
} else {
const oldFirst = this._first;
this._first = newNode;
newNode.next = oldFirst;
oldFirst.prev = newNode;
}
this._size += 1;
let didRemove = false;
return () => {
if (!didRemove) {
didRemove = true;
this._remove(newNode);
}
};
}
shift() {
if (this._first === Node.Undefined) {
return void 0;
} else {
const res = this._first.element;
this._remove(this._first);
return res;
}
}
pop() {
if (this._last === Node.Undefined) {
return void 0;
} else {
const res = this._last.element;
this._remove(this._last);
return res;
}
}
_remove(node) {
if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
const anchor = node.prev;
anchor.next = node.next;
node.next.prev = anchor;
} else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
this._first = Node.Undefined;
this._last = Node.Undefined;
} else if (node.next === Node.Undefined) {
this._last = this._last.prev;
this._last.next = Node.Undefined;
} else if (node.prev === Node.Undefined) {
this._first = this._first.next;
this._first.prev = Node.Undefined;
}
this._size -= 1;
}
*[Symbol.iterator]() {
let node = this._first;
while (node !== Node.Undefined) {
yield node.element;
node = node.next;
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/stopwatch.js
var hasPerformanceNow, StopWatch;
var init_stopwatch = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/stopwatch.js"() {
hasPerformanceNow = globalThis.performance && typeof globalThis.performance.now === "function";
StopWatch = class _StopWatch {
static create(highResolution) {
return new _StopWatch(highResolution);
}
constructor(highResolution) {
this._now = hasPerformanceNow && highResolution === false ? Date.now : globalThis.performance.now.bind(globalThis.performance);
this._startTime = this._now();
this._stopTime = -1;
}
stop() {
this._stopTime = this._now();
}
reset() {
this._startTime = this._now();
this._stopTime = -1;
}
elapsed() {
if (this._stopTime !== -1) {
return this._stopTime - this._startTime;
}
return this._now() - this._startTime;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/event.js
var _enableListenerGCedWarning, _enableDisposeWithListenerWarning, _enableSnapshotPotentialLeakWarning, Event, EventProfiling, _globalLeakWarningThreshold, LeakageMonitor, Stacktrace, ListenerLeakError, ListenerRefusalError, UniqueContainer, compactionThreshold, forEachListener, _listenerFinalizers, Emitter, EventDeliveryQueuePrivate;
var init_event = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/event.js"() {
init_errors();
init_functional();
init_lifecycle();
init_linkedList();
init_stopwatch();
_enableListenerGCedWarning = false;
_enableDisposeWithListenerWarning = false;
_enableSnapshotPotentialLeakWarning = false;
(function(Event2) {
Event2.None = () => Disposable.None;
function _addLeakageTraceLogic(options) {
if (_enableSnapshotPotentialLeakWarning) {
const { onDidAddListener: origListenerDidAdd } = options;
const stack = Stacktrace.create();
let count = 0;
options.onDidAddListener = () => {
if (++count === 2) {
console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here");
stack.print();
}
origListenerDidAdd?.();
};
}
}
function defer(event, disposable) {
return debounce(event, () => void 0, 0, void 0, true, void 0, disposable);
}
Event2.defer = defer;
function once(event) {
return (listener, thisArgs = null, disposables) => {
let didFire = false;
let result = void 0;
result = event((e) => {
if (didFire) {
return;
} else if (result) {
result.dispose();
} else {
didFire = true;
}
return listener.call(thisArgs, e);
}, null, disposables);
if (didFire) {
result.dispose();
}
return result;
};
}
Event2.once = once;
function onceIf(event, condition) {
return Event2.once(Event2.filter(event, condition));
}
Event2.onceIf = onceIf;
function map(event, map2, disposable) {
return snapshot((listener, thisArgs = null, disposables) => event((i) => listener.call(thisArgs, map2(i)), null, disposables), disposable);
}
Event2.map = map;
function forEach(event, each, disposable) {
return snapshot((listener, thisArgs = null, disposables) => event((i) => {
each(i);
listener.call(thisArgs, i);
}, null, disposables), disposable);
}
Event2.forEach = forEach;
function filter(event, filter2, disposable) {
return snapshot((listener, thisArgs = null, disposables) => event((e) => filter2(e) && listener.call(thisArgs, e), null, disposables), disposable);
}
Event2.filter = filter;
function signal(event) {
return event;
}
Event2.signal = signal;
function any(...events) {
return (listener, thisArgs = null, disposables) => {
const disposable = combinedDisposable(...events.map((event) => event((e) => listener.call(thisArgs, e))));
return addAndReturnDisposable(disposable, disposables);
};
}
Event2.any = any;
function reduce2(event, merge, initial, disposable) {
let output = initial;
return map(event, (e) => {
output = merge(output, e);
return output;
}, disposable);
}
Event2.reduce = reduce2;
function snapshot(event, disposable) {
let listener;
const options = {
onWillAddFirstListener() {
listener = event(emitter.fire, emitter);
},
onDidRemoveLastListener() {
listener?.dispose();
}
};
if (!disposable) {
_addLeakageTraceLogic(options);
}
const emitter = new Emitter(options);
disposable?.add(emitter);
return emitter.event;
}
function addAndReturnDisposable(d, store) {
if (store instanceof Array) {
store.push(d);
} else if (store) {
store.add(d);
}
return d;
}
function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) {
let subscription;
let output = void 0;
let handle = void 0;
let numDebouncedCalls = 0;
let doFire;
const options = {
leakWarningThreshold,
onWillAddFirstListener() {
subscription = event((cur) => {
numDebouncedCalls++;
output = merge(output, cur);
if (leading && !handle) {
emitter.fire(output);
output = void 0;
}
doFire = () => {
const _output = output;
output = void 0;
handle = void 0;
if (!leading || numDebouncedCalls > 1) {
emitter.fire(_output);
}
numDebouncedCalls = 0;
};
if (typeof delay === "number") {
clearTimeout(handle);
handle = setTimeout(doFire, delay);
} else {
if (handle === void 0) {
handle = 0;
queueMicrotask(doFire);
}
}
});
},
onWillRemoveListener() {
if (flushOnListenerRemove && numDebouncedCalls > 0) {
doFire?.();
}
},
onDidRemoveLastListener() {
doFire = void 0;
subscription.dispose();
}
};
if (!disposable) {
_addLeakageTraceLogic(options);
}
const emitter = new Emitter(options);
disposable?.add(emitter);
return emitter.event;
}
Event2.debounce = debounce;
function accumulate(event, delay = 0, disposable) {
return Event2.debounce(event, (last, e) => {
if (!last) {
return [e];
}
last.push(e);
return last;
}, delay, void 0, true, void 0, disposable);
}
Event2.accumulate = accumulate;
function latch(event, equals3 = (a, b) => a === b, disposable) {
let firstCall = true;
let cache;
return filter(event, (value) => {
const shouldEmit = firstCall || !equals3(value, cache);
firstCall = false;
cache = value;
return shouldEmit;
}, disposable);
}
Event2.latch = latch;
function split(event, isT, disposable) {
return [
Event2.filter(event, isT, disposable),
Event2.filter(event, (e) => !isT(e), disposable)
];
}
Event2.split = split;
function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) {
let buffer2 = _buffer.slice();
let listener = event((e) => {
if (buffer2) {
buffer2.push(e);
} else {
emitter.fire(e);
}
});
if (disposable) {
disposable.add(listener);
}
const flush = () => {
buffer2?.forEach((e) => emitter.fire(e));
buffer2 = null;
};
const emitter = new Emitter({
onWillAddFirstListener() {
if (!listener) {
listener = event((e) => emitter.fire(e));
if (disposable) {
disposable.add(listener);
}
}
},
onDidAddFirstListener() {
if (buffer2) {
if (flushAfterTimeout) {
setTimeout(flush);
} else {
flush();
}
}
},
onDidRemoveLastListener() {
if (listener) {
listener.dispose();
}
listener = null;
}
});
if (disposable) {
disposable.add(emitter);
}
return emitter.event;
}
Event2.buffer = buffer;
function chain(event, sythensize) {
const fn2 = (listener, thisArgs, disposables) => {
const cs = sythensize(new ChainableSynthesis());
return event(function(value) {
const result = cs.evaluate(value);
if (result !== HaltChainable) {
listener.call(thisArgs, result);
}
}, void 0, disposables);
};
return fn2;
}
Event2.chain = chain;
const HaltChainable = /* @__PURE__ */ Symbol("HaltChainable");
class ChainableSynthesis {
constructor() {
this.steps = [];
}
map(fn2) {
this.steps.push(fn2);
return this;
}
forEach(fn2) {
this.steps.push((v) => {
fn2(v);
return v;
});
return this;
}
filter(fn2) {
this.steps.push((v) => fn2(v) ? v : HaltChainable);
return this;
}
reduce(merge, initial) {
let last = initial;
this.steps.push((v) => {
last = merge(last, v);
return last;
});
return this;
}
latch(equals3 = (a, b) => a === b) {
let firstCall = true;
let cache;
this.steps.push((value) => {
const shouldEmit = firstCall || !equals3(value, cache);
firstCall = false;
cache = value;
return shouldEmit ? value : HaltChainable;
});
return this;
}
evaluate(value) {
for (const step of this.steps) {
value = step(value);
if (value === HaltChainable) {
break;
}
}
return value;
}
}
function fromNodeEventEmitter(emitter, eventName, map2 = (id) => id) {
const fn2 = (...args) => result.fire(map2(...args));
const onFirstListenerAdd = () => emitter.on(eventName, fn2);
const onLastListenerRemove = () => emitter.removeListener(eventName, fn2);
const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });
return result.event;
}
Event2.fromNodeEventEmitter = fromNodeEventEmitter;
function fromDOMEventEmitter(emitter, eventName, map2 = (id) => id) {
const fn2 = (...args) => result.fire(map2(...args));
const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn2);
const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn2);
const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });
return result.event;
}
Event2.fromDOMEventEmitter = fromDOMEventEmitter;
function toPromise(event) {
return new Promise((resolve2) => once(event)(resolve2));
}
Event2.toPromise = toPromise;
function fromPromise(promise) {
const result = new Emitter();
promise.then((res) => {
result.fire(res);
}, () => {
result.fire(void 0);
}).finally(() => {
result.dispose();
});
return result.event;
}
Event2.fromPromise = fromPromise;
function forward(from, to2) {
return from((e) => to2.fire(e));
}
Event2.forward = forward;
function runAndSubscribe(event, handler, initial) {
handler(initial);
return event((e) => handler(e));
}
Event2.runAndSubscribe = runAndSubscribe;
class EmitterObserver {
constructor(_observable, store) {
this._observable = _observable;
this._counter = 0;
this._hasChanged = false;
const options = {
onWillAddFirstListener: () => {
_observable.addObserver(this);
this._observable.reportChanges();
},
onDidRemoveLastListener: () => {
_observable.removeObserver(this);
}
};
if (!store) {
_addLeakageTraceLogic(options);
}
this.emitter = new Emitter(options);
if (store) {
store.add(this.emitter);
}
}
beginUpdate(_observable) {
this._counter++;
}
handlePossibleChange(_observable) {
}
handleChange(_observable, _change) {
this._hasChanged = true;
}
endUpdate(_observable) {
this._counter--;
if (this._counter === 0) {
this._observable.reportChanges();
if (this._hasChanged) {
this._hasChanged = false;
this.emitter.fire(this._observable.get());
}
}
}
}
function fromObservable(obs, store) {
const observer = new EmitterObserver(obs, store);
return observer.emitter.event;
}
Event2.fromObservable = fromObservable;
function fromObservableLight(observable) {
return (listener, thisArgs, disposables) => {
let count = 0;
let didChange = false;
const observer = {
beginUpdate() {
count++;
},
endUpdate() {
count--;
if (count === 0) {
observable.reportChanges();
if (didChange) {
didChange = false;
listener.call(thisArgs);
}
}
},
handlePossibleChange() {
},
handleChange() {
didChange = true;
}
};
observable.addObserver(observer);
observable.reportChanges();
const disposable = {
dispose() {
observable.removeObserver(observer);
}
};
if (disposables instanceof DisposableStore) {
disposables.add(disposable);
} else if (Array.isArray(disposables)) {
disposables.push(disposable);
}
return disposable;
};
}
Event2.fromObservableLight = fromObservableLight;
})(Event || (Event = {}));
EventProfiling = class _EventProfiling {
static {
this.all = /* @__PURE__ */ new Set();
}
static {
this._idPool = 0;
}
constructor(name) {
this.listenerCount = 0;
this.invocationCount = 0;
this.elapsedOverall = 0;
this.durations = [];
this.name = `${name}_${_EventProfiling._idPool++}`;
_EventProfiling.all.add(this);
}
start(listenerCount) {
this._stopWatch = new StopWatch();
this.listenerCount = listenerCount;
}
stop() {
if (this._stopWatch) {
const elapsed = this._stopWatch.elapsed();
this.durations.push(elapsed);
this.elapsedOverall += elapsed;
this.invocationCount += 1;
this._stopWatch = void 0;
}
}
};
_globalLeakWarningThreshold = -1;
LeakageMonitor = class _LeakageMonitor {
static {
this._idPool = 1;
}
constructor(_errorHandler, threshold, name = (_LeakageMonitor._idPool++).toString(16).padStart(3, "0")) {
this._errorHandler = _errorHandler;
this.threshold = threshold;
this.name = name;
this._warnCountdown = 0;
}
dispose() {
this._stacks?.clear();
}
check(stack, listenerCount) {
const threshold = this.threshold;
if (threshold <= 0 || listenerCount < threshold) {
return void 0;
}
if (!this._stacks) {
this._stacks = /* @__PURE__ */ new Map();
}
const count = this._stacks.get(stack.value) || 0;
this._stacks.set(stack.value, count + 1);
this._warnCountdown -= 1;
if (this._warnCountdown <= 0) {
this._warnCountdown = threshold * 0.5;
const [topStack, topCount] = this.getMostFrequentStack();
const message = `[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`;
console.warn(message);
console.warn(topStack);
const error = new ListenerLeakError(message, topStack);
this._errorHandler(error);
}
return () => {
const count2 = this._stacks.get(stack.value) || 0;
this._stacks.set(stack.value, count2 - 1);
};
}
getMostFrequentStack() {
if (!this._stacks) {
return void 0;
}
let topStack;
let topCount = 0;
for (const [stack, count] of this._stacks) {
if (!topStack || topCount < count) {
topStack = [stack, count];
topCount = count;
}
}
return topStack;
}
};
Stacktrace = class _Stacktrace {
static create() {
const err = new Error();
return new _Stacktrace(err.stack ?? "");
}
constructor(value) {
this.value = value;
}
print() {
console.warn(this.value.split("\n").slice(2).join("\n"));
}
};
ListenerLeakError = class extends Error {
constructor(message, stack) {
super(message);
this.name = "ListenerLeakError";
this.stack = stack;
}
};
ListenerRefusalError = class extends Error {
constructor(message, stack) {
super(message);
this.name = "ListenerRefusalError";
this.stack = stack;
}
};
UniqueContainer = class {
constructor(value) {
this.value = value;
}
};
compactionThreshold = 2;
forEachListener = (listeners, fn2) => {
if (listeners instanceof UniqueContainer) {
fn2(listeners);
} else {
for (let i = 0; i < listeners.length; i++) {
const l = listeners[i];
if (l) {
fn2(l);
}
}
}
};
if (_enableListenerGCedWarning) {
const leaks = [];
setInterval(() => {
if (leaks.length === 0) {
return;
}
console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:");
console.warn(leaks.join("\n"));
leaks.length = 0;
}, 3e3);
_listenerFinalizers = new FinalizationRegistry((heldValue) => {
if (typeof heldValue === "string") {
leaks.push(heldValue);
}
});
}
Emitter = class {
constructor(options) {
this._size = 0;
this._options = options;
this._leakageMon = _globalLeakWarningThreshold > 0 || this._options?.leakWarningThreshold ? new LeakageMonitor(options?.onListenerError ?? onUnexpectedError, this._options?.leakWarningThreshold ?? _globalLeakWarningThreshold) : void 0;
this._perfMon = this._options?._profName ? new EventProfiling(this._options._profName) : void 0;
this._deliveryQueue = this._options?.deliveryQueue;
}
dispose() {
if (!this._disposed) {
this._disposed = true;
if (this._deliveryQueue?.current === this) {
this._deliveryQueue.reset();
}
if (this._listeners) {
if (_enableDisposeWithListenerWarning) {
const listeners = this._listeners;
queueMicrotask(() => {
forEachListener(listeners, (l) => l.stack?.print());
});
}
this._listeners = void 0;
this._size = 0;
}
this._options?.onDidRemoveLastListener?.();
this._leakageMon?.dispose();
}
}
/**
* For the public to allow to subscribe
* to events from this Emitter
*/
get event() {
this._event ??= (callback, thisArgs, disposables) => {
if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
const message = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
console.warn(message);
const tuple = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1];
const error = new ListenerRefusalError(`${message}. HINT: Stack shows most frequent listener (${tuple[1]}-times)`, tuple[0]);
const errorHandler2 = this._options?.onListenerError || onUnexpectedError;
errorHandler2(error);
return Disposable.None;
}
if (this._disposed) {
return Disposable.None;
}
if (thisArgs) {
callback = callback.bind(thisArgs);
}
const contained = new UniqueContainer(callback);
let removeMonitor;
let stack;
if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) {
contained.stack = Stacktrace.create();
removeMonitor = this._leakageMon.check(contained.stack, this._size + 1);
}
if (_enableDisposeWithListenerWarning) {
contained.stack = stack ?? Stacktrace.create();
}
if (!this._listeners) {
this._options?.onWillAddFirstListener?.(this);
this._listeners = contained;
this._options?.onDidAddFirstListener?.(this);
} else if (this._listeners instanceof UniqueContainer) {
this._deliveryQueue ??= new EventDeliveryQueuePrivate();
this._listeners = [this._listeners, contained];
} else {
this._listeners.push(contained);
}
this._size++;
const result = toDisposable(() => {
_listenerFinalizers?.unregister(result);
removeMonitor?.();
this._removeListener(contained);
});
if (disposables instanceof DisposableStore) {
disposables.add(result);
} else if (Array.isArray(disposables)) {
disposables.push(result);
}
if (_listenerFinalizers) {
const stack2 = new Error().stack.split("\n").slice(2, 3).join("\n").trim();
const match = /(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(stack2);
_listenerFinalizers.register(result, match?.[2] ?? stack2, result);
}
return result;
};
return this._event;
}
_removeListener(listener) {
this._options?.onWillRemoveListener?.(this);
if (!this._listeners) {
return;
}
if (this._size === 1) {
this._listeners = void 0;
this._options?.onDidRemoveLastListener?.(this);
this._size = 0;
return;
}
const listeners = this._listeners;
const index = listeners.indexOf(listener);
if (index === -1) {
console.log("disposed?", this._disposed);
console.log("size?", this._size);
console.log("arr?", JSON.stringify(this._listeners));
throw new Error("Attempted to dispose unknown listener");
}
this._size--;
listeners[index] = void 0;
const adjustDeliveryQueue = this._deliveryQueue.current === this;
if (this._size * compactionThreshold <= listeners.length) {
let n = 0;
for (let i = 0; i < listeners.length; i++) {
if (listeners[i]) {
listeners[n++] = listeners[i];
} else if (adjustDeliveryQueue) {
this._deliveryQueue.end--;
if (n < this._deliveryQueue.i) {
this._deliveryQueue.i--;
}
}
}
listeners.length = n;
}
}
_deliver(listener, value) {
if (!listener) {
return;
}
const errorHandler2 = this._options?.onListenerError || onUnexpectedError;
if (!errorHandler2) {
listener.value(value);
return;
}
try {
listener.value(value);
} catch (e) {
errorHandler2(e);
}
}
/** Delivers items in the queue. Assumes the queue is ready to go. */
_deliverQueue(dq) {
const listeners = dq.current._listeners;
while (dq.i < dq.end) {
this._deliver(listeners[dq.i++], dq.value);
}
dq.reset();
}
/**
* To be kept private to fire an event to
* subscribers
*/
fire(event) {
if (this._deliveryQueue?.current) {
this._deliverQueue(this._deliveryQueue);
this._perfMon?.stop();
}
this._perfMon?.start(this._size);
if (!this._listeners) {
} else if (this._listeners instanceof UniqueContainer) {
this._deliver(this._listeners, event);
} else {
const dq = this._deliveryQueue;
dq.enqueue(this, event, this._listeners.length);
this._deliverQueue(dq);
}
this._perfMon?.stop();
}
hasListeners() {
return this._size > 0;
}
};
EventDeliveryQueuePrivate = class {
constructor() {
this.i = -1;
this.end = 0;
}
enqueue(emitter, value, end) {
this.i = 0;
this.end = end;
this.current = emitter;
this.value = value;
}
reset() {
this.i = this.end;
this.current = void 0;
this.value = void 0;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/nls.messages.js
function getNLSMessages() {
return globalThis._VSCODE_NLS_MESSAGES;
}
function getNLSLanguage() {
return globalThis._VSCODE_NLS_LANGUAGE;
}
var init_nls_messages = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/nls.messages.js"() {
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/nls.js
function _format(message, args) {
let result;
if (args.length === 0) {
result = message;
} else {
result = message.replace(/\{(\d+)\}/g, (match, rest) => {
const index = rest[0];
const arg = args[index];
let result2 = match;
if (typeof arg === "string") {
result2 = arg;
} else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) {
result2 = String(arg);
}
return result2;
});
}
if (isPseudo) {
result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D";
}
return result;
}
function localize(data, message, ...args) {
if (typeof data === "number") {
return _format(lookupMessage(data, message), args);
}
return _format(message, args);
}
function lookupMessage(index, fallback) {
const message = getNLSMessages()?.[index];
if (typeof message !== "string") {
if (typeof fallback === "string") {
return fallback;
}
throw new Error(`!!! NLS MISSING: ${index} !!!`);
}
return message;
}
var isPseudo;
var init_nls = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/nls.js"() {
init_nls_messages();
init_nls_messages();
isPseudo = getNLSLanguage() === "pseudo" || typeof document !== "undefined" && document.location && document.location.hash.indexOf("pseudo=true") >= 0;
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/platform.js
var LANGUAGE_DEFAULT, _isWindows, _isMacintosh, _isLinux, _isLinuxSnap, _isNative, _isWeb, _isElectron, _isIOS, _isCI, _isMobile, _locale, _language, _platformLocale, _translationsConfigFile, _userAgent, $globalThis, nodeProcess, isElectronProcess, isElectronRenderer, _platform, isWindows, isMacintosh, isNative, isWeb, isWebWorker, webWorkerOrigin, userAgent, setTimeout0IsFaster, setTimeout0, isChrome, isFirefox, isSafari, isEdge, isAndroid;
var init_platform = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/platform.js"() {
init_nls();
LANGUAGE_DEFAULT = "en";
_isWindows = false;
_isMacintosh = false;
_isLinux = false;
_isLinuxSnap = false;
_isNative = false;
_isWeb = false;
_isElectron = false;
_isIOS = false;
_isCI = false;
_isMobile = false;
_locale = void 0;
_language = LANGUAGE_DEFAULT;
_platformLocale = LANGUAGE_DEFAULT;
_translationsConfigFile = void 0;
_userAgent = void 0;
$globalThis = globalThis;
nodeProcess = void 0;
if (typeof $globalThis.vscode !== "undefined" && typeof $globalThis.vscode.process !== "undefined") {
nodeProcess = $globalThis.vscode.process;
} else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") {
nodeProcess = process;
}
isElectronProcess = typeof nodeProcess?.versions?.electron === "string";
isElectronRenderer = isElectronProcess && nodeProcess?.type === "renderer";
if (typeof nodeProcess === "object") {
_isWindows = nodeProcess.platform === "win32";
_isMacintosh = nodeProcess.platform === "darwin";
_isLinux = nodeProcess.platform === "linux";
_isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"];
_isElectron = isElectronProcess;
_isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"];
_locale = LANGUAGE_DEFAULT;
_language = LANGUAGE_DEFAULT;
const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"];
if (rawNlsConfig) {
try {
const nlsConfig = JSON.parse(rawNlsConfig);
_locale = nlsConfig.userLocale;
_platformLocale = nlsConfig.osLocale;
_language = nlsConfig.resolvedLanguage || LANGUAGE_DEFAULT;
_translationsConfigFile = nlsConfig.languagePack?.translationsConfigFile;
} catch (e) {
}
}
_isNative = true;
} else if (typeof navigator === "object" && !isElectronRenderer) {
_userAgent = navigator.userAgent;
_isWindows = _userAgent.indexOf("Windows") >= 0;
_isMacintosh = _userAgent.indexOf("Macintosh") >= 0;
_isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
_isLinux = _userAgent.indexOf("Linux") >= 0;
_isMobile = _userAgent?.indexOf("Mobi") >= 0;
_isWeb = true;
_language = getNLSLanguage() || LANGUAGE_DEFAULT;
_locale = navigator.language.toLowerCase();
_platformLocale = _locale;
} else {
console.error("Unable to resolve platform.");
}
_platform = 0;
if (_isMacintosh) {
_platform = 1;
} else if (_isWindows) {
_platform = 3;
} else if (_isLinux) {
_platform = 2;
}
isWindows = _isWindows;
isMacintosh = _isMacintosh;
isNative = _isNative;
isWeb = _isWeb;
isWebWorker = _isWeb && typeof $globalThis.importScripts === "function";
webWorkerOrigin = isWebWorker ? $globalThis.origin : void 0;
userAgent = _userAgent;
setTimeout0IsFaster = typeof $globalThis.postMessage === "function" && !$globalThis.importScripts;
setTimeout0 = (() => {
if (setTimeout0IsFaster) {
const pending = [];
$globalThis.addEventListener("message", (e) => {
if (e.data && e.data.vscodeScheduleAsyncWork) {
for (let i = 0, len = pending.length; i < len; i++) {
const candidate = pending[i];
if (candidate.id === e.data.vscodeScheduleAsyncWork) {
pending.splice(i, 1);
candidate.callback();
return;
}
}
}
});
let lastId = 0;
return (callback) => {
const myId = ++lastId;
pending.push({
id: myId,
callback
});
$globalThis.postMessage({ vscodeScheduleAsyncWork: myId }, "*");
};
}
return (callback) => setTimeout(callback);
})();
isChrome = !!(userAgent && userAgent.indexOf("Chrome") >= 0);
isFirefox = !!(userAgent && userAgent.indexOf("Firefox") >= 0);
isSafari = !!(!isChrome && (userAgent && userAgent.indexOf("Safari") >= 0));
isEdge = !!(userAgent && userAgent.indexOf("Edg/") >= 0);
isAndroid = !!(userAgent && userAgent.indexOf("Android") >= 0);
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/cache.js
function identity(t) {
return t;
}
var LRUCachedFunction;
var init_cache = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/cache.js"() {
LRUCachedFunction = class {
constructor(arg1, arg2) {
this.lastCache = void 0;
this.lastArgKey = void 0;
if (typeof arg1 === "function") {
this._fn = arg1;
this._computeKey = identity;
} else {
this._fn = arg2;
this._computeKey = arg1.getCacheKey;
}
}
get(arg) {
const key = this._computeKey(arg);
if (this.lastArgKey !== key) {
this.lastArgKey = key;
this.lastCache = this._fn(arg);
}
return this.lastCache;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/lazy.js
var Lazy;
var init_lazy = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/lazy.js"() {
Lazy = class {
constructor(executor) {
this.executor = executor;
this._didRun = false;
}
/**
* Get the wrapped value.
*
* This will force evaluation of the lazy value if it has not been resolved yet. Lazy values are only
* resolved once. `getValue` will re-throw exceptions that are hit while resolving the value
*/
get value() {
if (!this._didRun) {
try {
this._value = this.executor();
} catch (err) {
this._error = err;
} finally {
this._didRun = true;
}
}
if (this._error) {
throw this._error;
}
return this._value;
}
/**
* Get the wrapped value without forcing evaluation.
*/
get rawValue() {
return this._value;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/strings.js
function escapeRegExpCharacters(value) {
return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, "\\$&");
}
function splitLines(str) {
return str.split(/\r\n|\r|\n/);
}
function firstNonWhitespaceIndex(str) {
for (let i = 0, len = str.length; i < len; i++) {
const chCode = str.charCodeAt(i);
if (chCode !== 32 && chCode !== 9) {
return i;
}
}
return -1;
}
function lastNonWhitespaceIndex(str, startIndex = str.length - 1) {
for (let i = startIndex; i >= 0; i--) {
const chCode = str.charCodeAt(i);
if (chCode !== 32 && chCode !== 9) {
return i;
}
}
return -1;
}
function isUpperAsciiLetter(code) {
return code >= 65 && code <= 90;
}
function isHighSurrogate(charCode) {
return 55296 <= charCode && charCode <= 56319;
}
function isLowSurrogate(charCode) {
return 56320 <= charCode && charCode <= 57343;
}
function computeCodePoint(highSurrogate, lowSurrogate) {
return (highSurrogate - 55296 << 10) + (lowSurrogate - 56320) + 65536;
}
function getNextCodePoint(str, len, offset) {
const charCode = str.charCodeAt(offset);
if (isHighSurrogate(charCode) && offset + 1 < len) {
const nextCharCode = str.charCodeAt(offset + 1);
if (isLowSurrogate(nextCharCode)) {
return computeCodePoint(charCode, nextCharCode);
}
}
return charCode;
}
function isBasicASCII(str) {
return IS_BASIC_ASCII.test(str);
}
function getGraphemeBreakRawData() {
return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]");
}
var IS_BASIC_ASCII, UTF8_BOM_CHARACTER, GraphemeBreakTree, AmbiguousCharacters, InvisibleCharacters;
var init_strings = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/strings.js"() {
init_cache();
init_lazy();
IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/;
UTF8_BOM_CHARACTER = String.fromCharCode(
65279
/* CharCode.UTF8_BOM */
);
GraphemeBreakTree = class _GraphemeBreakTree {
static {
this._INSTANCE = null;
}
static getInstance() {
if (!_GraphemeBreakTree._INSTANCE) {
_GraphemeBreakTree._INSTANCE = new _GraphemeBreakTree();
}
return _GraphemeBreakTree._INSTANCE;
}
constructor() {
this._data = getGraphemeBreakRawData();
}
getGraphemeBreakType(codePoint) {
if (codePoint < 32) {
if (codePoint === 10) {
return 3;
}
if (codePoint === 13) {
return 2;
}
return 4;
}
if (codePoint < 127) {
return 0;
}
const data = this._data;
const nodeCount = data.length / 3;
let nodeIndex = 1;
while (nodeIndex <= nodeCount) {
if (codePoint < data[3 * nodeIndex]) {
nodeIndex = 2 * nodeIndex;
} else if (codePoint > data[3 * nodeIndex + 1]) {
nodeIndex = 2 * nodeIndex + 1;
} else {
return data[3 * nodeIndex + 2];
}
}
return 0;
}
};
AmbiguousCharacters = class _AmbiguousCharacters {
static {
this.ambiguousCharacterData = new Lazy(() => {
return JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}');
});
}
static {
this.cache = new LRUCachedFunction({ getCacheKey: JSON.stringify }, (locales) => {
function arrayToMap(arr) {
const result = /* @__PURE__ */ new Map();
for (let i = 0; i < arr.length; i += 2) {
result.set(arr[i], arr[i + 1]);
}
return result;
}
function mergeMaps(map1, map2) {
const result = new Map(map1);
for (const [key, value] of map2) {
result.set(key, value);
}
return result;
}
function intersectMaps(map1, map2) {
if (!map1) {
return map2;
}
const result = /* @__PURE__ */ new Map();
for (const [key, value] of map1) {
if (map2.has(key)) {
result.set(key, value);
}
}
return result;
}
const data = this.ambiguousCharacterData.value;
let filteredLocales = locales.filter((l) => !l.startsWith("_") && l in data);
if (filteredLocales.length === 0) {
filteredLocales = ["_default"];
}
let languageSpecificMap = void 0;
for (const locale of filteredLocales) {
const map2 = arrayToMap(data[locale]);
languageSpecificMap = intersectMaps(languageSpecificMap, map2);
}
const commonMap = arrayToMap(data["_common"]);
const map = mergeMaps(commonMap, languageSpecificMap);
return new _AmbiguousCharacters(map);
});
}
static getInstance(locales) {
return _AmbiguousCharacters.cache.get(Array.from(locales));
}
static {
this._locales = new Lazy(() => Object.keys(_AmbiguousCharacters.ambiguousCharacterData.value).filter((k2) => !k2.startsWith("_")));
}
static getLocales() {
return _AmbiguousCharacters._locales.value;
}
constructor(confusableDictionary) {
this.confusableDictionary = confusableDictionary;
}
isAmbiguous(codePoint) {
return this.confusableDictionary.has(codePoint);
}
/**
* Returns the non basic ASCII code point that the given code point can be confused,
* or undefined if such code point does note exist.
*/
getPrimaryConfusable(codePoint) {
return this.confusableDictionary.get(codePoint);
}
getConfusableCodePoints() {
return new Set(this.confusableDictionary.keys());
}
};
InvisibleCharacters = class _InvisibleCharacters {
static getRawData() {
return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]");
}
static {
this._data = void 0;
}
static getData() {
if (!this._data) {
this._data = new Set(_InvisibleCharacters.getRawData());
}
return this._data;
}
static isInvisibleCharacter(codePoint) {
return _InvisibleCharacters.getData().has(codePoint);
}
static get codePoints() {
return _InvisibleCharacters.getData();
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/process.js
var safeProcess, vscodeGlobal, cwd, env, platform;
var init_process = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/process.js"() {
init_platform();
vscodeGlobal = globalThis.vscode;
if (typeof vscodeGlobal !== "undefined" && typeof vscodeGlobal.process !== "undefined") {
const sandboxProcess = vscodeGlobal.process;
safeProcess = {
get platform() {
return sandboxProcess.platform;
},
get arch() {
return sandboxProcess.arch;
},
get env() {
return sandboxProcess.env;
},
cwd() {
return sandboxProcess.cwd();
}
};
} else if (typeof process !== "undefined" && typeof process?.versions?.node === "string") {
safeProcess = {
get platform() {
return process.platform;
},
get arch() {
return process.arch;
},
get env() {
return process.env;
},
cwd() {
return process.env["VSCODE_CWD"] || process.cwd();
}
};
} else {
safeProcess = {
// Supported
get platform() {
return isWindows ? "win32" : isMacintosh ? "darwin" : "linux";
},
get arch() {
return void 0;
},
// Unsupported
get env() {
return {};
},
cwd() {
return "/";
}
};
}
cwd = safeProcess.cwd;
env = safeProcess.env;
platform = safeProcess.platform;
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/path.js
function validateObject(pathObject, name) {
if (pathObject === null || typeof pathObject !== "object") {
throw new ErrorInvalidArgType(name, "Object", pathObject);
}
}
function validateString(value, name) {
if (typeof value !== "string") {
throw new ErrorInvalidArgType(name, "string", value);
}
}
function isPathSeparator(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z || code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z;
}
function normalizeString(path, allowAboveRoot, separator, isPathSeparator2) {
let res = "";
let lastSegmentLength = 0;
let lastSlash = -1;
let dots = 0;
let code = 0;
for (let i = 0; i <= path.length; ++i) {
if (i < path.length) {
code = path.charCodeAt(i);
} else if (isPathSeparator2(code)) {
break;
} else {
code = CHAR_FORWARD_SLASH;
}
if (isPathSeparator2(code)) {
if (lastSlash === i - 1 || dots === 1) {
} else if (dots === 2) {
if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
if (res.length > 2) {
const lastSlashIndex = res.lastIndexOf(separator);
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
}
lastSlash = i;
dots = 0;
continue;
} else if (res.length !== 0) {
res = "";
lastSegmentLength = 0;
lastSlash = i;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
res += res.length > 0 ? `${separator}..` : "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) {
res += `${separator}${path.slice(lastSlash + 1, i)}`;
} else {
res = path.slice(lastSlash + 1, i);
}
lastSegmentLength = i - lastSlash - 1;
}
lastSlash = i;
dots = 0;
} else if (code === CHAR_DOT && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
function formatExt(ext) {
return ext ? `${ext[0] === "." ? "" : "."}${ext}` : "";
}
function _format2(sep2, pathObject) {
validateObject(pathObject, "pathObject");
const dir = pathObject.dir || pathObject.root;
const base = pathObject.base || `${pathObject.name || ""}${formatExt(pathObject.ext)}`;
if (!dir) {
return base;
}
return dir === pathObject.root ? `${dir}${base}` : `${dir}${sep2}${base}`;
}
var CHAR_UPPERCASE_A, CHAR_LOWERCASE_A, CHAR_UPPERCASE_Z, CHAR_LOWERCASE_Z, CHAR_DOT, CHAR_FORWARD_SLASH, CHAR_BACKWARD_SLASH, CHAR_COLON, CHAR_QUESTION_MARK, ErrorInvalidArgType, platformIsWin32, win32, posixCwd, posix, normalize, join, resolve, relative, dirname, basename, extname, sep;
var init_path = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/path.js"() {
init_process();
CHAR_UPPERCASE_A = 65;
CHAR_LOWERCASE_A = 97;
CHAR_UPPERCASE_Z = 90;
CHAR_LOWERCASE_Z = 122;
CHAR_DOT = 46;
CHAR_FORWARD_SLASH = 47;
CHAR_BACKWARD_SLASH = 92;
CHAR_COLON = 58;
CHAR_QUESTION_MARK = 63;
ErrorInvalidArgType = class extends Error {
constructor(name, expected, actual) {
let determiner;
if (typeof expected === "string" && expected.indexOf("not ") === 0) {
determiner = "must not be";
expected = expected.replace(/^not /, "");
} else {
determiner = "must be";
}
const type = name.indexOf(".") !== -1 ? "property" : "argument";
let msg = `The "${name}" ${type} ${determiner} of type ${expected}`;
msg += `. Received type ${typeof actual}`;
super(msg);
this.code = "ERR_INVALID_ARG_TYPE";
}
};
platformIsWin32 = platform === "win32";
win32 = {
// path.resolve([from ...], to)
resolve(...pathSegments) {
let resolvedDevice = "";
let resolvedTail = "";
let resolvedAbsolute = false;
for (let i = pathSegments.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = pathSegments[i];
validateString(path, `paths[${i}]`);
if (path.length === 0) {
continue;
}
} else if (resolvedDevice.length === 0) {
path = cwd();
} else {
path = env[`=${resolvedDevice}`] || cwd();
if (path === void 0 || path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() && path.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = "";
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparator(code)) {
rootEnd = 1;
isAbsolute = true;
}
} else if (isPathSeparator(code)) {
isAbsolute = true;
if (isPathSeparator(path.charCodeAt(1))) {
let j = 2;
let last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
} else {
rootEnd = 1;
}
} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase()) {
continue;
}
} else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0) {
break;
}
} else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0) {
break;
}
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
return resolvedAbsolute ? `${resolvedDevice}\\${resolvedTail}` : `${resolvedDevice}${resolvedTail}` || ".";
},
normalize(path) {
validateString(path, "path");
const len = path.length;
if (len === 0) {
return ".";
}
let rootEnd = 0;
let device;
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
return isPosixPathSeparator(code) ? "\\" : path;
}
if (isPathSeparator(code)) {
isAbsolute = true;
if (isPathSeparator(path.charCodeAt(1))) {
let j = 2;
let last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j === len) {
return `\\\\${firstPart}\\${path.slice(last)}\\`;
}
if (j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
} else {
rootEnd = 1;
}
} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparator(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : "";
if (tail.length === 0 && !isAbsolute) {
tail = ".";
}
if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
tail += "\\";
}
if (device === void 0) {
return isAbsolute ? `\\${tail}` : tail;
}
return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`;
},
isAbsolute(path) {
validateString(path, "path");
const len = path.length;
if (len === 0) {
return false;
}
const code = path.charCodeAt(0);
return isPathSeparator(code) || // Possible device root
len > 2 && isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON && isPathSeparator(path.charCodeAt(2));
},
join(...paths) {
if (paths.length === 0) {
return ".";
}
let joined;
let firstPart;
for (let i = 0; i < paths.length; ++i) {
const arg = paths[i];
validateString(arg, "path");
if (arg.length > 0) {
if (joined === void 0) {
joined = firstPart = arg;
} else {
joined += `\\${arg}`;
}
}
}
if (joined === void 0) {
return ".";
}
let needsReplace = true;
let slashCount = 0;
if (typeof firstPart === "string" && isPathSeparator(firstPart.charCodeAt(0))) {
++slashCount;
const firstLen = firstPart.length;
if (firstLen > 1 && isPathSeparator(firstPart.charCodeAt(1))) {
++slashCount;
if (firstLen > 2) {
if (isPathSeparator(firstPart.charCodeAt(2))) {
++slashCount;
} else {
needsReplace = false;
}
}
}
}
if (needsReplace) {
while (slashCount < joined.length && isPathSeparator(joined.charCodeAt(slashCount))) {
slashCount++;
}
if (slashCount >= 2) {
joined = `\\${joined.slice(slashCount)}`;
}
}
return win32.normalize(joined);
},
// It will solve the relative path from `from` to `to`, for instance:
// from = 'C:\\orandea\\test\\aaa'
// to = 'C:\\orandea\\impl\\bbb'
// The output of the function should be: '..\\..\\impl\\bbb'
relative(from, to2) {
validateString(from, "from");
validateString(to2, "to");
if (from === to2) {
return "";
}
const fromOrig = win32.resolve(from);
const toOrig = win32.resolve(to2);
if (fromOrig === toOrig) {
return "";
}
from = fromOrig.toLowerCase();
to2 = toOrig.toLowerCase();
if (from === to2) {
return "";
}
let fromStart = 0;
while (fromStart < from.length && from.charCodeAt(fromStart) === CHAR_BACKWARD_SLASH) {
fromStart++;
}
let fromEnd = from.length;
while (fromEnd - 1 > fromStart && from.charCodeAt(fromEnd - 1) === CHAR_BACKWARD_SLASH) {
fromEnd--;
}
const fromLen = fromEnd - fromStart;
let toStart = 0;
while (toStart < to2.length && to2.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
toStart++;
}
let toEnd = to2.length;
while (toEnd - 1 > toStart && to2.charCodeAt(toEnd - 1) === CHAR_BACKWARD_SLASH) {
toEnd--;
}
const toLen = toEnd - toStart;
const length = fromLen < toLen ? fromLen : toLen;
let lastCommonSep = -1;
let i = 0;
for (; i < length; i++) {
const fromCode = from.charCodeAt(fromStart + i);
if (fromCode !== to2.charCodeAt(toStart + i)) {
break;
} else if (fromCode === CHAR_BACKWARD_SLASH) {
lastCommonSep = i;
}
}
if (i !== length) {
if (lastCommonSep === -1) {
return toOrig;
}
} else {
if (toLen > length) {
if (to2.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
return toOrig.slice(toStart + i + 1);
}
if (i === 2) {
return toOrig.slice(toStart + i);
}
}
if (fromLen > length) {
if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
lastCommonSep = i;
} else if (i === 2) {
lastCommonSep = 3;
}
}
if (lastCommonSep === -1) {
lastCommonSep = 0;
}
}
let out = "";
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
out += out.length === 0 ? ".." : "\\..";
}
}
toStart += lastCommonSep;
if (out.length > 0) {
return `${out}${toOrig.slice(toStart, toEnd)}`;
}
if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) {
++toStart;
}
return toOrig.slice(toStart, toEnd);
},
toNamespacedPath(path) {
if (typeof path !== "string" || path.length === 0) {
return path;
}
const resolvedPath = win32.resolve(path);
if (resolvedPath.length <= 2) {
return path;
}
if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
const code = resolvedPath.charCodeAt(2);
if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
}
}
} else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0)) && resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
return `\\\\?\\${resolvedPath}`;
}
return path;
},
dirname(path) {
validateString(path, "path");
const len = path.length;
if (len === 0) {
return ".";
}
let rootEnd = -1;
let offset = 0;
const code = path.charCodeAt(0);
if (len === 1) {
return isPathSeparator(code) ? path : ".";
}
if (isPathSeparator(code)) {
rootEnd = offset = 1;
if (isPathSeparator(path.charCodeAt(1))) {
let j = 2;
let last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j === len) {
return path;
}
if (j !== last) {
rootEnd = offset = j + 1;
}
}
}
}
} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2;
offset = rootEnd;
}
let end = -1;
let matchedSlash = true;
for (let i = len - 1; i >= offset; --i) {
if (isPathSeparator(path.charCodeAt(i))) {
if (!matchedSlash) {
end = i;
break;
}
} else {
matchedSlash = false;
}
}
if (end === -1) {
if (rootEnd === -1) {
return ".";
}
end = rootEnd;
}
return path.slice(0, end);
},
basename(path, suffix) {
if (suffix !== void 0) {
validateString(suffix, "suffix");
}
validateString(path, "path");
let start = 0;
let end = -1;
let matchedSlash = true;
let i;
if (path.length >= 2 && isWindowsDeviceRoot(path.charCodeAt(0)) && path.charCodeAt(1) === CHAR_COLON) {
start = 2;
}
if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
if (suffix === path) {
return "";
}
let extIdx = suffix.length - 1;
let firstNonSlashEnd = -1;
for (i = path.length - 1; i >= start; --i) {
const code = path.charCodeAt(i);
if (isPathSeparator(code)) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else {
if (firstNonSlashEnd === -1) {
matchedSlash = false;
firstNonSlashEnd = i + 1;
}
if (extIdx >= 0) {
if (code === suffix.charCodeAt(extIdx)) {
if (--extIdx === -1) {
end = i;
}
} else {
extIdx = -1;
end = firstNonSlashEnd;
}
}
}
}
if (start === end) {
end = firstNonSlashEnd;
} else if (end === -1) {
end = path.length;
}
return path.slice(start, end);
}
for (i = path.length - 1; i >= start; --i) {
if (isPathSeparator(path.charCodeAt(i))) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) {
return "";
}
return path.slice(start, end);
},
extname(path) {
validateString(path, "path");
let start = 0;
let startDot = -1;
let startPart = 0;
let end = -1;
let matchedSlash = true;
let preDotState = 0;
if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
start = startPart = 2;
}
for (let i = path.length - 1; i >= start; --i) {
const code = path.charCodeAt(i);
if (isPathSeparator(code)) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
matchedSlash = false;
end = i + 1;
}
if (code === CHAR_DOT) {
if (startDot === -1) {
startDot = i;
} else if (preDotState !== 1) {
preDotState = 1;
}
} else if (startDot !== -1) {
preDotState = -1;
}
}
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return "";
}
return path.slice(startDot, end);
},
format: _format2.bind(null, "\\"),
parse(path) {
validateString(path, "path");
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
if (path.length === 0) {
return ret;
}
const len = path.length;
let rootEnd = 0;
let code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparator(code)) {
ret.root = ret.dir = path;
return ret;
}
ret.base = ret.name = path;
return ret;
}
if (isPathSeparator(code)) {
rootEnd = 1;
if (isPathSeparator(path.charCodeAt(1))) {
let j = 2;
let last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparator(path.charCodeAt(j))) {
j++;
}
if (j === len) {
rootEnd = j;
} else if (j !== last) {
rootEnd = j + 1;
}
}
}
}
} else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
if (len <= 2) {
ret.root = ret.dir = path;
return ret;
}
rootEnd = 2;
if (isPathSeparator(path.charCodeAt(2))) {
if (len === 3) {
ret.root = ret.dir = path;
return ret;
}
rootEnd = 3;
}
}
if (rootEnd > 0) {
ret.root = path.slice(0, rootEnd);
}
let startDot = -1;
let startPart = rootEnd;
let end = -1;
let matchedSlash = true;
let i = path.length - 1;
let preDotState = 0;
for (; i >= rootEnd; --i) {
code = path.charCodeAt(i);
if (isPathSeparator(code)) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
matchedSlash = false;
end = i + 1;
}
if (code === CHAR_DOT) {
if (startDot === -1) {
startDot = i;
} else if (preDotState !== 1) {
preDotState = 1;
}
} else if (startDot !== -1) {
preDotState = -1;
}
}
if (end !== -1) {
if (startDot === -1 || // We saw a non-dot character immediately before the dot
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
ret.base = ret.name = path.slice(startPart, end);
} else {
ret.name = path.slice(startPart, startDot);
ret.base = path.slice(startPart, end);
ret.ext = path.slice(startDot, end);
}
}
if (startPart > 0 && startPart !== rootEnd) {
ret.dir = path.slice(0, startPart - 1);
} else {
ret.dir = ret.root;
}
return ret;
},
sep: "\\",
delimiter: ";",
win32: null,
posix: null
};
posixCwd = (() => {
if (platformIsWin32) {
const regexp = /\\/g;
return () => {
const cwd2 = cwd().replace(regexp, "/");
return cwd2.slice(cwd2.indexOf("/"));
};
}
return () => cwd();
})();
posix = {
// path.resolve([from ...], to)
resolve(...pathSegments) {
let resolvedPath = "";
let resolvedAbsolute = false;
for (let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
const path = i >= 0 ? pathSegments[i] : posixCwd();
validateString(path, `paths[${i}]`);
if (path.length === 0) {
continue;
}
resolvedPath = `${path}/${resolvedPath}`;
resolvedAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
}
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
if (resolvedAbsolute) {
return `/${resolvedPath}`;
}
return resolvedPath.length > 0 ? resolvedPath : ".";
},
normalize(path) {
validateString(path, "path");
if (path.length === 0) {
return ".";
}
const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH;
path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
if (path.length === 0) {
if (isAbsolute) {
return "/";
}
return trailingSeparator ? "./" : ".";
}
if (trailingSeparator) {
path += "/";
}
return isAbsolute ? `/${path}` : path;
},
isAbsolute(path) {
validateString(path, "path");
return path.length > 0 && path.charCodeAt(0) === CHAR_FORWARD_SLASH;
},
join(...paths) {
if (paths.length === 0) {
return ".";
}
let joined;
for (let i = 0; i < paths.length; ++i) {
const arg = paths[i];
validateString(arg, "path");
if (arg.length > 0) {
if (joined === void 0) {
joined = arg;
} else {
joined += `/${arg}`;
}
}
}
if (joined === void 0) {
return ".";
}
return posix.normalize(joined);
},
relative(from, to2) {
validateString(from, "from");
validateString(to2, "to");
if (from === to2) {
return "";
}
from = posix.resolve(from);
to2 = posix.resolve(to2);
if (from === to2) {
return "";
}
const fromStart = 1;
const fromEnd = from.length;
const fromLen = fromEnd - fromStart;
const toStart = 1;
const toLen = to2.length - toStart;
const length = fromLen < toLen ? fromLen : toLen;
let lastCommonSep = -1;
let i = 0;
for (; i < length; i++) {
const fromCode = from.charCodeAt(fromStart + i);
if (fromCode !== to2.charCodeAt(toStart + i)) {
break;
} else if (fromCode === CHAR_FORWARD_SLASH) {
lastCommonSep = i;
}
}
if (i === length) {
if (toLen > length) {
if (to2.charCodeAt(toStart + i) === CHAR_FORWARD_SLASH) {
return to2.slice(toStart + i + 1);
}
if (i === 0) {
return to2.slice(toStart + i);
}
} else if (fromLen > length) {
if (from.charCodeAt(fromStart + i) === CHAR_FORWARD_SLASH) {
lastCommonSep = i;
} else if (i === 0) {
lastCommonSep = 0;
}
}
}
let out = "";
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
if (i === fromEnd || from.charCodeAt(i) === CHAR_FORWARD_SLASH) {
out += out.length === 0 ? ".." : "/..";
}
}
return `${out}${to2.slice(toStart + lastCommonSep)}`;
},
toNamespacedPath(path) {
return path;
},
dirname(path) {
validateString(path, "path");
if (path.length === 0) {
return ".";
}
const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
let end = -1;
let matchedSlash = true;
for (let i = path.length - 1; i >= 1; --i) {
if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
if (!matchedSlash) {
end = i;
break;
}
} else {
matchedSlash = false;
}
}
if (end === -1) {
return hasRoot ? "/" : ".";
}
if (hasRoot && end === 1) {
return "//";
}
return path.slice(0, end);
},
basename(path, suffix) {
if (suffix !== void 0) {
validateString(suffix, "ext");
}
validateString(path, "path");
let start = 0;
let end = -1;
let matchedSlash = true;
let i;
if (suffix !== void 0 && suffix.length > 0 && suffix.length <= path.length) {
if (suffix === path) {
return "";
}
let extIdx = suffix.length - 1;
let firstNonSlashEnd = -1;
for (i = path.length - 1; i >= 0; --i) {
const code = path.charCodeAt(i);
if (code === CHAR_FORWARD_SLASH) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else {
if (firstNonSlashEnd === -1) {
matchedSlash = false;
firstNonSlashEnd = i + 1;
}
if (extIdx >= 0) {
if (code === suffix.charCodeAt(extIdx)) {
if (--extIdx === -1) {
end = i;
}
} else {
extIdx = -1;
end = firstNonSlashEnd;
}
}
}
}
if (start === end) {
end = firstNonSlashEnd;
} else if (end === -1) {
end = path.length;
}
return path.slice(start, end);
}
for (i = path.length - 1; i >= 0; --i) {
if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) {
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) {
return "";
}
return path.slice(start, end);
},
extname(path) {
validateString(path, "path");
let startDot = -1;
let startPart = 0;
let end = -1;
let matchedSlash = true;
let preDotState = 0;
for (let i = path.length - 1; i >= 0; --i) {
const code = path.charCodeAt(i);
if (code === CHAR_FORWARD_SLASH) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
matchedSlash = false;
end = i + 1;
}
if (code === CHAR_DOT) {
if (startDot === -1) {
startDot = i;
} else if (preDotState !== 1) {
preDotState = 1;
}
} else if (startDot !== -1) {
preDotState = -1;
}
}
if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
return "";
}
return path.slice(startDot, end);
},
format: _format2.bind(null, "/"),
parse(path) {
validateString(path, "path");
const ret = { root: "", dir: "", base: "", ext: "", name: "" };
if (path.length === 0) {
return ret;
}
const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH;
let start;
if (isAbsolute) {
ret.root = "/";
start = 1;
} else {
start = 0;
}
let startDot = -1;
let startPart = 0;
let end = -1;
let matchedSlash = true;
let i = path.length - 1;
let preDotState = 0;
for (; i >= start; --i) {
const code = path.charCodeAt(i);
if (code === CHAR_FORWARD_SLASH) {
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
matchedSlash = false;
end = i + 1;
}
if (code === CHAR_DOT) {
if (startDot === -1) {
startDot = i;
} else if (preDotState !== 1) {
preDotState = 1;
}
} else if (startDot !== -1) {
preDotState = -1;
}
}
if (end !== -1) {
const start2 = startPart === 0 && isAbsolute ? 1 : startPart;
if (startDot === -1 || // We saw a non-dot character immediately before the dot
preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
ret.base = ret.name = path.slice(start2, end);
} else {
ret.name = path.slice(start2, startDot);
ret.base = path.slice(start2, end);
ret.ext = path.slice(startDot, end);
}
}
if (startPart > 0) {
ret.dir = path.slice(0, startPart - 1);
} else if (isAbsolute) {
ret.dir = "/";
}
return ret;
},
sep: "/",
delimiter: ":",
win32: null,
posix: null
};
posix.win32 = win32.win32 = win32;
posix.posix = win32.posix = posix;
normalize = platformIsWin32 ? win32.normalize : posix.normalize;
join = platformIsWin32 ? win32.join : posix.join;
resolve = platformIsWin32 ? win32.resolve : posix.resolve;
relative = platformIsWin32 ? win32.relative : posix.relative;
dirname = platformIsWin32 ? win32.dirname : posix.dirname;
basename = platformIsWin32 ? win32.basename : posix.basename;
extname = platformIsWin32 ? win32.extname : posix.extname;
sep = platformIsWin32 ? win32.sep : posix.sep;
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/uri.js
function _validateUri(ret, _strict) {
if (!ret.scheme && _strict) {
throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${ret.authority}", path: "${ret.path}", query: "${ret.query}", fragment: "${ret.fragment}"}`);
}
if (ret.scheme && !_schemePattern.test(ret.scheme)) {
throw new Error("[UriError]: Scheme contains illegal characters.");
}
if (ret.path) {
if (ret.authority) {
if (!_singleSlashStart.test(ret.path)) {
throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
}
} else {
if (_doubleSlashStart.test(ret.path)) {
throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
}
}
}
}
function _schemeFix(scheme, _strict) {
if (!scheme && !_strict) {
return "file";
}
return scheme;
}
function _referenceResolution(scheme, path) {
switch (scheme) {
case "https":
case "http":
case "file":
if (!path) {
path = _slash;
} else if (path[0] !== _slash) {
path = _slash + path;
}
break;
}
return path;
}
function encodeURIComponentFast(uriComponent, isPath, isAuthority) {
let res = void 0;
let nativeEncodePos = -1;
for (let pos = 0; pos < uriComponent.length; pos++) {
const code = uriComponent.charCodeAt(pos);
if (code >= 97 && code <= 122 || code >= 65 && code <= 90 || code >= 48 && code <= 57 || code === 45 || code === 46 || code === 95 || code === 126 || isPath && code === 47 || isAuthority && code === 91 || isAuthority && code === 93 || isAuthority && code === 58) {
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
nativeEncodePos = -1;
}
if (res !== void 0) {
res += uriComponent.charAt(pos);
}
} else {
if (res === void 0) {
res = uriComponent.substr(0, pos);
}
const escaped = encodeTable[code];
if (escaped !== void 0) {
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
nativeEncodePos = -1;
}
res += escaped;
} else if (nativeEncodePos === -1) {
nativeEncodePos = pos;
}
}
}
if (nativeEncodePos !== -1) {
res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
}
return res !== void 0 ? res : uriComponent;
}
function encodeURIComponentMinimal(path) {
let res = void 0;
for (let pos = 0; pos < path.length; pos++) {
const code = path.charCodeAt(pos);
if (code === 35 || code === 63) {
if (res === void 0) {
res = path.substr(0, pos);
}
res += encodeTable[code];
} else {
if (res !== void 0) {
res += path[pos];
}
}
}
return res !== void 0 ? res : path;
}
function uriToFsPath(uri, keepDriveLetterCasing) {
let value;
if (uri.authority && uri.path.length > 1 && uri.scheme === "file") {
value = `//${uri.authority}${uri.path}`;
} else if (uri.path.charCodeAt(0) === 47 && (uri.path.charCodeAt(1) >= 65 && uri.path.charCodeAt(1) <= 90 || uri.path.charCodeAt(1) >= 97 && uri.path.charCodeAt(1) <= 122) && uri.path.charCodeAt(2) === 58) {
if (!keepDriveLetterCasing) {
value = uri.path[1].toLowerCase() + uri.path.substr(2);
} else {
value = uri.path.substr(1);
}
} else {
value = uri.path;
}
if (isWindows) {
value = value.replace(/\//g, "\\");
}
return value;
}
function _asFormatted(uri, skipEncoding) {
const encoder = !skipEncoding ? encodeURIComponentFast : encodeURIComponentMinimal;
let res = "";
let { scheme, authority, path, query, fragment } = uri;
if (scheme) {
res += scheme;
res += ":";
}
if (authority || scheme === "file") {
res += _slash;
res += _slash;
}
if (authority) {
let idx = authority.indexOf("@");
if (idx !== -1) {
const userinfo = authority.substr(0, idx);
authority = authority.substr(idx + 1);
idx = userinfo.lastIndexOf(":");
if (idx === -1) {
res += encoder(userinfo, false, false);
} else {
res += encoder(userinfo.substr(0, idx), false, false);
res += ":";
res += encoder(userinfo.substr(idx + 1), false, true);
}
res += "@";
}
authority = authority.toLowerCase();
idx = authority.lastIndexOf(":");
if (idx === -1) {
res += encoder(authority, false, true);
} else {
res += encoder(authority.substr(0, idx), false, true);
res += authority.substr(idx);
}
}
if (path) {
if (path.length >= 3 && path.charCodeAt(0) === 47 && path.charCodeAt(2) === 58) {
const code = path.charCodeAt(1);
if (code >= 65 && code <= 90) {
path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`;
}
} else if (path.length >= 2 && path.charCodeAt(1) === 58) {
const code = path.charCodeAt(0);
if (code >= 65 && code <= 90) {
path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`;
}
}
res += encoder(path, true, false);
}
if (query) {
res += "?";
res += encoder(query, false, false);
}
if (fragment) {
res += "#";
res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment;
}
return res;
}
function decodeURIComponentGraceful(str) {
try {
return decodeURIComponent(str);
} catch {
if (str.length > 3) {
return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
} else {
return str;
}
}
}
function percentDecode(str) {
if (!str.match(_rEncodedAsHex)) {
return str;
}
return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));
}
var _schemePattern, _singleSlashStart, _doubleSlashStart, _empty, _slash, _regexp, URI, _pathSepMarker, Uri, encodeTable, _rEncodedAsHex;
var init_uri = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/uri.js"() {
init_path();
init_platform();
_schemePattern = /^\w[\w\d+.-]*$/;
_singleSlashStart = /^\//;
_doubleSlashStart = /^\/\//;
_empty = "";
_slash = "/";
_regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
URI = class _URI {
static isUri(thing) {
if (thing instanceof _URI) {
return true;
}
if (!thing) {
return false;
}
return typeof thing.authority === "string" && typeof thing.fragment === "string" && typeof thing.path === "string" && typeof thing.query === "string" && typeof thing.scheme === "string" && typeof thing.fsPath === "string" && typeof thing.with === "function" && typeof thing.toString === "function";
}
/**
* @internal
*/
constructor(schemeOrData, authority, path, query, fragment, _strict = false) {
if (typeof schemeOrData === "object") {
this.scheme = schemeOrData.scheme || _empty;
this.authority = schemeOrData.authority || _empty;
this.path = schemeOrData.path || _empty;
this.query = schemeOrData.query || _empty;
this.fragment = schemeOrData.fragment || _empty;
} else {
this.scheme = _schemeFix(schemeOrData, _strict);
this.authority = authority || _empty;
this.path = _referenceResolution(this.scheme, path || _empty);
this.query = query || _empty;
this.fragment = fragment || _empty;
_validateUri(this, _strict);
}
}
// ---- filesystem path -----------------------
/**
* Returns a string representing the corresponding file system path of this URI.
* Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
* platform specific path separator.
*
* * Will *not* validate the path for invalid characters and semantics.
* * Will *not* look at the scheme of this URI.
* * The result shall *not* be used for display purposes but for accessing a file on disk.
*
*
* The *difference* to `URI#path` is the use of the platform specific separator and the handling
* of UNC paths. See the below sample of a file-uri with an authority (UNC path).
*
* ```ts
const u = URI.parse('file://server/c$/folder/file.txt')
u.authority === 'server'
u.path === '/shares/c$/file.txt'
u.fsPath === '\\server\c$\folder\file.txt'
```
*
* Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
* namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
* with URIs that represent files on disk (`file` scheme).
*/
get fsPath() {
return uriToFsPath(this, false);
}
// ---- modify to new -------------------------
with(change) {
if (!change) {
return this;
}
let { scheme, authority, path, query, fragment } = change;
if (scheme === void 0) {
scheme = this.scheme;
} else if (scheme === null) {
scheme = _empty;
}
if (authority === void 0) {
authority = this.authority;
} else if (authority === null) {
authority = _empty;
}
if (path === void 0) {
path = this.path;
} else if (path === null) {
path = _empty;
}
if (query === void 0) {
query = this.query;
} else if (query === null) {
query = _empty;
}
if (fragment === void 0) {
fragment = this.fragment;
} else if (fragment === null) {
fragment = _empty;
}
if (scheme === this.scheme && authority === this.authority && path === this.path && query === this.query && fragment === this.fragment) {
return this;
}
return new Uri(scheme, authority, path, query, fragment);
}
// ---- parse & validate ------------------------
/**
* Creates a new URI from a string, e.g. `http://www.example.com/some/path`,
* `file:///usr/home`, or `scheme:with/path`.
*
* @param value A string which represents an URI (see `URI#toString`).
*/
static parse(value, _strict = false) {
const match = _regexp.exec(value);
if (!match) {
return new Uri(_empty, _empty, _empty, _empty, _empty);
}
return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
}
/**
* Creates a new URI from a file system path, e.g. `c:\my\files`,
* `/usr/home`, or `\\server\share\some\path`.
*
* The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
* as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
* `URI.parse('file://' + path)` because the path might contain characters that are
* interpreted (# and ?). See the following sample:
* ```ts
const good = URI.file('/coding/c#/project1');
good.scheme === 'file';
good.path === '/coding/c#/project1';
good.fragment === '';
const bad = URI.parse('file://' + '/coding/c#/project1');
bad.scheme === 'file';
bad.path === '/coding/c'; // path is now broken
bad.fragment === '/project1';
```
*
* @param path A file system path (see `URI#fsPath`)
*/
static file(path) {
let authority = _empty;
if (isWindows) {
path = path.replace(/\\/g, _slash);
}
if (path[0] === _slash && path[1] === _slash) {
const idx = path.indexOf(_slash, 2);
if (idx === -1) {
authority = path.substring(2);
path = _slash;
} else {
authority = path.substring(2, idx);
path = path.substring(idx) || _slash;
}
}
return new Uri("file", authority, path, _empty, _empty);
}
/**
* Creates new URI from uri components.
*
* Unless `strict` is `true` the scheme is defaults to be `file`. This function performs
* validation and should be used for untrusted uri components retrieved from storage,
* user input, command arguments etc
*/
static from(components, strict) {
const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict);
return result;
}
/**
* Join a URI path with path fragments and normalizes the resulting path.
*
* @param uri The input URI.
* @param pathFragment The path fragment to add to the URI path.
* @returns The resulting URI.
*/
static joinPath(uri, ...pathFragment) {
if (!uri.path) {
throw new Error(`[UriError]: cannot call joinPath on URI without path`);
}
let newPath;
if (isWindows && uri.scheme === "file") {
newPath = _URI.file(win32.join(uriToFsPath(uri, true), ...pathFragment)).path;
} else {
newPath = posix.join(uri.path, ...pathFragment);
}
return uri.with({ path: newPath });
}
// ---- printing/externalize ---------------------------
/**
* Creates a string representation for this URI. It's guaranteed that calling
* `URI.parse` with the result of this function creates an URI which is equal
* to this URI.
*
* * The result shall *not* be used for display purposes but for externalization or transport.
* * The result will be encoded using the percentage encoding and encoding happens mostly
* ignore the scheme-specific encoding rules.
*
* @param skipEncoding Do not encode the result, default is `false`
*/
toString(skipEncoding = false) {
return _asFormatted(this, skipEncoding);
}
toJSON() {
return this;
}
static revive(data) {
if (!data) {
return data;
} else if (data instanceof _URI) {
return data;
} else {
const result = new Uri(data);
result._formatted = data.external ?? null;
result._fsPath = data._sep === _pathSepMarker ? data.fsPath ?? null : null;
return result;
}
}
};
_pathSepMarker = isWindows ? 1 : void 0;
Uri = class extends URI {
constructor() {
super(...arguments);
this._formatted = null;
this._fsPath = null;
}
get fsPath() {
if (!this._fsPath) {
this._fsPath = uriToFsPath(this, false);
}
return this._fsPath;
}
toString(skipEncoding = false) {
if (!skipEncoding) {
if (!this._formatted) {
this._formatted = _asFormatted(this, false);
}
return this._formatted;
} else {
return _asFormatted(this, true);
}
}
toJSON() {
const res = {
$mid: 1
/* MarshalledId.Uri */
};
if (this._fsPath) {
res.fsPath = this._fsPath;
res._sep = _pathSepMarker;
}
if (this._formatted) {
res.external = this._formatted;
}
if (this.path) {
res.path = this.path;
}
if (this.scheme) {
res.scheme = this.scheme;
}
if (this.authority) {
res.authority = this.authority;
}
if (this.query) {
res.query = this.query;
}
if (this.fragment) {
res.fragment = this.fragment;
}
return res;
}
};
encodeTable = {
[
58
/* CharCode.Colon */
]: "%3A",
// gen-delims
[
47
/* CharCode.Slash */
]: "%2F",
[
63
/* CharCode.QuestionMark */
]: "%3F",
[
35
/* CharCode.Hash */
]: "%23",
[
91
/* CharCode.OpenSquareBracket */
]: "%5B",
[
93
/* CharCode.CloseSquareBracket */
]: "%5D",
[
64
/* CharCode.AtSign */
]: "%40",
[
33
/* CharCode.ExclamationMark */
]: "%21",
// sub-delims
[
36
/* CharCode.DollarSign */
]: "%24",
[
38
/* CharCode.Ampersand */
]: "%26",
[
39
/* CharCode.SingleQuote */
]: "%27",
[
40
/* CharCode.OpenParen */
]: "%28",
[
41
/* CharCode.CloseParen */
]: "%29",
[
42
/* CharCode.Asterisk */
]: "%2A",
[
43
/* CharCode.Plus */
]: "%2B",
[
44
/* CharCode.Comma */
]: "%2C",
[
59
/* CharCode.Semicolon */
]: "%3B",
[
61
/* CharCode.Equals */
]: "%3D",
[
32
/* CharCode.Space */
]: "%20"
};
_rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/network.js
var Schemas, connectionTokenQueryName, RemoteAuthoritiesImpl, RemoteAuthorities, VSCODE_AUTHORITY, FileAccessImpl, FileAccess, COI;
var init_network = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/network.js"() {
init_errors();
init_platform();
init_strings();
init_uri();
init_path();
(function(Schemas2) {
Schemas2.inMemory = "inmemory";
Schemas2.vscode = "vscode";
Schemas2.internal = "private";
Schemas2.walkThrough = "walkThrough";
Schemas2.walkThroughSnippet = "walkThroughSnippet";
Schemas2.http = "http";
Schemas2.https = "https";
Schemas2.file = "file";
Schemas2.mailto = "mailto";
Schemas2.untitled = "untitled";
Schemas2.data = "data";
Schemas2.command = "command";
Schemas2.vscodeRemote = "vscode-remote";
Schemas2.vscodeRemoteResource = "vscode-remote-resource";
Schemas2.vscodeManagedRemoteResource = "vscode-managed-remote-resource";
Schemas2.vscodeUserData = "vscode-userdata";
Schemas2.vscodeCustomEditor = "vscode-custom-editor";
Schemas2.vscodeNotebookCell = "vscode-notebook-cell";
Schemas2.vscodeNotebookCellMetadata = "vscode-notebook-cell-metadata";
Schemas2.vscodeNotebookCellMetadataDiff = "vscode-notebook-cell-metadata-diff";
Schemas2.vscodeNotebookCellOutput = "vscode-notebook-cell-output";
Schemas2.vscodeNotebookCellOutputDiff = "vscode-notebook-cell-output-diff";
Schemas2.vscodeNotebookMetadata = "vscode-notebook-metadata";
Schemas2.vscodeInteractiveInput = "vscode-interactive-input";
Schemas2.vscodeSettings = "vscode-settings";
Schemas2.vscodeWorkspaceTrust = "vscode-workspace-trust";
Schemas2.vscodeTerminal = "vscode-terminal";
Schemas2.vscodeChatCodeBlock = "vscode-chat-code-block";
Schemas2.vscodeChatCodeCompareBlock = "vscode-chat-code-compare-block";
Schemas2.vscodeChatSesssion = "vscode-chat-editor";
Schemas2.webviewPanel = "webview-panel";
Schemas2.vscodeWebview = "vscode-webview";
Schemas2.extension = "extension";
Schemas2.vscodeFileResource = "vscode-file";
Schemas2.tmp = "tmp";
Schemas2.vsls = "vsls";
Schemas2.vscodeSourceControl = "vscode-scm";
Schemas2.commentsInput = "comment";
Schemas2.codeSetting = "code-setting";
Schemas2.outputChannel = "output";
})(Schemas || (Schemas = {}));
connectionTokenQueryName = "tkn";
RemoteAuthoritiesImpl = class {
constructor() {
this._hosts = /* @__PURE__ */ Object.create(null);
this._ports = /* @__PURE__ */ Object.create(null);
this._connectionTokens = /* @__PURE__ */ Object.create(null);
this._preferredWebSchema = "http";
this._delegate = null;
this._serverRootPath = "/";
}
setPreferredWebSchema(schema) {
this._preferredWebSchema = schema;
}
get _remoteResourcesPath() {
return posix.join(this._serverRootPath, Schemas.vscodeRemoteResource);
}
rewrite(uri) {
if (this._delegate) {
try {
return this._delegate(uri);
} catch (err) {
onUnexpectedError(err);
return uri;
}
}
const authority = uri.authority;
let host = this._hosts[authority];
if (host && host.indexOf(":") !== -1 && host.indexOf("[") === -1) {
host = `[${host}]`;
}
const port = this._ports[authority];
const connectionToken = this._connectionTokens[authority];
let query = `path=${encodeURIComponent(uri.path)}`;
if (typeof connectionToken === "string") {
query += `&${connectionTokenQueryName}=${encodeURIComponent(connectionToken)}`;
}
return URI.from({
scheme: isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
authority: `${host}:${port}`,
path: this._remoteResourcesPath,
query
});
}
};
RemoteAuthorities = new RemoteAuthoritiesImpl();
VSCODE_AUTHORITY = "vscode-app";
FileAccessImpl = class _FileAccessImpl {
static {
this.FALLBACK_AUTHORITY = VSCODE_AUTHORITY;
}
/**
* Returns a URI to use in contexts where the browser is responsible
* for loading (e.g. fetch()) or when used within the DOM.
*
* **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.
*/
asBrowserUri(resourcePath) {
const uri = this.toUri(resourcePath);
return this.uriToBrowserUri(uri);
}
/**
* Returns a URI to use in contexts where the browser is responsible
* for loading (e.g. fetch()) or when used within the DOM.
*
* **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context.
*/
uriToBrowserUri(uri) {
if (uri.scheme === Schemas.vscodeRemote) {
return RemoteAuthorities.rewrite(uri);
}
if (
// ...only ever for `file` resources
uri.scheme === Schemas.file && // ...and we run in native environments
(isNative || // ...or web worker extensions on desktop
webWorkerOrigin === `${Schemas.vscodeFileResource}://${_FileAccessImpl.FALLBACK_AUTHORITY}`)
) {
return uri.with({
scheme: Schemas.vscodeFileResource,
// We need to provide an authority here so that it can serve
// as origin for network and loading matters in chromium.
// If the URI is not coming with an authority already, we
// add our own
authority: uri.authority || _FileAccessImpl.FALLBACK_AUTHORITY,
query: null,
fragment: null
});
}
return uri;
}
toUri(uriOrModule, moduleIdToUrl) {
if (URI.isUri(uriOrModule)) {
return uriOrModule;
}
if (globalThis._VSCODE_FILE_ROOT) {
const rootUriOrPath = globalThis._VSCODE_FILE_ROOT;
if (/^\w[\w\d+.-]*:\/\//.test(rootUriOrPath)) {
return URI.joinPath(URI.parse(rootUriOrPath, true), uriOrModule);
}
const modulePath = join(rootUriOrPath, uriOrModule);
return URI.file(modulePath);
}
return URI.parse(moduleIdToUrl.toUrl(uriOrModule));
}
};
FileAccess = new FileAccessImpl();
(function(COI2) {
const coiHeaders = /* @__PURE__ */ new Map([
["1", { "Cross-Origin-Opener-Policy": "same-origin" }],
["2", { "Cross-Origin-Embedder-Policy": "require-corp" }],
["3", { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp" }]
]);
COI2.CoopAndCoep = Object.freeze(coiHeaders.get("3"));
const coiSearchParamName = "vscode-coi";
function getHeadersFromQuery(url) {
let params;
if (typeof url === "string") {
params = new URL(url).searchParams;
} else if (url instanceof URL) {
params = url.searchParams;
} else if (URI.isUri(url)) {
params = new URL(url.toString(true)).searchParams;
}
const value = params?.get(coiSearchParamName);
if (!value) {
return void 0;
}
return coiHeaders.get(value);
}
COI2.getHeadersFromQuery = getHeadersFromQuery;
function addSearchParam(urlOrSearch, coop, coep) {
if (!globalThis.crossOriginIsolated) {
return;
}
const value = coop && coep ? "3" : coep ? "2" : "1";
if (urlOrSearch instanceof URLSearchParams) {
urlOrSearch.set(coiSearchParamName, value);
} else {
urlOrSearch[coiSearchParamName] = value;
}
}
COI2.addSearchParam = addSearchParam;
})(COI || (COI = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js
function propertyIsEvent(name) {
return name[0] === "o" && name[1] === "n" && isUpperAsciiLetter(name.charCodeAt(2));
}
function propertyIsDynamicEvent(name) {
return /^onDynamic/.test(name) && isUpperAsciiLetter(name.charCodeAt(9));
}
var isESM, DEFAULT_CHANNEL, INITIALIZE, RequestMessage, ReplyMessage, SubscribeEventMessage, EventMessage, UnsubscribeEventMessage, SimpleWorkerProtocol, SimpleWorkerServer;
var init_simpleWorker = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js"() {
init_errors();
init_event();
init_lifecycle();
init_network();
init_platform();
init_strings();
isESM = true;
DEFAULT_CHANNEL = "default";
INITIALIZE = "$initialize";
RequestMessage = class {
constructor(vsWorker, req, channel, method, args) {
this.vsWorker = vsWorker;
this.req = req;
this.channel = channel;
this.method = method;
this.args = args;
this.type = 0;
}
};
ReplyMessage = class {
constructor(vsWorker, seq, res, err) {
this.vsWorker = vsWorker;
this.seq = seq;
this.res = res;
this.err = err;
this.type = 1;
}
};
SubscribeEventMessage = class {
constructor(vsWorker, req, channel, eventName, arg) {
this.vsWorker = vsWorker;
this.req = req;
this.channel = channel;
this.eventName = eventName;
this.arg = arg;
this.type = 2;
}
};
EventMessage = class {
constructor(vsWorker, req, event) {
this.vsWorker = vsWorker;
this.req = req;
this.event = event;
this.type = 3;
}
};
UnsubscribeEventMessage = class {
constructor(vsWorker, req) {
this.vsWorker = vsWorker;
this.req = req;
this.type = 4;
}
};
SimpleWorkerProtocol = class {
constructor(handler) {
this._workerId = -1;
this._handler = handler;
this._lastSentReq = 0;
this._pendingReplies = /* @__PURE__ */ Object.create(null);
this._pendingEmitters = /* @__PURE__ */ new Map();
this._pendingEvents = /* @__PURE__ */ new Map();
}
setWorkerId(workerId) {
this._workerId = workerId;
}
sendMessage(channel, method, args) {
const req = String(++this._lastSentReq);
return new Promise((resolve2, reject) => {
this._pendingReplies[req] = {
resolve: resolve2,
reject
};
this._send(new RequestMessage(this._workerId, req, channel, method, args));
});
}
listen(channel, eventName, arg) {
let req = null;
const emitter = new Emitter({
onWillAddFirstListener: () => {
req = String(++this._lastSentReq);
this._pendingEmitters.set(req, emitter);
this._send(new SubscribeEventMessage(this._workerId, req, channel, eventName, arg));
},
onDidRemoveLastListener: () => {
this._pendingEmitters.delete(req);
this._send(new UnsubscribeEventMessage(this._workerId, req));
req = null;
}
});
return emitter.event;
}
handleMessage(message) {
if (!message || !message.vsWorker) {
return;
}
if (this._workerId !== -1 && message.vsWorker !== this._workerId) {
return;
}
this._handleMessage(message);
}
createProxyToRemoteChannel(channel, sendMessageBarrier) {
const handler = {
get: (target, name) => {
if (typeof name === "string" && !target[name]) {
if (propertyIsDynamicEvent(name)) {
target[name] = (arg) => {
return this.listen(channel, name, arg);
};
} else if (propertyIsEvent(name)) {
target[name] = this.listen(channel, name, void 0);
} else if (name.charCodeAt(0) === 36) {
target[name] = async (...myArgs) => {
await sendMessageBarrier?.();
return this.sendMessage(channel, name, myArgs);
};
}
}
return target[name];
}
};
return new Proxy(/* @__PURE__ */ Object.create(null), handler);
}
_handleMessage(msg) {
switch (msg.type) {
case 1:
return this._handleReplyMessage(msg);
case 0:
return this._handleRequestMessage(msg);
case 2:
return this._handleSubscribeEventMessage(msg);
case 3:
return this._handleEventMessage(msg);
case 4:
return this._handleUnsubscribeEventMessage(msg);
}
}
_handleReplyMessage(replyMessage) {
if (!this._pendingReplies[replyMessage.seq]) {
console.warn("Got reply to unknown seq");
return;
}
const reply = this._pendingReplies[replyMessage.seq];
delete this._pendingReplies[replyMessage.seq];
if (replyMessage.err) {
let err = replyMessage.err;
if (replyMessage.err.$isError) {
err = new Error();
err.name = replyMessage.err.name;
err.message = replyMessage.err.message;
err.stack = replyMessage.err.stack;
}
reply.reject(err);
return;
}
reply.resolve(replyMessage.res);
}
_handleRequestMessage(requestMessage) {
const req = requestMessage.req;
const result = this._handler.handleMessage(requestMessage.channel, requestMessage.method, requestMessage.args);
result.then((r) => {
this._send(new ReplyMessage(this._workerId, req, r, void 0));
}, (e) => {
if (e.detail instanceof Error) {
e.detail = transformErrorForSerialization(e.detail);
}
this._send(new ReplyMessage(this._workerId, req, void 0, transformErrorForSerialization(e)));
});
}
_handleSubscribeEventMessage(msg) {
const req = msg.req;
const disposable = this._handler.handleEvent(msg.channel, msg.eventName, msg.arg)((event) => {
this._send(new EventMessage(this._workerId, req, event));
});
this._pendingEvents.set(req, disposable);
}
_handleEventMessage(msg) {
if (!this._pendingEmitters.has(msg.req)) {
console.warn("Got event for unknown req");
return;
}
this._pendingEmitters.get(msg.req).fire(msg.event);
}
_handleUnsubscribeEventMessage(msg) {
if (!this._pendingEvents.has(msg.req)) {
console.warn("Got unsubscribe for unknown req");
return;
}
this._pendingEvents.get(msg.req).dispose();
this._pendingEvents.delete(msg.req);
}
_send(msg) {
const transfer = [];
if (msg.type === 0) {
for (let i = 0; i < msg.args.length; i++) {
if (msg.args[i] instanceof ArrayBuffer) {
transfer.push(msg.args[i]);
}
}
} else if (msg.type === 1) {
if (msg.res instanceof ArrayBuffer) {
transfer.push(msg.res);
}
}
this._handler.sendMessage(msg, transfer);
}
};
SimpleWorkerServer = class {
constructor(postMessage, requestHandlerFactory) {
this._localChannels = /* @__PURE__ */ new Map();
this._remoteChannels = /* @__PURE__ */ new Map();
this._requestHandlerFactory = requestHandlerFactory;
this._requestHandler = null;
this._protocol = new SimpleWorkerProtocol({
sendMessage: (msg, transfer) => {
postMessage(msg, transfer);
},
handleMessage: (channel, method, args) => this._handleMessage(channel, method, args),
handleEvent: (channel, eventName, arg) => this._handleEvent(channel, eventName, arg)
});
}
onmessage(msg) {
this._protocol.handleMessage(msg);
}
_handleMessage(channel, method, args) {
if (channel === DEFAULT_CHANNEL && method === INITIALIZE) {
return this.initialize(args[0], args[1], args[2]);
}
const requestHandler = channel === DEFAULT_CHANNEL ? this._requestHandler : this._localChannels.get(channel);
if (!requestHandler) {
return Promise.reject(new Error(`Missing channel ${channel} on worker thread`));
}
if (typeof requestHandler[method] !== "function") {
return Promise.reject(new Error(`Missing method ${method} on worker thread channel ${channel}`));
}
try {
return Promise.resolve(requestHandler[method].apply(requestHandler, args));
} catch (e) {
return Promise.reject(e);
}
}
_handleEvent(channel, eventName, arg) {
const requestHandler = channel === DEFAULT_CHANNEL ? this._requestHandler : this._localChannels.get(channel);
if (!requestHandler) {
throw new Error(`Missing channel ${channel} on worker thread`);
}
if (propertyIsDynamicEvent(eventName)) {
const event = requestHandler[eventName].call(requestHandler, arg);
if (typeof event !== "function") {
throw new Error(`Missing dynamic event ${eventName} on request handler.`);
}
return event;
}
if (propertyIsEvent(eventName)) {
const event = requestHandler[eventName];
if (typeof event !== "function") {
throw new Error(`Missing event ${eventName} on request handler.`);
}
return event;
}
throw new Error(`Malformed event name ${eventName}`);
}
getChannel(channel) {
if (!this._remoteChannels.has(channel)) {
const inst = this._protocol.createProxyToRemoteChannel(channel);
this._remoteChannels.set(channel, inst);
}
return this._remoteChannels.get(channel);
}
async initialize(workerId, loaderConfig, moduleId) {
this._protocol.setWorkerId(workerId);
if (this._requestHandlerFactory) {
this._requestHandler = this._requestHandlerFactory(this);
return;
}
if (loaderConfig) {
if (typeof loaderConfig.baseUrl !== "undefined") {
delete loaderConfig["baseUrl"];
}
if (typeof loaderConfig.paths !== "undefined") {
if (typeof loaderConfig.paths.vs !== "undefined") {
delete loaderConfig.paths["vs"];
}
}
if (typeof loaderConfig.trustedTypesPolicy !== "undefined") {
delete loaderConfig["trustedTypesPolicy"];
}
loaderConfig.catchError = true;
globalThis.require.config(loaderConfig);
}
if (isESM) {
const url = FileAccess.asBrowserUri(`${moduleId}.js`).toString(true);
return import(`${url}`).then((module) => {
this._requestHandler = module.create(this);
if (!this._requestHandler) {
throw new Error(`No RequestHandler!`);
}
});
}
return new Promise((resolve2, reject) => {
const req = globalThis.require;
req([moduleId], (module) => {
this._requestHandler = module.create(this);
if (!this._requestHandler) {
reject(new Error(`No RequestHandler!`));
return;
}
resolve2();
}, reject);
});
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js
var DiffChange;
var init_diffChange = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js"() {
DiffChange = class {
/**
* Constructs a new DiffChange with the given sequence information
* and content.
*/
constructor(originalStart, originalLength, modifiedStart, modifiedLength) {
this.originalStart = originalStart;
this.originalLength = originalLength;
this.modifiedStart = modifiedStart;
this.modifiedLength = modifiedLength;
}
/**
* The end point (exclusive) of the change in the original sequence.
*/
getOriginalEnd() {
return this.originalStart + this.originalLength;
}
/**
* The end point (exclusive) of the change in the modified sequence.
*/
getModifiedEnd() {
return this.modifiedStart + this.modifiedLength;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/hash.js
function numberHash(val, initialHashVal) {
return (initialHashVal << 5) - initialHashVal + val | 0;
}
function stringHash(s, hashVal) {
hashVal = numberHash(149417, hashVal);
for (let i = 0, length = s.length; i < length; i++) {
hashVal = numberHash(s.charCodeAt(i), hashVal);
}
return hashVal;
}
function leftRotate(value, bits, totalBits = 32) {
const delta = totalBits - bits;
const mask = ~((1 << delta) - 1);
return (value << bits | (mask & value) >>> delta) >>> 0;
}
function fill(dest, index = 0, count = dest.byteLength, value = 0) {
for (let i = 0; i < count; i++) {
dest[index + i] = value;
}
}
function leftPad(value, length, char = "0") {
while (value.length < length) {
value = char + value;
}
return value;
}
function toHexString(bufferOrValue, bitsize = 32) {
if (bufferOrValue instanceof ArrayBuffer) {
return Array.from(new Uint8Array(bufferOrValue)).map((b) => b.toString(16).padStart(2, "0")).join("");
}
return leftPad((bufferOrValue >>> 0).toString(16), bitsize / 4);
}
var StringSHA1;
var init_hash = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/hash.js"() {
init_strings();
StringSHA1 = class _StringSHA1 {
static {
this._bigBlock32 = new DataView(new ArrayBuffer(320));
}
// 80 * 4 = 320
constructor() {
this._h0 = 1732584193;
this._h1 = 4023233417;
this._h2 = 2562383102;
this._h3 = 271733878;
this._h4 = 3285377520;
this._buff = new Uint8Array(
64 + 3
/* to fit any utf-8 */
);
this._buffDV = new DataView(this._buff.buffer);
this._buffLen = 0;
this._totalLen = 0;
this._leftoverHighSurrogate = 0;
this._finished = false;
}
update(str) {
const strLen = str.length;
if (strLen === 0) {
return;
}
const buff = this._buff;
let buffLen = this._buffLen;
let leftoverHighSurrogate = this._leftoverHighSurrogate;
let charCode;
let offset;
if (leftoverHighSurrogate !== 0) {
charCode = leftoverHighSurrogate;
offset = -1;
leftoverHighSurrogate = 0;
} else {
charCode = str.charCodeAt(0);
offset = 0;
}
while (true) {
let codePoint = charCode;
if (isHighSurrogate(charCode)) {
if (offset + 1 < strLen) {
const nextCharCode = str.charCodeAt(offset + 1);
if (isLowSurrogate(nextCharCode)) {
offset++;
codePoint = computeCodePoint(charCode, nextCharCode);
} else {
codePoint = 65533;
}
} else {
leftoverHighSurrogate = charCode;
break;
}
} else if (isLowSurrogate(charCode)) {
codePoint = 65533;
}
buffLen = this._push(buff, buffLen, codePoint);
offset++;
if (offset < strLen) {
charCode = str.charCodeAt(offset);
} else {
break;
}
}
this._buffLen = buffLen;
this._leftoverHighSurrogate = leftoverHighSurrogate;
}
_push(buff, buffLen, codePoint) {
if (codePoint < 128) {
buff[buffLen++] = codePoint;
} else if (codePoint < 2048) {
buff[buffLen++] = 192 | (codePoint & 1984) >>> 6;
buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
} else if (codePoint < 65536) {
buff[buffLen++] = 224 | (codePoint & 61440) >>> 12;
buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
} else {
buff[buffLen++] = 240 | (codePoint & 1835008) >>> 18;
buff[buffLen++] = 128 | (codePoint & 258048) >>> 12;
buff[buffLen++] = 128 | (codePoint & 4032) >>> 6;
buff[buffLen++] = 128 | (codePoint & 63) >>> 0;
}
if (buffLen >= 64) {
this._step();
buffLen -= 64;
this._totalLen += 64;
buff[0] = buff[64 + 0];
buff[1] = buff[64 + 1];
buff[2] = buff[64 + 2];
}
return buffLen;
}
digest() {
if (!this._finished) {
this._finished = true;
if (this._leftoverHighSurrogate) {
this._leftoverHighSurrogate = 0;
this._buffLen = this._push(
this._buff,
this._buffLen,
65533
/* SHA1Constant.UNICODE_REPLACEMENT */
);
}
this._totalLen += this._buffLen;
this._wrapUp();
}
return toHexString(this._h0) + toHexString(this._h1) + toHexString(this._h2) + toHexString(this._h3) + toHexString(this._h4);
}
_wrapUp() {
this._buff[this._buffLen++] = 128;
fill(this._buff, this._buffLen);
if (this._buffLen > 56) {
this._step();
fill(this._buff);
}
const ml = 8 * this._totalLen;
this._buffDV.setUint32(56, Math.floor(ml / 4294967296), false);
this._buffDV.setUint32(60, ml % 4294967296, false);
this._step();
}
_step() {
const bigBlock32 = _StringSHA1._bigBlock32;
const data = this._buffDV;
for (let j = 0; j < 64; j += 4) {
bigBlock32.setUint32(j, data.getUint32(j, false), false);
}
for (let j = 64; j < 320; j += 4) {
bigBlock32.setUint32(j, leftRotate(bigBlock32.getUint32(j - 12, false) ^ bigBlock32.getUint32(j - 32, false) ^ bigBlock32.getUint32(j - 56, false) ^ bigBlock32.getUint32(j - 64, false), 1), false);
}
let a = this._h0;
let b = this._h1;
let c = this._h2;
let d = this._h3;
let e = this._h4;
let f, k2;
let temp;
for (let j = 0; j < 80; j++) {
if (j < 20) {
f = b & c | ~b & d;
k2 = 1518500249;
} else if (j < 40) {
f = b ^ c ^ d;
k2 = 1859775393;
} else if (j < 60) {
f = b & c | b & d | c & d;
k2 = 2400959708;
} else {
f = b ^ c ^ d;
k2 = 3395469782;
}
temp = leftRotate(a, 5) + f + e + k2 + bigBlock32.getUint32(j * 4, false) & 4294967295;
e = d;
d = c;
c = leftRotate(b, 30);
b = a;
a = temp;
}
this._h0 = this._h0 + a & 4294967295;
this._h1 = this._h1 + b & 4294967295;
this._h2 = this._h2 + c & 4294967295;
this._h3 = this._h3 + d & 4294967295;
this._h4 = this._h4 + e & 4294967295;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/diff/diff.js
function stringDiff(original, modified, pretty) {
return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;
}
var StringDiffSequence, Debug, MyArray, DiffChangeHelper, LcsDiff;
var init_diff = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/diff/diff.js"() {
init_diffChange();
init_hash();
StringDiffSequence = class {
constructor(source) {
this.source = source;
}
getElements() {
const source = this.source;
const characters = new Int32Array(source.length);
for (let i = 0, len = source.length; i < len; i++) {
characters[i] = source.charCodeAt(i);
}
return characters;
}
};
Debug = class {
static Assert(condition, message) {
if (!condition) {
throw new Error(message);
}
}
};
MyArray = class {
/**
* Copies a range of elements from an Array starting at the specified source index and pastes
* them to another Array starting at the specified destination index. The length and the indexes
* are specified as 64-bit integers.
* sourceArray:
* The Array that contains the data to copy.
* sourceIndex:
* A 64-bit integer that represents the index in the sourceArray at which copying begins.
* destinationArray:
* The Array that receives the data.
* destinationIndex:
* A 64-bit integer that represents the index in the destinationArray at which storing begins.
* length:
* A 64-bit integer that represents the number of elements to copy.
*/
static Copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
for (let i = 0; i < length; i++) {
destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
}
}
static Copy2(sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
for (let i = 0; i < length; i++) {
destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
}
}
};
DiffChangeHelper = class {
/**
* Constructs a new DiffChangeHelper for the given DiffSequences.
*/
constructor() {
this.m_changes = [];
this.m_originalStart = 1073741824;
this.m_modifiedStart = 1073741824;
this.m_originalCount = 0;
this.m_modifiedCount = 0;
}
/**
* Marks the beginning of the next change in the set of differences.
*/
MarkNextChange() {
if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
this.m_changes.push(new DiffChange(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));
}
this.m_originalCount = 0;
this.m_modifiedCount = 0;
this.m_originalStart = 1073741824;
this.m_modifiedStart = 1073741824;
}
/**
* Adds the original element at the given position to the elements
* affected by the current change. The modified index gives context
* to the change position with respect to the original sequence.
* @param originalIndex The index of the original element to add.
* @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.
*/
AddOriginalElement(originalIndex, modifiedIndex) {
this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
this.m_originalCount++;
}
/**
* Adds the modified element at the given position to the elements
* affected by the current change. The original index gives context
* to the change position with respect to the modified sequence.
* @param originalIndex The index of the original element that provides corresponding position in the original sequence.
* @param modifiedIndex The index of the modified element to add.
*/
AddModifiedElement(originalIndex, modifiedIndex) {
this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
this.m_modifiedCount++;
}
/**
* Retrieves all of the changes marked by the class.
*/
getChanges() {
if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
this.MarkNextChange();
}
return this.m_changes;
}
/**
* Retrieves all of the changes marked by the class in the reverse order
*/
getReverseChanges() {
if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
this.MarkNextChange();
}
this.m_changes.reverse();
return this.m_changes;
}
};
LcsDiff = class _LcsDiff {
/**
* Constructs the DiffFinder
*/
constructor(originalSequence, modifiedSequence, continueProcessingPredicate = null) {
this.ContinueProcessingPredicate = continueProcessingPredicate;
this._originalSequence = originalSequence;
this._modifiedSequence = modifiedSequence;
const [originalStringElements, originalElementsOrHash, originalHasStrings] = _LcsDiff._getElements(originalSequence);
const [modifiedStringElements, modifiedElementsOrHash, modifiedHasStrings] = _LcsDiff._getElements(modifiedSequence);
this._hasStrings = originalHasStrings && modifiedHasStrings;
this._originalStringElements = originalStringElements;
this._originalElementsOrHash = originalElementsOrHash;
this._modifiedStringElements = modifiedStringElements;
this._modifiedElementsOrHash = modifiedElementsOrHash;
this.m_forwardHistory = [];
this.m_reverseHistory = [];
}
static _isStringArray(arr) {
return arr.length > 0 && typeof arr[0] === "string";
}
static _getElements(sequence) {
const elements = sequence.getElements();
if (_LcsDiff._isStringArray(elements)) {
const hashes = new Int32Array(elements.length);
for (let i = 0, len = elements.length; i < len; i++) {
hashes[i] = stringHash(elements[i], 0);
}
return [elements, hashes, true];
}
if (elements instanceof Int32Array) {
return [[], elements, false];
}
return [[], new Int32Array(elements), false];
}
ElementsAreEqual(originalIndex, newIndex) {
if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {
return false;
}
return this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true;
}
ElementsAreStrictEqual(originalIndex, newIndex) {
if (!this.ElementsAreEqual(originalIndex, newIndex)) {
return false;
}
const originalElement = _LcsDiff._getStrictElement(this._originalSequence, originalIndex);
const modifiedElement = _LcsDiff._getStrictElement(this._modifiedSequence, newIndex);
return originalElement === modifiedElement;
}
static _getStrictElement(sequence, index) {
if (typeof sequence.getStrictElement === "function") {
return sequence.getStrictElement(index);
}
return null;
}
OriginalElementsAreEqual(index1, index2) {
if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {
return false;
}
return this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true;
}
ModifiedElementsAreEqual(index1, index2) {
if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {
return false;
}
return this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true;
}
ComputeDiff(pretty) {
return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);
}
/**
* Computes the differences between the original and modified input
* sequences on the bounded range.
* @returns An array of the differences between the two input sequences.
*/
_ComputeDiff(originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {
const quitEarlyArr = [false];
let changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);
if (pretty) {
changes = this.PrettifyChanges(changes);
}
return {
quitEarly: quitEarlyArr[0],
changes
};
}
/**
* Private helper method which computes the differences on the bounded range
* recursively.
* @returns An array of the differences between the two input sequences.
*/
ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {
quitEarlyArr[0] = false;
while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {
originalStart++;
modifiedStart++;
}
while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {
originalEnd--;
modifiedEnd--;
}
if (originalStart > originalEnd || modifiedStart > modifiedEnd) {
let changes;
if (modifiedStart <= modifiedEnd) {
Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
changes = [
new DiffChange(originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)
];
} else if (originalStart <= originalEnd) {
Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
changes = [
new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, 0)
];
} else {
Debug.Assert(originalStart === originalEnd + 1, "originalStart should only be one more than originalEnd");
Debug.Assert(modifiedStart === modifiedEnd + 1, "modifiedStart should only be one more than modifiedEnd");
changes = [];
}
return changes;
}
const midOriginalArr = [0];
const midModifiedArr = [0];
const result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);
const midOriginal = midOriginalArr[0];
const midModified = midModifiedArr[0];
if (result !== null) {
return result;
} else if (!quitEarlyArr[0]) {
const leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);
let rightChanges = [];
if (!quitEarlyArr[0]) {
rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);
} else {
rightChanges = [
new DiffChange(midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)
];
}
return this.ConcatenateChanges(leftChanges, rightChanges);
}
return [
new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
];
}
WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {
let forwardChanges = null;
let reverseChanges = null;
let changeHelper = new DiffChangeHelper();
let diagonalMin = diagonalForwardStart;
let diagonalMax = diagonalForwardEnd;
let diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalForwardOffset;
let lastOriginalIndex = -1073741824;
let historyIndex = this.m_forwardHistory.length - 1;
do {
const diagonal = diagonalRelative + diagonalForwardBase;
if (diagonal === diagonalMin || diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
originalIndex = forwardPoints[diagonal + 1];
modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
if (originalIndex < lastOriginalIndex) {
changeHelper.MarkNextChange();
}
lastOriginalIndex = originalIndex;
changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);
diagonalRelative = diagonal + 1 - diagonalForwardBase;
} else {
originalIndex = forwardPoints[diagonal - 1] + 1;
modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
if (originalIndex < lastOriginalIndex) {
changeHelper.MarkNextChange();
}
lastOriginalIndex = originalIndex - 1;
changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);
diagonalRelative = diagonal - 1 - diagonalForwardBase;
}
if (historyIndex >= 0) {
forwardPoints = this.m_forwardHistory[historyIndex];
diagonalForwardBase = forwardPoints[0];
diagonalMin = 1;
diagonalMax = forwardPoints.length - 1;
}
} while (--historyIndex >= -1);
forwardChanges = changeHelper.getReverseChanges();
if (quitEarlyArr[0]) {
let originalStartPoint = midOriginalArr[0] + 1;
let modifiedStartPoint = midModifiedArr[0] + 1;
if (forwardChanges !== null && forwardChanges.length > 0) {
const lastForwardChange = forwardChanges[forwardChanges.length - 1];
originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());
modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());
}
reverseChanges = [
new DiffChange(originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)
];
} else {
changeHelper = new DiffChangeHelper();
diagonalMin = diagonalReverseStart;
diagonalMax = diagonalReverseEnd;
diagonalRelative = midOriginalArr[0] - midModifiedArr[0] - diagonalReverseOffset;
lastOriginalIndex = 1073741824;
historyIndex = deltaIsEven ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
do {
const diagonal = diagonalRelative + diagonalReverseBase;
if (diagonal === diagonalMin || diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
originalIndex = reversePoints[diagonal + 1] - 1;
modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
if (originalIndex > lastOriginalIndex) {
changeHelper.MarkNextChange();
}
lastOriginalIndex = originalIndex + 1;
changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
diagonalRelative = diagonal + 1 - diagonalReverseBase;
} else {
originalIndex = reversePoints[diagonal - 1];
modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
if (originalIndex > lastOriginalIndex) {
changeHelper.MarkNextChange();
}
lastOriginalIndex = originalIndex;
changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);
diagonalRelative = diagonal - 1 - diagonalReverseBase;
}
if (historyIndex >= 0) {
reversePoints = this.m_reverseHistory[historyIndex];
diagonalReverseBase = reversePoints[0];
diagonalMin = 1;
diagonalMax = reversePoints.length - 1;
}
} while (--historyIndex >= -1);
reverseChanges = changeHelper.getChanges();
}
return this.ConcatenateChanges(forwardChanges, reverseChanges);
}
/**
* Given the range to compute the diff on, this method finds the point:
* (midOriginal, midModified)
* that exists in the middle of the LCS of the two sequences and
* is the point at which the LCS problem may be broken down recursively.
* This method will try to keep the LCS trace in memory. If the LCS recursion
* point is calculated and the full trace is available in memory, then this method
* will return the change list.
* @param originalStart The start bound of the original sequence range
* @param originalEnd The end bound of the original sequence range
* @param modifiedStart The start bound of the modified sequence range
* @param modifiedEnd The end bound of the modified sequence range
* @param midOriginal The middle point of the original sequence range
* @param midModified The middle point of the modified sequence range
* @returns The diff changes, if available, otherwise null
*/
ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {
let originalIndex = 0, modifiedIndex = 0;
let diagonalForwardStart = 0, diagonalForwardEnd = 0;
let diagonalReverseStart = 0, diagonalReverseEnd = 0;
originalStart--;
modifiedStart--;
midOriginalArr[0] = 0;
midModifiedArr[0] = 0;
this.m_forwardHistory = [];
this.m_reverseHistory = [];
const maxDifferences = originalEnd - originalStart + (modifiedEnd - modifiedStart);
const numDiagonals = maxDifferences + 1;
const forwardPoints = new Int32Array(numDiagonals);
const reversePoints = new Int32Array(numDiagonals);
const diagonalForwardBase = modifiedEnd - modifiedStart;
const diagonalReverseBase = originalEnd - originalStart;
const diagonalForwardOffset = originalStart - modifiedStart;
const diagonalReverseOffset = originalEnd - modifiedEnd;
const delta = diagonalReverseBase - diagonalForwardBase;
const deltaIsEven = delta % 2 === 0;
forwardPoints[diagonalForwardBase] = originalStart;
reversePoints[diagonalReverseBase] = originalEnd;
quitEarlyArr[0] = false;
for (let numDifferences = 1; numDifferences <= maxDifferences / 2 + 1; numDifferences++) {
let furthestOriginalIndex = 0;
let furthestModifiedIndex = 0;
diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
for (let diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {
if (diagonal === diagonalForwardStart || diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1]) {
originalIndex = forwardPoints[diagonal + 1];
} else {
originalIndex = forwardPoints[diagonal - 1] + 1;
}
modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;
const tempOriginalIndex = originalIndex;
while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {
originalIndex++;
modifiedIndex++;
}
forwardPoints[diagonal] = originalIndex;
if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {
furthestOriginalIndex = originalIndex;
furthestModifiedIndex = modifiedIndex;
}
if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= numDifferences - 1) {
if (originalIndex >= reversePoints[diagonal]) {
midOriginalArr[0] = originalIndex;
midModifiedArr[0] = modifiedIndex;
if (tempOriginalIndex <= reversePoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
} else {
return null;
}
}
}
}
const matchLengthOfLongest = (furthestOriginalIndex - originalStart + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;
if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
quitEarlyArr[0] = true;
midOriginalArr[0] = furthestOriginalIndex;
midModifiedArr[0] = furthestModifiedIndex;
if (matchLengthOfLongest > 0 && 1447 > 0 && numDifferences <= 1447 + 1) {
return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
} else {
originalStart++;
modifiedStart++;
return [
new DiffChange(originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
];
}
}
diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
for (let diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {
if (diagonal === diagonalReverseStart || diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1]) {
originalIndex = reversePoints[diagonal + 1] - 1;
} else {
originalIndex = reversePoints[diagonal - 1];
}
modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;
const tempOriginalIndex = originalIndex;
while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {
originalIndex--;
modifiedIndex--;
}
reversePoints[diagonal] = originalIndex;
if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {
if (originalIndex <= forwardPoints[diagonal]) {
midOriginalArr[0] = originalIndex;
midModifiedArr[0] = modifiedIndex;
if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 > 0 && numDifferences <= 1447 + 1) {
return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
} else {
return null;
}
}
}
}
if (numDifferences <= 1447) {
let temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);
temp[0] = diagonalForwardBase - diagonalForwardStart + 1;
MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);
this.m_forwardHistory.push(temp);
temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);
temp[0] = diagonalReverseBase - diagonalReverseStart + 1;
MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);
this.m_reverseHistory.push(temp);
}
}
return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
}
/**
* Shifts the given changes to provide a more intuitive diff.
* While the first element in a diff matches the first element after the diff,
* we shift the diff down.
*
* @param changes The list of changes to shift
* @returns The shifted changes
*/
PrettifyChanges(changes) {
for (let i = 0; i < changes.length; i++) {
const change = changes[i];
const originalStop = i < changes.length - 1 ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
const modifiedStop = i < changes.length - 1 ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;
const checkOriginal = change.originalLength > 0;
const checkModified = change.modifiedLength > 0;
while (change.originalStart + change.originalLength < originalStop && change.modifiedStart + change.modifiedLength < modifiedStop && (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) && (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {
const startStrictEqual = this.ElementsAreStrictEqual(change.originalStart, change.modifiedStart);
const endStrictEqual = this.ElementsAreStrictEqual(change.originalStart + change.originalLength, change.modifiedStart + change.modifiedLength);
if (endStrictEqual && !startStrictEqual) {
break;
}
change.originalStart++;
change.modifiedStart++;
}
const mergedChangeArr = [null];
if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {
changes[i] = mergedChangeArr[0];
changes.splice(i + 1, 1);
i--;
continue;
}
}
for (let i = changes.length - 1; i >= 0; i--) {
const change = changes[i];
let originalStop = 0;
let modifiedStop = 0;
if (i > 0) {
const prevChange = changes[i - 1];
originalStop = prevChange.originalStart + prevChange.originalLength;
modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;
}
const checkOriginal = change.originalLength > 0;
const checkModified = change.modifiedLength > 0;
let bestDelta = 0;
let bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);
for (let delta = 1; ; delta++) {
const originalStart = change.originalStart - delta;
const modifiedStart = change.modifiedStart - delta;
if (originalStart < originalStop || modifiedStart < modifiedStop) {
break;
}
if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {
break;
}
if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {
break;
}
const touchingPreviousChange = originalStart === originalStop && modifiedStart === modifiedStop;
const score2 = (touchingPreviousChange ? 5 : 0) + this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);
if (score2 > bestScore) {
bestScore = score2;
bestDelta = delta;
}
}
change.originalStart -= bestDelta;
change.modifiedStart -= bestDelta;
const mergedChangeArr = [null];
if (i > 0 && this.ChangesOverlap(changes[i - 1], changes[i], mergedChangeArr)) {
changes[i - 1] = mergedChangeArr[0];
changes.splice(i, 1);
i++;
continue;
}
}
if (this._hasStrings) {
for (let i = 1, len = changes.length; i < len; i++) {
const aChange = changes[i - 1];
const bChange = changes[i];
const matchedLength = bChange.originalStart - aChange.originalStart - aChange.originalLength;
const aOriginalStart = aChange.originalStart;
const bOriginalEnd = bChange.originalStart + bChange.originalLength;
const abOriginalLength = bOriginalEnd - aOriginalStart;
const aModifiedStart = aChange.modifiedStart;
const bModifiedEnd = bChange.modifiedStart + bChange.modifiedLength;
const abModifiedLength = bModifiedEnd - aModifiedStart;
if (matchedLength < 5 && abOriginalLength < 20 && abModifiedLength < 20) {
const t = this._findBetterContiguousSequence(aOriginalStart, abOriginalLength, aModifiedStart, abModifiedLength, matchedLength);
if (t) {
const [originalMatchStart, modifiedMatchStart] = t;
if (originalMatchStart !== aChange.originalStart + aChange.originalLength || modifiedMatchStart !== aChange.modifiedStart + aChange.modifiedLength) {
aChange.originalLength = originalMatchStart - aChange.originalStart;
aChange.modifiedLength = modifiedMatchStart - aChange.modifiedStart;
bChange.originalStart = originalMatchStart + matchedLength;
bChange.modifiedStart = modifiedMatchStart + matchedLength;
bChange.originalLength = bOriginalEnd - bChange.originalStart;
bChange.modifiedLength = bModifiedEnd - bChange.modifiedStart;
}
}
}
}
}
return changes;
}
_findBetterContiguousSequence(originalStart, originalLength, modifiedStart, modifiedLength, desiredLength) {
if (originalLength < desiredLength || modifiedLength < desiredLength) {
return null;
}
const originalMax = originalStart + originalLength - desiredLength + 1;
const modifiedMax = modifiedStart + modifiedLength - desiredLength + 1;
let bestScore = 0;
let bestOriginalStart = 0;
let bestModifiedStart = 0;
for (let i = originalStart; i < originalMax; i++) {
for (let j = modifiedStart; j < modifiedMax; j++) {
const score2 = this._contiguousSequenceScore(i, j, desiredLength);
if (score2 > 0 && score2 > bestScore) {
bestScore = score2;
bestOriginalStart = i;
bestModifiedStart = j;
}
}
}
if (bestScore > 0) {
return [bestOriginalStart, bestModifiedStart];
}
return null;
}
_contiguousSequenceScore(originalStart, modifiedStart, length) {
let score2 = 0;
for (let l = 0; l < length; l++) {
if (!this.ElementsAreEqual(originalStart + l, modifiedStart + l)) {
return 0;
}
score2 += this._originalStringElements[originalStart + l].length;
}
return score2;
}
_OriginalIsBoundary(index) {
if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {
return true;
}
return this._hasStrings && /^\s*$/.test(this._originalStringElements[index]);
}
_OriginalRegionIsBoundary(originalStart, originalLength) {
if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {
return true;
}
if (originalLength > 0) {
const originalEnd = originalStart + originalLength;
if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {
return true;
}
}
return false;
}
_ModifiedIsBoundary(index) {
if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {
return true;
}
return this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]);
}
_ModifiedRegionIsBoundary(modifiedStart, modifiedLength) {
if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {
return true;
}
if (modifiedLength > 0) {
const modifiedEnd = modifiedStart + modifiedLength;
if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {
return true;
}
}
return false;
}
_boundaryScore(originalStart, originalLength, modifiedStart, modifiedLength) {
const originalScore = this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0;
const modifiedScore = this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0;
return originalScore + modifiedScore;
}
/**
* Concatenates the two input DiffChange lists and returns the resulting
* list.
* @param The left changes
* @param The right changes
* @returns The concatenated list
*/
ConcatenateChanges(left, right) {
const mergedChangeArr = [];
if (left.length === 0 || right.length === 0) {
return right.length > 0 ? right : left;
} else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {
const result = new Array(left.length + right.length - 1);
MyArray.Copy(left, 0, result, 0, left.length - 1);
result[left.length - 1] = mergedChangeArr[0];
MyArray.Copy(right, 1, result, left.length, right.length - 1);
return result;
} else {
const result = new Array(left.length + right.length);
MyArray.Copy(left, 0, result, 0, left.length);
MyArray.Copy(right, 0, result, left.length, right.length);
return result;
}
}
/**
* Returns true if the two changes overlap and can be merged into a single
* change
* @param left The left change
* @param right The right change
* @param mergedChange The merged change if the two overlap, null otherwise
* @returns True if the two changes overlap
*/
ChangesOverlap(left, right, mergedChangeArr) {
Debug.Assert(left.originalStart <= right.originalStart, "Left change is not less than or equal to right change");
Debug.Assert(left.modifiedStart <= right.modifiedStart, "Left change is not less than or equal to right change");
if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
const originalStart = left.originalStart;
let originalLength = left.originalLength;
const modifiedStart = left.modifiedStart;
let modifiedLength = left.modifiedLength;
if (left.originalStart + left.originalLength >= right.originalStart) {
originalLength = right.originalStart + right.originalLength - left.originalStart;
}
if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;
}
mergedChangeArr[0] = new DiffChange(originalStart, originalLength, modifiedStart, modifiedLength);
return true;
} else {
mergedChangeArr[0] = null;
return false;
}
}
/**
* Helper method used to clip a diagonal index to the range of valid
* diagonals. This also decides whether or not the diagonal index,
* if it exceeds the boundary, should be clipped to the boundary or clipped
* one inside the boundary depending on the Even/Odd status of the boundary
* and numDifferences.
* @param diagonal The index of the diagonal to clip.
* @param numDifferences The current number of differences being iterated upon.
* @param diagonalBaseIndex The base reference diagonal.
* @param numDiagonals The total number of diagonals.
* @returns The clipped diagonal index.
*/
ClipDiagonalBound(diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {
if (diagonal >= 0 && diagonal < numDiagonals) {
return diagonal;
}
const diagonalsBelow = diagonalBaseIndex;
const diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;
const diffEven = numDifferences % 2 === 0;
if (diagonal < 0) {
const lowerBoundEven = diagonalsBelow % 2 === 0;
return diffEven === lowerBoundEven ? 0 : 1;
} else {
const upperBoundEven = diagonalsAbove % 2 === 0;
return diffEven === upperBoundEven ? numDiagonals - 1 : numDiagonals - 2;
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/position.js
var Position;
var init_position = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/position.js"() {
Position = class _Position {
constructor(lineNumber, column) {
this.lineNumber = lineNumber;
this.column = column;
}
/**
* Create a new position from this position.
*
* @param newLineNumber new line number
* @param newColumn new column
*/
with(newLineNumber = this.lineNumber, newColumn = this.column) {
if (newLineNumber === this.lineNumber && newColumn === this.column) {
return this;
} else {
return new _Position(newLineNumber, newColumn);
}
}
/**
* Derive a new position from this position.
*
* @param deltaLineNumber line number delta
* @param deltaColumn column delta
*/
delta(deltaLineNumber = 0, deltaColumn = 0) {
return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);
}
/**
* Test if this position equals other position
*/
equals(other) {
return _Position.equals(this, other);
}
/**
* Test if position `a` equals position `b`
*/
static equals(a, b) {
if (!a && !b) {
return true;
}
return !!a && !!b && a.lineNumber === b.lineNumber && a.column === b.column;
}
/**
* Test if this position is before other position.
* If the two positions are equal, the result will be false.
*/
isBefore(other) {
return _Position.isBefore(this, other);
}
/**
* Test if position `a` is before position `b`.
* If the two positions are equal, the result will be false.
*/
static isBefore(a, b) {
if (a.lineNumber < b.lineNumber) {
return true;
}
if (b.lineNumber < a.lineNumber) {
return false;
}
return a.column < b.column;
}
/**
* Test if this position is before other position.
* If the two positions are equal, the result will be true.
*/
isBeforeOrEqual(other) {
return _Position.isBeforeOrEqual(this, other);
}
/**
* Test if position `a` is before position `b`.
* If the two positions are equal, the result will be true.
*/
static isBeforeOrEqual(a, b) {
if (a.lineNumber < b.lineNumber) {
return true;
}
if (b.lineNumber < a.lineNumber) {
return false;
}
return a.column <= b.column;
}
/**
* A function that compares positions, useful for sorting
*/
static compare(a, b) {
const aLineNumber = a.lineNumber | 0;
const bLineNumber = b.lineNumber | 0;
if (aLineNumber === bLineNumber) {
const aColumn = a.column | 0;
const bColumn = b.column | 0;
return aColumn - bColumn;
}
return aLineNumber - bLineNumber;
}
/**
* Clone this position.
*/
clone() {
return new _Position(this.lineNumber, this.column);
}
/**
* Convert to a human-readable representation.
*/
toString() {
return "(" + this.lineNumber + "," + this.column + ")";
}
// ---
/**
* Create a `Position` from an `IPosition`.
*/
static lift(pos) {
return new _Position(pos.lineNumber, pos.column);
}
/**
* Test if `obj` is an `IPosition`.
*/
static isIPosition(obj) {
return obj && typeof obj.lineNumber === "number" && typeof obj.column === "number";
}
toJSON() {
return {
lineNumber: this.lineNumber,
column: this.column
};
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/range.js
var Range;
var init_range = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/range.js"() {
init_position();
Range = class _Range {
constructor(startLineNumber, startColumn, endLineNumber, endColumn) {
if (startLineNumber > endLineNumber || startLineNumber === endLineNumber && startColumn > endColumn) {
this.startLineNumber = endLineNumber;
this.startColumn = endColumn;
this.endLineNumber = startLineNumber;
this.endColumn = startColumn;
} else {
this.startLineNumber = startLineNumber;
this.startColumn = startColumn;
this.endLineNumber = endLineNumber;
this.endColumn = endColumn;
}
}
/**
* Test if this range is empty.
*/
isEmpty() {
return _Range.isEmpty(this);
}
/**
* Test if `range` is empty.
*/
static isEmpty(range) {
return range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn;
}
/**
* Test if position is in this range. If the position is at the edges, will return true.
*/
containsPosition(position) {
return _Range.containsPosition(this, position);
}
/**
* Test if `position` is in `range`. If the position is at the edges, will return true.
*/
static containsPosition(range, position) {
if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
return false;
}
if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {
return false;
}
if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {
return false;
}
return true;
}
/**
* Test if `position` is in `range`. If the position is at the edges, will return false.
* @internal
*/
static strictContainsPosition(range, position) {
if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
return false;
}
if (position.lineNumber === range.startLineNumber && position.column <= range.startColumn) {
return false;
}
if (position.lineNumber === range.endLineNumber && position.column >= range.endColumn) {
return false;
}
return true;
}
/**
* Test if range is in this range. If the range is equal to this range, will return true.
*/
containsRange(range) {
return _Range.containsRange(this, range);
}
/**
* Test if `otherRange` is in `range`. If the ranges are equal, will return true.
*/
static containsRange(range, otherRange) {
if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
return false;
}
if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
return false;
}
if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {
return false;
}
if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {
return false;
}
return true;
}
/**
* Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
*/
strictContainsRange(range) {
return _Range.strictContainsRange(this, range);
}
/**
* Test if `otherRange` is strictly in `range` (must start after, and end before). If the ranges are equal, will return false.
*/
static strictContainsRange(range, otherRange) {
if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
return false;
}
if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
return false;
}
if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {
return false;
}
if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {
return false;
}
return true;
}
/**
* A reunion of the two ranges.
* The smallest position will be used as the start point, and the largest one as the end point.
*/
plusRange(range) {
return _Range.plusRange(this, range);
}
/**
* A reunion of the two ranges.
* The smallest position will be used as the start point, and the largest one as the end point.
*/
static plusRange(a, b) {
let startLineNumber;
let startColumn;
let endLineNumber;
let endColumn;
if (b.startLineNumber < a.startLineNumber) {
startLineNumber = b.startLineNumber;
startColumn = b.startColumn;
} else if (b.startLineNumber === a.startLineNumber) {
startLineNumber = b.startLineNumber;
startColumn = Math.min(b.startColumn, a.startColumn);
} else {
startLineNumber = a.startLineNumber;
startColumn = a.startColumn;
}
if (b.endLineNumber > a.endLineNumber) {
endLineNumber = b.endLineNumber;
endColumn = b.endColumn;
} else if (b.endLineNumber === a.endLineNumber) {
endLineNumber = b.endLineNumber;
endColumn = Math.max(b.endColumn, a.endColumn);
} else {
endLineNumber = a.endLineNumber;
endColumn = a.endColumn;
}
return new _Range(startLineNumber, startColumn, endLineNumber, endColumn);
}
/**
* A intersection of the two ranges.
*/
intersectRanges(range) {
return _Range.intersectRanges(this, range);
}
/**
* A intersection of the two ranges.
*/
static intersectRanges(a, b) {
let resultStartLineNumber = a.startLineNumber;
let resultStartColumn = a.startColumn;
let resultEndLineNumber = a.endLineNumber;
let resultEndColumn = a.endColumn;
const otherStartLineNumber = b.startLineNumber;
const otherStartColumn = b.startColumn;
const otherEndLineNumber = b.endLineNumber;
const otherEndColumn = b.endColumn;
if (resultStartLineNumber < otherStartLineNumber) {
resultStartLineNumber = otherStartLineNumber;
resultStartColumn = otherStartColumn;
} else if (resultStartLineNumber === otherStartLineNumber) {
resultStartColumn = Math.max(resultStartColumn, otherStartColumn);
}
if (resultEndLineNumber > otherEndLineNumber) {
resultEndLineNumber = otherEndLineNumber;
resultEndColumn = otherEndColumn;
} else if (resultEndLineNumber === otherEndLineNumber) {
resultEndColumn = Math.min(resultEndColumn, otherEndColumn);
}
if (resultStartLineNumber > resultEndLineNumber) {
return null;
}
if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {
return null;
}
return new _Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);
}
/**
* Test if this range equals other.
*/
equalsRange(other) {
return _Range.equalsRange(this, other);
}
/**
* Test if range `a` equals `b`.
*/
static equalsRange(a, b) {
if (!a && !b) {
return true;
}
return !!a && !!b && a.startLineNumber === b.startLineNumber && a.startColumn === b.startColumn && a.endLineNumber === b.endLineNumber && a.endColumn === b.endColumn;
}
/**
* Return the end position (which will be after or equal to the start position)
*/
getEndPosition() {
return _Range.getEndPosition(this);
}
/**
* Return the end position (which will be after or equal to the start position)
*/
static getEndPosition(range) {
return new Position(range.endLineNumber, range.endColumn);
}
/**
* Return the start position (which will be before or equal to the end position)
*/
getStartPosition() {
return _Range.getStartPosition(this);
}
/**
* Return the start position (which will be before or equal to the end position)
*/
static getStartPosition(range) {
return new Position(range.startLineNumber, range.startColumn);
}
/**
* Transform to a user presentable string representation.
*/
toString() {
return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]";
}
/**
* Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
*/
setEndPosition(endLineNumber, endColumn) {
return new _Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
}
/**
* Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
*/
setStartPosition(startLineNumber, startColumn) {
return new _Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
}
/**
* Create a new empty range using this range's start position.
*/
collapseToStart() {
return _Range.collapseToStart(this);
}
/**
* Create a new empty range using this range's start position.
*/
static collapseToStart(range) {
return new _Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);
}
/**
* Create a new empty range using this range's end position.
*/
collapseToEnd() {
return _Range.collapseToEnd(this);
}
/**
* Create a new empty range using this range's end position.
*/
static collapseToEnd(range) {
return new _Range(range.endLineNumber, range.endColumn, range.endLineNumber, range.endColumn);
}
/**
* Moves the range by the given amount of lines.
*/
delta(lineCount) {
return new _Range(this.startLineNumber + lineCount, this.startColumn, this.endLineNumber + lineCount, this.endColumn);
}
// ---
static fromPositions(start, end = start) {
return new _Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
static lift(range) {
if (!range) {
return null;
}
return new _Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
}
/**
* Test if `obj` is an `IRange`.
*/
static isIRange(obj) {
return obj && typeof obj.startLineNumber === "number" && typeof obj.startColumn === "number" && typeof obj.endLineNumber === "number" && typeof obj.endColumn === "number";
}
/**
* Test if the two ranges are touching in any way.
*/
static areIntersectingOrTouching(a, b) {
if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn) {
return false;
}
if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn) {
return false;
}
return true;
}
/**
* Test if the two ranges are intersecting. If the ranges are touching it returns true.
*/
static areIntersecting(a, b) {
if (a.endLineNumber < b.startLineNumber || a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn) {
return false;
}
if (b.endLineNumber < a.startLineNumber || b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn) {
return false;
}
return true;
}
/**
* A function that compares ranges, useful for sorting ranges
* It will first compare ranges on the startPosition and then on the endPosition
*/
static compareRangesUsingStarts(a, b) {
if (a && b) {
const aStartLineNumber = a.startLineNumber | 0;
const bStartLineNumber = b.startLineNumber | 0;
if (aStartLineNumber === bStartLineNumber) {
const aStartColumn = a.startColumn | 0;
const bStartColumn = b.startColumn | 0;
if (aStartColumn === bStartColumn) {
const aEndLineNumber = a.endLineNumber | 0;
const bEndLineNumber = b.endLineNumber | 0;
if (aEndLineNumber === bEndLineNumber) {
const aEndColumn = a.endColumn | 0;
const bEndColumn = b.endColumn | 0;
return aEndColumn - bEndColumn;
}
return aEndLineNumber - bEndLineNumber;
}
return aStartColumn - bStartColumn;
}
return aStartLineNumber - bStartLineNumber;
}
const aExists = a ? 1 : 0;
const bExists = b ? 1 : 0;
return aExists - bExists;
}
/**
* A function that compares ranges, useful for sorting ranges
* It will first compare ranges on the endPosition and then on the startPosition
*/
static compareRangesUsingEnds(a, b) {
if (a.endLineNumber === b.endLineNumber) {
if (a.endColumn === b.endColumn) {
if (a.startLineNumber === b.startLineNumber) {
return a.startColumn - b.startColumn;
}
return a.startLineNumber - b.startLineNumber;
}
return a.endColumn - b.endColumn;
}
return a.endLineNumber - b.endLineNumber;
}
/**
* Test if the range spans multiple lines.
*/
static spansMultipleLines(range) {
return range.endLineNumber > range.startLineNumber;
}
toJSON() {
return this;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/uint.js
function toUint8(v) {
if (v < 0) {
return 0;
}
if (v > 255) {
return 255;
}
return v | 0;
}
function toUint32(v) {
if (v < 0) {
return 0;
}
if (v > 4294967295) {
return 4294967295;
}
return v | 0;
}
var init_uint = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/uint.js"() {
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js
var CharacterClassifier;
var init_characterClassifier = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js"() {
init_uint();
CharacterClassifier = class _CharacterClassifier {
constructor(_defaultValue) {
const defaultValue = toUint8(_defaultValue);
this._defaultValue = defaultValue;
this._asciiMap = _CharacterClassifier._createAsciiMap(defaultValue);
this._map = /* @__PURE__ */ new Map();
}
static _createAsciiMap(defaultValue) {
const asciiMap = new Uint8Array(256);
asciiMap.fill(defaultValue);
return asciiMap;
}
set(charCode, _value) {
const value = toUint8(_value);
if (charCode >= 0 && charCode < 256) {
this._asciiMap[charCode] = value;
} else {
this._map.set(charCode, value);
}
}
get(charCode) {
if (charCode >= 0 && charCode < 256) {
return this._asciiMap[charCode];
} else {
return this._map.get(charCode) || this._defaultValue;
}
}
clear() {
this._asciiMap.fill(this._defaultValue);
this._map.clear();
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/linkComputer.js
function getStateMachine() {
if (_stateMachine === null) {
_stateMachine = new StateMachine([
[
1,
104,
2
/* State.H */
],
[
1,
72,
2
/* State.H */
],
[
1,
102,
6
/* State.F */
],
[
1,
70,
6
/* State.F */
],
[
2,
116,
3
/* State.HT */
],
[
2,
84,
3
/* State.HT */
],
[
3,
116,
4
/* State.HTT */
],
[
3,
84,
4
/* State.HTT */
],
[
4,
112,
5
/* State.HTTP */
],
[
4,
80,
5
/* State.HTTP */
],
[
5,
115,
9
/* State.BeforeColon */
],
[
5,
83,
9
/* State.BeforeColon */
],
[
5,
58,
10
/* State.AfterColon */
],
[
6,
105,
7
/* State.FI */
],
[
6,
73,
7
/* State.FI */
],
[
7,
108,
8
/* State.FIL */
],
[
7,
76,
8
/* State.FIL */
],
[
8,
101,
9
/* State.BeforeColon */
],
[
8,
69,
9
/* State.BeforeColon */
],
[
9,
58,
10
/* State.AfterColon */
],
[
10,
47,
11
/* State.AlmostThere */
],
[
11,
47,
12
/* State.End */
]
]);
}
return _stateMachine;
}
function getClassifier() {
if (_classifier === null) {
_classifier = new CharacterClassifier(
0
/* CharacterClass.None */
);
const FORCE_TERMINATION_CHARACTERS = ` <>'"\u3001\u3002\uFF61\uFF64\uFF0C\uFF0E\uFF1A\uFF1B\u2018\u3008\u300C\u300E\u3014\uFF08\uFF3B\uFF5B\uFF62\uFF63\uFF5D\uFF3D\uFF09\u3015\u300F\u300D\u3009\u2019\uFF40\uFF5E\u2026`;
for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {
_classifier.set(
FORCE_TERMINATION_CHARACTERS.charCodeAt(i),
1
/* CharacterClass.ForceTermination */
);
}
const CANNOT_END_WITH_CHARACTERS = ".,;:";
for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {
_classifier.set(
CANNOT_END_WITH_CHARACTERS.charCodeAt(i),
2
/* CharacterClass.CannotEndIn */
);
}
}
return _classifier;
}
function computeLinks(model) {
if (!model || typeof model.getLineCount !== "function" || typeof model.getLineContent !== "function") {
return [];
}
return LinkComputer.computeLinks(model);
}
var Uint8Matrix, StateMachine, _stateMachine, _classifier, LinkComputer;
var init_linkComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/linkComputer.js"() {
init_characterClassifier();
Uint8Matrix = class {
constructor(rows, cols, defaultValue) {
const data = new Uint8Array(rows * cols);
for (let i = 0, len = rows * cols; i < len; i++) {
data[i] = defaultValue;
}
this._data = data;
this.rows = rows;
this.cols = cols;
}
get(row, col) {
return this._data[row * this.cols + col];
}
set(row, col, value) {
this._data[row * this.cols + col] = value;
}
};
StateMachine = class {
constructor(edges) {
let maxCharCode = 0;
let maxState = 0;
for (let i = 0, len = edges.length; i < len; i++) {
const [from, chCode, to2] = edges[i];
if (chCode > maxCharCode) {
maxCharCode = chCode;
}
if (from > maxState) {
maxState = from;
}
if (to2 > maxState) {
maxState = to2;
}
}
maxCharCode++;
maxState++;
const states = new Uint8Matrix(
maxState,
maxCharCode,
0
/* State.Invalid */
);
for (let i = 0, len = edges.length; i < len; i++) {
const [from, chCode, to2] = edges[i];
states.set(from, chCode, to2);
}
this._states = states;
this._maxCharCode = maxCharCode;
}
nextState(currentState, chCode) {
if (chCode < 0 || chCode >= this._maxCharCode) {
return 0;
}
return this._states.get(currentState, chCode);
}
};
_stateMachine = null;
_classifier = null;
LinkComputer = class _LinkComputer {
static _createLink(classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {
let lastIncludedCharIndex = linkEndIndex - 1;
do {
const chCode = line.charCodeAt(lastIncludedCharIndex);
const chClass = classifier.get(chCode);
if (chClass !== 2) {
break;
}
lastIncludedCharIndex--;
} while (lastIncludedCharIndex > linkBeginIndex);
if (linkBeginIndex > 0) {
const charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);
const lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);
if (charCodeBeforeLink === 40 && lastCharCodeInLink === 41 || charCodeBeforeLink === 91 && lastCharCodeInLink === 93 || charCodeBeforeLink === 123 && lastCharCodeInLink === 125) {
lastIncludedCharIndex--;
}
}
return {
range: {
startLineNumber: lineNumber,
startColumn: linkBeginIndex + 1,
endLineNumber: lineNumber,
endColumn: lastIncludedCharIndex + 2
},
url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)
};
}
static computeLinks(model, stateMachine = getStateMachine()) {
const classifier = getClassifier();
const result = [];
for (let i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {
const line = model.getLineContent(i);
const len = line.length;
let j = 0;
let linkBeginIndex = 0;
let linkBeginChCode = 0;
let state = 1;
let hasOpenParens = false;
let hasOpenSquareBracket = false;
let inSquareBrackets = false;
let hasOpenCurlyBracket = false;
while (j < len) {
let resetStateMachine = false;
const chCode = line.charCodeAt(j);
if (state === 13) {
let chClass;
switch (chCode) {
case 40:
hasOpenParens = true;
chClass = 0;
break;
case 41:
chClass = hasOpenParens ? 0 : 1;
break;
case 91:
inSquareBrackets = true;
hasOpenSquareBracket = true;
chClass = 0;
break;
case 93:
inSquareBrackets = false;
chClass = hasOpenSquareBracket ? 0 : 1;
break;
case 123:
hasOpenCurlyBracket = true;
chClass = 0;
break;
case 125:
chClass = hasOpenCurlyBracket ? 0 : 1;
break;
// The following three rules make it that ' or " or ` are allowed inside links
// only if the link is wrapped by some other quote character
case 39:
case 34:
case 96:
if (linkBeginChCode === chCode) {
chClass = 1;
} else if (linkBeginChCode === 39 || linkBeginChCode === 34 || linkBeginChCode === 96) {
chClass = 0;
} else {
chClass = 1;
}
break;
case 42:
chClass = linkBeginChCode === 42 ? 1 : 0;
break;
case 124:
chClass = linkBeginChCode === 124 ? 1 : 0;
break;
case 32:
chClass = inSquareBrackets ? 0 : 1;
break;
default:
chClass = classifier.get(chCode);
}
if (chClass === 1) {
result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));
resetStateMachine = true;
}
} else if (state === 12) {
let chClass;
if (chCode === 91) {
hasOpenSquareBracket = true;
chClass = 0;
} else {
chClass = classifier.get(chCode);
}
if (chClass === 1) {
resetStateMachine = true;
} else {
state = 13;
}
} else {
state = stateMachine.nextState(state, chCode);
if (state === 0) {
resetStateMachine = true;
}
}
if (resetStateMachine) {
state = 1;
hasOpenParens = false;
hasOpenSquareBracket = false;
hasOpenCurlyBracket = false;
linkBeginIndex = j + 1;
linkBeginChCode = chCode;
}
j++;
}
if (state === 13) {
result.push(_LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));
}
}
return result;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js
var BasicInplaceReplace;
var init_inplaceReplaceSupport = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/supports/inplaceReplaceSupport.js"() {
BasicInplaceReplace = class _BasicInplaceReplace {
constructor() {
this._defaultValueSet = [
["true", "false"],
["True", "False"],
["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"],
["public", "protected", "private"]
];
}
static {
this.INSTANCE = new _BasicInplaceReplace();
}
navigateValueSet(range1, text1, range2, text2, up) {
if (range1 && text1) {
const result = this.doNavigateValueSet(text1, up);
if (result) {
return {
range: range1,
value: result
};
}
}
if (range2 && text2) {
const result = this.doNavigateValueSet(text2, up);
if (result) {
return {
range: range2,
value: result
};
}
}
return null;
}
doNavigateValueSet(text, up) {
const numberResult = this.numberReplace(text, up);
if (numberResult !== null) {
return numberResult;
}
return this.textReplace(text, up);
}
numberReplace(value, up) {
const precision = Math.pow(10, value.length - (value.lastIndexOf(".") + 1));
let n1 = Number(value);
const n2 = parseFloat(value);
if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {
if (n1 === 0 && !up) {
return null;
} else {
n1 = Math.floor(n1 * precision);
n1 += up ? precision : -precision;
return String(n1 / precision);
}
}
return null;
}
textReplace(value, up) {
return this.valueSetsReplace(this._defaultValueSet, value, up);
}
valueSetsReplace(valueSets, value, up) {
let result = null;
for (let i = 0, len = valueSets.length; result === null && i < len; i++) {
result = this.valueSetReplace(valueSets[i], value, up);
}
return result;
}
valueSetReplace(valueSet, value, up) {
let idx = valueSet.indexOf(value);
if (idx >= 0) {
idx += up ? 1 : -1;
if (idx < 0) {
idx = valueSet.length - 1;
} else {
idx %= valueSet.length;
}
return valueSet[idx];
}
return null;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/cancellation.js
var shortcutEvent, CancellationToken, MutableToken, CancellationTokenSource;
var init_cancellation = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/cancellation.js"() {
init_event();
shortcutEvent = Object.freeze(function(callback, context) {
const handle = setTimeout(callback.bind(context), 0);
return { dispose() {
clearTimeout(handle);
} };
});
(function(CancellationToken2) {
function isCancellationToken(thing) {
if (thing === CancellationToken2.None || thing === CancellationToken2.Cancelled) {
return true;
}
if (thing instanceof MutableToken) {
return true;
}
if (!thing || typeof thing !== "object") {
return false;
}
return typeof thing.isCancellationRequested === "boolean" && typeof thing.onCancellationRequested === "function";
}
CancellationToken2.isCancellationToken = isCancellationToken;
CancellationToken2.None = Object.freeze({
isCancellationRequested: false,
onCancellationRequested: Event.None
});
CancellationToken2.Cancelled = Object.freeze({
isCancellationRequested: true,
onCancellationRequested: shortcutEvent
});
})(CancellationToken || (CancellationToken = {}));
MutableToken = class {
constructor() {
this._isCancelled = false;
this._emitter = null;
}
cancel() {
if (!this._isCancelled) {
this._isCancelled = true;
if (this._emitter) {
this._emitter.fire(void 0);
this.dispose();
}
}
}
get isCancellationRequested() {
return this._isCancelled;
}
get onCancellationRequested() {
if (this._isCancelled) {
return shortcutEvent;
}
if (!this._emitter) {
this._emitter = new Emitter();
}
return this._emitter.event;
}
dispose() {
if (this._emitter) {
this._emitter.dispose();
this._emitter = null;
}
}
};
CancellationTokenSource = class {
constructor(parent) {
this._token = void 0;
this._parentListener = void 0;
this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);
}
get token() {
if (!this._token) {
this._token = new MutableToken();
}
return this._token;
}
cancel() {
if (!this._token) {
this._token = CancellationToken.Cancelled;
} else if (this._token instanceof MutableToken) {
this._token.cancel();
}
}
dispose(cancel = false) {
if (cancel) {
this.cancel();
}
this._parentListener?.dispose();
if (!this._token) {
this._token = CancellationToken.None;
} else if (this._token instanceof MutableToken) {
this._token.dispose();
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/keyCodes.js
function KeyChord(firstPart, secondPart) {
const chordPart = (secondPart & 65535) << 16 >>> 0;
return (firstPart | chordPart) >>> 0;
}
var KeyCodeStrMap, uiMap, userSettingsUSMap, userSettingsGeneralMap, EVENT_KEY_CODE_MAP, NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE, scanCodeIntToStr, scanCodeStrToInt, scanCodeLowerCaseStrToInt, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE, KeyCodeUtils;
var init_keyCodes = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/keyCodes.js"() {
KeyCodeStrMap = class {
constructor() {
this._keyCodeToStr = [];
this._strToKeyCode = /* @__PURE__ */ Object.create(null);
}
define(keyCode, str) {
this._keyCodeToStr[keyCode] = str;
this._strToKeyCode[str.toLowerCase()] = keyCode;
}
keyCodeToStr(keyCode) {
return this._keyCodeToStr[keyCode];
}
strToKeyCode(str) {
return this._strToKeyCode[str.toLowerCase()] || 0;
}
};
uiMap = new KeyCodeStrMap();
userSettingsUSMap = new KeyCodeStrMap();
userSettingsGeneralMap = new KeyCodeStrMap();
EVENT_KEY_CODE_MAP = new Array(230);
NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {};
scanCodeIntToStr = [];
scanCodeStrToInt = /* @__PURE__ */ Object.create(null);
scanCodeLowerCaseStrToInt = /* @__PURE__ */ Object.create(null);
IMMUTABLE_CODE_TO_KEY_CODE = [];
IMMUTABLE_KEY_CODE_TO_CODE = [];
for (let i = 0; i <= 193; i++) {
IMMUTABLE_CODE_TO_KEY_CODE[i] = -1;
}
for (let i = 0; i <= 132; i++) {
IMMUTABLE_KEY_CODE_TO_CODE[i] = -1;
}
(function() {
const empty = "";
const mappings = [
// immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel
[1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", empty, empty],
[1, 1, "Hyper", 0, empty, 0, empty, empty, empty],
[1, 2, "Super", 0, empty, 0, empty, empty, empty],
[1, 3, "Fn", 0, empty, 0, empty, empty, empty],
[1, 4, "FnLock", 0, empty, 0, empty, empty, empty],
[1, 5, "Suspend", 0, empty, 0, empty, empty, empty],
[1, 6, "Resume", 0, empty, 0, empty, empty, empty],
[1, 7, "Turbo", 0, empty, 0, empty, empty, empty],
[1, 8, "Sleep", 0, empty, 0, "VK_SLEEP", empty, empty],
[1, 9, "WakeUp", 0, empty, 0, empty, empty, empty],
[0, 10, "KeyA", 31, "A", 65, "VK_A", empty, empty],
[0, 11, "KeyB", 32, "B", 66, "VK_B", empty, empty],
[0, 12, "KeyC", 33, "C", 67, "VK_C", empty, empty],
[0, 13, "KeyD", 34, "D", 68, "VK_D", empty, empty],
[0, 14, "KeyE", 35, "E", 69, "VK_E", empty, empty],
[0, 15, "KeyF", 36, "F", 70, "VK_F", empty, empty],
[0, 16, "KeyG", 37, "G", 71, "VK_G", empty, empty],
[0, 17, "KeyH", 38, "H", 72, "VK_H", empty, empty],
[0, 18, "KeyI", 39, "I", 73, "VK_I", empty, empty],
[0, 19, "KeyJ", 40, "J", 74, "VK_J", empty, empty],
[0, 20, "KeyK", 41, "K", 75, "VK_K", empty, empty],
[0, 21, "KeyL", 42, "L", 76, "VK_L", empty, empty],
[0, 22, "KeyM", 43, "M", 77, "VK_M", empty, empty],
[0, 23, "KeyN", 44, "N", 78, "VK_N", empty, empty],
[0, 24, "KeyO", 45, "O", 79, "VK_O", empty, empty],
[0, 25, "KeyP", 46, "P", 80, "VK_P", empty, empty],
[0, 26, "KeyQ", 47, "Q", 81, "VK_Q", empty, empty],
[0, 27, "KeyR", 48, "R", 82, "VK_R", empty, empty],
[0, 28, "KeyS", 49, "S", 83, "VK_S", empty, empty],
[0, 29, "KeyT", 50, "T", 84, "VK_T", empty, empty],
[0, 30, "KeyU", 51, "U", 85, "VK_U", empty, empty],
[0, 31, "KeyV", 52, "V", 86, "VK_V", empty, empty],
[0, 32, "KeyW", 53, "W", 87, "VK_W", empty, empty],
[0, 33, "KeyX", 54, "X", 88, "VK_X", empty, empty],
[0, 34, "KeyY", 55, "Y", 89, "VK_Y", empty, empty],
[0, 35, "KeyZ", 56, "Z", 90, "VK_Z", empty, empty],
[0, 36, "Digit1", 22, "1", 49, "VK_1", empty, empty],
[0, 37, "Digit2", 23, "2", 50, "VK_2", empty, empty],
[0, 38, "Digit3", 24, "3", 51, "VK_3", empty, empty],
[0, 39, "Digit4", 25, "4", 52, "VK_4", empty, empty],
[0, 40, "Digit5", 26, "5", 53, "VK_5", empty, empty],
[0, 41, "Digit6", 27, "6", 54, "VK_6", empty, empty],
[0, 42, "Digit7", 28, "7", 55, "VK_7", empty, empty],
[0, 43, "Digit8", 29, "8", 56, "VK_8", empty, empty],
[0, 44, "Digit9", 30, "9", 57, "VK_9", empty, empty],
[0, 45, "Digit0", 21, "0", 48, "VK_0", empty, empty],
[1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", empty, empty],
[1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", empty, empty],
[1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", empty, empty],
[1, 49, "Tab", 2, "Tab", 9, "VK_TAB", empty, empty],
[1, 50, "Space", 10, "Space", 32, "VK_SPACE", empty, empty],
[0, 51, "Minus", 88, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"],
[0, 52, "Equal", 86, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"],
[0, 53, "BracketLeft", 92, "[", 219, "VK_OEM_4", "[", "OEM_4"],
[0, 54, "BracketRight", 94, "]", 221, "VK_OEM_6", "]", "OEM_6"],
[0, 55, "Backslash", 93, "\\", 220, "VK_OEM_5", "\\", "OEM_5"],
[0, 56, "IntlHash", 0, empty, 0, empty, empty, empty],
// has been dropped from the w3c spec
[0, 57, "Semicolon", 85, ";", 186, "VK_OEM_1", ";", "OEM_1"],
[0, 58, "Quote", 95, "'", 222, "VK_OEM_7", "'", "OEM_7"],
[0, 59, "Backquote", 91, "`", 192, "VK_OEM_3", "`", "OEM_3"],
[0, 60, "Comma", 87, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"],
[0, 61, "Period", 89, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"],
[0, 62, "Slash", 90, "/", 191, "VK_OEM_2", "/", "OEM_2"],
[1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", empty, empty],
[1, 64, "F1", 59, "F1", 112, "VK_F1", empty, empty],
[1, 65, "F2", 60, "F2", 113, "VK_F2", empty, empty],
[1, 66, "F3", 61, "F3", 114, "VK_F3", empty, empty],
[1, 67, "F4", 62, "F4", 115, "VK_F4", empty, empty],
[1, 68, "F5", 63, "F5", 116, "VK_F5", empty, empty],
[1, 69, "F6", 64, "F6", 117, "VK_F6", empty, empty],
[1, 70, "F7", 65, "F7", 118, "VK_F7", empty, empty],
[1, 71, "F8", 66, "F8", 119, "VK_F8", empty, empty],
[1, 72, "F9", 67, "F9", 120, "VK_F9", empty, empty],
[1, 73, "F10", 68, "F10", 121, "VK_F10", empty, empty],
[1, 74, "F11", 69, "F11", 122, "VK_F11", empty, empty],
[1, 75, "F12", 70, "F12", 123, "VK_F12", empty, empty],
[1, 76, "PrintScreen", 0, empty, 0, empty, empty, empty],
[1, 77, "ScrollLock", 84, "ScrollLock", 145, "VK_SCROLL", empty, empty],
[1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", empty, empty],
[1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", empty, empty],
[1, 80, "Home", 14, "Home", 36, "VK_HOME", empty, empty],
[1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", empty, empty],
[1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", empty, empty],
[1, 83, "End", 13, "End", 35, "VK_END", empty, empty],
[1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", empty, empty],
[1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", empty],
[1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", empty],
[1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", empty],
[1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", empty],
[1, 89, "NumLock", 83, "NumLock", 144, "VK_NUMLOCK", empty, empty],
[1, 90, "NumpadDivide", 113, "NumPad_Divide", 111, "VK_DIVIDE", empty, empty],
[1, 91, "NumpadMultiply", 108, "NumPad_Multiply", 106, "VK_MULTIPLY", empty, empty],
[1, 92, "NumpadSubtract", 111, "NumPad_Subtract", 109, "VK_SUBTRACT", empty, empty],
[1, 93, "NumpadAdd", 109, "NumPad_Add", 107, "VK_ADD", empty, empty],
[1, 94, "NumpadEnter", 3, empty, 0, empty, empty, empty],
[1, 95, "Numpad1", 99, "NumPad1", 97, "VK_NUMPAD1", empty, empty],
[1, 96, "Numpad2", 100, "NumPad2", 98, "VK_NUMPAD2", empty, empty],
[1, 97, "Numpad3", 101, "NumPad3", 99, "VK_NUMPAD3", empty, empty],
[1, 98, "Numpad4", 102, "NumPad4", 100, "VK_NUMPAD4", empty, empty],
[1, 99, "Numpad5", 103, "NumPad5", 101, "VK_NUMPAD5", empty, empty],
[1, 100, "Numpad6", 104, "NumPad6", 102, "VK_NUMPAD6", empty, empty],
[1, 101, "Numpad7", 105, "NumPad7", 103, "VK_NUMPAD7", empty, empty],
[1, 102, "Numpad8", 106, "NumPad8", 104, "VK_NUMPAD8", empty, empty],
[1, 103, "Numpad9", 107, "NumPad9", 105, "VK_NUMPAD9", empty, empty],
[1, 104, "Numpad0", 98, "NumPad0", 96, "VK_NUMPAD0", empty, empty],
[1, 105, "NumpadDecimal", 112, "NumPad_Decimal", 110, "VK_DECIMAL", empty, empty],
[0, 106, "IntlBackslash", 97, "OEM_102", 226, "VK_OEM_102", empty, empty],
[1, 107, "ContextMenu", 58, "ContextMenu", 93, empty, empty, empty],
[1, 108, "Power", 0, empty, 0, empty, empty, empty],
[1, 109, "NumpadEqual", 0, empty, 0, empty, empty, empty],
[1, 110, "F13", 71, "F13", 124, "VK_F13", empty, empty],
[1, 111, "F14", 72, "F14", 125, "VK_F14", empty, empty],
[1, 112, "F15", 73, "F15", 126, "VK_F15", empty, empty],
[1, 113, "F16", 74, "F16", 127, "VK_F16", empty, empty],
[1, 114, "F17", 75, "F17", 128, "VK_F17", empty, empty],
[1, 115, "F18", 76, "F18", 129, "VK_F18", empty, empty],
[1, 116, "F19", 77, "F19", 130, "VK_F19", empty, empty],
[1, 117, "F20", 78, "F20", 131, "VK_F20", empty, empty],
[1, 118, "F21", 79, "F21", 132, "VK_F21", empty, empty],
[1, 119, "F22", 80, "F22", 133, "VK_F22", empty, empty],
[1, 120, "F23", 81, "F23", 134, "VK_F23", empty, empty],
[1, 121, "F24", 82, "F24", 135, "VK_F24", empty, empty],
[1, 122, "Open", 0, empty, 0, empty, empty, empty],
[1, 123, "Help", 0, empty, 0, empty, empty, empty],
[1, 124, "Select", 0, empty, 0, empty, empty, empty],
[1, 125, "Again", 0, empty, 0, empty, empty, empty],
[1, 126, "Undo", 0, empty, 0, empty, empty, empty],
[1, 127, "Cut", 0, empty, 0, empty, empty, empty],
[1, 128, "Copy", 0, empty, 0, empty, empty, empty],
[1, 129, "Paste", 0, empty, 0, empty, empty, empty],
[1, 130, "Find", 0, empty, 0, empty, empty, empty],
[1, 131, "AudioVolumeMute", 117, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", empty, empty],
[1, 132, "AudioVolumeUp", 118, "AudioVolumeUp", 175, "VK_VOLUME_UP", empty, empty],
[1, 133, "AudioVolumeDown", 119, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", empty, empty],
[1, 134, "NumpadComma", 110, "NumPad_Separator", 108, "VK_SEPARATOR", empty, empty],
[0, 135, "IntlRo", 115, "ABNT_C1", 193, "VK_ABNT_C1", empty, empty],
[1, 136, "KanaMode", 0, empty, 0, empty, empty, empty],
[0, 137, "IntlYen", 0, empty, 0, empty, empty, empty],
[1, 138, "Convert", 0, empty, 0, empty, empty, empty],
[1, 139, "NonConvert", 0, empty, 0, empty, empty, empty],
[1, 140, "Lang1", 0, empty, 0, empty, empty, empty],
[1, 141, "Lang2", 0, empty, 0, empty, empty, empty],
[1, 142, "Lang3", 0, empty, 0, empty, empty, empty],
[1, 143, "Lang4", 0, empty, 0, empty, empty, empty],
[1, 144, "Lang5", 0, empty, 0, empty, empty, empty],
[1, 145, "Abort", 0, empty, 0, empty, empty, empty],
[1, 146, "Props", 0, empty, 0, empty, empty, empty],
[1, 147, "NumpadParenLeft", 0, empty, 0, empty, empty, empty],
[1, 148, "NumpadParenRight", 0, empty, 0, empty, empty, empty],
[1, 149, "NumpadBackspace", 0, empty, 0, empty, empty, empty],
[1, 150, "NumpadMemoryStore", 0, empty, 0, empty, empty, empty],
[1, 151, "NumpadMemoryRecall", 0, empty, 0, empty, empty, empty],
[1, 152, "NumpadMemoryClear", 0, empty, 0, empty, empty, empty],
[1, 153, "NumpadMemoryAdd", 0, empty, 0, empty, empty, empty],
[1, 154, "NumpadMemorySubtract", 0, empty, 0, empty, empty, empty],
[1, 155, "NumpadClear", 131, "Clear", 12, "VK_CLEAR", empty, empty],
[1, 156, "NumpadClearEntry", 0, empty, 0, empty, empty, empty],
[1, 0, empty, 5, "Ctrl", 17, "VK_CONTROL", empty, empty],
[1, 0, empty, 4, "Shift", 16, "VK_SHIFT", empty, empty],
[1, 0, empty, 6, "Alt", 18, "VK_MENU", empty, empty],
[1, 0, empty, 57, "Meta", 91, "VK_COMMAND", empty, empty],
[1, 157, "ControlLeft", 5, empty, 0, "VK_LCONTROL", empty, empty],
[1, 158, "ShiftLeft", 4, empty, 0, "VK_LSHIFT", empty, empty],
[1, 159, "AltLeft", 6, empty, 0, "VK_LMENU", empty, empty],
[1, 160, "MetaLeft", 57, empty, 0, "VK_LWIN", empty, empty],
[1, 161, "ControlRight", 5, empty, 0, "VK_RCONTROL", empty, empty],
[1, 162, "ShiftRight", 4, empty, 0, "VK_RSHIFT", empty, empty],
[1, 163, "AltRight", 6, empty, 0, "VK_RMENU", empty, empty],
[1, 164, "MetaRight", 57, empty, 0, "VK_RWIN", empty, empty],
[1, 165, "BrightnessUp", 0, empty, 0, empty, empty, empty],
[1, 166, "BrightnessDown", 0, empty, 0, empty, empty, empty],
[1, 167, "MediaPlay", 0, empty, 0, empty, empty, empty],
[1, 168, "MediaRecord", 0, empty, 0, empty, empty, empty],
[1, 169, "MediaFastForward", 0, empty, 0, empty, empty, empty],
[1, 170, "MediaRewind", 0, empty, 0, empty, empty, empty],
[1, 171, "MediaTrackNext", 124, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", empty, empty],
[1, 172, "MediaTrackPrevious", 125, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", empty, empty],
[1, 173, "MediaStop", 126, "MediaStop", 178, "VK_MEDIA_STOP", empty, empty],
[1, 174, "Eject", 0, empty, 0, empty, empty, empty],
[1, 175, "MediaPlayPause", 127, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", empty, empty],
[1, 176, "MediaSelect", 128, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", empty, empty],
[1, 177, "LaunchMail", 129, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", empty, empty],
[1, 178, "LaunchApp2", 130, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", empty, empty],
[1, 179, "LaunchApp1", 0, empty, 0, "VK_MEDIA_LAUNCH_APP1", empty, empty],
[1, 180, "SelectTask", 0, empty, 0, empty, empty, empty],
[1, 181, "LaunchScreenSaver", 0, empty, 0, empty, empty, empty],
[1, 182, "BrowserSearch", 120, "BrowserSearch", 170, "VK_BROWSER_SEARCH", empty, empty],
[1, 183, "BrowserHome", 121, "BrowserHome", 172, "VK_BROWSER_HOME", empty, empty],
[1, 184, "BrowserBack", 122, "BrowserBack", 166, "VK_BROWSER_BACK", empty, empty],
[1, 185, "BrowserForward", 123, "BrowserForward", 167, "VK_BROWSER_FORWARD", empty, empty],
[1, 186, "BrowserStop", 0, empty, 0, "VK_BROWSER_STOP", empty, empty],
[1, 187, "BrowserRefresh", 0, empty, 0, "VK_BROWSER_REFRESH", empty, empty],
[1, 188, "BrowserFavorites", 0, empty, 0, "VK_BROWSER_FAVORITES", empty, empty],
[1, 189, "ZoomToggle", 0, empty, 0, empty, empty, empty],
[1, 190, "MailReply", 0, empty, 0, empty, empty, empty],
[1, 191, "MailForward", 0, empty, 0, empty, empty, empty],
[1, 192, "MailSend", 0, empty, 0, empty, empty, empty],
// See https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
// If an Input Method Editor is processing key input and the event is keydown, return 229.
[1, 0, empty, 114, "KeyInComposition", 229, empty, empty, empty],
[1, 0, empty, 116, "ABNT_C2", 194, "VK_ABNT_C2", empty, empty],
[1, 0, empty, 96, "OEM_8", 223, "VK_OEM_8", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_KANA", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_HANGUL", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_JUNJA", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_FINAL", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_HANJA", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_KANJI", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_CONVERT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_NONCONVERT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_ACCEPT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_MODECHANGE", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_SELECT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_PRINT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_EXECUTE", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_SNAPSHOT", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_HELP", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_APPS", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_PROCESSKEY", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_PACKET", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_DBE_SBCSCHAR", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_DBE_DBCSCHAR", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_ATTN", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_CRSEL", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_EXSEL", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_EREOF", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_PLAY", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_ZOOM", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_NONAME", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_PA1", empty, empty],
[1, 0, empty, 0, empty, 0, "VK_OEM_CLEAR", empty, empty]
];
const seenKeyCode = [];
const seenScanCode = [];
for (const mapping of mappings) {
const [immutable, scanCode, scanCodeStr, keyCode, keyCodeStr, eventKeyCode, vkey, usUserSettingsLabel, generalUserSettingsLabel] = mapping;
if (!seenScanCode[scanCode]) {
seenScanCode[scanCode] = true;
scanCodeIntToStr[scanCode] = scanCodeStr;
scanCodeStrToInt[scanCodeStr] = scanCode;
scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;
if (immutable) {
IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;
if (keyCode !== 0 && keyCode !== 3 && keyCode !== 5 && keyCode !== 4 && keyCode !== 6 && keyCode !== 57) {
IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;
}
}
}
if (!seenKeyCode[keyCode]) {
seenKeyCode[keyCode] = true;
if (!keyCodeStr) {
throw new Error(`String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`);
}
uiMap.define(keyCode, keyCodeStr);
userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);
userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);
}
if (eventKeyCode) {
EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;
}
if (vkey) {
NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;
}
}
IMMUTABLE_KEY_CODE_TO_CODE[
3
/* KeyCode.Enter */
] = 46;
})();
(function(KeyCodeUtils2) {
function toString(keyCode) {
return uiMap.keyCodeToStr(keyCode);
}
KeyCodeUtils2.toString = toString;
function fromString(key) {
return uiMap.strToKeyCode(key);
}
KeyCodeUtils2.fromString = fromString;
function toUserSettingsUS(keyCode) {
return userSettingsUSMap.keyCodeToStr(keyCode);
}
KeyCodeUtils2.toUserSettingsUS = toUserSettingsUS;
function toUserSettingsGeneral(keyCode) {
return userSettingsGeneralMap.keyCodeToStr(keyCode);
}
KeyCodeUtils2.toUserSettingsGeneral = toUserSettingsGeneral;
function fromUserSettings(key) {
return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);
}
KeyCodeUtils2.fromUserSettings = fromUserSettings;
function toElectronAccelerator(keyCode) {
if (keyCode >= 98 && keyCode <= 113) {
return null;
}
switch (keyCode) {
case 16:
return "Up";
case 18:
return "Down";
case 15:
return "Left";
case 17:
return "Right";
}
return uiMap.keyCodeToStr(keyCode);
}
KeyCodeUtils2.toElectronAccelerator = toElectronAccelerator;
})(KeyCodeUtils || (KeyCodeUtils = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/selection.js
var Selection;
var init_selection = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/selection.js"() {
init_position();
init_range();
Selection = class _Selection extends Range {
constructor(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {
super(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn);
this.selectionStartLineNumber = selectionStartLineNumber;
this.selectionStartColumn = selectionStartColumn;
this.positionLineNumber = positionLineNumber;
this.positionColumn = positionColumn;
}
/**
* Transform to a human-readable representation.
*/
toString() {
return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]";
}
/**
* Test if equals other selection.
*/
equalsSelection(other) {
return _Selection.selectionsEqual(this, other);
}
/**
* Test if the two selections are equal.
*/
static selectionsEqual(a, b) {
return a.selectionStartLineNumber === b.selectionStartLineNumber && a.selectionStartColumn === b.selectionStartColumn && a.positionLineNumber === b.positionLineNumber && a.positionColumn === b.positionColumn;
}
/**
* Get directions (LTR or RTL).
*/
getDirection() {
if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {
return 0;
}
return 1;
}
/**
* Create a new selection with a different `positionLineNumber` and `positionColumn`.
*/
setEndPosition(endLineNumber, endColumn) {
if (this.getDirection() === 0) {
return new _Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
}
return new _Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);
}
/**
* Get the position at `positionLineNumber` and `positionColumn`.
*/
getPosition() {
return new Position(this.positionLineNumber, this.positionColumn);
}
/**
* Get the position at the start of the selection.
*/
getSelectionStart() {
return new Position(this.selectionStartLineNumber, this.selectionStartColumn);
}
/**
* Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
*/
setStartPosition(startLineNumber, startColumn) {
if (this.getDirection() === 0) {
return new _Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
}
return new _Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);
}
// ----
/**
* Create a `Selection` from one or two positions
*/
static fromPositions(start, end = start) {
return new _Selection(start.lineNumber, start.column, end.lineNumber, end.column);
}
/**
* Creates a `Selection` from a range, given a direction.
*/
static fromRange(range, direction) {
if (direction === 0) {
return new _Selection(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
} else {
return new _Selection(range.endLineNumber, range.endColumn, range.startLineNumber, range.startColumn);
}
}
/**
* Create a `Selection` from an `ISelection`.
*/
static liftSelection(sel) {
return new _Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);
}
/**
* `a` equals `b`.
*/
static selectionsArrEqual(a, b) {
if (a && !b || !a && b) {
return false;
}
if (!a && !b) {
return true;
}
if (a.length !== b.length) {
return false;
}
for (let i = 0, len = a.length; i < len; i++) {
if (!this.selectionsEqual(a[i], b[i])) {
return false;
}
}
return true;
}
/**
* Test if `obj` is an `ISelection`.
*/
static isISelection(obj) {
return obj && typeof obj.selectionStartLineNumber === "number" && typeof obj.selectionStartColumn === "number" && typeof obj.positionLineNumber === "number" && typeof obj.positionColumn === "number";
}
/**
* Create with a direction.
*/
static createWithDirection(startLineNumber, startColumn, endLineNumber, endColumn, direction) {
if (direction === 0) {
return new _Selection(startLineNumber, startColumn, endLineNumber, endColumn);
}
return new _Selection(endLineNumber, endColumn, startLineNumber, startColumn);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/types.js
function isString(str) {
return typeof str === "string";
}
var init_types = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/types.js"() {
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codiconsUtil.js
function register(id, fontCharacter) {
if (isString(fontCharacter)) {
const val = _codiconFontCharacters[fontCharacter];
if (val === void 0) {
throw new Error(`${id} references an unknown codicon: ${fontCharacter}`);
}
fontCharacter = val;
}
_codiconFontCharacters[id] = fontCharacter;
return { id };
}
var _codiconFontCharacters;
var init_codiconsUtil = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codiconsUtil.js"() {
init_types();
_codiconFontCharacters = /* @__PURE__ */ Object.create(null);
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codiconsLibrary.js
var codiconsLibrary;
var init_codiconsLibrary = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codiconsLibrary.js"() {
init_codiconsUtil();
codiconsLibrary = {
add: register("add", 6e4),
plus: register("plus", 6e4),
gistNew: register("gist-new", 6e4),
repoCreate: register("repo-create", 6e4),
lightbulb: register("lightbulb", 60001),
lightBulb: register("light-bulb", 60001),
repo: register("repo", 60002),
repoDelete: register("repo-delete", 60002),
gistFork: register("gist-fork", 60003),
repoForked: register("repo-forked", 60003),
gitPullRequest: register("git-pull-request", 60004),
gitPullRequestAbandoned: register("git-pull-request-abandoned", 60004),
recordKeys: register("record-keys", 60005),
keyboard: register("keyboard", 60005),
tag: register("tag", 60006),
gitPullRequestLabel: register("git-pull-request-label", 60006),
tagAdd: register("tag-add", 60006),
tagRemove: register("tag-remove", 60006),
person: register("person", 60007),
personFollow: register("person-follow", 60007),
personOutline: register("person-outline", 60007),
personFilled: register("person-filled", 60007),
gitBranch: register("git-branch", 60008),
gitBranchCreate: register("git-branch-create", 60008),
gitBranchDelete: register("git-branch-delete", 60008),
sourceControl: register("source-control", 60008),
mirror: register("mirror", 60009),
mirrorPublic: register("mirror-public", 60009),
star: register("star", 60010),
starAdd: register("star-add", 60010),
starDelete: register("star-delete", 60010),
starEmpty: register("star-empty", 60010),
comment: register("comment", 60011),
commentAdd: register("comment-add", 60011),
alert: register("alert", 60012),
warning: register("warning", 60012),
search: register("search", 60013),
searchSave: register("search-save", 60013),
logOut: register("log-out", 60014),
signOut: register("sign-out", 60014),
logIn: register("log-in", 60015),
signIn: register("sign-in", 60015),
eye: register("eye", 60016),
eyeUnwatch: register("eye-unwatch", 60016),
eyeWatch: register("eye-watch", 60016),
circleFilled: register("circle-filled", 60017),
primitiveDot: register("primitive-dot", 60017),
closeDirty: register("close-dirty", 60017),
debugBreakpoint: register("debug-breakpoint", 60017),
debugBreakpointDisabled: register("debug-breakpoint-disabled", 60017),
debugHint: register("debug-hint", 60017),
terminalDecorationSuccess: register("terminal-decoration-success", 60017),
primitiveSquare: register("primitive-square", 60018),
edit: register("edit", 60019),
pencil: register("pencil", 60019),
info: register("info", 60020),
issueOpened: register("issue-opened", 60020),
gistPrivate: register("gist-private", 60021),
gitForkPrivate: register("git-fork-private", 60021),
lock: register("lock", 60021),
mirrorPrivate: register("mirror-private", 60021),
close: register("close", 60022),
removeClose: register("remove-close", 60022),
x: register("x", 60022),
repoSync: register("repo-sync", 60023),
sync: register("sync", 60023),
clone: register("clone", 60024),
desktopDownload: register("desktop-download", 60024),
beaker: register("beaker", 60025),
microscope: register("microscope", 60025),
vm: register("vm", 60026),
deviceDesktop: register("device-desktop", 60026),
file: register("file", 60027),
fileText: register("file-text", 60027),
more: register("more", 60028),
ellipsis: register("ellipsis", 60028),
kebabHorizontal: register("kebab-horizontal", 60028),
mailReply: register("mail-reply", 60029),
reply: register("reply", 60029),
organization: register("organization", 60030),
organizationFilled: register("organization-filled", 60030),
organizationOutline: register("organization-outline", 60030),
newFile: register("new-file", 60031),
fileAdd: register("file-add", 60031),
newFolder: register("new-folder", 60032),
fileDirectoryCreate: register("file-directory-create", 60032),
trash: register("trash", 60033),
trashcan: register("trashcan", 60033),
history: register("history", 60034),
clock: register("clock", 60034),
folder: register("folder", 60035),
fileDirectory: register("file-directory", 60035),
symbolFolder: register("symbol-folder", 60035),
logoGithub: register("logo-github", 60036),
markGithub: register("mark-github", 60036),
github: register("github", 60036),
terminal: register("terminal", 60037),
console: register("console", 60037),
repl: register("repl", 60037),
zap: register("zap", 60038),
symbolEvent: register("symbol-event", 60038),
error: register("error", 60039),
stop: register("stop", 60039),
variable: register("variable", 60040),
symbolVariable: register("symbol-variable", 60040),
array: register("array", 60042),
symbolArray: register("symbol-array", 60042),
symbolModule: register("symbol-module", 60043),
symbolPackage: register("symbol-package", 60043),
symbolNamespace: register("symbol-namespace", 60043),
symbolObject: register("symbol-object", 60043),
symbolMethod: register("symbol-method", 60044),
symbolFunction: register("symbol-function", 60044),
symbolConstructor: register("symbol-constructor", 60044),
symbolBoolean: register("symbol-boolean", 60047),
symbolNull: register("symbol-null", 60047),
symbolNumeric: register("symbol-numeric", 60048),
symbolNumber: register("symbol-number", 60048),
symbolStructure: register("symbol-structure", 60049),
symbolStruct: register("symbol-struct", 60049),
symbolParameter: register("symbol-parameter", 60050),
symbolTypeParameter: register("symbol-type-parameter", 60050),
symbolKey: register("symbol-key", 60051),
symbolText: register("symbol-text", 60051),
symbolReference: register("symbol-reference", 60052),
goToFile: register("go-to-file", 60052),
symbolEnum: register("symbol-enum", 60053),
symbolValue: register("symbol-value", 60053),
symbolRuler: register("symbol-ruler", 60054),
symbolUnit: register("symbol-unit", 60054),
activateBreakpoints: register("activate-breakpoints", 60055),
archive: register("archive", 60056),
arrowBoth: register("arrow-both", 60057),
arrowDown: register("arrow-down", 60058),
arrowLeft: register("arrow-left", 60059),
arrowRight: register("arrow-right", 60060),
arrowSmallDown: register("arrow-small-down", 60061),
arrowSmallLeft: register("arrow-small-left", 60062),
arrowSmallRight: register("arrow-small-right", 60063),
arrowSmallUp: register("arrow-small-up", 60064),
arrowUp: register("arrow-up", 60065),
bell: register("bell", 60066),
bold: register("bold", 60067),
book: register("book", 60068),
bookmark: register("bookmark", 60069),
debugBreakpointConditionalUnverified: register("debug-breakpoint-conditional-unverified", 60070),
debugBreakpointConditional: register("debug-breakpoint-conditional", 60071),
debugBreakpointConditionalDisabled: register("debug-breakpoint-conditional-disabled", 60071),
debugBreakpointDataUnverified: register("debug-breakpoint-data-unverified", 60072),
debugBreakpointData: register("debug-breakpoint-data", 60073),
debugBreakpointDataDisabled: register("debug-breakpoint-data-disabled", 60073),
debugBreakpointLogUnverified: register("debug-breakpoint-log-unverified", 60074),
debugBreakpointLog: register("debug-breakpoint-log", 60075),
debugBreakpointLogDisabled: register("debug-breakpoint-log-disabled", 60075),
briefcase: register("briefcase", 60076),
broadcast: register("broadcast", 60077),
browser: register("browser", 60078),
bug: register("bug", 60079),
calendar: register("calendar", 60080),
caseSensitive: register("case-sensitive", 60081),
check: register("check", 60082),
checklist: register("checklist", 60083),
chevronDown: register("chevron-down", 60084),
chevronLeft: register("chevron-left", 60085),
chevronRight: register("chevron-right", 60086),
chevronUp: register("chevron-up", 60087),
chromeClose: register("chrome-close", 60088),
chromeMaximize: register("chrome-maximize", 60089),
chromeMinimize: register("chrome-minimize", 60090),
chromeRestore: register("chrome-restore", 60091),
circleOutline: register("circle-outline", 60092),
circle: register("circle", 60092),
debugBreakpointUnverified: register("debug-breakpoint-unverified", 60092),
terminalDecorationIncomplete: register("terminal-decoration-incomplete", 60092),
circleSlash: register("circle-slash", 60093),
circuitBoard: register("circuit-board", 60094),
clearAll: register("clear-all", 60095),
clippy: register("clippy", 60096),
closeAll: register("close-all", 60097),
cloudDownload: register("cloud-download", 60098),
cloudUpload: register("cloud-upload", 60099),
code: register("code", 60100),
collapseAll: register("collapse-all", 60101),
colorMode: register("color-mode", 60102),
commentDiscussion: register("comment-discussion", 60103),
creditCard: register("credit-card", 60105),
dash: register("dash", 60108),
dashboard: register("dashboard", 60109),
database: register("database", 60110),
debugContinue: register("debug-continue", 60111),
debugDisconnect: register("debug-disconnect", 60112),
debugPause: register("debug-pause", 60113),
debugRestart: register("debug-restart", 60114),
debugStart: register("debug-start", 60115),
debugStepInto: register("debug-step-into", 60116),
debugStepOut: register("debug-step-out", 60117),
debugStepOver: register("debug-step-over", 60118),
debugStop: register("debug-stop", 60119),
debug: register("debug", 60120),
deviceCameraVideo: register("device-camera-video", 60121),
deviceCamera: register("device-camera", 60122),
deviceMobile: register("device-mobile", 60123),
diffAdded: register("diff-added", 60124),
diffIgnored: register("diff-ignored", 60125),
diffModified: register("diff-modified", 60126),
diffRemoved: register("diff-removed", 60127),
diffRenamed: register("diff-renamed", 60128),
diff: register("diff", 60129),
diffSidebyside: register("diff-sidebyside", 60129),
discard: register("discard", 60130),
editorLayout: register("editor-layout", 60131),
emptyWindow: register("empty-window", 60132),
exclude: register("exclude", 60133),
extensions: register("extensions", 60134),
eyeClosed: register("eye-closed", 60135),
fileBinary: register("file-binary", 60136),
fileCode: register("file-code", 60137),
fileMedia: register("file-media", 60138),
filePdf: register("file-pdf", 60139),
fileSubmodule: register("file-submodule", 60140),
fileSymlinkDirectory: register("file-symlink-directory", 60141),
fileSymlinkFile: register("file-symlink-file", 60142),
fileZip: register("file-zip", 60143),
files: register("files", 60144),
filter: register("filter", 60145),
flame: register("flame", 60146),
foldDown: register("fold-down", 60147),
foldUp: register("fold-up", 60148),
fold: register("fold", 60149),
folderActive: register("folder-active", 60150),
folderOpened: register("folder-opened", 60151),
gear: register("gear", 60152),
gift: register("gift", 60153),
gistSecret: register("gist-secret", 60154),
gist: register("gist", 60155),
gitCommit: register("git-commit", 60156),
gitCompare: register("git-compare", 60157),
compareChanges: register("compare-changes", 60157),
gitMerge: register("git-merge", 60158),
githubAction: register("github-action", 60159),
githubAlt: register("github-alt", 60160),
globe: register("globe", 60161),
grabber: register("grabber", 60162),
graph: register("graph", 60163),
gripper: register("gripper", 60164),
heart: register("heart", 60165),
home: register("home", 60166),
horizontalRule: register("horizontal-rule", 60167),
hubot: register("hubot", 60168),
inbox: register("inbox", 60169),
issueReopened: register("issue-reopened", 60171),
issues: register("issues", 60172),
italic: register("italic", 60173),
jersey: register("jersey", 60174),
json: register("json", 60175),
kebabVertical: register("kebab-vertical", 60176),
key: register("key", 60177),
law: register("law", 60178),
lightbulbAutofix: register("lightbulb-autofix", 60179),
linkExternal: register("link-external", 60180),
link: register("link", 60181),
listOrdered: register("list-ordered", 60182),
listUnordered: register("list-unordered", 60183),
liveShare: register("live-share", 60184),
loading: register("loading", 60185),
location: register("location", 60186),
mailRead: register("mail-read", 60187),
mail: register("mail", 60188),
markdown: register("markdown", 60189),
megaphone: register("megaphone", 60190),
mention: register("mention", 60191),
milestone: register("milestone", 60192),
gitPullRequestMilestone: register("git-pull-request-milestone", 60192),
mortarBoard: register("mortar-board", 60193),
move: register("move", 60194),
multipleWindows: register("multiple-windows", 60195),
mute: register("mute", 60196),
noNewline: register("no-newline", 60197),
note: register("note", 60198),
octoface: register("octoface", 60199),
openPreview: register("open-preview", 60200),
package: register("package", 60201),
paintcan: register("paintcan", 60202),
pin: register("pin", 60203),
play: register("play", 60204),
run: register("run", 60204),
plug: register("plug", 60205),
preserveCase: register("preserve-case", 60206),
preview: register("preview", 60207),
project: register("project", 60208),
pulse: register("pulse", 60209),
question: register("question", 60210),
quote: register("quote", 60211),
radioTower: register("radio-tower", 60212),
reactions: register("reactions", 60213),
references: register("references", 60214),
refresh: register("refresh", 60215),
regex: register("regex", 60216),
remoteExplorer: register("remote-explorer", 60217),
remote: register("remote", 60218),
remove: register("remove", 60219),
replaceAll: register("replace-all", 60220),
replace: register("replace", 60221),
repoClone: register("repo-clone", 60222),
repoForcePush: register("repo-force-push", 60223),
repoPull: register("repo-pull", 60224),
repoPush: register("repo-push", 60225),
report: register("report", 60226),
requestChanges: register("request-changes", 60227),
rocket: register("rocket", 60228),
rootFolderOpened: register("root-folder-opened", 60229),
rootFolder: register("root-folder", 60230),
rss: register("rss", 60231),
ruby: register("ruby", 60232),
saveAll: register("save-all", 60233),
saveAs: register("save-as", 60234),
save: register("save", 60235),
screenFull: register("screen-full", 60236),
screenNormal: register("screen-normal", 60237),
searchStop: register("search-stop", 60238),
server: register("server", 60240),
settingsGear: register("settings-gear", 60241),
settings: register("settings", 60242),
shield: register("shield", 60243),
smiley: register("smiley", 60244),
sortPrecedence: register("sort-precedence", 60245),
splitHorizontal: register("split-horizontal", 60246),
splitVertical: register("split-vertical", 60247),
squirrel: register("squirrel", 60248),
starFull: register("star-full", 60249),
starHalf: register("star-half", 60250),
symbolClass: register("symbol-class", 60251),
symbolColor: register("symbol-color", 60252),
symbolConstant: register("symbol-constant", 60253),
symbolEnumMember: register("symbol-enum-member", 60254),
symbolField: register("symbol-field", 60255),
symbolFile: register("symbol-file", 60256),
symbolInterface: register("symbol-interface", 60257),
symbolKeyword: register("symbol-keyword", 60258),
symbolMisc: register("symbol-misc", 60259),
symbolOperator: register("symbol-operator", 60260),
symbolProperty: register("symbol-property", 60261),
wrench: register("wrench", 60261),
wrenchSubaction: register("wrench-subaction", 60261),
symbolSnippet: register("symbol-snippet", 60262),
tasklist: register("tasklist", 60263),
telescope: register("telescope", 60264),
textSize: register("text-size", 60265),
threeBars: register("three-bars", 60266),
thumbsdown: register("thumbsdown", 60267),
thumbsup: register("thumbsup", 60268),
tools: register("tools", 60269),
triangleDown: register("triangle-down", 60270),
triangleLeft: register("triangle-left", 60271),
triangleRight: register("triangle-right", 60272),
triangleUp: register("triangle-up", 60273),
twitter: register("twitter", 60274),
unfold: register("unfold", 60275),
unlock: register("unlock", 60276),
unmute: register("unmute", 60277),
unverified: register("unverified", 60278),
verified: register("verified", 60279),
versions: register("versions", 60280),
vmActive: register("vm-active", 60281),
vmOutline: register("vm-outline", 60282),
vmRunning: register("vm-running", 60283),
watch: register("watch", 60284),
whitespace: register("whitespace", 60285),
wholeWord: register("whole-word", 60286),
window: register("window", 60287),
wordWrap: register("word-wrap", 60288),
zoomIn: register("zoom-in", 60289),
zoomOut: register("zoom-out", 60290),
listFilter: register("list-filter", 60291),
listFlat: register("list-flat", 60292),
listSelection: register("list-selection", 60293),
selection: register("selection", 60293),
listTree: register("list-tree", 60294),
debugBreakpointFunctionUnverified: register("debug-breakpoint-function-unverified", 60295),
debugBreakpointFunction: register("debug-breakpoint-function", 60296),
debugBreakpointFunctionDisabled: register("debug-breakpoint-function-disabled", 60296),
debugStackframeActive: register("debug-stackframe-active", 60297),
circleSmallFilled: register("circle-small-filled", 60298),
debugStackframeDot: register("debug-stackframe-dot", 60298),
terminalDecorationMark: register("terminal-decoration-mark", 60298),
debugStackframe: register("debug-stackframe", 60299),
debugStackframeFocused: register("debug-stackframe-focused", 60299),
debugBreakpointUnsupported: register("debug-breakpoint-unsupported", 60300),
symbolString: register("symbol-string", 60301),
debugReverseContinue: register("debug-reverse-continue", 60302),
debugStepBack: register("debug-step-back", 60303),
debugRestartFrame: register("debug-restart-frame", 60304),
debugAlt: register("debug-alt", 60305),
callIncoming: register("call-incoming", 60306),
callOutgoing: register("call-outgoing", 60307),
menu: register("menu", 60308),
expandAll: register("expand-all", 60309),
feedback: register("feedback", 60310),
gitPullRequestReviewer: register("git-pull-request-reviewer", 60310),
groupByRefType: register("group-by-ref-type", 60311),
ungroupByRefType: register("ungroup-by-ref-type", 60312),
account: register("account", 60313),
gitPullRequestAssignee: register("git-pull-request-assignee", 60313),
bellDot: register("bell-dot", 60314),
debugConsole: register("debug-console", 60315),
library: register("library", 60316),
output: register("output", 60317),
runAll: register("run-all", 60318),
syncIgnored: register("sync-ignored", 60319),
pinned: register("pinned", 60320),
githubInverted: register("github-inverted", 60321),
serverProcess: register("server-process", 60322),
serverEnvironment: register("server-environment", 60323),
pass: register("pass", 60324),
issueClosed: register("issue-closed", 60324),
stopCircle: register("stop-circle", 60325),
playCircle: register("play-circle", 60326),
record: register("record", 60327),
debugAltSmall: register("debug-alt-small", 60328),
vmConnect: register("vm-connect", 60329),
cloud: register("cloud", 60330),
merge: register("merge", 60331),
export: register("export", 60332),
graphLeft: register("graph-left", 60333),
magnet: register("magnet", 60334),
notebook: register("notebook", 60335),
redo: register("redo", 60336),
checkAll: register("check-all", 60337),
pinnedDirty: register("pinned-dirty", 60338),
passFilled: register("pass-filled", 60339),
circleLargeFilled: register("circle-large-filled", 60340),
circleLarge: register("circle-large", 60341),
circleLargeOutline: register("circle-large-outline", 60341),
combine: register("combine", 60342),
gather: register("gather", 60342),
table: register("table", 60343),
variableGroup: register("variable-group", 60344),
typeHierarchy: register("type-hierarchy", 60345),
typeHierarchySub: register("type-hierarchy-sub", 60346),
typeHierarchySuper: register("type-hierarchy-super", 60347),
gitPullRequestCreate: register("git-pull-request-create", 60348),
runAbove: register("run-above", 60349),
runBelow: register("run-below", 60350),
notebookTemplate: register("notebook-template", 60351),
debugRerun: register("debug-rerun", 60352),
workspaceTrusted: register("workspace-trusted", 60353),
workspaceUntrusted: register("workspace-untrusted", 60354),
workspaceUnknown: register("workspace-unknown", 60355),
terminalCmd: register("terminal-cmd", 60356),
terminalDebian: register("terminal-debian", 60357),
terminalLinux: register("terminal-linux", 60358),
terminalPowershell: register("terminal-powershell", 60359),
terminalTmux: register("terminal-tmux", 60360),
terminalUbuntu: register("terminal-ubuntu", 60361),
terminalBash: register("terminal-bash", 60362),
arrowSwap: register("arrow-swap", 60363),
copy: register("copy", 60364),
personAdd: register("person-add", 60365),
filterFilled: register("filter-filled", 60366),
wand: register("wand", 60367),
debugLineByLine: register("debug-line-by-line", 60368),
inspect: register("inspect", 60369),
layers: register("layers", 60370),
layersDot: register("layers-dot", 60371),
layersActive: register("layers-active", 60372),
compass: register("compass", 60373),
compassDot: register("compass-dot", 60374),
compassActive: register("compass-active", 60375),
azure: register("azure", 60376),
issueDraft: register("issue-draft", 60377),
gitPullRequestClosed: register("git-pull-request-closed", 60378),
gitPullRequestDraft: register("git-pull-request-draft", 60379),
debugAll: register("debug-all", 60380),
debugCoverage: register("debug-coverage", 60381),
runErrors: register("run-errors", 60382),
folderLibrary: register("folder-library", 60383),
debugContinueSmall: register("debug-continue-small", 60384),
beakerStop: register("beaker-stop", 60385),
graphLine: register("graph-line", 60386),
graphScatter: register("graph-scatter", 60387),
pieChart: register("pie-chart", 60388),
bracket: register("bracket", 60175),
bracketDot: register("bracket-dot", 60389),
bracketError: register("bracket-error", 60390),
lockSmall: register("lock-small", 60391),
azureDevops: register("azure-devops", 60392),
verifiedFilled: register("verified-filled", 60393),
newline: register("newline", 60394),
layout: register("layout", 60395),
layoutActivitybarLeft: register("layout-activitybar-left", 60396),
layoutActivitybarRight: register("layout-activitybar-right", 60397),
layoutPanelLeft: register("layout-panel-left", 60398),
layoutPanelCenter: register("layout-panel-center", 60399),
layoutPanelJustify: register("layout-panel-justify", 60400),
layoutPanelRight: register("layout-panel-right", 60401),
layoutPanel: register("layout-panel", 60402),
layoutSidebarLeft: register("layout-sidebar-left", 60403),
layoutSidebarRight: register("layout-sidebar-right", 60404),
layoutStatusbar: register("layout-statusbar", 60405),
layoutMenubar: register("layout-menubar", 60406),
layoutCentered: register("layout-centered", 60407),
target: register("target", 60408),
indent: register("indent", 60409),
recordSmall: register("record-small", 60410),
errorSmall: register("error-small", 60411),
terminalDecorationError: register("terminal-decoration-error", 60411),
arrowCircleDown: register("arrow-circle-down", 60412),
arrowCircleLeft: register("arrow-circle-left", 60413),
arrowCircleRight: register("arrow-circle-right", 60414),
arrowCircleUp: register("arrow-circle-up", 60415),
layoutSidebarRightOff: register("layout-sidebar-right-off", 60416),
layoutPanelOff: register("layout-panel-off", 60417),
layoutSidebarLeftOff: register("layout-sidebar-left-off", 60418),
blank: register("blank", 60419),
heartFilled: register("heart-filled", 60420),
map: register("map", 60421),
mapHorizontal: register("map-horizontal", 60421),
foldHorizontal: register("fold-horizontal", 60421),
mapFilled: register("map-filled", 60422),
mapHorizontalFilled: register("map-horizontal-filled", 60422),
foldHorizontalFilled: register("fold-horizontal-filled", 60422),
circleSmall: register("circle-small", 60423),
bellSlash: register("bell-slash", 60424),
bellSlashDot: register("bell-slash-dot", 60425),
commentUnresolved: register("comment-unresolved", 60426),
gitPullRequestGoToChanges: register("git-pull-request-go-to-changes", 60427),
gitPullRequestNewChanges: register("git-pull-request-new-changes", 60428),
searchFuzzy: register("search-fuzzy", 60429),
commentDraft: register("comment-draft", 60430),
send: register("send", 60431),
sparkle: register("sparkle", 60432),
insert: register("insert", 60433),
mic: register("mic", 60434),
thumbsdownFilled: register("thumbsdown-filled", 60435),
thumbsupFilled: register("thumbsup-filled", 60436),
coffee: register("coffee", 60437),
snake: register("snake", 60438),
game: register("game", 60439),
vr: register("vr", 60440),
chip: register("chip", 60441),
piano: register("piano", 60442),
music: register("music", 60443),
micFilled: register("mic-filled", 60444),
repoFetch: register("repo-fetch", 60445),
copilot: register("copilot", 60446),
lightbulbSparkle: register("lightbulb-sparkle", 60447),
robot: register("robot", 60448),
sparkleFilled: register("sparkle-filled", 60449),
diffSingle: register("diff-single", 60450),
diffMultiple: register("diff-multiple", 60451),
surroundWith: register("surround-with", 60452),
share: register("share", 60453),
gitStash: register("git-stash", 60454),
gitStashApply: register("git-stash-apply", 60455),
gitStashPop: register("git-stash-pop", 60456),
vscode: register("vscode", 60457),
vscodeInsiders: register("vscode-insiders", 60458),
codeOss: register("code-oss", 60459),
runCoverage: register("run-coverage", 60460),
runAllCoverage: register("run-all-coverage", 60461),
coverage: register("coverage", 60462),
githubProject: register("github-project", 60463),
mapVertical: register("map-vertical", 60464),
foldVertical: register("fold-vertical", 60464),
mapVerticalFilled: register("map-vertical-filled", 60465),
foldVerticalFilled: register("fold-vertical-filled", 60465),
goToSearch: register("go-to-search", 60466),
percentage: register("percentage", 60467),
sortPercentage: register("sort-percentage", 60467),
attach: register("attach", 60468)
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codicons.js
var codiconsDerived, Codicon;
var init_codicons = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/codicons.js"() {
init_codiconsUtil();
init_codiconsLibrary();
codiconsDerived = {
dialogError: register("dialog-error", "error"),
dialogWarning: register("dialog-warning", "warning"),
dialogInfo: register("dialog-info", "info"),
dialogClose: register("dialog-close", "close"),
treeItemExpanded: register("tree-item-expanded", "chevron-down"),
// collapsed is done with rotation
treeFilterOnTypeOn: register("tree-filter-on-type-on", "list-filter"),
treeFilterOnTypeOff: register("tree-filter-on-type-off", "list-selection"),
treeFilterClear: register("tree-filter-clear", "close"),
treeItemLoading: register("tree-item-loading", "loading"),
menuSelection: register("menu-selection", "check"),
menuSubmenu: register("menu-submenu", "chevron-right"),
menuBarMore: register("menubar-more", "more"),
scrollbarButtonLeft: register("scrollbar-button-left", "triangle-left"),
scrollbarButtonRight: register("scrollbar-button-right", "triangle-right"),
scrollbarButtonUp: register("scrollbar-button-up", "triangle-up"),
scrollbarButtonDown: register("scrollbar-button-down", "triangle-down"),
toolBarMore: register("toolbar-more", "more"),
quickInputBack: register("quick-input-back", "arrow-left"),
dropDownButton: register("drop-down-button", 60084),
symbolCustomColor: register("symbol-customcolor", 60252),
exportIcon: register("export", 60332),
workspaceUnspecified: register("workspace-unspecified", 60355),
newLine: register("newline", 60394),
thumbsDownFilled: register("thumbsdown-filled", 60435),
thumbsUpFilled: register("thumbsup-filled", 60436),
gitFetch: register("git-fetch", 60445),
lightbulbSparkleAutofix: register("lightbulb-sparkle-autofix", 60447),
debugBreakpointPending: register("debug-breakpoint-pending", 60377)
};
Codicon = {
...codiconsLibrary,
...codiconsDerived
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js
var TokenizationRegistry, TokenizationSupportFactoryData;
var init_tokenizationRegistry = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/tokenizationRegistry.js"() {
init_event();
init_lifecycle();
TokenizationRegistry = class {
constructor() {
this._tokenizationSupports = /* @__PURE__ */ new Map();
this._factories = /* @__PURE__ */ new Map();
this._onDidChange = new Emitter();
this.onDidChange = this._onDidChange.event;
this._colorMap = null;
}
handleChange(languageIds) {
this._onDidChange.fire({
changedLanguages: languageIds,
changedColorMap: false
});
}
register(languageId, support) {
this._tokenizationSupports.set(languageId, support);
this.handleChange([languageId]);
return toDisposable(() => {
if (this._tokenizationSupports.get(languageId) !== support) {
return;
}
this._tokenizationSupports.delete(languageId);
this.handleChange([languageId]);
});
}
get(languageId) {
return this._tokenizationSupports.get(languageId) || null;
}
registerFactory(languageId, factory) {
this._factories.get(languageId)?.dispose();
const myData = new TokenizationSupportFactoryData(this, languageId, factory);
this._factories.set(languageId, myData);
return toDisposable(() => {
const v = this._factories.get(languageId);
if (!v || v !== myData) {
return;
}
this._factories.delete(languageId);
v.dispose();
});
}
async getOrCreate(languageId) {
const tokenizationSupport = this.get(languageId);
if (tokenizationSupport) {
return tokenizationSupport;
}
const factory = this._factories.get(languageId);
if (!factory || factory.isResolved) {
return null;
}
await factory.resolve();
return this.get(languageId);
}
isResolved(languageId) {
const tokenizationSupport = this.get(languageId);
if (tokenizationSupport) {
return true;
}
const factory = this._factories.get(languageId);
if (!factory || factory.isResolved) {
return true;
}
return false;
}
setColorMap(colorMap) {
this._colorMap = colorMap;
this._onDidChange.fire({
changedLanguages: Array.from(this._tokenizationSupports.keys()),
changedColorMap: true
});
}
getColorMap() {
return this._colorMap;
}
getDefaultBackground() {
if (this._colorMap && this._colorMap.length > 2) {
return this._colorMap[
2
/* ColorId.DefaultBackground */
];
}
return null;
}
};
TokenizationSupportFactoryData = class extends Disposable {
get isResolved() {
return this._isResolved;
}
constructor(_registry, _languageId, _factory) {
super();
this._registry = _registry;
this._languageId = _languageId;
this._factory = _factory;
this._isDisposed = false;
this._resolvePromise = null;
this._isResolved = false;
}
dispose() {
this._isDisposed = true;
super.dispose();
}
async resolve() {
if (!this._resolvePromise) {
this._resolvePromise = this._create();
}
return this._resolvePromise;
}
async _create() {
const value = await this._factory.tokenizationSupport;
this._isResolved = true;
if (value && !this._isDisposed) {
this._register(this._registry.register(this._languageId, value));
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages.js
var Token, HoverVerbosityAction, CompletionItemKinds, InlineCompletionTriggerKind, DocumentPasteTriggerKind, SignatureHelpTriggerKind, DocumentHighlightKind, symbolKindNames, SymbolKinds, FoldingRangeKind, NewSymbolNameTag, NewSymbolNameTriggerKind, Command, InlayHintKind, TokenizationRegistry2, TreeSitterTokenizationRegistry, InlineEditTriggerKind;
var init_languages = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages.js"() {
init_codicons();
init_uri();
init_range();
init_tokenizationRegistry();
init_nls();
Token = class {
constructor(offset, type, language) {
this.offset = offset;
this.type = type;
this.language = language;
this._tokenBrand = void 0;
}
toString() {
return "(" + this.offset + ", " + this.type + ")";
}
};
(function(HoverVerbosityAction3) {
HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase";
HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease";
})(HoverVerbosityAction || (HoverVerbosityAction = {}));
(function(CompletionItemKinds2) {
const byKind = /* @__PURE__ */ new Map();
byKind.set(0, Codicon.symbolMethod);
byKind.set(1, Codicon.symbolFunction);
byKind.set(2, Codicon.symbolConstructor);
byKind.set(3, Codicon.symbolField);
byKind.set(4, Codicon.symbolVariable);
byKind.set(5, Codicon.symbolClass);
byKind.set(6, Codicon.symbolStruct);
byKind.set(7, Codicon.symbolInterface);
byKind.set(8, Codicon.symbolModule);
byKind.set(9, Codicon.symbolProperty);
byKind.set(10, Codicon.symbolEvent);
byKind.set(11, Codicon.symbolOperator);
byKind.set(12, Codicon.symbolUnit);
byKind.set(13, Codicon.symbolValue);
byKind.set(15, Codicon.symbolEnum);
byKind.set(14, Codicon.symbolConstant);
byKind.set(15, Codicon.symbolEnum);
byKind.set(16, Codicon.symbolEnumMember);
byKind.set(17, Codicon.symbolKeyword);
byKind.set(27, Codicon.symbolSnippet);
byKind.set(18, Codicon.symbolText);
byKind.set(19, Codicon.symbolColor);
byKind.set(20, Codicon.symbolFile);
byKind.set(21, Codicon.symbolReference);
byKind.set(22, Codicon.symbolCustomColor);
byKind.set(23, Codicon.symbolFolder);
byKind.set(24, Codicon.symbolTypeParameter);
byKind.set(25, Codicon.account);
byKind.set(26, Codicon.issues);
function toIcon(kind) {
let codicon = byKind.get(kind);
if (!codicon) {
console.info("No codicon found for CompletionItemKind " + kind);
codicon = Codicon.symbolProperty;
}
return codicon;
}
CompletionItemKinds2.toIcon = toIcon;
const data = /* @__PURE__ */ new Map();
data.set(
"method",
0
/* CompletionItemKind.Method */
);
data.set(
"function",
1
/* CompletionItemKind.Function */
);
data.set(
"constructor",
2
/* CompletionItemKind.Constructor */
);
data.set(
"field",
3
/* CompletionItemKind.Field */
);
data.set(
"variable",
4
/* CompletionItemKind.Variable */
);
data.set(
"class",
5
/* CompletionItemKind.Class */
);
data.set(
"struct",
6
/* CompletionItemKind.Struct */
);
data.set(
"interface",
7
/* CompletionItemKind.Interface */
);
data.set(
"module",
8
/* CompletionItemKind.Module */
);
data.set(
"property",
9
/* CompletionItemKind.Property */
);
data.set(
"event",
10
/* CompletionItemKind.Event */
);
data.set(
"operator",
11
/* CompletionItemKind.Operator */
);
data.set(
"unit",
12
/* CompletionItemKind.Unit */
);
data.set(
"value",
13
/* CompletionItemKind.Value */
);
data.set(
"constant",
14
/* CompletionItemKind.Constant */
);
data.set(
"enum",
15
/* CompletionItemKind.Enum */
);
data.set(
"enum-member",
16
/* CompletionItemKind.EnumMember */
);
data.set(
"enumMember",
16
/* CompletionItemKind.EnumMember */
);
data.set(
"keyword",
17
/* CompletionItemKind.Keyword */
);
data.set(
"snippet",
27
/* CompletionItemKind.Snippet */
);
data.set(
"text",
18
/* CompletionItemKind.Text */
);
data.set(
"color",
19
/* CompletionItemKind.Color */
);
data.set(
"file",
20
/* CompletionItemKind.File */
);
data.set(
"reference",
21
/* CompletionItemKind.Reference */
);
data.set(
"customcolor",
22
/* CompletionItemKind.Customcolor */
);
data.set(
"folder",
23
/* CompletionItemKind.Folder */
);
data.set(
"type-parameter",
24
/* CompletionItemKind.TypeParameter */
);
data.set(
"typeParameter",
24
/* CompletionItemKind.TypeParameter */
);
data.set(
"account",
25
/* CompletionItemKind.User */
);
data.set(
"issue",
26
/* CompletionItemKind.Issue */
);
function fromString(value, strict) {
let res = data.get(value);
if (typeof res === "undefined" && !strict) {
res = 9;
}
return res;
}
CompletionItemKinds2.fromString = fromString;
})(CompletionItemKinds || (CompletionItemKinds = {}));
(function(InlineCompletionTriggerKind4) {
InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["Automatic"] = 0] = "Automatic";
InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["Explicit"] = 1] = "Explicit";
})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
(function(DocumentPasteTriggerKind2) {
DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["Automatic"] = 0] = "Automatic";
DocumentPasteTriggerKind2[DocumentPasteTriggerKind2["PasteAs"] = 1] = "PasteAs";
})(DocumentPasteTriggerKind || (DocumentPasteTriggerKind = {}));
(function(SignatureHelpTriggerKind3) {
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
})(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));
(function(DocumentHighlightKind4) {
DocumentHighlightKind4[DocumentHighlightKind4["Text"] = 0] = "Text";
DocumentHighlightKind4[DocumentHighlightKind4["Read"] = 1] = "Read";
DocumentHighlightKind4[DocumentHighlightKind4["Write"] = 2] = "Write";
})(DocumentHighlightKind || (DocumentHighlightKind = {}));
symbolKindNames = {
[
17
/* SymbolKind.Array */
]: localize("Array", "array"),
[
16
/* SymbolKind.Boolean */
]: localize("Boolean", "boolean"),
[
4
/* SymbolKind.Class */
]: localize("Class", "class"),
[
13
/* SymbolKind.Constant */
]: localize("Constant", "constant"),
[
8
/* SymbolKind.Constructor */
]: localize("Constructor", "constructor"),
[
9
/* SymbolKind.Enum */
]: localize("Enum", "enumeration"),
[
21
/* SymbolKind.EnumMember */
]: localize("EnumMember", "enumeration member"),
[
23
/* SymbolKind.Event */
]: localize("Event", "event"),
[
7
/* SymbolKind.Field */
]: localize("Field", "field"),
[
0
/* SymbolKind.File */
]: localize("File", "file"),
[
11
/* SymbolKind.Function */
]: localize("Function", "function"),
[
10
/* SymbolKind.Interface */
]: localize("Interface", "interface"),
[
19
/* SymbolKind.Key */
]: localize("Key", "key"),
[
5
/* SymbolKind.Method */
]: localize("Method", "method"),
[
1
/* SymbolKind.Module */
]: localize("Module", "module"),
[
2
/* SymbolKind.Namespace */
]: localize("Namespace", "namespace"),
[
20
/* SymbolKind.Null */
]: localize("Null", "null"),
[
15
/* SymbolKind.Number */
]: localize("Number", "number"),
[
18
/* SymbolKind.Object */
]: localize("Object", "object"),
[
24
/* SymbolKind.Operator */
]: localize("Operator", "operator"),
[
3
/* SymbolKind.Package */
]: localize("Package", "package"),
[
6
/* SymbolKind.Property */
]: localize("Property", "property"),
[
14
/* SymbolKind.String */
]: localize("String", "string"),
[
22
/* SymbolKind.Struct */
]: localize("Struct", "struct"),
[
25
/* SymbolKind.TypeParameter */
]: localize("TypeParameter", "type parameter"),
[
12
/* SymbolKind.Variable */
]: localize("Variable", "variable")
};
(function(SymbolKinds2) {
const byKind = /* @__PURE__ */ new Map();
byKind.set(0, Codicon.symbolFile);
byKind.set(1, Codicon.symbolModule);
byKind.set(2, Codicon.symbolNamespace);
byKind.set(3, Codicon.symbolPackage);
byKind.set(4, Codicon.symbolClass);
byKind.set(5, Codicon.symbolMethod);
byKind.set(6, Codicon.symbolProperty);
byKind.set(7, Codicon.symbolField);
byKind.set(8, Codicon.symbolConstructor);
byKind.set(9, Codicon.symbolEnum);
byKind.set(10, Codicon.symbolInterface);
byKind.set(11, Codicon.symbolFunction);
byKind.set(12, Codicon.symbolVariable);
byKind.set(13, Codicon.symbolConstant);
byKind.set(14, Codicon.symbolString);
byKind.set(15, Codicon.symbolNumber);
byKind.set(16, Codicon.symbolBoolean);
byKind.set(17, Codicon.symbolArray);
byKind.set(18, Codicon.symbolObject);
byKind.set(19, Codicon.symbolKey);
byKind.set(20, Codicon.symbolNull);
byKind.set(21, Codicon.symbolEnumMember);
byKind.set(22, Codicon.symbolStruct);
byKind.set(23, Codicon.symbolEvent);
byKind.set(24, Codicon.symbolOperator);
byKind.set(25, Codicon.symbolTypeParameter);
function toIcon(kind) {
let icon = byKind.get(kind);
if (!icon) {
console.info("No codicon found for SymbolKind " + kind);
icon = Codicon.symbolProperty;
}
return icon;
}
SymbolKinds2.toIcon = toIcon;
})(SymbolKinds || (SymbolKinds = {}));
FoldingRangeKind = class _FoldingRangeKind {
static {
this.Comment = new _FoldingRangeKind("comment");
}
static {
this.Imports = new _FoldingRangeKind("imports");
}
static {
this.Region = new _FoldingRangeKind("region");
}
/**
* Returns a {@link FoldingRangeKind} for the given value.
*
* @param value of the kind.
*/
static fromValue(value) {
switch (value) {
case "comment":
return _FoldingRangeKind.Comment;
case "imports":
return _FoldingRangeKind.Imports;
case "region":
return _FoldingRangeKind.Region;
}
return new _FoldingRangeKind(value);
}
/**
* Creates a new {@link FoldingRangeKind}.
*
* @param value of the kind.
*/
constructor(value) {
this.value = value;
}
};
(function(NewSymbolNameTag3) {
NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated";
})(NewSymbolNameTag || (NewSymbolNameTag = {}));
(function(NewSymbolNameTriggerKind3) {
NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke";
NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic";
})(NewSymbolNameTriggerKind || (NewSymbolNameTriggerKind = {}));
(function(Command3) {
function is(obj) {
if (!obj || typeof obj !== "object") {
return false;
}
return typeof obj.id === "string" && typeof obj.title === "string";
}
Command3.is = is;
})(Command || (Command = {}));
(function(InlayHintKind4) {
InlayHintKind4[InlayHintKind4["Type"] = 1] = "Type";
InlayHintKind4[InlayHintKind4["Parameter"] = 2] = "Parameter";
})(InlayHintKind || (InlayHintKind = {}));
TokenizationRegistry2 = new TokenizationRegistry();
TreeSitterTokenizationRegistry = new TokenizationRegistry();
(function(InlineEditTriggerKind3) {
InlineEditTriggerKind3[InlineEditTriggerKind3["Invoke"] = 0] = "Invoke";
InlineEditTriggerKind3[InlineEditTriggerKind3["Automatic"] = 1] = "Automatic";
})(InlineEditTriggerKind || (InlineEditTriggerKind = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js
var standaloneEnums_exports = {};
__export(standaloneEnums_exports, {
AccessibilitySupport: () => AccessibilitySupport,
CodeActionTriggerType: () => CodeActionTriggerType,
CompletionItemInsertTextRule: () => CompletionItemInsertTextRule,
CompletionItemKind: () => CompletionItemKind,
CompletionItemTag: () => CompletionItemTag,
CompletionTriggerKind: () => CompletionTriggerKind,
ContentWidgetPositionPreference: () => ContentWidgetPositionPreference,
CursorChangeReason: () => CursorChangeReason,
DefaultEndOfLine: () => DefaultEndOfLine,
DocumentHighlightKind: () => DocumentHighlightKind2,
EditorAutoIndentStrategy: () => EditorAutoIndentStrategy,
EditorOption: () => EditorOption,
EndOfLinePreference: () => EndOfLinePreference,
EndOfLineSequence: () => EndOfLineSequence,
GlyphMarginLane: () => GlyphMarginLane,
HoverVerbosityAction: () => HoverVerbosityAction2,
IndentAction: () => IndentAction,
InjectedTextCursorStops: () => InjectedTextCursorStops,
InlayHintKind: () => InlayHintKind2,
InlineCompletionTriggerKind: () => InlineCompletionTriggerKind2,
InlineEditTriggerKind: () => InlineEditTriggerKind2,
KeyCode: () => KeyCode,
MarkerSeverity: () => MarkerSeverity,
MarkerTag: () => MarkerTag,
MinimapPosition: () => MinimapPosition,
MinimapSectionHeaderStyle: () => MinimapSectionHeaderStyle,
MouseTargetType: () => MouseTargetType,
NewSymbolNameTag: () => NewSymbolNameTag2,
NewSymbolNameTriggerKind: () => NewSymbolNameTriggerKind2,
OverlayWidgetPositionPreference: () => OverlayWidgetPositionPreference,
OverviewRulerLane: () => OverviewRulerLane,
PartialAcceptTriggerKind: () => PartialAcceptTriggerKind,
PositionAffinity: () => PositionAffinity,
RenderLineNumbersType: () => RenderLineNumbersType,
RenderMinimap: () => RenderMinimap,
ScrollType: () => ScrollType,
ScrollbarVisibility: () => ScrollbarVisibility,
SelectionDirection: () => SelectionDirection,
ShowLightbulbIconMode: () => ShowLightbulbIconMode,
SignatureHelpTriggerKind: () => SignatureHelpTriggerKind2,
SymbolKind: () => SymbolKind,
SymbolTag: () => SymbolTag,
TextEditorCursorBlinkingStyle: () => TextEditorCursorBlinkingStyle,
TextEditorCursorStyle: () => TextEditorCursorStyle,
TrackedRangeStickiness: () => TrackedRangeStickiness,
WrappingIndent: () => WrappingIndent
});
var AccessibilitySupport, CodeActionTriggerType, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemTag, CompletionTriggerKind, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, DocumentHighlightKind2, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, GlyphMarginLane, HoverVerbosityAction2, IndentAction, InjectedTextCursorStops, InlayHintKind2, InlineCompletionTriggerKind2, InlineEditTriggerKind2, KeyCode, MarkerSeverity, MarkerTag, MinimapPosition, MinimapSectionHeaderStyle, MouseTargetType, NewSymbolNameTag2, NewSymbolNameTriggerKind2, OverlayWidgetPositionPreference, OverviewRulerLane, PartialAcceptTriggerKind, PositionAffinity, RenderLineNumbersType, RenderMinimap, ScrollType, ScrollbarVisibility, SelectionDirection, ShowLightbulbIconMode, SignatureHelpTriggerKind2, SymbolKind, SymbolTag, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent;
var init_standaloneEnums = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js"() {
(function(AccessibilitySupport2) {
AccessibilitySupport2[AccessibilitySupport2["Unknown"] = 0] = "Unknown";
AccessibilitySupport2[AccessibilitySupport2["Disabled"] = 1] = "Disabled";
AccessibilitySupport2[AccessibilitySupport2["Enabled"] = 2] = "Enabled";
})(AccessibilitySupport || (AccessibilitySupport = {}));
(function(CodeActionTriggerType2) {
CodeActionTriggerType2[CodeActionTriggerType2["Invoke"] = 1] = "Invoke";
CodeActionTriggerType2[CodeActionTriggerType2["Auto"] = 2] = "Auto";
})(CodeActionTriggerType || (CodeActionTriggerType = {}));
(function(CompletionItemInsertTextRule2) {
CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["None"] = 0] = "None";
CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["KeepWhitespace"] = 1] = "KeepWhitespace";
CompletionItemInsertTextRule2[CompletionItemInsertTextRule2["InsertAsSnippet"] = 4] = "InsertAsSnippet";
})(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));
(function(CompletionItemKind3) {
CompletionItemKind3[CompletionItemKind3["Method"] = 0] = "Method";
CompletionItemKind3[CompletionItemKind3["Function"] = 1] = "Function";
CompletionItemKind3[CompletionItemKind3["Constructor"] = 2] = "Constructor";
CompletionItemKind3[CompletionItemKind3["Field"] = 3] = "Field";
CompletionItemKind3[CompletionItemKind3["Variable"] = 4] = "Variable";
CompletionItemKind3[CompletionItemKind3["Class"] = 5] = "Class";
CompletionItemKind3[CompletionItemKind3["Struct"] = 6] = "Struct";
CompletionItemKind3[CompletionItemKind3["Interface"] = 7] = "Interface";
CompletionItemKind3[CompletionItemKind3["Module"] = 8] = "Module";
CompletionItemKind3[CompletionItemKind3["Property"] = 9] = "Property";
CompletionItemKind3[CompletionItemKind3["Event"] = 10] = "Event";
CompletionItemKind3[CompletionItemKind3["Operator"] = 11] = "Operator";
CompletionItemKind3[CompletionItemKind3["Unit"] = 12] = "Unit";
CompletionItemKind3[CompletionItemKind3["Value"] = 13] = "Value";
CompletionItemKind3[CompletionItemKind3["Constant"] = 14] = "Constant";
CompletionItemKind3[CompletionItemKind3["Enum"] = 15] = "Enum";
CompletionItemKind3[CompletionItemKind3["EnumMember"] = 16] = "EnumMember";
CompletionItemKind3[CompletionItemKind3["Keyword"] = 17] = "Keyword";
CompletionItemKind3[CompletionItemKind3["Text"] = 18] = "Text";
CompletionItemKind3[CompletionItemKind3["Color"] = 19] = "Color";
CompletionItemKind3[CompletionItemKind3["File"] = 20] = "File";
CompletionItemKind3[CompletionItemKind3["Reference"] = 21] = "Reference";
CompletionItemKind3[CompletionItemKind3["Customcolor"] = 22] = "Customcolor";
CompletionItemKind3[CompletionItemKind3["Folder"] = 23] = "Folder";
CompletionItemKind3[CompletionItemKind3["TypeParameter"] = 24] = "TypeParameter";
CompletionItemKind3[CompletionItemKind3["User"] = 25] = "User";
CompletionItemKind3[CompletionItemKind3["Issue"] = 26] = "Issue";
CompletionItemKind3[CompletionItemKind3["Snippet"] = 27] = "Snippet";
})(CompletionItemKind || (CompletionItemKind = {}));
(function(CompletionItemTag3) {
CompletionItemTag3[CompletionItemTag3["Deprecated"] = 1] = "Deprecated";
})(CompletionItemTag || (CompletionItemTag = {}));
(function(CompletionTriggerKind2) {
CompletionTriggerKind2[CompletionTriggerKind2["Invoke"] = 0] = "Invoke";
CompletionTriggerKind2[CompletionTriggerKind2["TriggerCharacter"] = 1] = "TriggerCharacter";
CompletionTriggerKind2[CompletionTriggerKind2["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions";
})(CompletionTriggerKind || (CompletionTriggerKind = {}));
(function(ContentWidgetPositionPreference2) {
ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["EXACT"] = 0] = "EXACT";
ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["ABOVE"] = 1] = "ABOVE";
ContentWidgetPositionPreference2[ContentWidgetPositionPreference2["BELOW"] = 2] = "BELOW";
})(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));
(function(CursorChangeReason2) {
CursorChangeReason2[CursorChangeReason2["NotSet"] = 0] = "NotSet";
CursorChangeReason2[CursorChangeReason2["ContentFlush"] = 1] = "ContentFlush";
CursorChangeReason2[CursorChangeReason2["RecoverFromMarkers"] = 2] = "RecoverFromMarkers";
CursorChangeReason2[CursorChangeReason2["Explicit"] = 3] = "Explicit";
CursorChangeReason2[CursorChangeReason2["Paste"] = 4] = "Paste";
CursorChangeReason2[CursorChangeReason2["Undo"] = 5] = "Undo";
CursorChangeReason2[CursorChangeReason2["Redo"] = 6] = "Redo";
})(CursorChangeReason || (CursorChangeReason = {}));
(function(DefaultEndOfLine2) {
DefaultEndOfLine2[DefaultEndOfLine2["LF"] = 1] = "LF";
DefaultEndOfLine2[DefaultEndOfLine2["CRLF"] = 2] = "CRLF";
})(DefaultEndOfLine || (DefaultEndOfLine = {}));
(function(DocumentHighlightKind4) {
DocumentHighlightKind4[DocumentHighlightKind4["Text"] = 0] = "Text";
DocumentHighlightKind4[DocumentHighlightKind4["Read"] = 1] = "Read";
DocumentHighlightKind4[DocumentHighlightKind4["Write"] = 2] = "Write";
})(DocumentHighlightKind2 || (DocumentHighlightKind2 = {}));
(function(EditorAutoIndentStrategy2) {
EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["None"] = 0] = "None";
EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Keep"] = 1] = "Keep";
EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Brackets"] = 2] = "Brackets";
EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Advanced"] = 3] = "Advanced";
EditorAutoIndentStrategy2[EditorAutoIndentStrategy2["Full"] = 4] = "Full";
})(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));
(function(EditorOption2) {
EditorOption2[EditorOption2["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter";
EditorOption2[EditorOption2["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter";
EditorOption2[EditorOption2["accessibilitySupport"] = 2] = "accessibilitySupport";
EditorOption2[EditorOption2["accessibilityPageSize"] = 3] = "accessibilityPageSize";
EditorOption2[EditorOption2["ariaLabel"] = 4] = "ariaLabel";
EditorOption2[EditorOption2["ariaRequired"] = 5] = "ariaRequired";
EditorOption2[EditorOption2["autoClosingBrackets"] = 6] = "autoClosingBrackets";
EditorOption2[EditorOption2["autoClosingComments"] = 7] = "autoClosingComments";
EditorOption2[EditorOption2["screenReaderAnnounceInlineSuggestion"] = 8] = "screenReaderAnnounceInlineSuggestion";
EditorOption2[EditorOption2["autoClosingDelete"] = 9] = "autoClosingDelete";
EditorOption2[EditorOption2["autoClosingOvertype"] = 10] = "autoClosingOvertype";
EditorOption2[EditorOption2["autoClosingQuotes"] = 11] = "autoClosingQuotes";
EditorOption2[EditorOption2["autoIndent"] = 12] = "autoIndent";
EditorOption2[EditorOption2["automaticLayout"] = 13] = "automaticLayout";
EditorOption2[EditorOption2["autoSurround"] = 14] = "autoSurround";
EditorOption2[EditorOption2["bracketPairColorization"] = 15] = "bracketPairColorization";
EditorOption2[EditorOption2["guides"] = 16] = "guides";
EditorOption2[EditorOption2["codeLens"] = 17] = "codeLens";
EditorOption2[EditorOption2["codeLensFontFamily"] = 18] = "codeLensFontFamily";
EditorOption2[EditorOption2["codeLensFontSize"] = 19] = "codeLensFontSize";
EditorOption2[EditorOption2["colorDecorators"] = 20] = "colorDecorators";
EditorOption2[EditorOption2["colorDecoratorsLimit"] = 21] = "colorDecoratorsLimit";
EditorOption2[EditorOption2["columnSelection"] = 22] = "columnSelection";
EditorOption2[EditorOption2["comments"] = 23] = "comments";
EditorOption2[EditorOption2["contextmenu"] = 24] = "contextmenu";
EditorOption2[EditorOption2["copyWithSyntaxHighlighting"] = 25] = "copyWithSyntaxHighlighting";
EditorOption2[EditorOption2["cursorBlinking"] = 26] = "cursorBlinking";
EditorOption2[EditorOption2["cursorSmoothCaretAnimation"] = 27] = "cursorSmoothCaretAnimation";
EditorOption2[EditorOption2["cursorStyle"] = 28] = "cursorStyle";
EditorOption2[EditorOption2["cursorSurroundingLines"] = 29] = "cursorSurroundingLines";
EditorOption2[EditorOption2["cursorSurroundingLinesStyle"] = 30] = "cursorSurroundingLinesStyle";
EditorOption2[EditorOption2["cursorWidth"] = 31] = "cursorWidth";
EditorOption2[EditorOption2["disableLayerHinting"] = 32] = "disableLayerHinting";
EditorOption2[EditorOption2["disableMonospaceOptimizations"] = 33] = "disableMonospaceOptimizations";
EditorOption2[EditorOption2["domReadOnly"] = 34] = "domReadOnly";
EditorOption2[EditorOption2["dragAndDrop"] = 35] = "dragAndDrop";
EditorOption2[EditorOption2["dropIntoEditor"] = 36] = "dropIntoEditor";
EditorOption2[EditorOption2["emptySelectionClipboard"] = 37] = "emptySelectionClipboard";
EditorOption2[EditorOption2["experimentalWhitespaceRendering"] = 38] = "experimentalWhitespaceRendering";
EditorOption2[EditorOption2["extraEditorClassName"] = 39] = "extraEditorClassName";
EditorOption2[EditorOption2["fastScrollSensitivity"] = 40] = "fastScrollSensitivity";
EditorOption2[EditorOption2["find"] = 41] = "find";
EditorOption2[EditorOption2["fixedOverflowWidgets"] = 42] = "fixedOverflowWidgets";
EditorOption2[EditorOption2["folding"] = 43] = "folding";
EditorOption2[EditorOption2["foldingStrategy"] = 44] = "foldingStrategy";
EditorOption2[EditorOption2["foldingHighlight"] = 45] = "foldingHighlight";
EditorOption2[EditorOption2["foldingImportsByDefault"] = 46] = "foldingImportsByDefault";
EditorOption2[EditorOption2["foldingMaximumRegions"] = 47] = "foldingMaximumRegions";
EditorOption2[EditorOption2["unfoldOnClickAfterEndOfLine"] = 48] = "unfoldOnClickAfterEndOfLine";
EditorOption2[EditorOption2["fontFamily"] = 49] = "fontFamily";
EditorOption2[EditorOption2["fontInfo"] = 50] = "fontInfo";
EditorOption2[EditorOption2["fontLigatures"] = 51] = "fontLigatures";
EditorOption2[EditorOption2["fontSize"] = 52] = "fontSize";
EditorOption2[EditorOption2["fontWeight"] = 53] = "fontWeight";
EditorOption2[EditorOption2["fontVariations"] = 54] = "fontVariations";
EditorOption2[EditorOption2["formatOnPaste"] = 55] = "formatOnPaste";
EditorOption2[EditorOption2["formatOnType"] = 56] = "formatOnType";
EditorOption2[EditorOption2["glyphMargin"] = 57] = "glyphMargin";
EditorOption2[EditorOption2["gotoLocation"] = 58] = "gotoLocation";
EditorOption2[EditorOption2["hideCursorInOverviewRuler"] = 59] = "hideCursorInOverviewRuler";
EditorOption2[EditorOption2["hover"] = 60] = "hover";
EditorOption2[EditorOption2["inDiffEditor"] = 61] = "inDiffEditor";
EditorOption2[EditorOption2["inlineSuggest"] = 62] = "inlineSuggest";
EditorOption2[EditorOption2["inlineEdit"] = 63] = "inlineEdit";
EditorOption2[EditorOption2["letterSpacing"] = 64] = "letterSpacing";
EditorOption2[EditorOption2["lightbulb"] = 65] = "lightbulb";
EditorOption2[EditorOption2["lineDecorationsWidth"] = 66] = "lineDecorationsWidth";
EditorOption2[EditorOption2["lineHeight"] = 67] = "lineHeight";
EditorOption2[EditorOption2["lineNumbers"] = 68] = "lineNumbers";
EditorOption2[EditorOption2["lineNumbersMinChars"] = 69] = "lineNumbersMinChars";
EditorOption2[EditorOption2["linkedEditing"] = 70] = "linkedEditing";
EditorOption2[EditorOption2["links"] = 71] = "links";
EditorOption2[EditorOption2["matchBrackets"] = 72] = "matchBrackets";
EditorOption2[EditorOption2["minimap"] = 73] = "minimap";
EditorOption2[EditorOption2["mouseStyle"] = 74] = "mouseStyle";
EditorOption2[EditorOption2["mouseWheelScrollSensitivity"] = 75] = "mouseWheelScrollSensitivity";
EditorOption2[EditorOption2["mouseWheelZoom"] = 76] = "mouseWheelZoom";
EditorOption2[EditorOption2["multiCursorMergeOverlapping"] = 77] = "multiCursorMergeOverlapping";
EditorOption2[EditorOption2["multiCursorModifier"] = 78] = "multiCursorModifier";
EditorOption2[EditorOption2["multiCursorPaste"] = 79] = "multiCursorPaste";
EditorOption2[EditorOption2["multiCursorLimit"] = 80] = "multiCursorLimit";
EditorOption2[EditorOption2["occurrencesHighlight"] = 81] = "occurrencesHighlight";
EditorOption2[EditorOption2["overviewRulerBorder"] = 82] = "overviewRulerBorder";
EditorOption2[EditorOption2["overviewRulerLanes"] = 83] = "overviewRulerLanes";
EditorOption2[EditorOption2["padding"] = 84] = "padding";
EditorOption2[EditorOption2["pasteAs"] = 85] = "pasteAs";
EditorOption2[EditorOption2["parameterHints"] = 86] = "parameterHints";
EditorOption2[EditorOption2["peekWidgetDefaultFocus"] = 87] = "peekWidgetDefaultFocus";
EditorOption2[EditorOption2["placeholder"] = 88] = "placeholder";
EditorOption2[EditorOption2["definitionLinkOpensInPeek"] = 89] = "definitionLinkOpensInPeek";
EditorOption2[EditorOption2["quickSuggestions"] = 90] = "quickSuggestions";
EditorOption2[EditorOption2["quickSuggestionsDelay"] = 91] = "quickSuggestionsDelay";
EditorOption2[EditorOption2["readOnly"] = 92] = "readOnly";
EditorOption2[EditorOption2["readOnlyMessage"] = 93] = "readOnlyMessage";
EditorOption2[EditorOption2["renameOnType"] = 94] = "renameOnType";
EditorOption2[EditorOption2["renderControlCharacters"] = 95] = "renderControlCharacters";
EditorOption2[EditorOption2["renderFinalNewline"] = 96] = "renderFinalNewline";
EditorOption2[EditorOption2["renderLineHighlight"] = 97] = "renderLineHighlight";
EditorOption2[EditorOption2["renderLineHighlightOnlyWhenFocus"] = 98] = "renderLineHighlightOnlyWhenFocus";
EditorOption2[EditorOption2["renderValidationDecorations"] = 99] = "renderValidationDecorations";
EditorOption2[EditorOption2["renderWhitespace"] = 100] = "renderWhitespace";
EditorOption2[EditorOption2["revealHorizontalRightPadding"] = 101] = "revealHorizontalRightPadding";
EditorOption2[EditorOption2["roundedSelection"] = 102] = "roundedSelection";
EditorOption2[EditorOption2["rulers"] = 103] = "rulers";
EditorOption2[EditorOption2["scrollbar"] = 104] = "scrollbar";
EditorOption2[EditorOption2["scrollBeyondLastColumn"] = 105] = "scrollBeyondLastColumn";
EditorOption2[EditorOption2["scrollBeyondLastLine"] = 106] = "scrollBeyondLastLine";
EditorOption2[EditorOption2["scrollPredominantAxis"] = 107] = "scrollPredominantAxis";
EditorOption2[EditorOption2["selectionClipboard"] = 108] = "selectionClipboard";
EditorOption2[EditorOption2["selectionHighlight"] = 109] = "selectionHighlight";
EditorOption2[EditorOption2["selectOnLineNumbers"] = 110] = "selectOnLineNumbers";
EditorOption2[EditorOption2["showFoldingControls"] = 111] = "showFoldingControls";
EditorOption2[EditorOption2["showUnused"] = 112] = "showUnused";
EditorOption2[EditorOption2["snippetSuggestions"] = 113] = "snippetSuggestions";
EditorOption2[EditorOption2["smartSelect"] = 114] = "smartSelect";
EditorOption2[EditorOption2["smoothScrolling"] = 115] = "smoothScrolling";
EditorOption2[EditorOption2["stickyScroll"] = 116] = "stickyScroll";
EditorOption2[EditorOption2["stickyTabStops"] = 117] = "stickyTabStops";
EditorOption2[EditorOption2["stopRenderingLineAfter"] = 118] = "stopRenderingLineAfter";
EditorOption2[EditorOption2["suggest"] = 119] = "suggest";
EditorOption2[EditorOption2["suggestFontSize"] = 120] = "suggestFontSize";
EditorOption2[EditorOption2["suggestLineHeight"] = 121] = "suggestLineHeight";
EditorOption2[EditorOption2["suggestOnTriggerCharacters"] = 122] = "suggestOnTriggerCharacters";
EditorOption2[EditorOption2["suggestSelection"] = 123] = "suggestSelection";
EditorOption2[EditorOption2["tabCompletion"] = 124] = "tabCompletion";
EditorOption2[EditorOption2["tabIndex"] = 125] = "tabIndex";
EditorOption2[EditorOption2["unicodeHighlighting"] = 126] = "unicodeHighlighting";
EditorOption2[EditorOption2["unusualLineTerminators"] = 127] = "unusualLineTerminators";
EditorOption2[EditorOption2["useShadowDOM"] = 128] = "useShadowDOM";
EditorOption2[EditorOption2["useTabStops"] = 129] = "useTabStops";
EditorOption2[EditorOption2["wordBreak"] = 130] = "wordBreak";
EditorOption2[EditorOption2["wordSegmenterLocales"] = 131] = "wordSegmenterLocales";
EditorOption2[EditorOption2["wordSeparators"] = 132] = "wordSeparators";
EditorOption2[EditorOption2["wordWrap"] = 133] = "wordWrap";
EditorOption2[EditorOption2["wordWrapBreakAfterCharacters"] = 134] = "wordWrapBreakAfterCharacters";
EditorOption2[EditorOption2["wordWrapBreakBeforeCharacters"] = 135] = "wordWrapBreakBeforeCharacters";
EditorOption2[EditorOption2["wordWrapColumn"] = 136] = "wordWrapColumn";
EditorOption2[EditorOption2["wordWrapOverride1"] = 137] = "wordWrapOverride1";
EditorOption2[EditorOption2["wordWrapOverride2"] = 138] = "wordWrapOverride2";
EditorOption2[EditorOption2["wrappingIndent"] = 139] = "wrappingIndent";
EditorOption2[EditorOption2["wrappingStrategy"] = 140] = "wrappingStrategy";
EditorOption2[EditorOption2["showDeprecated"] = 141] = "showDeprecated";
EditorOption2[EditorOption2["inlayHints"] = 142] = "inlayHints";
EditorOption2[EditorOption2["editorClassName"] = 143] = "editorClassName";
EditorOption2[EditorOption2["pixelRatio"] = 144] = "pixelRatio";
EditorOption2[EditorOption2["tabFocusMode"] = 145] = "tabFocusMode";
EditorOption2[EditorOption2["layoutInfo"] = 146] = "layoutInfo";
EditorOption2[EditorOption2["wrappingInfo"] = 147] = "wrappingInfo";
EditorOption2[EditorOption2["defaultColorDecorators"] = 148] = "defaultColorDecorators";
EditorOption2[EditorOption2["colorDecoratorsActivatedOn"] = 149] = "colorDecoratorsActivatedOn";
EditorOption2[EditorOption2["inlineCompletionsAccessibilityVerbose"] = 150] = "inlineCompletionsAccessibilityVerbose";
})(EditorOption || (EditorOption = {}));
(function(EndOfLinePreference2) {
EndOfLinePreference2[EndOfLinePreference2["TextDefined"] = 0] = "TextDefined";
EndOfLinePreference2[EndOfLinePreference2["LF"] = 1] = "LF";
EndOfLinePreference2[EndOfLinePreference2["CRLF"] = 2] = "CRLF";
})(EndOfLinePreference || (EndOfLinePreference = {}));
(function(EndOfLineSequence2) {
EndOfLineSequence2[EndOfLineSequence2["LF"] = 0] = "LF";
EndOfLineSequence2[EndOfLineSequence2["CRLF"] = 1] = "CRLF";
})(EndOfLineSequence || (EndOfLineSequence = {}));
(function(GlyphMarginLane3) {
GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left";
GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center";
GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right";
})(GlyphMarginLane || (GlyphMarginLane = {}));
(function(HoverVerbosityAction3) {
HoverVerbosityAction3[HoverVerbosityAction3["Increase"] = 0] = "Increase";
HoverVerbosityAction3[HoverVerbosityAction3["Decrease"] = 1] = "Decrease";
})(HoverVerbosityAction2 || (HoverVerbosityAction2 = {}));
(function(IndentAction2) {
IndentAction2[IndentAction2["None"] = 0] = "None";
IndentAction2[IndentAction2["Indent"] = 1] = "Indent";
IndentAction2[IndentAction2["IndentOutdent"] = 2] = "IndentOutdent";
IndentAction2[IndentAction2["Outdent"] = 3] = "Outdent";
})(IndentAction || (IndentAction = {}));
(function(InjectedTextCursorStops3) {
InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
})(InjectedTextCursorStops || (InjectedTextCursorStops = {}));
(function(InlayHintKind4) {
InlayHintKind4[InlayHintKind4["Type"] = 1] = "Type";
InlayHintKind4[InlayHintKind4["Parameter"] = 2] = "Parameter";
})(InlayHintKind2 || (InlayHintKind2 = {}));
(function(InlineCompletionTriggerKind4) {
InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["Automatic"] = 0] = "Automatic";
InlineCompletionTriggerKind4[InlineCompletionTriggerKind4["Explicit"] = 1] = "Explicit";
})(InlineCompletionTriggerKind2 || (InlineCompletionTriggerKind2 = {}));
(function(InlineEditTriggerKind3) {
InlineEditTriggerKind3[InlineEditTriggerKind3["Invoke"] = 0] = "Invoke";
InlineEditTriggerKind3[InlineEditTriggerKind3["Automatic"] = 1] = "Automatic";
})(InlineEditTriggerKind2 || (InlineEditTriggerKind2 = {}));
(function(KeyCode2) {
KeyCode2[KeyCode2["DependsOnKbLayout"] = -1] = "DependsOnKbLayout";
KeyCode2[KeyCode2["Unknown"] = 0] = "Unknown";
KeyCode2[KeyCode2["Backspace"] = 1] = "Backspace";
KeyCode2[KeyCode2["Tab"] = 2] = "Tab";
KeyCode2[KeyCode2["Enter"] = 3] = "Enter";
KeyCode2[KeyCode2["Shift"] = 4] = "Shift";
KeyCode2[KeyCode2["Ctrl"] = 5] = "Ctrl";
KeyCode2[KeyCode2["Alt"] = 6] = "Alt";
KeyCode2[KeyCode2["PauseBreak"] = 7] = "PauseBreak";
KeyCode2[KeyCode2["CapsLock"] = 8] = "CapsLock";
KeyCode2[KeyCode2["Escape"] = 9] = "Escape";
KeyCode2[KeyCode2["Space"] = 10] = "Space";
KeyCode2[KeyCode2["PageUp"] = 11] = "PageUp";
KeyCode2[KeyCode2["PageDown"] = 12] = "PageDown";
KeyCode2[KeyCode2["End"] = 13] = "End";
KeyCode2[KeyCode2["Home"] = 14] = "Home";
KeyCode2[KeyCode2["LeftArrow"] = 15] = "LeftArrow";
KeyCode2[KeyCode2["UpArrow"] = 16] = "UpArrow";
KeyCode2[KeyCode2["RightArrow"] = 17] = "RightArrow";
KeyCode2[KeyCode2["DownArrow"] = 18] = "DownArrow";
KeyCode2[KeyCode2["Insert"] = 19] = "Insert";
KeyCode2[KeyCode2["Delete"] = 20] = "Delete";
KeyCode2[KeyCode2["Digit0"] = 21] = "Digit0";
KeyCode2[KeyCode2["Digit1"] = 22] = "Digit1";
KeyCode2[KeyCode2["Digit2"] = 23] = "Digit2";
KeyCode2[KeyCode2["Digit3"] = 24] = "Digit3";
KeyCode2[KeyCode2["Digit4"] = 25] = "Digit4";
KeyCode2[KeyCode2["Digit5"] = 26] = "Digit5";
KeyCode2[KeyCode2["Digit6"] = 27] = "Digit6";
KeyCode2[KeyCode2["Digit7"] = 28] = "Digit7";
KeyCode2[KeyCode2["Digit8"] = 29] = "Digit8";
KeyCode2[KeyCode2["Digit9"] = 30] = "Digit9";
KeyCode2[KeyCode2["KeyA"] = 31] = "KeyA";
KeyCode2[KeyCode2["KeyB"] = 32] = "KeyB";
KeyCode2[KeyCode2["KeyC"] = 33] = "KeyC";
KeyCode2[KeyCode2["KeyD"] = 34] = "KeyD";
KeyCode2[KeyCode2["KeyE"] = 35] = "KeyE";
KeyCode2[KeyCode2["KeyF"] = 36] = "KeyF";
KeyCode2[KeyCode2["KeyG"] = 37] = "KeyG";
KeyCode2[KeyCode2["KeyH"] = 38] = "KeyH";
KeyCode2[KeyCode2["KeyI"] = 39] = "KeyI";
KeyCode2[KeyCode2["KeyJ"] = 40] = "KeyJ";
KeyCode2[KeyCode2["KeyK"] = 41] = "KeyK";
KeyCode2[KeyCode2["KeyL"] = 42] = "KeyL";
KeyCode2[KeyCode2["KeyM"] = 43] = "KeyM";
KeyCode2[KeyCode2["KeyN"] = 44] = "KeyN";
KeyCode2[KeyCode2["KeyO"] = 45] = "KeyO";
KeyCode2[KeyCode2["KeyP"] = 46] = "KeyP";
KeyCode2[KeyCode2["KeyQ"] = 47] = "KeyQ";
KeyCode2[KeyCode2["KeyR"] = 48] = "KeyR";
KeyCode2[KeyCode2["KeyS"] = 49] = "KeyS";
KeyCode2[KeyCode2["KeyT"] = 50] = "KeyT";
KeyCode2[KeyCode2["KeyU"] = 51] = "KeyU";
KeyCode2[KeyCode2["KeyV"] = 52] = "KeyV";
KeyCode2[KeyCode2["KeyW"] = 53] = "KeyW";
KeyCode2[KeyCode2["KeyX"] = 54] = "KeyX";
KeyCode2[KeyCode2["KeyY"] = 55] = "KeyY";
KeyCode2[KeyCode2["KeyZ"] = 56] = "KeyZ";
KeyCode2[KeyCode2["Meta"] = 57] = "Meta";
KeyCode2[KeyCode2["ContextMenu"] = 58] = "ContextMenu";
KeyCode2[KeyCode2["F1"] = 59] = "F1";
KeyCode2[KeyCode2["F2"] = 60] = "F2";
KeyCode2[KeyCode2["F3"] = 61] = "F3";
KeyCode2[KeyCode2["F4"] = 62] = "F4";
KeyCode2[KeyCode2["F5"] = 63] = "F5";
KeyCode2[KeyCode2["F6"] = 64] = "F6";
KeyCode2[KeyCode2["F7"] = 65] = "F7";
KeyCode2[KeyCode2["F8"] = 66] = "F8";
KeyCode2[KeyCode2["F9"] = 67] = "F9";
KeyCode2[KeyCode2["F10"] = 68] = "F10";
KeyCode2[KeyCode2["F11"] = 69] = "F11";
KeyCode2[KeyCode2["F12"] = 70] = "F12";
KeyCode2[KeyCode2["F13"] = 71] = "F13";
KeyCode2[KeyCode2["F14"] = 72] = "F14";
KeyCode2[KeyCode2["F15"] = 73] = "F15";
KeyCode2[KeyCode2["F16"] = 74] = "F16";
KeyCode2[KeyCode2["F17"] = 75] = "F17";
KeyCode2[KeyCode2["F18"] = 76] = "F18";
KeyCode2[KeyCode2["F19"] = 77] = "F19";
KeyCode2[KeyCode2["F20"] = 78] = "F20";
KeyCode2[KeyCode2["F21"] = 79] = "F21";
KeyCode2[KeyCode2["F22"] = 80] = "F22";
KeyCode2[KeyCode2["F23"] = 81] = "F23";
KeyCode2[KeyCode2["F24"] = 82] = "F24";
KeyCode2[KeyCode2["NumLock"] = 83] = "NumLock";
KeyCode2[KeyCode2["ScrollLock"] = 84] = "ScrollLock";
KeyCode2[KeyCode2["Semicolon"] = 85] = "Semicolon";
KeyCode2[KeyCode2["Equal"] = 86] = "Equal";
KeyCode2[KeyCode2["Comma"] = 87] = "Comma";
KeyCode2[KeyCode2["Minus"] = 88] = "Minus";
KeyCode2[KeyCode2["Period"] = 89] = "Period";
KeyCode2[KeyCode2["Slash"] = 90] = "Slash";
KeyCode2[KeyCode2["Backquote"] = 91] = "Backquote";
KeyCode2[KeyCode2["BracketLeft"] = 92] = "BracketLeft";
KeyCode2[KeyCode2["Backslash"] = 93] = "Backslash";
KeyCode2[KeyCode2["BracketRight"] = 94] = "BracketRight";
KeyCode2[KeyCode2["Quote"] = 95] = "Quote";
KeyCode2[KeyCode2["OEM_8"] = 96] = "OEM_8";
KeyCode2[KeyCode2["IntlBackslash"] = 97] = "IntlBackslash";
KeyCode2[KeyCode2["Numpad0"] = 98] = "Numpad0";
KeyCode2[KeyCode2["Numpad1"] = 99] = "Numpad1";
KeyCode2[KeyCode2["Numpad2"] = 100] = "Numpad2";
KeyCode2[KeyCode2["Numpad3"] = 101] = "Numpad3";
KeyCode2[KeyCode2["Numpad4"] = 102] = "Numpad4";
KeyCode2[KeyCode2["Numpad5"] = 103] = "Numpad5";
KeyCode2[KeyCode2["Numpad6"] = 104] = "Numpad6";
KeyCode2[KeyCode2["Numpad7"] = 105] = "Numpad7";
KeyCode2[KeyCode2["Numpad8"] = 106] = "Numpad8";
KeyCode2[KeyCode2["Numpad9"] = 107] = "Numpad9";
KeyCode2[KeyCode2["NumpadMultiply"] = 108] = "NumpadMultiply";
KeyCode2[KeyCode2["NumpadAdd"] = 109] = "NumpadAdd";
KeyCode2[KeyCode2["NUMPAD_SEPARATOR"] = 110] = "NUMPAD_SEPARATOR";
KeyCode2[KeyCode2["NumpadSubtract"] = 111] = "NumpadSubtract";
KeyCode2[KeyCode2["NumpadDecimal"] = 112] = "NumpadDecimal";
KeyCode2[KeyCode2["NumpadDivide"] = 113] = "NumpadDivide";
KeyCode2[KeyCode2["KEY_IN_COMPOSITION"] = 114] = "KEY_IN_COMPOSITION";
KeyCode2[KeyCode2["ABNT_C1"] = 115] = "ABNT_C1";
KeyCode2[KeyCode2["ABNT_C2"] = 116] = "ABNT_C2";
KeyCode2[KeyCode2["AudioVolumeMute"] = 117] = "AudioVolumeMute";
KeyCode2[KeyCode2["AudioVolumeUp"] = 118] = "AudioVolumeUp";
KeyCode2[KeyCode2["AudioVolumeDown"] = 119] = "AudioVolumeDown";
KeyCode2[KeyCode2["BrowserSearch"] = 120] = "BrowserSearch";
KeyCode2[KeyCode2["BrowserHome"] = 121] = "BrowserHome";
KeyCode2[KeyCode2["BrowserBack"] = 122] = "BrowserBack";
KeyCode2[KeyCode2["BrowserForward"] = 123] = "BrowserForward";
KeyCode2[KeyCode2["MediaTrackNext"] = 124] = "MediaTrackNext";
KeyCode2[KeyCode2["MediaTrackPrevious"] = 125] = "MediaTrackPrevious";
KeyCode2[KeyCode2["MediaStop"] = 126] = "MediaStop";
KeyCode2[KeyCode2["MediaPlayPause"] = 127] = "MediaPlayPause";
KeyCode2[KeyCode2["LaunchMediaPlayer"] = 128] = "LaunchMediaPlayer";
KeyCode2[KeyCode2["LaunchMail"] = 129] = "LaunchMail";
KeyCode2[KeyCode2["LaunchApp2"] = 130] = "LaunchApp2";
KeyCode2[KeyCode2["Clear"] = 131] = "Clear";
KeyCode2[KeyCode2["MAX_VALUE"] = 132] = "MAX_VALUE";
})(KeyCode || (KeyCode = {}));
(function(MarkerSeverity2) {
MarkerSeverity2[MarkerSeverity2["Hint"] = 1] = "Hint";
MarkerSeverity2[MarkerSeverity2["Info"] = 2] = "Info";
MarkerSeverity2[MarkerSeverity2["Warning"] = 4] = "Warning";
MarkerSeverity2[MarkerSeverity2["Error"] = 8] = "Error";
})(MarkerSeverity || (MarkerSeverity = {}));
(function(MarkerTag2) {
MarkerTag2[MarkerTag2["Unnecessary"] = 1] = "Unnecessary";
MarkerTag2[MarkerTag2["Deprecated"] = 2] = "Deprecated";
})(MarkerTag || (MarkerTag = {}));
(function(MinimapPosition2) {
MinimapPosition2[MinimapPosition2["Inline"] = 1] = "Inline";
MinimapPosition2[MinimapPosition2["Gutter"] = 2] = "Gutter";
})(MinimapPosition || (MinimapPosition = {}));
(function(MinimapSectionHeaderStyle2) {
MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Normal"] = 1] = "Normal";
MinimapSectionHeaderStyle2[MinimapSectionHeaderStyle2["Underlined"] = 2] = "Underlined";
})(MinimapSectionHeaderStyle || (MinimapSectionHeaderStyle = {}));
(function(MouseTargetType2) {
MouseTargetType2[MouseTargetType2["UNKNOWN"] = 0] = "UNKNOWN";
MouseTargetType2[MouseTargetType2["TEXTAREA"] = 1] = "TEXTAREA";
MouseTargetType2[MouseTargetType2["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN";
MouseTargetType2[MouseTargetType2["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS";
MouseTargetType2[MouseTargetType2["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS";
MouseTargetType2[MouseTargetType2["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE";
MouseTargetType2[MouseTargetType2["CONTENT_TEXT"] = 6] = "CONTENT_TEXT";
MouseTargetType2[MouseTargetType2["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY";
MouseTargetType2[MouseTargetType2["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE";
MouseTargetType2[MouseTargetType2["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET";
MouseTargetType2[MouseTargetType2["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER";
MouseTargetType2[MouseTargetType2["SCROLLBAR"] = 11] = "SCROLLBAR";
MouseTargetType2[MouseTargetType2["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET";
MouseTargetType2[MouseTargetType2["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR";
})(MouseTargetType || (MouseTargetType = {}));
(function(NewSymbolNameTag3) {
NewSymbolNameTag3[NewSymbolNameTag3["AIGenerated"] = 1] = "AIGenerated";
})(NewSymbolNameTag2 || (NewSymbolNameTag2 = {}));
(function(NewSymbolNameTriggerKind3) {
NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Invoke"] = 0] = "Invoke";
NewSymbolNameTriggerKind3[NewSymbolNameTriggerKind3["Automatic"] = 1] = "Automatic";
})(NewSymbolNameTriggerKind2 || (NewSymbolNameTriggerKind2 = {}));
(function(OverlayWidgetPositionPreference2) {
OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER";
OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER";
OverlayWidgetPositionPreference2[OverlayWidgetPositionPreference2["TOP_CENTER"] = 2] = "TOP_CENTER";
})(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));
(function(OverviewRulerLane3) {
OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
})(OverviewRulerLane || (OverviewRulerLane = {}));
(function(PartialAcceptTriggerKind2) {
PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Word"] = 0] = "Word";
PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Line"] = 1] = "Line";
PartialAcceptTriggerKind2[PartialAcceptTriggerKind2["Suggest"] = 2] = "Suggest";
})(PartialAcceptTriggerKind || (PartialAcceptTriggerKind = {}));
(function(PositionAffinity2) {
PositionAffinity2[PositionAffinity2["Left"] = 0] = "Left";
PositionAffinity2[PositionAffinity2["Right"] = 1] = "Right";
PositionAffinity2[PositionAffinity2["None"] = 2] = "None";
PositionAffinity2[PositionAffinity2["LeftOfInjectedText"] = 3] = "LeftOfInjectedText";
PositionAffinity2[PositionAffinity2["RightOfInjectedText"] = 4] = "RightOfInjectedText";
})(PositionAffinity || (PositionAffinity = {}));
(function(RenderLineNumbersType2) {
RenderLineNumbersType2[RenderLineNumbersType2["Off"] = 0] = "Off";
RenderLineNumbersType2[RenderLineNumbersType2["On"] = 1] = "On";
RenderLineNumbersType2[RenderLineNumbersType2["Relative"] = 2] = "Relative";
RenderLineNumbersType2[RenderLineNumbersType2["Interval"] = 3] = "Interval";
RenderLineNumbersType2[RenderLineNumbersType2["Custom"] = 4] = "Custom";
})(RenderLineNumbersType || (RenderLineNumbersType = {}));
(function(RenderMinimap2) {
RenderMinimap2[RenderMinimap2["None"] = 0] = "None";
RenderMinimap2[RenderMinimap2["Text"] = 1] = "Text";
RenderMinimap2[RenderMinimap2["Blocks"] = 2] = "Blocks";
})(RenderMinimap || (RenderMinimap = {}));
(function(ScrollType2) {
ScrollType2[ScrollType2["Smooth"] = 0] = "Smooth";
ScrollType2[ScrollType2["Immediate"] = 1] = "Immediate";
})(ScrollType || (ScrollType = {}));
(function(ScrollbarVisibility2) {
ScrollbarVisibility2[ScrollbarVisibility2["Auto"] = 1] = "Auto";
ScrollbarVisibility2[ScrollbarVisibility2["Hidden"] = 2] = "Hidden";
ScrollbarVisibility2[ScrollbarVisibility2["Visible"] = 3] = "Visible";
})(ScrollbarVisibility || (ScrollbarVisibility = {}));
(function(SelectionDirection2) {
SelectionDirection2[SelectionDirection2["LTR"] = 0] = "LTR";
SelectionDirection2[SelectionDirection2["RTL"] = 1] = "RTL";
})(SelectionDirection || (SelectionDirection = {}));
(function(ShowLightbulbIconMode2) {
ShowLightbulbIconMode2["Off"] = "off";
ShowLightbulbIconMode2["OnCode"] = "onCode";
ShowLightbulbIconMode2["On"] = "on";
})(ShowLightbulbIconMode || (ShowLightbulbIconMode = {}));
(function(SignatureHelpTriggerKind3) {
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["Invoke"] = 1] = "Invoke";
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["TriggerCharacter"] = 2] = "TriggerCharacter";
SignatureHelpTriggerKind3[SignatureHelpTriggerKind3["ContentChange"] = 3] = "ContentChange";
})(SignatureHelpTriggerKind2 || (SignatureHelpTriggerKind2 = {}));
(function(SymbolKind3) {
SymbolKind3[SymbolKind3["File"] = 0] = "File";
SymbolKind3[SymbolKind3["Module"] = 1] = "Module";
SymbolKind3[SymbolKind3["Namespace"] = 2] = "Namespace";
SymbolKind3[SymbolKind3["Package"] = 3] = "Package";
SymbolKind3[SymbolKind3["Class"] = 4] = "Class";
SymbolKind3[SymbolKind3["Method"] = 5] = "Method";
SymbolKind3[SymbolKind3["Property"] = 6] = "Property";
SymbolKind3[SymbolKind3["Field"] = 7] = "Field";
SymbolKind3[SymbolKind3["Constructor"] = 8] = "Constructor";
SymbolKind3[SymbolKind3["Enum"] = 9] = "Enum";
SymbolKind3[SymbolKind3["Interface"] = 10] = "Interface";
SymbolKind3[SymbolKind3["Function"] = 11] = "Function";
SymbolKind3[SymbolKind3["Variable"] = 12] = "Variable";
SymbolKind3[SymbolKind3["Constant"] = 13] = "Constant";
SymbolKind3[SymbolKind3["String"] = 14] = "String";
SymbolKind3[SymbolKind3["Number"] = 15] = "Number";
SymbolKind3[SymbolKind3["Boolean"] = 16] = "Boolean";
SymbolKind3[SymbolKind3["Array"] = 17] = "Array";
SymbolKind3[SymbolKind3["Object"] = 18] = "Object";
SymbolKind3[SymbolKind3["Key"] = 19] = "Key";
SymbolKind3[SymbolKind3["Null"] = 20] = "Null";
SymbolKind3[SymbolKind3["EnumMember"] = 21] = "EnumMember";
SymbolKind3[SymbolKind3["Struct"] = 22] = "Struct";
SymbolKind3[SymbolKind3["Event"] = 23] = "Event";
SymbolKind3[SymbolKind3["Operator"] = 24] = "Operator";
SymbolKind3[SymbolKind3["TypeParameter"] = 25] = "TypeParameter";
})(SymbolKind || (SymbolKind = {}));
(function(SymbolTag3) {
SymbolTag3[SymbolTag3["Deprecated"] = 1] = "Deprecated";
})(SymbolTag || (SymbolTag = {}));
(function(TextEditorCursorBlinkingStyle2) {
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Hidden"] = 0] = "Hidden";
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Blink"] = 1] = "Blink";
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Smooth"] = 2] = "Smooth";
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Phase"] = 3] = "Phase";
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Expand"] = 4] = "Expand";
TextEditorCursorBlinkingStyle2[TextEditorCursorBlinkingStyle2["Solid"] = 5] = "Solid";
})(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));
(function(TextEditorCursorStyle2) {
TextEditorCursorStyle2[TextEditorCursorStyle2["Line"] = 1] = "Line";
TextEditorCursorStyle2[TextEditorCursorStyle2["Block"] = 2] = "Block";
TextEditorCursorStyle2[TextEditorCursorStyle2["Underline"] = 3] = "Underline";
TextEditorCursorStyle2[TextEditorCursorStyle2["LineThin"] = 4] = "LineThin";
TextEditorCursorStyle2[TextEditorCursorStyle2["BlockOutline"] = 5] = "BlockOutline";
TextEditorCursorStyle2[TextEditorCursorStyle2["UnderlineThin"] = 6] = "UnderlineThin";
})(TextEditorCursorStyle || (TextEditorCursorStyle = {}));
(function(TrackedRangeStickiness2) {
TrackedRangeStickiness2[TrackedRangeStickiness2["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges";
TrackedRangeStickiness2[TrackedRangeStickiness2["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges";
TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore";
TrackedRangeStickiness2[TrackedRangeStickiness2["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter";
})(TrackedRangeStickiness || (TrackedRangeStickiness = {}));
(function(WrappingIndent2) {
WrappingIndent2[WrappingIndent2["None"] = 0] = "None";
WrappingIndent2[WrappingIndent2["Same"] = 1] = "Same";
WrappingIndent2[WrappingIndent2["Indent"] = 2] = "Indent";
WrappingIndent2[WrappingIndent2["DeepIndent"] = 3] = "DeepIndent";
})(WrappingIndent || (WrappingIndent = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorBaseApi.js
function createMonacoBaseAPI() {
return {
editor: void 0,
// undefined override expected here
languages: void 0,
// undefined override expected here
CancellationTokenSource,
Emitter,
KeyCode,
KeyMod,
Position,
Range,
Selection,
SelectionDirection,
MarkerSeverity,
MarkerTag,
Uri: URI,
Token
};
}
var KeyMod;
var init_editorBaseApi = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorBaseApi.js"() {
init_cancellation();
init_event();
init_keyCodes();
init_uri();
init_position();
init_range();
init_selection();
init_languages();
init_standaloneEnums();
KeyMod = class {
static {
this.CtrlCmd = 2048;
}
static {
this.Shift = 1024;
}
static {
this.Alt = 512;
}
static {
this.WinCtrl = 256;
}
static chord(firstPart, secondPart) {
return KeyChord(firstPart, secondPart);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerHost.js
var EditorWorkerHost;
var init_editorWorkerHost = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorWorkerHost.js"() {
EditorWorkerHost = class _EditorWorkerHost {
static {
this.CHANNEL_NAME = "editorWorkerHost";
}
static getChannel(workerServer) {
return workerServer.getChannel(_EditorWorkerHost.CHANNEL_NAME);
}
static setChannel(workerClient, obj) {
workerClient.setChannel(_EditorWorkerHost.CHANNEL_NAME, obj);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/map.js
function isEntries(arg) {
return Array.isArray(arg);
}
var _a, _b, ResourceMapEntry, ResourceMap, LinkedMap, Cache, LRUCache, SetMap;
var init_map = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/map.js"() {
ResourceMapEntry = class {
constructor(uri, value) {
this.uri = uri;
this.value = value;
}
};
ResourceMap = class _ResourceMap {
static {
this.defaultToKey = (resource) => resource.toString();
}
constructor(arg, toKey) {
this[_a] = "ResourceMap";
if (arg instanceof _ResourceMap) {
this.map = new Map(arg.map);
this.toKey = toKey ?? _ResourceMap.defaultToKey;
} else if (isEntries(arg)) {
this.map = /* @__PURE__ */ new Map();
this.toKey = toKey ?? _ResourceMap.defaultToKey;
for (const [resource, value] of arg) {
this.set(resource, value);
}
} else {
this.map = /* @__PURE__ */ new Map();
this.toKey = arg ?? _ResourceMap.defaultToKey;
}
}
set(resource, value) {
this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value));
return this;
}
get(resource) {
return this.map.get(this.toKey(resource))?.value;
}
has(resource) {
return this.map.has(this.toKey(resource));
}
get size() {
return this.map.size;
}
clear() {
this.map.clear();
}
delete(resource) {
return this.map.delete(this.toKey(resource));
}
forEach(clb, thisArg) {
if (typeof thisArg !== "undefined") {
clb = clb.bind(thisArg);
}
for (const [_2, entry] of this.map) {
clb(entry.value, entry.uri, this);
}
}
*values() {
for (const entry of this.map.values()) {
yield entry.value;
}
}
*keys() {
for (const entry of this.map.values()) {
yield entry.uri;
}
}
*entries() {
for (const entry of this.map.values()) {
yield [entry.uri, entry.value];
}
}
*[(_a = Symbol.toStringTag, Symbol.iterator)]() {
for (const [, entry] of this.map) {
yield [entry.uri, entry.value];
}
}
};
LinkedMap = class {
constructor() {
this[_b] = "LinkedMap";
this._map = /* @__PURE__ */ new Map();
this._head = void 0;
this._tail = void 0;
this._size = 0;
this._state = 0;
}
clear() {
this._map.clear();
this._head = void 0;
this._tail = void 0;
this._size = 0;
this._state++;
}
isEmpty() {
return !this._head && !this._tail;
}
get size() {
return this._size;
}
get first() {
return this._head?.value;
}
get last() {
return this._tail?.value;
}
has(key) {
return this._map.has(key);
}
get(key, touch = 0) {
const item = this._map.get(key);
if (!item) {
return void 0;
}
if (touch !== 0) {
this.touch(item, touch);
}
return item.value;
}
set(key, value, touch = 0) {
let item = this._map.get(key);
if (item) {
item.value = value;
if (touch !== 0) {
this.touch(item, touch);
}
} else {
item = { key, value, next: void 0, previous: void 0 };
switch (touch) {
case 0:
this.addItemLast(item);
break;
case 1:
this.addItemFirst(item);
break;
case 2:
this.addItemLast(item);
break;
default:
this.addItemLast(item);
break;
}
this._map.set(key, item);
this._size++;
}
return this;
}
delete(key) {
return !!this.remove(key);
}
remove(key) {
const item = this._map.get(key);
if (!item) {
return void 0;
}
this._map.delete(key);
this.removeItem(item);
this._size--;
return item.value;
}
shift() {
if (!this._head && !this._tail) {
return void 0;
}
if (!this._head || !this._tail) {
throw new Error("Invalid list");
}
const item = this._head;
this._map.delete(item.key);
this.removeItem(item);
this._size--;
return item.value;
}
forEach(callbackfn, thisArg) {
const state = this._state;
let current = this._head;
while (current) {
if (thisArg) {
callbackfn.bind(thisArg)(current.value, current.key, this);
} else {
callbackfn(current.value, current.key, this);
}
if (this._state !== state) {
throw new Error(`LinkedMap got modified during iteration.`);
}
current = current.next;
}
}
keys() {
const map = this;
const state = this._state;
let current = this._head;
const iterator = {
[Symbol.iterator]() {
return iterator;
},
next() {
if (map._state !== state) {
throw new Error(`LinkedMap got modified during iteration.`);
}
if (current) {
const result = { value: current.key, done: false };
current = current.next;
return result;
} else {
return { value: void 0, done: true };
}
}
};
return iterator;
}
values() {
const map = this;
const state = this._state;
let current = this._head;
const iterator = {
[Symbol.iterator]() {
return iterator;
},
next() {
if (map._state !== state) {
throw new Error(`LinkedMap got modified during iteration.`);
}
if (current) {
const result = { value: current.value, done: false };
current = current.next;
return result;
} else {
return { value: void 0, done: true };
}
}
};
return iterator;
}
entries() {
const map = this;
const state = this._state;
let current = this._head;
const iterator = {
[Symbol.iterator]() {
return iterator;
},
next() {
if (map._state !== state) {
throw new Error(`LinkedMap got modified during iteration.`);
}
if (current) {
const result = { value: [current.key, current.value], done: false };
current = current.next;
return result;
} else {
return { value: void 0, done: true };
}
}
};
return iterator;
}
[(_b = Symbol.toStringTag, Symbol.iterator)]() {
return this.entries();
}
trimOld(newSize) {
if (newSize >= this.size) {
return;
}
if (newSize === 0) {
this.clear();
return;
}
let current = this._head;
let currentSize = this.size;
while (current && currentSize > newSize) {
this._map.delete(current.key);
current = current.next;
currentSize--;
}
this._head = current;
this._size = currentSize;
if (current) {
current.previous = void 0;
}
this._state++;
}
trimNew(newSize) {
if (newSize >= this.size) {
return;
}
if (newSize === 0) {
this.clear();
return;
}
let current = this._tail;
let currentSize = this.size;
while (current && currentSize > newSize) {
this._map.delete(current.key);
current = current.previous;
currentSize--;
}
this._tail = current;
this._size = currentSize;
if (current) {
current.next = void 0;
}
this._state++;
}
addItemFirst(item) {
if (!this._head && !this._tail) {
this._tail = item;
} else if (!this._head) {
throw new Error("Invalid list");
} else {
item.next = this._head;
this._head.previous = item;
}
this._head = item;
this._state++;
}
addItemLast(item) {
if (!this._head && !this._tail) {
this._head = item;
} else if (!this._tail) {
throw new Error("Invalid list");
} else {
item.previous = this._tail;
this._tail.next = item;
}
this._tail = item;
this._state++;
}
removeItem(item) {
if (item === this._head && item === this._tail) {
this._head = void 0;
this._tail = void 0;
} else if (item === this._head) {
if (!item.next) {
throw new Error("Invalid list");
}
item.next.previous = void 0;
this._head = item.next;
} else if (item === this._tail) {
if (!item.previous) {
throw new Error("Invalid list");
}
item.previous.next = void 0;
this._tail = item.previous;
} else {
const next = item.next;
const previous = item.previous;
if (!next || !previous) {
throw new Error("Invalid list");
}
next.previous = previous;
previous.next = next;
}
item.next = void 0;
item.previous = void 0;
this._state++;
}
touch(item, touch) {
if (!this._head || !this._tail) {
throw new Error("Invalid list");
}
if (touch !== 1 && touch !== 2) {
return;
}
if (touch === 1) {
if (item === this._head) {
return;
}
const next = item.next;
const previous = item.previous;
if (item === this._tail) {
previous.next = void 0;
this._tail = previous;
} else {
next.previous = previous;
previous.next = next;
}
item.previous = void 0;
item.next = this._head;
this._head.previous = item;
this._head = item;
this._state++;
} else if (touch === 2) {
if (item === this._tail) {
return;
}
const next = item.next;
const previous = item.previous;
if (item === this._head) {
next.previous = void 0;
this._head = next;
} else {
next.previous = previous;
previous.next = next;
}
item.next = void 0;
item.previous = this._tail;
this._tail.next = item;
this._tail = item;
this._state++;
}
}
toJSON() {
const data = [];
this.forEach((value, key) => {
data.push([key, value]);
});
return data;
}
fromJSON(data) {
this.clear();
for (const [key, value] of data) {
this.set(key, value);
}
}
};
Cache = class extends LinkedMap {
constructor(limit, ratio = 1) {
super();
this._limit = limit;
this._ratio = Math.min(Math.max(0, ratio), 1);
}
get limit() {
return this._limit;
}
set limit(limit) {
this._limit = limit;
this.checkTrim();
}
get(key, touch = 2) {
return super.get(key, touch);
}
peek(key) {
return super.get(
key,
0
/* Touch.None */
);
}
set(key, value) {
super.set(
key,
value,
2
/* Touch.AsNew */
);
return this;
}
checkTrim() {
if (this.size > this._limit) {
this.trim(Math.round(this._limit * this._ratio));
}
}
};
LRUCache = class extends Cache {
constructor(limit, ratio = 1) {
super(limit, ratio);
}
trim(newSize) {
this.trimOld(newSize);
}
set(key, value) {
super.set(key, value);
this.checkTrim();
return this;
}
};
SetMap = class {
constructor() {
this.map = /* @__PURE__ */ new Map();
}
add(key, value) {
let values = this.map.get(key);
if (!values) {
values = /* @__PURE__ */ new Set();
this.map.set(key, values);
}
values.add(value);
}
delete(key, value) {
const values = this.map.get(key);
if (!values) {
return;
}
values.delete(value);
if (values.size === 0) {
this.map.delete(key);
}
}
forEach(key, fn2) {
const values = this.map.get(key);
if (!values) {
return;
}
values.forEach(fn2);
}
get(key) {
const values = this.map.get(key);
if (!values) {
return /* @__PURE__ */ new Set();
}
return values;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/wordCharacterClassifier.js
var wordClassifierCache;
var init_wordCharacterClassifier = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/wordCharacterClassifier.js"() {
init_map();
init_characterClassifier();
wordClassifierCache = new LRUCache(10);
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/objects.js
function getAllPropertyNames(obj) {
let res = [];
while (Object.prototype !== obj) {
res = res.concat(Object.getOwnPropertyNames(obj));
obj = Object.getPrototypeOf(obj);
}
return res;
}
function getAllMethodNames(obj) {
const methods = [];
for (const prop of getAllPropertyNames(obj)) {
if (typeof obj[prop] === "function") {
methods.push(prop);
}
}
return methods;
}
function createProxyObject(methodNames, invoke) {
const createProxyMethod = (method) => {
return function() {
const args = Array.prototype.slice.call(arguments, 0);
return invoke(method, args);
};
};
const result = {};
for (const methodName of methodNames) {
result[methodName] = createProxyMethod(methodName);
}
return result;
}
var init_objects = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/objects.js"() {
init_types();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model.js
var OverviewRulerLane2, GlyphMarginLane2, InjectedTextCursorStops2;
var init_model = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model.js"() {
init_objects();
(function(OverviewRulerLane3) {
OverviewRulerLane3[OverviewRulerLane3["Left"] = 1] = "Left";
OverviewRulerLane3[OverviewRulerLane3["Center"] = 2] = "Center";
OverviewRulerLane3[OverviewRulerLane3["Right"] = 4] = "Right";
OverviewRulerLane3[OverviewRulerLane3["Full"] = 7] = "Full";
})(OverviewRulerLane2 || (OverviewRulerLane2 = {}));
(function(GlyphMarginLane3) {
GlyphMarginLane3[GlyphMarginLane3["Left"] = 1] = "Left";
GlyphMarginLane3[GlyphMarginLane3["Center"] = 2] = "Center";
GlyphMarginLane3[GlyphMarginLane3["Right"] = 3] = "Right";
})(GlyphMarginLane2 || (GlyphMarginLane2 = {}));
(function(InjectedTextCursorStops3) {
InjectedTextCursorStops3[InjectedTextCursorStops3["Both"] = 0] = "Both";
InjectedTextCursorStops3[InjectedTextCursorStops3["Right"] = 1] = "Right";
InjectedTextCursorStops3[InjectedTextCursorStops3["Left"] = 2] = "Left";
InjectedTextCursorStops3[InjectedTextCursorStops3["None"] = 3] = "None";
})(InjectedTextCursorStops2 || (InjectedTextCursorStops2 = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js
function leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
if (matchStartIndex === 0) {
return true;
}
const charBefore = text.charCodeAt(matchStartIndex - 1);
if (wordSeparators.get(charBefore) !== 0) {
return true;
}
if (charBefore === 13 || charBefore === 10) {
return true;
}
if (matchLength > 0) {
const firstCharInMatch = text.charCodeAt(matchStartIndex);
if (wordSeparators.get(firstCharInMatch) !== 0) {
return true;
}
}
return false;
}
function rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) {
if (matchStartIndex + matchLength === textLength) {
return true;
}
const charAfter = text.charCodeAt(matchStartIndex + matchLength);
if (wordSeparators.get(charAfter) !== 0) {
return true;
}
if (charAfter === 13 || charAfter === 10) {
return true;
}
if (matchLength > 0) {
const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1);
if (wordSeparators.get(lastCharInMatch) !== 0) {
return true;
}
}
return false;
}
function isValidMatch(wordSeparators, text, textLength, matchStartIndex, matchLength) {
return leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength);
}
var Searcher;
var init_textModelSearch = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/textModelSearch.js"() {
init_strings();
init_wordCharacterClassifier();
init_position();
init_range();
init_model();
Searcher = class {
constructor(wordSeparators, searchRegex) {
this._wordSeparators = wordSeparators;
this._searchRegex = searchRegex;
this._prevMatchStartIndex = -1;
this._prevMatchLength = 0;
}
reset(lastIndex) {
this._searchRegex.lastIndex = lastIndex;
this._prevMatchStartIndex = -1;
this._prevMatchLength = 0;
}
next(text) {
const textLength = text.length;
let m;
do {
if (this._prevMatchStartIndex + this._prevMatchLength === textLength) {
return null;
}
m = this._searchRegex.exec(text);
if (!m) {
return null;
}
const matchStartIndex = m.index;
const matchLength = m[0].length;
if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) {
if (matchLength === 0) {
if (getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 65535) {
this._searchRegex.lastIndex += 2;
} else {
this._searchRegex.lastIndex += 1;
}
continue;
}
return null;
}
this._prevMatchStartIndex = matchStartIndex;
this._prevMatchLength = matchLength;
if (!this._wordSeparators || isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength)) {
return m;
}
} while (m);
return null;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/assert.js
function assertNever(value, message = "Unreachable") {
throw new Error(message);
}
function assertFn(condition) {
if (!condition()) {
debugger;
condition();
onUnexpectedError(new BugIndicatingError("Assertion Failed"));
}
}
function checkAdjacentItems(items, predicate) {
let i = 0;
while (i < items.length - 1) {
const a = items[i];
const b = items[i + 1];
if (!predicate(a, b)) {
return false;
}
i++;
}
return true;
}
var init_assert = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/assert.js"() {
init_errors();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js
function createWordRegExp(allowInWords = "") {
let source = "(-?\\d*\\.\\d\\w*)|([^";
for (const sep2 of USUAL_WORD_SEPARATORS) {
if (allowInWords.indexOf(sep2) >= 0) {
continue;
}
source += "\\" + sep2;
}
source += "\\s]+)";
return new RegExp(source, "g");
}
function ensureValidWordDefinition(wordDefinition) {
let result = DEFAULT_WORD_REGEXP;
if (wordDefinition && wordDefinition instanceof RegExp) {
if (!wordDefinition.global) {
let flags = "g";
if (wordDefinition.ignoreCase) {
flags += "i";
}
if (wordDefinition.multiline) {
flags += "m";
}
if (wordDefinition.unicode) {
flags += "u";
}
result = new RegExp(wordDefinition.source, flags);
} else {
result = wordDefinition;
}
}
result.lastIndex = 0;
return result;
}
function getWordAtText(column, wordDefinition, text, textOffset, config) {
wordDefinition = ensureValidWordDefinition(wordDefinition);
if (!config) {
config = Iterable.first(_defaultConfig);
}
if (text.length > config.maxLen) {
let start = column - config.maxLen / 2;
if (start < 0) {
start = 0;
} else {
textOffset += start;
}
text = text.substring(start, column + config.maxLen / 2);
return getWordAtText(column, wordDefinition, text, textOffset, config);
}
const t1 = Date.now();
const pos = column - 1 - textOffset;
let prevRegexIndex = -1;
let match = null;
for (let i = 1; ; i++) {
if (Date.now() - t1 >= config.timeBudget) {
break;
}
const regexIndex = pos - config.windowSize * i;
wordDefinition.lastIndex = Math.max(0, regexIndex);
const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text, pos, prevRegexIndex);
if (!thisMatch && match) {
break;
}
match = thisMatch;
if (regexIndex <= 0) {
break;
}
prevRegexIndex = regexIndex;
}
if (match) {
const result = {
word: match[0],
startColumn: textOffset + 1 + match.index,
endColumn: textOffset + 1 + match.index + match[0].length
};
wordDefinition.lastIndex = 0;
return result;
}
return null;
}
function _findRegexMatchEnclosingPosition(wordDefinition, text, pos, stopPos) {
let match;
while (match = wordDefinition.exec(text)) {
const matchIndex = match.index || 0;
if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {
return match;
} else if (stopPos > 0 && matchIndex > stopPos) {
return null;
}
}
return null;
}
var USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, _defaultConfig;
var init_wordHelper = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js"() {
init_iterator();
init_linkedList();
USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";
DEFAULT_WORD_REGEXP = createWordRegExp();
_defaultConfig = new LinkedList();
_defaultConfig.unshift({
maxLen: 1e3,
windowSize: 15,
timeBudget: 150
});
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/unicodeTextModelHighlighter.js
function buildRegExpCharClassExpr(codePoints, flags) {
const src = `[${escapeRegExpCharacters(codePoints.map((i) => String.fromCodePoint(i)).join(""))}]`;
return src;
}
function isAllowedInvisibleCharacter(character) {
return character === " " || character === "\n" || character === " ";
}
var UnicodeTextModelHighlighter, CodePointHighlighter;
var init_unicodeTextModelHighlighter = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/unicodeTextModelHighlighter.js"() {
init_range();
init_textModelSearch();
init_strings();
init_assert();
init_wordHelper();
UnicodeTextModelHighlighter = class {
static computeUnicodeHighlights(model, options, range) {
const startLine = range ? range.startLineNumber : 1;
const endLine = range ? range.endLineNumber : model.getLineCount();
const codePointHighlighter = new CodePointHighlighter(options);
const candidates = codePointHighlighter.getCandidateCodePoints();
let regex;
if (candidates === "allNonBasicAscii") {
regex = new RegExp("[^\\t\\n\\r\\x20-\\x7E]", "g");
} else {
regex = new RegExp(`${buildRegExpCharClassExpr(Array.from(candidates))}`, "g");
}
const searcher = new Searcher(null, regex);
const ranges = [];
let hasMore = false;
let m;
let ambiguousCharacterCount = 0;
let invisibleCharacterCount = 0;
let nonBasicAsciiCharacterCount = 0;
forLoop: for (let lineNumber = startLine, lineCount = endLine; lineNumber <= lineCount; lineNumber++) {
const lineContent = model.getLineContent(lineNumber);
const lineLength = lineContent.length;
searcher.reset(0);
do {
m = searcher.next(lineContent);
if (m) {
let startIndex = m.index;
let endIndex = m.index + m[0].length;
if (startIndex > 0) {
const charCodeBefore = lineContent.charCodeAt(startIndex - 1);
if (isHighSurrogate(charCodeBefore)) {
startIndex--;
}
}
if (endIndex + 1 < lineLength) {
const charCodeBefore = lineContent.charCodeAt(endIndex - 1);
if (isHighSurrogate(charCodeBefore)) {
endIndex++;
}
}
const str = lineContent.substring(startIndex, endIndex);
let word = getWordAtText(startIndex + 1, DEFAULT_WORD_REGEXP, lineContent, 0);
if (word && word.endColumn <= startIndex + 1) {
word = null;
}
const highlightReason = codePointHighlighter.shouldHighlightNonBasicASCII(str, word ? word.word : null);
if (highlightReason !== 0) {
if (highlightReason === 3) {
ambiguousCharacterCount++;
} else if (highlightReason === 2) {
invisibleCharacterCount++;
} else if (highlightReason === 1) {
nonBasicAsciiCharacterCount++;
} else {
assertNever(highlightReason);
}
const MAX_RESULT_LENGTH = 1e3;
if (ranges.length >= MAX_RESULT_LENGTH) {
hasMore = true;
break forLoop;
}
ranges.push(new Range(lineNumber, startIndex + 1, lineNumber, endIndex + 1));
}
}
} while (m);
}
return {
ranges,
hasMore,
ambiguousCharacterCount,
invisibleCharacterCount,
nonBasicAsciiCharacterCount
};
}
static computeUnicodeHighlightReason(char, options) {
const codePointHighlighter = new CodePointHighlighter(options);
const reason = codePointHighlighter.shouldHighlightNonBasicASCII(char, null);
switch (reason) {
case 0:
return null;
case 2:
return {
kind: 1
/* UnicodeHighlighterReasonKind.Invisible */
};
case 3: {
const codePoint = char.codePointAt(0);
const primaryConfusable = codePointHighlighter.ambiguousCharacters.getPrimaryConfusable(codePoint);
const notAmbiguousInLocales = AmbiguousCharacters.getLocales().filter((l) => !AmbiguousCharacters.getInstance(/* @__PURE__ */ new Set([...options.allowedLocales, l])).isAmbiguous(codePoint));
return { kind: 0, confusableWith: String.fromCodePoint(primaryConfusable), notAmbiguousInLocales };
}
case 1:
return {
kind: 2
/* UnicodeHighlighterReasonKind.NonBasicAscii */
};
}
}
};
CodePointHighlighter = class {
constructor(options) {
this.options = options;
this.allowedCodePoints = new Set(options.allowedCodePoints);
this.ambiguousCharacters = AmbiguousCharacters.getInstance(new Set(options.allowedLocales));
}
getCandidateCodePoints() {
if (this.options.nonBasicASCII) {
return "allNonBasicAscii";
}
const set = /* @__PURE__ */ new Set();
if (this.options.invisibleCharacters) {
for (const cp of InvisibleCharacters.codePoints) {
if (!isAllowedInvisibleCharacter(String.fromCodePoint(cp))) {
set.add(cp);
}
}
}
if (this.options.ambiguousCharacters) {
for (const cp of this.ambiguousCharacters.getConfusableCodePoints()) {
set.add(cp);
}
}
for (const cp of this.allowedCodePoints) {
set.delete(cp);
}
return set;
}
shouldHighlightNonBasicASCII(character, wordContext) {
const codePoint = character.codePointAt(0);
if (this.allowedCodePoints.has(codePoint)) {
return 0;
}
if (this.options.nonBasicASCII) {
return 1;
}
let hasBasicASCIICharacters = false;
let hasNonConfusableNonBasicAsciiCharacter = false;
if (wordContext) {
for (const char of wordContext) {
const codePoint2 = char.codePointAt(0);
const isBasicASCII2 = isBasicASCII(char);
hasBasicASCIICharacters = hasBasicASCIICharacters || isBasicASCII2;
if (!isBasicASCII2 && !this.ambiguousCharacters.isAmbiguous(codePoint2) && !InvisibleCharacters.isInvisibleCharacter(codePoint2)) {
hasNonConfusableNonBasicAsciiCharacter = true;
}
}
}
if (
/* Don't allow mixing weird looking characters with ASCII */
!hasBasicASCIICharacters && /* Is there an obviously weird looking character? */
hasNonConfusableNonBasicAsciiCharacter
) {
return 0;
}
if (this.options.invisibleCharacters) {
if (!isAllowedInvisibleCharacter(character) && InvisibleCharacters.isInvisibleCharacter(codePoint)) {
return 2;
}
}
if (this.options.ambiguousCharacters) {
if (this.ambiguousCharacters.isAmbiguous(codePoint)) {
return 3;
}
}
return 0;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputer.js
var LinesDiff, MovedText;
var init_linesDiffComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputer.js"() {
LinesDiff = class {
constructor(changes, moves, hitTimeout) {
this.changes = changes;
this.moves = moves;
this.hitTimeout = hitTimeout;
}
};
MovedText = class {
constructor(lineRangeMapping, changes) {
this.lineRangeMapping = lineRangeMapping;
this.changes = changes;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/offsetRange.js
var OffsetRange;
var init_offsetRange = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/offsetRange.js"() {
init_errors();
OffsetRange = class _OffsetRange {
static addRange(range, sortedRanges) {
let i = 0;
while (i < sortedRanges.length && sortedRanges[i].endExclusive < range.start) {
i++;
}
let j = i;
while (j < sortedRanges.length && sortedRanges[j].start <= range.endExclusive) {
j++;
}
if (i === j) {
sortedRanges.splice(i, 0, range);
} else {
const start = Math.min(range.start, sortedRanges[i].start);
const end = Math.max(range.endExclusive, sortedRanges[j - 1].endExclusive);
sortedRanges.splice(i, j - i, new _OffsetRange(start, end));
}
}
static tryCreate(start, endExclusive) {
if (start > endExclusive) {
return void 0;
}
return new _OffsetRange(start, endExclusive);
}
static ofLength(length) {
return new _OffsetRange(0, length);
}
static ofStartAndLength(start, length) {
return new _OffsetRange(start, start + length);
}
constructor(start, endExclusive) {
this.start = start;
this.endExclusive = endExclusive;
if (start > endExclusive) {
throw new BugIndicatingError(`Invalid range: ${this.toString()}`);
}
}
get isEmpty() {
return this.start === this.endExclusive;
}
delta(offset) {
return new _OffsetRange(this.start + offset, this.endExclusive + offset);
}
deltaStart(offset) {
return new _OffsetRange(this.start + offset, this.endExclusive);
}
deltaEnd(offset) {
return new _OffsetRange(this.start, this.endExclusive + offset);
}
get length() {
return this.endExclusive - this.start;
}
toString() {
return `[${this.start}, ${this.endExclusive})`;
}
contains(offset) {
return this.start <= offset && offset < this.endExclusive;
}
/**
* for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n)
* The joined range is the smallest range that contains both ranges.
*/
join(other) {
return new _OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive));
}
/**
* for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n)
*
* The resulting range is empty if the ranges do not intersect, but touch.
* If the ranges don't even touch, the result is undefined.
*/
intersect(other) {
const start = Math.max(this.start, other.start);
const end = Math.min(this.endExclusive, other.endExclusive);
if (start <= end) {
return new _OffsetRange(start, end);
}
return void 0;
}
intersects(other) {
const start = Math.max(this.start, other.start);
const end = Math.min(this.endExclusive, other.endExclusive);
return start < end;
}
isBefore(other) {
return this.endExclusive <= other.start;
}
isAfter(other) {
return this.start >= other.endExclusive;
}
slice(arr) {
return arr.slice(this.start, this.endExclusive);
}
substring(str) {
return str.substring(this.start, this.endExclusive);
}
/**
* Returns the given value if it is contained in this instance, otherwise the closest value that is contained.
* The range must not be empty.
*/
clip(value) {
if (this.isEmpty) {
throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);
}
return Math.max(this.start, Math.min(this.endExclusive - 1, value));
}
/**
* Returns `r := value + k * length` such that `r` is contained in this range.
* The range must not be empty.
*
* E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`.
*/
clipCyclic(value) {
if (this.isEmpty) {
throw new BugIndicatingError(`Invalid clipping range: ${this.toString()}`);
}
if (value < this.start) {
return this.endExclusive - (this.start - value) % this.length;
}
if (value >= this.endExclusive) {
return this.start + (value - this.start) % this.length;
}
return value;
}
forEach(f) {
for (let i = this.start; i < this.endExclusive; i++) {
f(i);
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/arraysFind.js
function findLastMonotonous(array, predicate) {
const idx = findLastIdxMonotonous(array, predicate);
return idx === -1 ? void 0 : array[idx];
}
function findLastIdxMonotonous(array, predicate, startIdx = 0, endIdxEx = array.length) {
let i = startIdx;
let j = endIdxEx;
while (i < j) {
const k2 = Math.floor((i + j) / 2);
if (predicate(array[k2])) {
i = k2 + 1;
} else {
j = k2;
}
}
return i - 1;
}
function findFirstMonotonous(array, predicate) {
const idx = findFirstIdxMonotonousOrArrLen(array, predicate);
return idx === array.length ? void 0 : array[idx];
}
function findFirstIdxMonotonousOrArrLen(array, predicate, startIdx = 0, endIdxEx = array.length) {
let i = startIdx;
let j = endIdxEx;
while (i < j) {
const k2 = Math.floor((i + j) / 2);
if (predicate(array[k2])) {
j = k2;
} else {
i = k2 + 1;
}
}
return i;
}
var MonotonousArray;
var init_arraysFind = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/arraysFind.js"() {
MonotonousArray = class _MonotonousArray {
static {
this.assertInvariants = false;
}
constructor(_array) {
this._array = _array;
this._findLastMonotonousLastIdx = 0;
}
/**
* The predicate must be monotonous, i.e. `arr.map(predicate)` must be like `[true, ..., true, false, ..., false]`!
* For subsequent calls, current predicate must be weaker than (or equal to) the previous predicate, i.e. more entries must be `true`.
*/
findLastMonotonous(predicate) {
if (_MonotonousArray.assertInvariants) {
if (this._prevFindLastPredicate) {
for (const item of this._array) {
if (this._prevFindLastPredicate(item) && !predicate(item)) {
throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.");
}
}
}
this._prevFindLastPredicate = predicate;
}
const idx = findLastIdxMonotonous(this._array, predicate, this._findLastMonotonousLastIdx);
this._findLastMonotonousLastIdx = idx + 1;
return idx === -1 ? void 0 : this._array[idx];
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/lineRange.js
var LineRange, LineRangeSet;
var init_lineRange = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/lineRange.js"() {
init_errors();
init_offsetRange();
init_range();
init_arraysFind();
LineRange = class _LineRange {
static fromRangeInclusive(range) {
return new _LineRange(range.startLineNumber, range.endLineNumber + 1);
}
/**
* @param lineRanges An array of sorted line ranges.
*/
static joinMany(lineRanges) {
if (lineRanges.length === 0) {
return [];
}
let result = new LineRangeSet(lineRanges[0].slice());
for (let i = 1; i < lineRanges.length; i++) {
result = result.getUnion(new LineRangeSet(lineRanges[i].slice()));
}
return result.ranges;
}
static join(lineRanges) {
if (lineRanges.length === 0) {
throw new BugIndicatingError("lineRanges cannot be empty");
}
let startLineNumber = lineRanges[0].startLineNumber;
let endLineNumberExclusive = lineRanges[0].endLineNumberExclusive;
for (let i = 1; i < lineRanges.length; i++) {
startLineNumber = Math.min(startLineNumber, lineRanges[i].startLineNumber);
endLineNumberExclusive = Math.max(endLineNumberExclusive, lineRanges[i].endLineNumberExclusive);
}
return new _LineRange(startLineNumber, endLineNumberExclusive);
}
static ofLength(startLineNumber, length) {
return new _LineRange(startLineNumber, startLineNumber + length);
}
/**
* @internal
*/
static deserialize(lineRange) {
return new _LineRange(lineRange[0], lineRange[1]);
}
constructor(startLineNumber, endLineNumberExclusive) {
if (startLineNumber > endLineNumberExclusive) {
throw new BugIndicatingError(`startLineNumber ${startLineNumber} cannot be after endLineNumberExclusive ${endLineNumberExclusive}`);
}
this.startLineNumber = startLineNumber;
this.endLineNumberExclusive = endLineNumberExclusive;
}
/**
* Indicates if this line range contains the given line number.
*/
contains(lineNumber) {
return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;
}
/**
* Indicates if this line range is empty.
*/
get isEmpty() {
return this.startLineNumber === this.endLineNumberExclusive;
}
/**
* Moves this line range by the given offset of line numbers.
*/
delta(offset) {
return new _LineRange(this.startLineNumber + offset, this.endLineNumberExclusive + offset);
}
deltaLength(offset) {
return new _LineRange(this.startLineNumber, this.endLineNumberExclusive + offset);
}
/**
* The number of lines this line range spans.
*/
get length() {
return this.endLineNumberExclusive - this.startLineNumber;
}
/**
* Creates a line range that combines this and the given line range.
*/
join(other) {
return new _LineRange(Math.min(this.startLineNumber, other.startLineNumber), Math.max(this.endLineNumberExclusive, other.endLineNumberExclusive));
}
toString() {
return `[${this.startLineNumber},${this.endLineNumberExclusive})`;
}
/**
* The resulting range is empty if the ranges do not intersect, but touch.
* If the ranges don't even touch, the result is undefined.
*/
intersect(other) {
const startLineNumber = Math.max(this.startLineNumber, other.startLineNumber);
const endLineNumberExclusive = Math.min(this.endLineNumberExclusive, other.endLineNumberExclusive);
if (startLineNumber <= endLineNumberExclusive) {
return new _LineRange(startLineNumber, endLineNumberExclusive);
}
return void 0;
}
intersectsStrict(other) {
return this.startLineNumber < other.endLineNumberExclusive && other.startLineNumber < this.endLineNumberExclusive;
}
overlapOrTouch(other) {
return this.startLineNumber <= other.endLineNumberExclusive && other.startLineNumber <= this.endLineNumberExclusive;
}
equals(b) {
return this.startLineNumber === b.startLineNumber && this.endLineNumberExclusive === b.endLineNumberExclusive;
}
toInclusiveRange() {
if (this.isEmpty) {
return null;
}
return new Range(this.startLineNumber, 1, this.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER);
}
/**
* @deprecated Using this function is discouraged because it might lead to bugs: The end position is not guaranteed to be a valid position!
*/
toExclusiveRange() {
return new Range(this.startLineNumber, 1, this.endLineNumberExclusive, 1);
}
mapToLineArray(f) {
const result = [];
for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {
result.push(f(lineNumber));
}
return result;
}
forEach(f) {
for (let lineNumber = this.startLineNumber; lineNumber < this.endLineNumberExclusive; lineNumber++) {
f(lineNumber);
}
}
/**
* @internal
*/
serialize() {
return [this.startLineNumber, this.endLineNumberExclusive];
}
includes(lineNumber) {
return this.startLineNumber <= lineNumber && lineNumber < this.endLineNumberExclusive;
}
/**
* Converts this 1-based line range to a 0-based offset range (subtracts 1!).
* @internal
*/
toOffsetRange() {
return new OffsetRange(this.startLineNumber - 1, this.endLineNumberExclusive - 1);
}
};
LineRangeSet = class _LineRangeSet {
constructor(_normalizedRanges = []) {
this._normalizedRanges = _normalizedRanges;
}
get ranges() {
return this._normalizedRanges;
}
addRange(range) {
if (range.length === 0) {
return;
}
const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber);
const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1;
if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
this._normalizedRanges.splice(joinRangeStartIdx, 0, range);
} else if (joinRangeStartIdx === joinRangeEndIdxExclusive - 1) {
const joinRange = this._normalizedRanges[joinRangeStartIdx];
this._normalizedRanges[joinRangeStartIdx] = joinRange.join(range);
} else {
const joinRange = this._normalizedRanges[joinRangeStartIdx].join(this._normalizedRanges[joinRangeEndIdxExclusive - 1]).join(range);
this._normalizedRanges.splice(joinRangeStartIdx, joinRangeEndIdxExclusive - joinRangeStartIdx, joinRange);
}
}
contains(lineNumber) {
const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= lineNumber);
return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > lineNumber;
}
intersects(range) {
const rangeThatStartsBeforeEnd = findLastMonotonous(this._normalizedRanges, (r) => r.startLineNumber < range.endLineNumberExclusive);
return !!rangeThatStartsBeforeEnd && rangeThatStartsBeforeEnd.endLineNumberExclusive > range.startLineNumber;
}
getUnion(other) {
if (this._normalizedRanges.length === 0) {
return other;
}
if (other._normalizedRanges.length === 0) {
return this;
}
const result = [];
let i1 = 0;
let i2 = 0;
let current = null;
while (i1 < this._normalizedRanges.length || i2 < other._normalizedRanges.length) {
let next = null;
if (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
const lineRange1 = this._normalizedRanges[i1];
const lineRange2 = other._normalizedRanges[i2];
if (lineRange1.startLineNumber < lineRange2.startLineNumber) {
next = lineRange1;
i1++;
} else {
next = lineRange2;
i2++;
}
} else if (i1 < this._normalizedRanges.length) {
next = this._normalizedRanges[i1];
i1++;
} else {
next = other._normalizedRanges[i2];
i2++;
}
if (current === null) {
current = next;
} else {
if (current.endLineNumberExclusive >= next.startLineNumber) {
current = new LineRange(current.startLineNumber, Math.max(current.endLineNumberExclusive, next.endLineNumberExclusive));
} else {
result.push(current);
current = next;
}
}
}
if (current !== null) {
result.push(current);
}
return new _LineRangeSet(result);
}
/**
* Subtracts all ranges in this set from `range` and returns the result.
*/
subtractFrom(range) {
const joinRangeStartIdx = findFirstIdxMonotonousOrArrLen(this._normalizedRanges, (r) => r.endLineNumberExclusive >= range.startLineNumber);
const joinRangeEndIdxExclusive = findLastIdxMonotonous(this._normalizedRanges, (r) => r.startLineNumber <= range.endLineNumberExclusive) + 1;
if (joinRangeStartIdx === joinRangeEndIdxExclusive) {
return new _LineRangeSet([range]);
}
const result = [];
let startLineNumber = range.startLineNumber;
for (let i = joinRangeStartIdx; i < joinRangeEndIdxExclusive; i++) {
const r = this._normalizedRanges[i];
if (r.startLineNumber > startLineNumber) {
result.push(new LineRange(startLineNumber, r.startLineNumber));
}
startLineNumber = r.endLineNumberExclusive;
}
if (startLineNumber < range.endLineNumberExclusive) {
result.push(new LineRange(startLineNumber, range.endLineNumberExclusive));
}
return new _LineRangeSet(result);
}
toString() {
return this._normalizedRanges.map((r) => r.toString()).join(", ");
}
getIntersection(other) {
const result = [];
let i1 = 0;
let i2 = 0;
while (i1 < this._normalizedRanges.length && i2 < other._normalizedRanges.length) {
const r1 = this._normalizedRanges[i1];
const r2 = other._normalizedRanges[i2];
const i = r1.intersect(r2);
if (i && !i.isEmpty) {
result.push(i);
}
if (r1.endLineNumberExclusive < r2.endLineNumberExclusive) {
i1++;
} else {
i2++;
}
}
return new _LineRangeSet(result);
}
getWithDelta(value) {
return new _LineRangeSet(this._normalizedRanges.map((r) => r.delta(value)));
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/textLength.js
var TextLength;
var init_textLength = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/textLength.js"() {
init_position();
init_range();
TextLength = class _TextLength {
static {
this.zero = new _TextLength(0, 0);
}
static betweenPositions(position1, position2) {
if (position1.lineNumber === position2.lineNumber) {
return new _TextLength(0, position2.column - position1.column);
} else {
return new _TextLength(position2.lineNumber - position1.lineNumber, position2.column - 1);
}
}
static ofRange(range) {
return _TextLength.betweenPositions(range.getStartPosition(), range.getEndPosition());
}
static ofText(text) {
let line = 0;
let column = 0;
for (const c of text) {
if (c === "\n") {
line++;
column = 0;
} else {
column++;
}
}
return new _TextLength(line, column);
}
constructor(lineCount, columnCount) {
this.lineCount = lineCount;
this.columnCount = columnCount;
}
isGreaterThanOrEqualTo(other) {
if (this.lineCount !== other.lineCount) {
return this.lineCount > other.lineCount;
}
return this.columnCount >= other.columnCount;
}
createRange(startPosition) {
if (this.lineCount === 0) {
return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber, startPosition.column + this.columnCount);
} else {
return new Range(startPosition.lineNumber, startPosition.column, startPosition.lineNumber + this.lineCount, this.columnCount + 1);
}
}
addToPosition(position) {
if (this.lineCount === 0) {
return new Position(position.lineNumber, position.column + this.columnCount);
} else {
return new Position(position.lineNumber + this.lineCount, this.columnCount + 1);
}
}
toString() {
return `${this.lineCount},${this.columnCount}`;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/positionToOffset.js
var init_positionToOffset = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/positionToOffset.js"() {
init_offsetRange();
init_textLength();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/textEdit.js
var SingleTextEdit;
var init_textEdit = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/core/textEdit.js"() {
init_assert();
init_errors();
init_position();
init_positionToOffset();
init_range();
init_textLength();
SingleTextEdit = class {
constructor(range, text) {
this.range = range;
this.text = text;
}
toSingleEditOperation() {
return {
range: this.range,
text: this.text
};
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/rangeMapping.js
function normalizePosition(position, content) {
if (position.lineNumber < 1) {
return new Position(1, 1);
}
if (position.lineNumber > content.length) {
return new Position(content.length, content[content.length - 1].length + 1);
}
const line = content[position.lineNumber - 1];
if (position.column > line.length + 1) {
return new Position(position.lineNumber, line.length + 1);
}
return position;
}
function isValidLineNumber(lineNumber, lines) {
return lineNumber >= 1 && lineNumber <= lines.length;
}
var LineRangeMapping, DetailedLineRangeMapping, RangeMapping;
var init_rangeMapping = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/rangeMapping.js"() {
init_errors();
init_lineRange();
init_position();
init_range();
init_textEdit();
LineRangeMapping = class _LineRangeMapping {
static inverse(mapping, originalLineCount, modifiedLineCount) {
const result = [];
let lastOriginalEndLineNumber = 1;
let lastModifiedEndLineNumber = 1;
for (const m of mapping) {
const r2 = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, m.original.startLineNumber), new LineRange(lastModifiedEndLineNumber, m.modified.startLineNumber));
if (!r2.modified.isEmpty) {
result.push(r2);
}
lastOriginalEndLineNumber = m.original.endLineNumberExclusive;
lastModifiedEndLineNumber = m.modified.endLineNumberExclusive;
}
const r = new _LineRangeMapping(new LineRange(lastOriginalEndLineNumber, originalLineCount + 1), new LineRange(lastModifiedEndLineNumber, modifiedLineCount + 1));
if (!r.modified.isEmpty) {
result.push(r);
}
return result;
}
static clip(mapping, originalRange, modifiedRange) {
const result = [];
for (const m of mapping) {
const original = m.original.intersect(originalRange);
const modified = m.modified.intersect(modifiedRange);
if (original && !original.isEmpty && modified && !modified.isEmpty) {
result.push(new _LineRangeMapping(original, modified));
}
}
return result;
}
constructor(originalRange, modifiedRange) {
this.original = originalRange;
this.modified = modifiedRange;
}
toString() {
return `{${this.original.toString()}->${this.modified.toString()}}`;
}
flip() {
return new _LineRangeMapping(this.modified, this.original);
}
join(other) {
return new _LineRangeMapping(this.original.join(other.original), this.modified.join(other.modified));
}
/**
* This method assumes that the LineRangeMapping describes a valid diff!
* I.e. if one range is empty, the other range cannot be the entire document.
* It avoids various problems when the line range points to non-existing line-numbers.
*/
toRangeMapping() {
const origInclusiveRange = this.original.toInclusiveRange();
const modInclusiveRange = this.modified.toInclusiveRange();
if (origInclusiveRange && modInclusiveRange) {
return new RangeMapping(origInclusiveRange, modInclusiveRange);
} else if (this.original.startLineNumber === 1 || this.modified.startLineNumber === 1) {
if (!(this.modified.startLineNumber === 1 && this.original.startLineNumber === 1)) {
throw new BugIndicatingError("not a valid diff");
}
return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
} else {
return new RangeMapping(new Range(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), new Range(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER, this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER));
}
}
/**
* This method assumes that the LineRangeMapping describes a valid diff!
* I.e. if one range is empty, the other range cannot be the entire document.
* It avoids various problems when the line range points to non-existing line-numbers.
*/
toRangeMapping2(original, modified) {
if (isValidLineNumber(this.original.endLineNumberExclusive, original) && isValidLineNumber(this.modified.endLineNumberExclusive, modified)) {
return new RangeMapping(new Range(this.original.startLineNumber, 1, this.original.endLineNumberExclusive, 1), new Range(this.modified.startLineNumber, 1, this.modified.endLineNumberExclusive, 1));
}
if (!this.original.isEmpty && !this.modified.isEmpty) {
return new RangeMapping(Range.fromPositions(new Position(this.original.startLineNumber, 1), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(new Position(this.modified.startLineNumber, 1), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
}
if (this.original.startLineNumber > 1 && this.modified.startLineNumber > 1) {
return new RangeMapping(Range.fromPositions(normalizePosition(new Position(this.original.startLineNumber - 1, Number.MAX_SAFE_INTEGER), original), normalizePosition(new Position(this.original.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), original)), Range.fromPositions(normalizePosition(new Position(this.modified.startLineNumber - 1, Number.MAX_SAFE_INTEGER), modified), normalizePosition(new Position(this.modified.endLineNumberExclusive - 1, Number.MAX_SAFE_INTEGER), modified)));
}
throw new BugIndicatingError();
}
};
DetailedLineRangeMapping = class _DetailedLineRangeMapping extends LineRangeMapping {
static fromRangeMappings(rangeMappings) {
const originalRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.originalRange)));
const modifiedRange = LineRange.join(rangeMappings.map((r) => LineRange.fromRangeInclusive(r.modifiedRange)));
return new _DetailedLineRangeMapping(originalRange, modifiedRange, rangeMappings);
}
constructor(originalRange, modifiedRange, innerChanges) {
super(originalRange, modifiedRange);
this.innerChanges = innerChanges;
}
flip() {
return new _DetailedLineRangeMapping(this.modified, this.original, this.innerChanges?.map((c) => c.flip()));
}
withInnerChangesFromLineRanges() {
return new _DetailedLineRangeMapping(this.original, this.modified, [this.toRangeMapping()]);
}
};
RangeMapping = class _RangeMapping {
static assertSorted(rangeMappings) {
for (let i = 1; i < rangeMappings.length; i++) {
const previous = rangeMappings[i - 1];
const current = rangeMappings[i];
if (!(previous.originalRange.getEndPosition().isBeforeOrEqual(current.originalRange.getStartPosition()) && previous.modifiedRange.getEndPosition().isBeforeOrEqual(current.modifiedRange.getStartPosition()))) {
throw new BugIndicatingError("Range mappings must be sorted");
}
}
}
constructor(originalRange, modifiedRange) {
this.originalRange = originalRange;
this.modifiedRange = modifiedRange;
}
toString() {
return `{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`;
}
flip() {
return new _RangeMapping(this.modifiedRange, this.originalRange);
}
/**
* Creates a single text edit that describes the change from the original to the modified text.
*/
toTextEdit(modified) {
const newText = modified.getValueOfRange(this.modifiedRange);
return new SingleTextEdit(this.originalRange, newText);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/legacyLinesDiffComputer.js
function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {
const diffAlgo = new LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate);
return diffAlgo.ComputeDiff(pretty);
}
function postProcessCharChanges(rawChanges) {
if (rawChanges.length <= 1) {
return rawChanges;
}
const result = [rawChanges[0]];
let prevChange = result[0];
for (let i = 1, len = rawChanges.length; i < len; i++) {
const currChange = rawChanges[i];
const originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);
const modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);
const matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);
if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {
prevChange.originalLength = currChange.originalStart + currChange.originalLength - prevChange.originalStart;
prevChange.modifiedLength = currChange.modifiedStart + currChange.modifiedLength - prevChange.modifiedStart;
} else {
result.push(currChange);
prevChange = currChange;
}
}
return result;
}
function getFirstNonBlankColumn(txt, defaultValue) {
const r = firstNonWhitespaceIndex(txt);
if (r === -1) {
return defaultValue;
}
return r + 1;
}
function getLastNonBlankColumn(txt, defaultValue) {
const r = lastNonWhitespaceIndex(txt);
if (r === -1) {
return defaultValue;
}
return r + 2;
}
function createContinueProcessingPredicate(maximumRuntime) {
if (maximumRuntime === 0) {
return () => true;
}
const startTime = Date.now();
return () => {
return Date.now() - startTime < maximumRuntime;
};
}
var MINIMUM_MATCHING_CHARACTER_LENGTH, LegacyLinesDiffComputer, LineSequence, CharSequence, CharChange, LineChange, DiffComputer;
var init_legacyLinesDiffComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/legacyLinesDiffComputer.js"() {
init_diff();
init_linesDiffComputer();
init_rangeMapping();
init_strings();
init_range();
init_assert();
init_lineRange();
MINIMUM_MATCHING_CHARACTER_LENGTH = 3;
LegacyLinesDiffComputer = class {
computeDiff(originalLines, modifiedLines, options) {
const diffComputer = new DiffComputer(originalLines, modifiedLines, {
maxComputationTime: options.maxComputationTimeMs,
shouldIgnoreTrimWhitespace: options.ignoreTrimWhitespace,
shouldComputeCharChanges: true,
shouldMakePrettyDiff: true,
shouldPostProcessCharChanges: true
});
const result = diffComputer.computeDiff();
const changes = [];
let lastChange = null;
for (const c of result.changes) {
let originalRange;
if (c.originalEndLineNumber === 0) {
originalRange = new LineRange(c.originalStartLineNumber + 1, c.originalStartLineNumber + 1);
} else {
originalRange = new LineRange(c.originalStartLineNumber, c.originalEndLineNumber + 1);
}
let modifiedRange;
if (c.modifiedEndLineNumber === 0) {
modifiedRange = new LineRange(c.modifiedStartLineNumber + 1, c.modifiedStartLineNumber + 1);
} else {
modifiedRange = new LineRange(c.modifiedStartLineNumber, c.modifiedEndLineNumber + 1);
}
let change = new DetailedLineRangeMapping(originalRange, modifiedRange, c.charChanges?.map((c2) => new RangeMapping(new Range(c2.originalStartLineNumber, c2.originalStartColumn, c2.originalEndLineNumber, c2.originalEndColumn), new Range(c2.modifiedStartLineNumber, c2.modifiedStartColumn, c2.modifiedEndLineNumber, c2.modifiedEndColumn))));
if (lastChange) {
if (lastChange.modified.endLineNumberExclusive === change.modified.startLineNumber || lastChange.original.endLineNumberExclusive === change.original.startLineNumber) {
change = new DetailedLineRangeMapping(lastChange.original.join(change.original), lastChange.modified.join(change.modified), lastChange.innerChanges && change.innerChanges ? lastChange.innerChanges.concat(change.innerChanges) : void 0);
changes.pop();
}
}
changes.push(change);
lastChange = change;
}
assertFn(() => {
return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);
});
return new LinesDiff(changes, [], result.quitEarly);
}
};
LineSequence = class {
constructor(lines) {
const startColumns = [];
const endColumns = [];
for (let i = 0, length = lines.length; i < length; i++) {
startColumns[i] = getFirstNonBlankColumn(lines[i], 1);
endColumns[i] = getLastNonBlankColumn(lines[i], 1);
}
this.lines = lines;
this._startColumns = startColumns;
this._endColumns = endColumns;
}
getElements() {
const elements = [];
for (let i = 0, len = this.lines.length; i < len; i++) {
elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
}
return elements;
}
getStrictElement(index) {
return this.lines[index];
}
getStartLineNumber(i) {
return i + 1;
}
getEndLineNumber(i) {
return i + 1;
}
createCharSequence(shouldIgnoreTrimWhitespace, startIndex, endIndex) {
const charCodes = [];
const lineNumbers = [];
const columns = [];
let len = 0;
for (let index = startIndex; index <= endIndex; index++) {
const lineContent = this.lines[index];
const startColumn = shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1;
const endColumn = shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1;
for (let col = startColumn; col < endColumn; col++) {
charCodes[len] = lineContent.charCodeAt(col - 1);
lineNumbers[len] = index + 1;
columns[len] = col;
len++;
}
if (!shouldIgnoreTrimWhitespace && index < endIndex) {
charCodes[len] = 10;
lineNumbers[len] = index + 1;
columns[len] = lineContent.length + 1;
len++;
}
}
return new CharSequence(charCodes, lineNumbers, columns);
}
};
CharSequence = class {
constructor(charCodes, lineNumbers, columns) {
this._charCodes = charCodes;
this._lineNumbers = lineNumbers;
this._columns = columns;
}
toString() {
return "[" + this._charCodes.map((s, idx) => (s === 10 ? "\\n" : String.fromCharCode(s)) + `-(${this._lineNumbers[idx]},${this._columns[idx]})`).join(", ") + "]";
}
_assertIndex(index, arr) {
if (index < 0 || index >= arr.length) {
throw new Error(`Illegal index`);
}
}
getElements() {
return this._charCodes;
}
getStartLineNumber(i) {
if (i > 0 && i === this._lineNumbers.length) {
return this.getEndLineNumber(i - 1);
}
this._assertIndex(i, this._lineNumbers);
return this._lineNumbers[i];
}
getEndLineNumber(i) {
if (i === -1) {
return this.getStartLineNumber(i + 1);
}
this._assertIndex(i, this._lineNumbers);
if (this._charCodes[i] === 10) {
return this._lineNumbers[i] + 1;
}
return this._lineNumbers[i];
}
getStartColumn(i) {
if (i > 0 && i === this._columns.length) {
return this.getEndColumn(i - 1);
}
this._assertIndex(i, this._columns);
return this._columns[i];
}
getEndColumn(i) {
if (i === -1) {
return this.getStartColumn(i + 1);
}
this._assertIndex(i, this._columns);
if (this._charCodes[i] === 10) {
return 1;
}
return this._columns[i] + 1;
}
};
CharChange = class _CharChange {
constructor(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {
this.originalStartLineNumber = originalStartLineNumber;
this.originalStartColumn = originalStartColumn;
this.originalEndLineNumber = originalEndLineNumber;
this.originalEndColumn = originalEndColumn;
this.modifiedStartLineNumber = modifiedStartLineNumber;
this.modifiedStartColumn = modifiedStartColumn;
this.modifiedEndLineNumber = modifiedEndLineNumber;
this.modifiedEndColumn = modifiedEndColumn;
}
static createFromDiffChange(diffChange, originalCharSequence, modifiedCharSequence) {
const originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);
const originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);
const originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
const originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);
const modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);
const modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);
const modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
const modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);
return new _CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);
}
};
LineChange = class _LineChange {
constructor(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {
this.originalStartLineNumber = originalStartLineNumber;
this.originalEndLineNumber = originalEndLineNumber;
this.modifiedStartLineNumber = modifiedStartLineNumber;
this.modifiedEndLineNumber = modifiedEndLineNumber;
this.charChanges = charChanges;
}
static createFromDiffResult(shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {
let originalStartLineNumber;
let originalEndLineNumber;
let modifiedStartLineNumber;
let modifiedEndLineNumber;
let charChanges = void 0;
if (diffChange.originalLength === 0) {
originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;
originalEndLineNumber = 0;
} else {
originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);
originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
}
if (diffChange.modifiedLength === 0) {
modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;
modifiedEndLineNumber = 0;
} else {
modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);
modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
}
if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {
const originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
const modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
if (originalCharSequence.getElements().length > 0 && modifiedCharSequence.getElements().length > 0) {
let rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;
if (shouldPostProcessCharChanges) {
rawChanges = postProcessCharChanges(rawChanges);
}
charChanges = [];
for (let i = 0, length = rawChanges.length; i < length; i++) {
charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));
}
}
}
return new _LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);
}
};
DiffComputer = class {
constructor(originalLines, modifiedLines, opts) {
this.shouldComputeCharChanges = opts.shouldComputeCharChanges;
this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;
this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;
this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;
this.originalLines = originalLines;
this.modifiedLines = modifiedLines;
this.original = new LineSequence(originalLines);
this.modified = new LineSequence(modifiedLines);
this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5e3));
}
computeDiff() {
if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
return {
quitEarly: false,
changes: []
};
}
return {
quitEarly: false,
changes: [{
originalStartLineNumber: 1,
originalEndLineNumber: 1,
modifiedStartLineNumber: 1,
modifiedEndLineNumber: this.modified.lines.length,
charChanges: void 0
}]
};
}
if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
return {
quitEarly: false,
changes: [{
originalStartLineNumber: 1,
originalEndLineNumber: this.original.lines.length,
modifiedStartLineNumber: 1,
modifiedEndLineNumber: 1,
charChanges: void 0
}]
};
}
const diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
const rawChanges = diffResult.changes;
const quitEarly = diffResult.quitEarly;
if (this.shouldIgnoreTrimWhitespace) {
const lineChanges = [];
for (let i = 0, length = rawChanges.length; i < length; i++) {
lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
}
return {
quitEarly,
changes: lineChanges
};
}
const result = [];
let originalLineIndex = 0;
let modifiedLineIndex = 0;
for (let i = -1, len = rawChanges.length; i < len; i++) {
const nextChange = i + 1 < len ? rawChanges[i + 1] : null;
const originalStop = nextChange ? nextChange.originalStart : this.originalLines.length;
const modifiedStop = nextChange ? nextChange.modifiedStart : this.modifiedLines.length;
while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
const originalLine = this.originalLines[originalLineIndex];
const modifiedLine = this.modifiedLines[modifiedLineIndex];
if (originalLine !== modifiedLine) {
{
let originalStartColumn = getFirstNonBlankColumn(originalLine, 1);
let modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);
while (originalStartColumn > 1 && modifiedStartColumn > 1) {
const originalChar = originalLine.charCodeAt(originalStartColumn - 2);
const modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);
if (originalChar !== modifiedChar) {
break;
}
originalStartColumn--;
modifiedStartColumn--;
}
if (originalStartColumn > 1 || modifiedStartColumn > 1) {
this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);
}
}
{
let originalEndColumn = getLastNonBlankColumn(originalLine, 1);
let modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);
const originalMaxColumn = originalLine.length + 1;
const modifiedMaxColumn = modifiedLine.length + 1;
while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {
const originalChar = originalLine.charCodeAt(originalEndColumn - 1);
const modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);
if (originalChar !== modifiedChar) {
break;
}
originalEndColumn++;
modifiedEndColumn++;
}
if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {
this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);
}
}
}
originalLineIndex++;
modifiedLineIndex++;
}
if (nextChange) {
result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
originalLineIndex += nextChange.originalLength;
modifiedLineIndex += nextChange.modifiedLength;
}
}
return {
quitEarly,
changes: result
};
}
_pushTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {
return;
}
let charChanges = void 0;
if (this.shouldComputeCharChanges) {
charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];
}
result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));
}
_mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
const len = result.length;
if (len === 0) {
return false;
}
const prevChange = result[len - 1];
if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {
return false;
}
if (prevChange.originalEndLineNumber === originalLineNumber && prevChange.modifiedEndLineNumber === modifiedLineNumber) {
if (this.shouldComputeCharChanges && prevChange.charChanges) {
prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
}
return true;
}
if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {
prevChange.originalEndLineNumber = originalLineNumber;
prevChange.modifiedEndLineNumber = modifiedLineNumber;
if (this.shouldComputeCharChanges && prevChange.charChanges) {
prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
}
return true;
}
return false;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/arrays.js
function equals2(one, other, itemEquals = (a, b) => a === b) {
if (one === other) {
return true;
}
if (!one || !other) {
return false;
}
if (one.length !== other.length) {
return false;
}
for (let i = 0, len = one.length; i < len; i++) {
if (!itemEquals(one[i], other[i])) {
return false;
}
}
return true;
}
function* groupAdjacentBy(items, shouldBeGrouped) {
let currentGroup;
let last;
for (const item of items) {
if (last !== void 0 && shouldBeGrouped(last, item)) {
currentGroup.push(item);
} else {
if (currentGroup) {
yield currentGroup;
}
currentGroup = [item];
}
last = item;
}
if (currentGroup) {
yield currentGroup;
}
}
function forEachAdjacent(arr, f) {
for (let i = 0; i <= arr.length; i++) {
f(i === 0 ? void 0 : arr[i - 1], i === arr.length ? void 0 : arr[i]);
}
}
function forEachWithNeighbors(arr, f) {
for (let i = 0; i < arr.length; i++) {
f(i === 0 ? void 0 : arr[i - 1], arr[i], i + 1 === arr.length ? void 0 : arr[i + 1]);
}
}
function pushMany(arr, items) {
for (const item of items) {
arr.push(item);
}
}
function compareBy(selector, comparator) {
return (a, b) => comparator(selector(a), selector(b));
}
function reverseOrder(comparator) {
return (a, b) => -comparator(a, b);
}
var CompareResult, numberComparator, CallbackIterable;
var init_arrays = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/arrays.js"() {
(function(CompareResult2) {
function isLessThan(result) {
return result < 0;
}
CompareResult2.isLessThan = isLessThan;
function isLessThanOrEqual(result) {
return result <= 0;
}
CompareResult2.isLessThanOrEqual = isLessThanOrEqual;
function isGreaterThan(result) {
return result > 0;
}
CompareResult2.isGreaterThan = isGreaterThan;
function isNeitherLessOrGreaterThan(result) {
return result === 0;
}
CompareResult2.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan;
CompareResult2.greaterThan = 1;
CompareResult2.lessThan = -1;
CompareResult2.neitherLessOrGreaterThan = 0;
})(CompareResult || (CompareResult = {}));
numberComparator = (a, b) => a - b;
CallbackIterable = class _CallbackIterable {
static {
this.empty = new _CallbackIterable((_callback) => {
});
}
constructor(iterate) {
this.iterate = iterate;
}
toArray() {
const result = [];
this.iterate((item) => {
result.push(item);
return true;
});
return result;
}
filter(predicate) {
return new _CallbackIterable((cb) => this.iterate((item) => predicate(item) ? cb(item) : true));
}
map(mapFn) {
return new _CallbackIterable((cb) => this.iterate((item) => cb(mapFn(item))));
}
findLast(predicate) {
let result;
this.iterate((item) => {
if (predicate(item)) {
result = item;
}
return true;
});
return result;
}
findLastMaxBy(comparator) {
let result;
let first = true;
this.iterate((item) => {
if (first || CompareResult.isGreaterThan(comparator(item, result))) {
first = false;
result = item;
}
return true;
});
return result;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js
var DiffAlgorithmResult, SequenceDiff, OffsetPair, InfiniteTimeout, DateTimeout;
var init_diffAlgorithm = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.js"() {
init_arrays();
init_errors();
init_offsetRange();
DiffAlgorithmResult = class _DiffAlgorithmResult {
static trivial(seq1, seq2) {
return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], false);
}
static trivialTimedOut(seq1, seq2) {
return new _DiffAlgorithmResult([new SequenceDiff(OffsetRange.ofLength(seq1.length), OffsetRange.ofLength(seq2.length))], true);
}
constructor(diffs, hitTimeout) {
this.diffs = diffs;
this.hitTimeout = hitTimeout;
}
};
SequenceDiff = class _SequenceDiff {
static invert(sequenceDiffs, doc1Length) {
const result = [];
forEachAdjacent(sequenceDiffs, (a, b) => {
result.push(_SequenceDiff.fromOffsetPairs(a ? a.getEndExclusives() : OffsetPair.zero, b ? b.getStarts() : new OffsetPair(doc1Length, (a ? a.seq2Range.endExclusive - a.seq1Range.endExclusive : 0) + doc1Length)));
});
return result;
}
static fromOffsetPairs(start, endExclusive) {
return new _SequenceDiff(new OffsetRange(start.offset1, endExclusive.offset1), new OffsetRange(start.offset2, endExclusive.offset2));
}
static assertSorted(sequenceDiffs) {
let last = void 0;
for (const cur of sequenceDiffs) {
if (last) {
if (!(last.seq1Range.endExclusive <= cur.seq1Range.start && last.seq2Range.endExclusive <= cur.seq2Range.start)) {
throw new BugIndicatingError("Sequence diffs must be sorted");
}
}
last = cur;
}
}
constructor(seq1Range, seq2Range) {
this.seq1Range = seq1Range;
this.seq2Range = seq2Range;
}
swap() {
return new _SequenceDiff(this.seq2Range, this.seq1Range);
}
toString() {
return `${this.seq1Range} <-> ${this.seq2Range}`;
}
join(other) {
return new _SequenceDiff(this.seq1Range.join(other.seq1Range), this.seq2Range.join(other.seq2Range));
}
delta(offset) {
if (offset === 0) {
return this;
}
return new _SequenceDiff(this.seq1Range.delta(offset), this.seq2Range.delta(offset));
}
deltaStart(offset) {
if (offset === 0) {
return this;
}
return new _SequenceDiff(this.seq1Range.deltaStart(offset), this.seq2Range.deltaStart(offset));
}
deltaEnd(offset) {
if (offset === 0) {
return this;
}
return new _SequenceDiff(this.seq1Range.deltaEnd(offset), this.seq2Range.deltaEnd(offset));
}
intersect(other) {
const i1 = this.seq1Range.intersect(other.seq1Range);
const i2 = this.seq2Range.intersect(other.seq2Range);
if (!i1 || !i2) {
return void 0;
}
return new _SequenceDiff(i1, i2);
}
getStarts() {
return new OffsetPair(this.seq1Range.start, this.seq2Range.start);
}
getEndExclusives() {
return new OffsetPair(this.seq1Range.endExclusive, this.seq2Range.endExclusive);
}
};
OffsetPair = class _OffsetPair {
static {
this.zero = new _OffsetPair(0, 0);
}
static {
this.max = new _OffsetPair(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER);
}
constructor(offset1, offset2) {
this.offset1 = offset1;
this.offset2 = offset2;
}
toString() {
return `${this.offset1} <-> ${this.offset2}`;
}
delta(offset) {
if (offset === 0) {
return this;
}
return new _OffsetPair(this.offset1 + offset, this.offset2 + offset);
}
equals(other) {
return this.offset1 === other.offset1 && this.offset2 === other.offset2;
}
};
InfiniteTimeout = class _InfiniteTimeout {
static {
this.instance = new _InfiniteTimeout();
}
isValid() {
return true;
}
};
DateTimeout = class {
constructor(timeout) {
this.timeout = timeout;
this.startTime = Date.now();
this.valid = true;
if (timeout <= 0) {
throw new BugIndicatingError("timeout must be positive");
}
}
// Recommendation: Set a log-point `{this.disable()}` in the body
isValid() {
const valid = Date.now() - this.startTime < this.timeout;
if (!valid && this.valid) {
this.valid = false;
debugger;
}
return this.valid;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js
function isSpace(charCode) {
return charCode === 32 || charCode === 9;
}
var Array2D, LineRangeFragment;
var init_utils = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/utils.js"() {
Array2D = class {
constructor(width, height) {
this.width = width;
this.height = height;
this.array = [];
this.array = new Array(width * height);
}
get(x2, y2) {
return this.array[x2 + y2 * this.width];
}
set(x2, y2, value) {
this.array[x2 + y2 * this.width] = value;
}
};
LineRangeFragment = class _LineRangeFragment {
static {
this.chrKeys = /* @__PURE__ */ new Map();
}
static getKey(chr) {
let key = this.chrKeys.get(chr);
if (key === void 0) {
key = this.chrKeys.size;
this.chrKeys.set(chr, key);
}
return key;
}
constructor(range, lines, source) {
this.range = range;
this.lines = lines;
this.source = source;
this.histogram = [];
let counter = 0;
for (let i = range.startLineNumber - 1; i < range.endLineNumberExclusive - 1; i++) {
const line = lines[i];
for (let j = 0; j < line.length; j++) {
counter++;
const chr = line[j];
const key2 = _LineRangeFragment.getKey(chr);
this.histogram[key2] = (this.histogram[key2] || 0) + 1;
}
counter++;
const key = _LineRangeFragment.getKey("\n");
this.histogram[key] = (this.histogram[key] || 0) + 1;
}
this.totalCount = counter;
}
computeSimilarity(other) {
let sumDifferences = 0;
const maxLength = Math.max(this.histogram.length, other.histogram.length);
for (let i = 0; i < maxLength; i++) {
sumDifferences += Math.abs((this.histogram[i] ?? 0) - (other.histogram[i] ?? 0));
}
return 1 - sumDifferences / (this.totalCount + other.totalCount);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js
var DynamicProgrammingDiffing;
var init_dynamicProgrammingDiffing = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.js"() {
init_offsetRange();
init_diffAlgorithm();
init_utils();
DynamicProgrammingDiffing = class {
compute(sequence1, sequence2, timeout = InfiniteTimeout.instance, equalityScore) {
if (sequence1.length === 0 || sequence2.length === 0) {
return DiffAlgorithmResult.trivial(sequence1, sequence2);
}
const lcsLengths = new Array2D(sequence1.length, sequence2.length);
const directions = new Array2D(sequence1.length, sequence2.length);
const lengths = new Array2D(sequence1.length, sequence2.length);
for (let s12 = 0; s12 < sequence1.length; s12++) {
for (let s22 = 0; s22 < sequence2.length; s22++) {
if (!timeout.isValid()) {
return DiffAlgorithmResult.trivialTimedOut(sequence1, sequence2);
}
const horizontalLen = s12 === 0 ? 0 : lcsLengths.get(s12 - 1, s22);
const verticalLen = s22 === 0 ? 0 : lcsLengths.get(s12, s22 - 1);
let extendedSeqScore;
if (sequence1.getElement(s12) === sequence2.getElement(s22)) {
if (s12 === 0 || s22 === 0) {
extendedSeqScore = 0;
} else {
extendedSeqScore = lcsLengths.get(s12 - 1, s22 - 1);
}
if (s12 > 0 && s22 > 0 && directions.get(s12 - 1, s22 - 1) === 3) {
extendedSeqScore += lengths.get(s12 - 1, s22 - 1);
}
extendedSeqScore += equalityScore ? equalityScore(s12, s22) : 1;
} else {
extendedSeqScore = -1;
}
const newValue = Math.max(horizontalLen, verticalLen, extendedSeqScore);
if (newValue === extendedSeqScore) {
const prevLen = s12 > 0 && s22 > 0 ? lengths.get(s12 - 1, s22 - 1) : 0;
lengths.set(s12, s22, prevLen + 1);
directions.set(s12, s22, 3);
} else if (newValue === horizontalLen) {
lengths.set(s12, s22, 0);
directions.set(s12, s22, 1);
} else if (newValue === verticalLen) {
lengths.set(s12, s22, 0);
directions.set(s12, s22, 2);
}
lcsLengths.set(s12, s22, newValue);
}
}
const result = [];
let lastAligningPosS1 = sequence1.length;
let lastAligningPosS2 = sequence2.length;
function reportDecreasingAligningPositions(s12, s22) {
if (s12 + 1 !== lastAligningPosS1 || s22 + 1 !== lastAligningPosS2) {
result.push(new SequenceDiff(new OffsetRange(s12 + 1, lastAligningPosS1), new OffsetRange(s22 + 1, lastAligningPosS2)));
}
lastAligningPosS1 = s12;
lastAligningPosS2 = s22;
}
let s1 = sequence1.length - 1;
let s2 = sequence2.length - 1;
while (s1 >= 0 && s2 >= 0) {
if (directions.get(s1, s2) === 3) {
reportDecreasingAligningPositions(s1, s2);
s1--;
s2--;
} else {
if (directions.get(s1, s2) === 1) {
s1--;
} else {
s2--;
}
}
}
reportDecreasingAligningPositions(-1, -1);
result.reverse();
return new DiffAlgorithmResult(result, false);
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js
var MyersDiffAlgorithm, SnakePath, FastInt32Array, FastArrayNegativeIndices;
var init_myersDiffAlgorithm = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.js"() {
init_offsetRange();
init_diffAlgorithm();
MyersDiffAlgorithm = class {
compute(seq1, seq2, timeout = InfiniteTimeout.instance) {
if (seq1.length === 0 || seq2.length === 0) {
return DiffAlgorithmResult.trivial(seq1, seq2);
}
const seqX = seq1;
const seqY = seq2;
function getXAfterSnake(x2, y2) {
while (x2 < seqX.length && y2 < seqY.length && seqX.getElement(x2) === seqY.getElement(y2)) {
x2++;
y2++;
}
return x2;
}
let d = 0;
const V2 = new FastInt32Array();
V2.set(0, getXAfterSnake(0, 0));
const paths = new FastArrayNegativeIndices();
paths.set(0, V2.get(0) === 0 ? null : new SnakePath(null, 0, 0, V2.get(0)));
let k2 = 0;
loop: while (true) {
d++;
if (!timeout.isValid()) {
return DiffAlgorithmResult.trivialTimedOut(seqX, seqY);
}
const lowerBound = -Math.min(d, seqY.length + d % 2);
const upperBound = Math.min(d, seqX.length + d % 2);
for (k2 = lowerBound; k2 <= upperBound; k2 += 2) {
let step = 0;
const maxXofDLineTop = k2 === upperBound ? -1 : V2.get(k2 + 1);
const maxXofDLineLeft = k2 === lowerBound ? -1 : V2.get(k2 - 1) + 1;
step++;
const x2 = Math.min(Math.max(maxXofDLineTop, maxXofDLineLeft), seqX.length);
const y2 = x2 - k2;
step++;
if (x2 > seqX.length || y2 > seqY.length) {
continue;
}
const newMaxX = getXAfterSnake(x2, y2);
V2.set(k2, newMaxX);
const lastPath = x2 === maxXofDLineTop ? paths.get(k2 + 1) : paths.get(k2 - 1);
paths.set(k2, newMaxX !== x2 ? new SnakePath(lastPath, x2, y2, newMaxX - x2) : lastPath);
if (V2.get(k2) === seqX.length && V2.get(k2) - k2 === seqY.length) {
break loop;
}
}
}
let path = paths.get(k2);
const result = [];
let lastAligningPosS1 = seqX.length;
let lastAligningPosS2 = seqY.length;
while (true) {
const endX = path ? path.x + path.length : 0;
const endY = path ? path.y + path.length : 0;
if (endX !== lastAligningPosS1 || endY !== lastAligningPosS2) {
result.push(new SequenceDiff(new OffsetRange(endX, lastAligningPosS1), new OffsetRange(endY, lastAligningPosS2)));
}
if (!path) {
break;
}
lastAligningPosS1 = path.x;
lastAligningPosS2 = path.y;
path = path.prev;
}
result.reverse();
return new DiffAlgorithmResult(result, false);
}
};
SnakePath = class {
constructor(prev, x2, y2, length) {
this.prev = prev;
this.x = x2;
this.y = y2;
this.length = length;
}
};
FastInt32Array = class {
constructor() {
this.positiveArr = new Int32Array(10);
this.negativeArr = new Int32Array(10);
}
get(idx) {
if (idx < 0) {
idx = -idx - 1;
return this.negativeArr[idx];
} else {
return this.positiveArr[idx];
}
}
set(idx, value) {
if (idx < 0) {
idx = -idx - 1;
if (idx >= this.negativeArr.length) {
const arr = this.negativeArr;
this.negativeArr = new Int32Array(arr.length * 2);
this.negativeArr.set(arr);
}
this.negativeArr[idx] = value;
} else {
if (idx >= this.positiveArr.length) {
const arr = this.positiveArr;
this.positiveArr = new Int32Array(arr.length * 2);
this.positiveArr.set(arr);
}
this.positiveArr[idx] = value;
}
}
};
FastArrayNegativeIndices = class {
constructor() {
this.positiveArr = [];
this.negativeArr = [];
}
get(idx) {
if (idx < 0) {
idx = -idx - 1;
return this.negativeArr[idx];
} else {
return this.positiveArr[idx];
}
}
set(idx, value) {
if (idx < 0) {
idx = -idx - 1;
this.negativeArr[idx] = value;
} else {
this.positiveArr[idx] = value;
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js
function isWordChar(charCode) {
return charCode >= 97 && charCode <= 122 || charCode >= 65 && charCode <= 90 || charCode >= 48 && charCode <= 57;
}
function getCategoryBoundaryScore(category) {
return score[category];
}
function getCategory(charCode) {
if (charCode === 10) {
return 8;
} else if (charCode === 13) {
return 7;
} else if (isSpace(charCode)) {
return 6;
} else if (charCode >= 97 && charCode <= 122) {
return 0;
} else if (charCode >= 65 && charCode <= 90) {
return 1;
} else if (charCode >= 48 && charCode <= 57) {
return 2;
} else if (charCode === -1) {
return 3;
} else if (charCode === 44 || charCode === 59) {
return 5;
} else {
return 4;
}
}
var LinesSliceCharSequence, score;
var init_linesSliceCharSequence = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.js"() {
init_arraysFind();
init_offsetRange();
init_position();
init_range();
init_utils();
LinesSliceCharSequence = class {
constructor(lines, range, considerWhitespaceChanges) {
this.lines = lines;
this.range = range;
this.considerWhitespaceChanges = considerWhitespaceChanges;
this.elements = [];
this.firstElementOffsetByLineIdx = [];
this.lineStartOffsets = [];
this.trimmedWsLengthsByLineIdx = [];
this.firstElementOffsetByLineIdx.push(0);
for (let lineNumber = this.range.startLineNumber; lineNumber <= this.range.endLineNumber; lineNumber++) {
let line = lines[lineNumber - 1];
let lineStartOffset = 0;
if (lineNumber === this.range.startLineNumber && this.range.startColumn > 1) {
lineStartOffset = this.range.startColumn - 1;
line = line.substring(lineStartOffset);
}
this.lineStartOffsets.push(lineStartOffset);
let trimmedWsLength = 0;
if (!considerWhitespaceChanges) {
const trimmedStartLine = line.trimStart();
trimmedWsLength = line.length - trimmedStartLine.length;
line = trimmedStartLine.trimEnd();
}
this.trimmedWsLengthsByLineIdx.push(trimmedWsLength);
const lineLength = lineNumber === this.range.endLineNumber ? Math.min(this.range.endColumn - 1 - lineStartOffset - trimmedWsLength, line.length) : line.length;
for (let i = 0; i < lineLength; i++) {
this.elements.push(line.charCodeAt(i));
}
if (lineNumber < this.range.endLineNumber) {
this.elements.push("\n".charCodeAt(0));
this.firstElementOffsetByLineIdx.push(this.elements.length);
}
}
}
toString() {
return `Slice: "${this.text}"`;
}
get text() {
return this.getText(new OffsetRange(0, this.length));
}
getText(range) {
return this.elements.slice(range.start, range.endExclusive).map((e) => String.fromCharCode(e)).join("");
}
getElement(offset) {
return this.elements[offset];
}
get length() {
return this.elements.length;
}
getBoundaryScore(length) {
const prevCategory = getCategory(length > 0 ? this.elements[length - 1] : -1);
const nextCategory = getCategory(length < this.elements.length ? this.elements[length] : -1);
if (prevCategory === 7 && nextCategory === 8) {
return 0;
}
if (prevCategory === 8) {
return 150;
}
let score2 = 0;
if (prevCategory !== nextCategory) {
score2 += 10;
if (prevCategory === 0 && nextCategory === 1) {
score2 += 1;
}
}
score2 += getCategoryBoundaryScore(prevCategory);
score2 += getCategoryBoundaryScore(nextCategory);
return score2;
}
translateOffset(offset, preference = "right") {
const i = findLastIdxMonotonous(this.firstElementOffsetByLineIdx, (value) => value <= offset);
const lineOffset = offset - this.firstElementOffsetByLineIdx[i];
return new Position(this.range.startLineNumber + i, 1 + this.lineStartOffsets[i] + lineOffset + (lineOffset === 0 && preference === "left" ? 0 : this.trimmedWsLengthsByLineIdx[i]));
}
translateRange(range) {
const pos1 = this.translateOffset(range.start, "right");
const pos2 = this.translateOffset(range.endExclusive, "left");
if (pos2.isBefore(pos1)) {
return Range.fromPositions(pos2, pos2);
}
return Range.fromPositions(pos1, pos2);
}
/**
* Finds the word that contains the character at the given offset
*/
findWordContaining(offset) {
if (offset < 0 || offset >= this.elements.length) {
return void 0;
}
if (!isWordChar(this.elements[offset])) {
return void 0;
}
let start = offset;
while (start > 0 && isWordChar(this.elements[start - 1])) {
start--;
}
let end = offset;
while (end < this.elements.length && isWordChar(this.elements[end])) {
end++;
}
return new OffsetRange(start, end);
}
countLinesIn(range) {
return this.translateOffset(range.endExclusive).lineNumber - this.translateOffset(range.start).lineNumber;
}
isStronglyEqual(offset1, offset2) {
return this.elements[offset1] === this.elements[offset2];
}
extendToFullLines(range) {
const start = findLastMonotonous(this.firstElementOffsetByLineIdx, (x2) => x2 <= range.start) ?? 0;
const end = findFirstMonotonous(this.firstElementOffsetByLineIdx, (x2) => range.endExclusive <= x2) ?? this.elements.length;
return new OffsetRange(start, end);
}
};
score = {
[
0
/* CharBoundaryCategory.WordLower */
]: 0,
[
1
/* CharBoundaryCategory.WordUpper */
]: 0,
[
2
/* CharBoundaryCategory.WordNumber */
]: 0,
[
3
/* CharBoundaryCategory.End */
]: 10,
[
4
/* CharBoundaryCategory.Other */
]: 2,
[
5
/* CharBoundaryCategory.Separator */
]: 30,
[
6
/* CharBoundaryCategory.Space */
]: 3,
[
7
/* CharBoundaryCategory.LineBreakCR */
]: 10,
[
8
/* CharBoundaryCategory.LineBreakLF */
]: 10
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js
function computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout) {
let { moves, excludedChanges } = computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout);
if (!timeout.isValid()) {
return [];
}
const filteredChanges = changes.filter((c) => !excludedChanges.has(c));
const unchangedMoves = computeUnchangedMoves(filteredChanges, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout);
pushMany(moves, unchangedMoves);
moves = joinCloseConsecutiveMoves(moves);
moves = moves.filter((current) => {
const lines = current.original.toOffsetRange().slice(originalLines).map((l) => l.trim());
const originalText = lines.join("\n");
return originalText.length >= 15 && countWhere(lines, (l) => l.length >= 2) >= 2;
});
moves = removeMovesInSameDiff(changes, moves);
return moves;
}
function countWhere(arr, predicate) {
let count = 0;
for (const t of arr) {
if (predicate(t)) {
count++;
}
}
return count;
}
function computeMovesFromSimpleDeletionsToSimpleInsertions(changes, originalLines, modifiedLines, timeout) {
const moves = [];
const deletions = changes.filter((c) => c.modified.isEmpty && c.original.length >= 3).map((d) => new LineRangeFragment(d.original, originalLines, d));
const insertions = new Set(changes.filter((c) => c.original.isEmpty && c.modified.length >= 3).map((d) => new LineRangeFragment(d.modified, modifiedLines, d)));
const excludedChanges = /* @__PURE__ */ new Set();
for (const deletion of deletions) {
let highestSimilarity = -1;
let best;
for (const insertion of insertions) {
const similarity = deletion.computeSimilarity(insertion);
if (similarity > highestSimilarity) {
highestSimilarity = similarity;
best = insertion;
}
}
if (highestSimilarity > 0.9 && best) {
insertions.delete(best);
moves.push(new LineRangeMapping(deletion.range, best.range));
excludedChanges.add(deletion.source);
excludedChanges.add(best.source);
}
if (!timeout.isValid()) {
return { moves, excludedChanges };
}
}
return { moves, excludedChanges };
}
function computeUnchangedMoves(changes, hashedOriginalLines, hashedModifiedLines, originalLines, modifiedLines, timeout) {
const moves = [];
const original3LineHashes = new SetMap();
for (const change of changes) {
for (let i = change.original.startLineNumber; i < change.original.endLineNumberExclusive - 2; i++) {
const key = `${hashedOriginalLines[i - 1]}:${hashedOriginalLines[i + 1 - 1]}:${hashedOriginalLines[i + 2 - 1]}`;
original3LineHashes.add(key, { range: new LineRange(i, i + 3) });
}
}
const possibleMappings = [];
changes.sort(compareBy((c) => c.modified.startLineNumber, numberComparator));
for (const change of changes) {
let lastMappings = [];
for (let i = change.modified.startLineNumber; i < change.modified.endLineNumberExclusive - 2; i++) {
const key = `${hashedModifiedLines[i - 1]}:${hashedModifiedLines[i + 1 - 1]}:${hashedModifiedLines[i + 2 - 1]}`;
const currentModifiedRange = new LineRange(i, i + 3);
const nextMappings = [];
original3LineHashes.forEach(key, ({ range }) => {
for (const lastMapping of lastMappings) {
if (lastMapping.originalLineRange.endLineNumberExclusive + 1 === range.endLineNumberExclusive && lastMapping.modifiedLineRange.endLineNumberExclusive + 1 === currentModifiedRange.endLineNumberExclusive) {
lastMapping.originalLineRange = new LineRange(lastMapping.originalLineRange.startLineNumber, range.endLineNumberExclusive);
lastMapping.modifiedLineRange = new LineRange(lastMapping.modifiedLineRange.startLineNumber, currentModifiedRange.endLineNumberExclusive);
nextMappings.push(lastMapping);
return;
}
}
const mapping = {
modifiedLineRange: currentModifiedRange,
originalLineRange: range
};
possibleMappings.push(mapping);
nextMappings.push(mapping);
});
lastMappings = nextMappings;
}
if (!timeout.isValid()) {
return [];
}
}
possibleMappings.sort(reverseOrder(compareBy((m) => m.modifiedLineRange.length, numberComparator)));
const modifiedSet = new LineRangeSet();
const originalSet = new LineRangeSet();
for (const mapping of possibleMappings) {
const diffOrigToMod = mapping.modifiedLineRange.startLineNumber - mapping.originalLineRange.startLineNumber;
const modifiedSections = modifiedSet.subtractFrom(mapping.modifiedLineRange);
const originalTranslatedSections = originalSet.subtractFrom(mapping.originalLineRange).getWithDelta(diffOrigToMod);
const modifiedIntersectedSections = modifiedSections.getIntersection(originalTranslatedSections);
for (const s of modifiedIntersectedSections.ranges) {
if (s.length < 3) {
continue;
}
const modifiedLineRange = s;
const originalLineRange = s.delta(-diffOrigToMod);
moves.push(new LineRangeMapping(originalLineRange, modifiedLineRange));
modifiedSet.addRange(modifiedLineRange);
originalSet.addRange(originalLineRange);
}
}
moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator));
const monotonousChanges = new MonotonousArray(changes);
for (let i = 0; i < moves.length; i++) {
const move = moves[i];
const firstTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber <= move.original.startLineNumber);
const firstTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber <= move.modified.startLineNumber);
const linesAbove = Math.max(move.original.startLineNumber - firstTouchingChangeOrig.original.startLineNumber, move.modified.startLineNumber - firstTouchingChangeMod.modified.startLineNumber);
const lastTouchingChangeOrig = monotonousChanges.findLastMonotonous((c) => c.original.startLineNumber < move.original.endLineNumberExclusive);
const lastTouchingChangeMod = findLastMonotonous(changes, (c) => c.modified.startLineNumber < move.modified.endLineNumberExclusive);
const linesBelow = Math.max(lastTouchingChangeOrig.original.endLineNumberExclusive - move.original.endLineNumberExclusive, lastTouchingChangeMod.modified.endLineNumberExclusive - move.modified.endLineNumberExclusive);
let extendToTop;
for (extendToTop = 0; extendToTop < linesAbove; extendToTop++) {
const origLine = move.original.startLineNumber - extendToTop - 1;
const modLine = move.modified.startLineNumber - extendToTop - 1;
if (origLine > originalLines.length || modLine > modifiedLines.length) {
break;
}
if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {
break;
}
if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {
break;
}
}
if (extendToTop > 0) {
originalSet.addRange(new LineRange(move.original.startLineNumber - extendToTop, move.original.startLineNumber));
modifiedSet.addRange(new LineRange(move.modified.startLineNumber - extendToTop, move.modified.startLineNumber));
}
let extendToBottom;
for (extendToBottom = 0; extendToBottom < linesBelow; extendToBottom++) {
const origLine = move.original.endLineNumberExclusive + extendToBottom;
const modLine = move.modified.endLineNumberExclusive + extendToBottom;
if (origLine > originalLines.length || modLine > modifiedLines.length) {
break;
}
if (modifiedSet.contains(modLine) || originalSet.contains(origLine)) {
break;
}
if (!areLinesSimilar(originalLines[origLine - 1], modifiedLines[modLine - 1], timeout)) {
break;
}
}
if (extendToBottom > 0) {
originalSet.addRange(new LineRange(move.original.endLineNumberExclusive, move.original.endLineNumberExclusive + extendToBottom));
modifiedSet.addRange(new LineRange(move.modified.endLineNumberExclusive, move.modified.endLineNumberExclusive + extendToBottom));
}
if (extendToTop > 0 || extendToBottom > 0) {
moves[i] = new LineRangeMapping(new LineRange(move.original.startLineNumber - extendToTop, move.original.endLineNumberExclusive + extendToBottom), new LineRange(move.modified.startLineNumber - extendToTop, move.modified.endLineNumberExclusive + extendToBottom));
}
}
return moves;
}
function areLinesSimilar(line1, line2, timeout) {
if (line1.trim() === line2.trim()) {
return true;
}
if (line1.length > 300 && line2.length > 300) {
return false;
}
const myersDiffingAlgorithm = new MyersDiffAlgorithm();
const result = myersDiffingAlgorithm.compute(new LinesSliceCharSequence([line1], new Range(1, 1, 1, line1.length), false), new LinesSliceCharSequence([line2], new Range(1, 1, 1, line2.length), false), timeout);
let commonNonSpaceCharCount = 0;
const inverted = SequenceDiff.invert(result.diffs, line1.length);
for (const seq of inverted) {
seq.seq1Range.forEach((idx) => {
if (!isSpace(line1.charCodeAt(idx))) {
commonNonSpaceCharCount++;
}
});
}
function countNonWsChars(str) {
let count = 0;
for (let i = 0; i < line1.length; i++) {
if (!isSpace(str.charCodeAt(i))) {
count++;
}
}
return count;
}
const longerLineLength = countNonWsChars(line1.length > line2.length ? line1 : line2);
const r = commonNonSpaceCharCount / longerLineLength > 0.6 && longerLineLength > 10;
return r;
}
function joinCloseConsecutiveMoves(moves) {
if (moves.length === 0) {
return moves;
}
moves.sort(compareBy((m) => m.original.startLineNumber, numberComparator));
const result = [moves[0]];
for (let i = 1; i < moves.length; i++) {
const last = result[result.length - 1];
const current = moves[i];
const originalDist = current.original.startLineNumber - last.original.endLineNumberExclusive;
const modifiedDist = current.modified.startLineNumber - last.modified.endLineNumberExclusive;
const currentMoveAfterLast = originalDist >= 0 && modifiedDist >= 0;
if (currentMoveAfterLast && originalDist + modifiedDist <= 2) {
result[result.length - 1] = last.join(current);
continue;
}
result.push(current);
}
return result;
}
function removeMovesInSameDiff(changes, moves) {
const changesMonotonous = new MonotonousArray(changes);
moves = moves.filter((m) => {
const diffBeforeEndOfMoveOriginal = changesMonotonous.findLastMonotonous((c) => c.original.startLineNumber < m.original.endLineNumberExclusive) || new LineRangeMapping(new LineRange(1, 1), new LineRange(1, 1));
const diffBeforeEndOfMoveModified = findLastMonotonous(changes, (c) => c.modified.startLineNumber < m.modified.endLineNumberExclusive);
const differentDiffs = diffBeforeEndOfMoveOriginal !== diffBeforeEndOfMoveModified;
return differentDiffs;
});
return moves;
}
var init_computeMovedLines = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.js"() {
init_diffAlgorithm();
init_rangeMapping();
init_arrays();
init_arraysFind();
init_map();
init_lineRange();
init_linesSliceCharSequence();
init_utils();
init_myersDiffAlgorithm();
init_range();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js
function optimizeSequenceDiffs(sequence1, sequence2, sequenceDiffs) {
let result = sequenceDiffs;
result = joinSequenceDiffsByShifting(sequence1, sequence2, result);
result = joinSequenceDiffsByShifting(sequence1, sequence2, result);
result = shiftSequenceDiffs(sequence1, sequence2, result);
return result;
}
function joinSequenceDiffsByShifting(sequence1, sequence2, sequenceDiffs) {
if (sequenceDiffs.length === 0) {
return sequenceDiffs;
}
const result = [];
result.push(sequenceDiffs[0]);
for (let i = 1; i < sequenceDiffs.length; i++) {
const prevResult = result[result.length - 1];
let cur = sequenceDiffs[i];
if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {
const length = cur.seq1Range.start - prevResult.seq1Range.endExclusive;
let d;
for (d = 1; d <= length; d++) {
if (sequence1.getElement(cur.seq1Range.start - d) !== sequence1.getElement(cur.seq1Range.endExclusive - d) || sequence2.getElement(cur.seq2Range.start - d) !== sequence2.getElement(cur.seq2Range.endExclusive - d)) {
break;
}
}
d--;
if (d === length) {
result[result.length - 1] = new SequenceDiff(new OffsetRange(prevResult.seq1Range.start, cur.seq1Range.endExclusive - length), new OffsetRange(prevResult.seq2Range.start, cur.seq2Range.endExclusive - length));
continue;
}
cur = cur.delta(-d);
}
result.push(cur);
}
const result2 = [];
for (let i = 0; i < result.length - 1; i++) {
const nextResult = result[i + 1];
let cur = result[i];
if (cur.seq1Range.isEmpty || cur.seq2Range.isEmpty) {
const length = nextResult.seq1Range.start - cur.seq1Range.endExclusive;
let d;
for (d = 0; d < length; d++) {
if (!sequence1.isStronglyEqual(cur.seq1Range.start + d, cur.seq1Range.endExclusive + d) || !sequence2.isStronglyEqual(cur.seq2Range.start + d, cur.seq2Range.endExclusive + d)) {
break;
}
}
if (d === length) {
result[i + 1] = new SequenceDiff(new OffsetRange(cur.seq1Range.start + length, nextResult.seq1Range.endExclusive), new OffsetRange(cur.seq2Range.start + length, nextResult.seq2Range.endExclusive));
continue;
}
if (d > 0) {
cur = cur.delta(d);
}
}
result2.push(cur);
}
if (result.length > 0) {
result2.push(result[result.length - 1]);
}
return result2;
}
function shiftSequenceDiffs(sequence1, sequence2, sequenceDiffs) {
if (!sequence1.getBoundaryScore || !sequence2.getBoundaryScore) {
return sequenceDiffs;
}
for (let i = 0; i < sequenceDiffs.length; i++) {
const prevDiff = i > 0 ? sequenceDiffs[i - 1] : void 0;
const diff2 = sequenceDiffs[i];
const nextDiff = i + 1 < sequenceDiffs.length ? sequenceDiffs[i + 1] : void 0;
const seq1ValidRange = new OffsetRange(prevDiff ? prevDiff.seq1Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq1Range.start - 1 : sequence1.length);
const seq2ValidRange = new OffsetRange(prevDiff ? prevDiff.seq2Range.endExclusive + 1 : 0, nextDiff ? nextDiff.seq2Range.start - 1 : sequence2.length);
if (diff2.seq1Range.isEmpty) {
sequenceDiffs[i] = shiftDiffToBetterPosition(diff2, sequence1, sequence2, seq1ValidRange, seq2ValidRange);
} else if (diff2.seq2Range.isEmpty) {
sequenceDiffs[i] = shiftDiffToBetterPosition(diff2.swap(), sequence2, sequence1, seq2ValidRange, seq1ValidRange).swap();
}
}
return sequenceDiffs;
}
function shiftDiffToBetterPosition(diff2, sequence1, sequence2, seq1ValidRange, seq2ValidRange) {
const maxShiftLimit = 100;
let deltaBefore = 1;
while (diff2.seq1Range.start - deltaBefore >= seq1ValidRange.start && diff2.seq2Range.start - deltaBefore >= seq2ValidRange.start && sequence2.isStronglyEqual(diff2.seq2Range.start - deltaBefore, diff2.seq2Range.endExclusive - deltaBefore) && deltaBefore < maxShiftLimit) {
deltaBefore++;
}
deltaBefore--;
let deltaAfter = 0;
while (diff2.seq1Range.start + deltaAfter < seq1ValidRange.endExclusive && diff2.seq2Range.endExclusive + deltaAfter < seq2ValidRange.endExclusive && sequence2.isStronglyEqual(diff2.seq2Range.start + deltaAfter, diff2.seq2Range.endExclusive + deltaAfter) && deltaAfter < maxShiftLimit) {
deltaAfter++;
}
if (deltaBefore === 0 && deltaAfter === 0) {
return diff2;
}
let bestDelta = 0;
let bestScore = -1;
for (let delta = -deltaBefore; delta <= deltaAfter; delta++) {
const seq2OffsetStart = diff2.seq2Range.start + delta;
const seq2OffsetEndExclusive = diff2.seq2Range.endExclusive + delta;
const seq1Offset = diff2.seq1Range.start + delta;
const score2 = sequence1.getBoundaryScore(seq1Offset) + sequence2.getBoundaryScore(seq2OffsetStart) + sequence2.getBoundaryScore(seq2OffsetEndExclusive);
if (score2 > bestScore) {
bestScore = score2;
bestDelta = delta;
}
}
return diff2.delta(bestDelta);
}
function removeShortMatches(sequence1, sequence2, sequenceDiffs) {
const result = [];
for (const s of sequenceDiffs) {
const last = result[result.length - 1];
if (!last) {
result.push(s);
continue;
}
if (s.seq1Range.start - last.seq1Range.endExclusive <= 2 || s.seq2Range.start - last.seq2Range.endExclusive <= 2) {
result[result.length - 1] = new SequenceDiff(last.seq1Range.join(s.seq1Range), last.seq2Range.join(s.seq2Range));
} else {
result.push(s);
}
}
return result;
}
function extendDiffsToEntireWordIfAppropriate(sequence1, sequence2, sequenceDiffs) {
const equalMappings = SequenceDiff.invert(sequenceDiffs, sequence1.length);
const additional = [];
let lastPoint = new OffsetPair(0, 0);
function scanWord(pair, equalMapping) {
if (pair.offset1 < lastPoint.offset1 || pair.offset2 < lastPoint.offset2) {
return;
}
const w1 = sequence1.findWordContaining(pair.offset1);
const w2 = sequence2.findWordContaining(pair.offset2);
if (!w1 || !w2) {
return;
}
let w3 = new SequenceDiff(w1, w2);
const equalPart = w3.intersect(equalMapping);
let equalChars1 = equalPart.seq1Range.length;
let equalChars2 = equalPart.seq2Range.length;
while (equalMappings.length > 0) {
const next = equalMappings[0];
const intersects = next.seq1Range.intersects(w3.seq1Range) || next.seq2Range.intersects(w3.seq2Range);
if (!intersects) {
break;
}
const v1 = sequence1.findWordContaining(next.seq1Range.start);
const v2 = sequence2.findWordContaining(next.seq2Range.start);
const v = new SequenceDiff(v1, v2);
const equalPart2 = v.intersect(next);
equalChars1 += equalPart2.seq1Range.length;
equalChars2 += equalPart2.seq2Range.length;
w3 = w3.join(v);
if (w3.seq1Range.endExclusive >= next.seq1Range.endExclusive) {
equalMappings.shift();
} else {
break;
}
}
if (equalChars1 + equalChars2 < (w3.seq1Range.length + w3.seq2Range.length) * 2 / 3) {
additional.push(w3);
}
lastPoint = w3.getEndExclusives();
}
while (equalMappings.length > 0) {
const next = equalMappings.shift();
if (next.seq1Range.isEmpty) {
continue;
}
scanWord(next.getStarts(), next);
scanWord(next.getEndExclusives().delta(-1), next);
}
const merged = mergeSequenceDiffs(sequenceDiffs, additional);
return merged;
}
function mergeSequenceDiffs(sequenceDiffs1, sequenceDiffs2) {
const result = [];
while (sequenceDiffs1.length > 0 || sequenceDiffs2.length > 0) {
const sd1 = sequenceDiffs1[0];
const sd2 = sequenceDiffs2[0];
let next;
if (sd1 && (!sd2 || sd1.seq1Range.start < sd2.seq1Range.start)) {
next = sequenceDiffs1.shift();
} else {
next = sequenceDiffs2.shift();
}
if (result.length > 0 && result[result.length - 1].seq1Range.endExclusive >= next.seq1Range.start) {
result[result.length - 1] = result[result.length - 1].join(next);
} else {
result.push(next);
}
}
return result;
}
function removeVeryShortMatchingLinesBetweenDiffs(sequence1, _sequence2, sequenceDiffs) {
let diffs = sequenceDiffs;
if (diffs.length === 0) {
return diffs;
}
let counter = 0;
let shouldRepeat;
do {
shouldRepeat = false;
const result = [
diffs[0]
];
for (let i = 1; i < diffs.length; i++) {
let shouldJoinDiffs = function(before, after) {
const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);
const unchangedText = sequence1.getText(unchangedRange);
const unchangedTextWithoutWs = unchangedText.replace(/\s/g, "");
if (unchangedTextWithoutWs.length <= 4 && (before.seq1Range.length + before.seq2Range.length > 5 || after.seq1Range.length + after.seq2Range.length > 5)) {
return true;
}
return false;
};
const cur = diffs[i];
const lastResult = result[result.length - 1];
const shouldJoin = shouldJoinDiffs(lastResult, cur);
if (shouldJoin) {
shouldRepeat = true;
result[result.length - 1] = result[result.length - 1].join(cur);
} else {
result.push(cur);
}
}
diffs = result;
} while (counter++ < 10 && shouldRepeat);
return diffs;
}
function removeVeryShortMatchingTextBetweenLongDiffs(sequence1, sequence2, sequenceDiffs) {
let diffs = sequenceDiffs;
if (diffs.length === 0) {
return diffs;
}
let counter = 0;
let shouldRepeat;
do {
shouldRepeat = false;
const result = [
diffs[0]
];
for (let i = 1; i < diffs.length; i++) {
let shouldJoinDiffs = function(before, after) {
const unchangedRange = new OffsetRange(lastResult.seq1Range.endExclusive, cur.seq1Range.start);
const unchangedLineCount = sequence1.countLinesIn(unchangedRange);
if (unchangedLineCount > 5 || unchangedRange.length > 500) {
return false;
}
const unchangedText = sequence1.getText(unchangedRange).trim();
if (unchangedText.length > 20 || unchangedText.split(/\r\n|\r|\n/).length > 1) {
return false;
}
const beforeLineCount1 = sequence1.countLinesIn(before.seq1Range);
const beforeSeq1Length = before.seq1Range.length;
const beforeLineCount2 = sequence2.countLinesIn(before.seq2Range);
const beforeSeq2Length = before.seq2Range.length;
const afterLineCount1 = sequence1.countLinesIn(after.seq1Range);
const afterSeq1Length = after.seq1Range.length;
const afterLineCount2 = sequence2.countLinesIn(after.seq2Range);
const afterSeq2Length = after.seq2Range.length;
const max = 2 * 40 + 50;
function cap(v) {
return Math.min(v, max);
}
if (Math.pow(Math.pow(cap(beforeLineCount1 * 40 + beforeSeq1Length), 1.5) + Math.pow(cap(beforeLineCount2 * 40 + beforeSeq2Length), 1.5), 1.5) + Math.pow(Math.pow(cap(afterLineCount1 * 40 + afterSeq1Length), 1.5) + Math.pow(cap(afterLineCount2 * 40 + afterSeq2Length), 1.5), 1.5) > (max ** 1.5) ** 1.5 * 1.3) {
return true;
}
return false;
};
const cur = diffs[i];
const lastResult = result[result.length - 1];
const shouldJoin = shouldJoinDiffs(lastResult, cur);
if (shouldJoin) {
shouldRepeat = true;
result[result.length - 1] = result[result.length - 1].join(cur);
} else {
result.push(cur);
}
}
diffs = result;
} while (counter++ < 10 && shouldRepeat);
const newDiffs = [];
forEachWithNeighbors(diffs, (prev, cur, next) => {
let newDiff = cur;
function shouldMarkAsChanged(text) {
return text.length > 0 && text.trim().length <= 3 && cur.seq1Range.length + cur.seq2Range.length > 100;
}
const fullRange1 = sequence1.extendToFullLines(cur.seq1Range);
const prefix = sequence1.getText(new OffsetRange(fullRange1.start, cur.seq1Range.start));
if (shouldMarkAsChanged(prefix)) {
newDiff = newDiff.deltaStart(-prefix.length);
}
const suffix = sequence1.getText(new OffsetRange(cur.seq1Range.endExclusive, fullRange1.endExclusive));
if (shouldMarkAsChanged(suffix)) {
newDiff = newDiff.deltaEnd(suffix.length);
}
const availableSpace = SequenceDiff.fromOffsetPairs(prev ? prev.getEndExclusives() : OffsetPair.zero, next ? next.getStarts() : OffsetPair.max);
const result = newDiff.intersect(availableSpace);
if (newDiffs.length > 0 && result.getStarts().equals(newDiffs[newDiffs.length - 1].getEndExclusives())) {
newDiffs[newDiffs.length - 1] = newDiffs[newDiffs.length - 1].join(result);
} else {
newDiffs.push(result);
}
});
return newDiffs;
}
var init_heuristicSequenceOptimizations = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.js"() {
init_arrays();
init_offsetRange();
init_diffAlgorithm();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js
function getIndentation(str) {
let i = 0;
while (i < str.length && (str.charCodeAt(i) === 32 || str.charCodeAt(i) === 9)) {
i++;
}
return i;
}
var LineSequence2;
var init_lineSequence = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.js"() {
LineSequence2 = class {
constructor(trimmedHash, lines) {
this.trimmedHash = trimmedHash;
this.lines = lines;
}
getElement(offset) {
return this.trimmedHash[offset];
}
get length() {
return this.trimmedHash.length;
}
getBoundaryScore(length) {
const indentationBefore = length === 0 ? 0 : getIndentation(this.lines[length - 1]);
const indentationAfter = length === this.lines.length ? 0 : getIndentation(this.lines[length]);
return 1e3 - (indentationBefore + indentationAfter);
}
getText(range) {
return this.lines.slice(range.start, range.endExclusive).join("\n");
}
isStronglyEqual(offset1, offset2) {
return this.lines[offset1] === this.lines[offset2];
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js
function lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines, dontAssertStartLine = false) {
const changes = [];
for (const g of groupAdjacentBy(alignments.map((a) => getLineRangeMapping(a, originalLines, modifiedLines)), (a1, a2) => a1.original.overlapOrTouch(a2.original) || a1.modified.overlapOrTouch(a2.modified))) {
const first = g[0];
const last = g[g.length - 1];
changes.push(new DetailedLineRangeMapping(first.original.join(last.original), first.modified.join(last.modified), g.map((a) => a.innerChanges[0])));
}
assertFn(() => {
if (!dontAssertStartLine && changes.length > 0) {
if (changes[0].modified.startLineNumber !== changes[0].original.startLineNumber) {
return false;
}
if (modifiedLines.length - changes[changes.length - 1].modified.endLineNumberExclusive !== originalLines.length - changes[changes.length - 1].original.endLineNumberExclusive) {
return false;
}
}
return checkAdjacentItems(changes, (m1, m2) => m2.original.startLineNumber - m1.original.endLineNumberExclusive === m2.modified.startLineNumber - m1.modified.endLineNumberExclusive && // There has to be an unchanged line in between (otherwise both diffs should have been joined)
m1.original.endLineNumberExclusive < m2.original.startLineNumber && m1.modified.endLineNumberExclusive < m2.modified.startLineNumber);
});
return changes;
}
function getLineRangeMapping(rangeMapping, originalLines, modifiedLines) {
let lineStartDelta = 0;
let lineEndDelta = 0;
if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1 && rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber && rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) {
lineEndDelta = -1;
}
if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines[rangeMapping.modifiedRange.startLineNumber - 1].length && rangeMapping.originalRange.startColumn - 1 >= originalLines[rangeMapping.originalRange.startLineNumber - 1].length && rangeMapping.originalRange.startLineNumber <= rangeMapping.originalRange.endLineNumber + lineEndDelta && rangeMapping.modifiedRange.startLineNumber <= rangeMapping.modifiedRange.endLineNumber + lineEndDelta) {
lineStartDelta = 1;
}
const originalLineRange = new LineRange(rangeMapping.originalRange.startLineNumber + lineStartDelta, rangeMapping.originalRange.endLineNumber + 1 + lineEndDelta);
const modifiedLineRange = new LineRange(rangeMapping.modifiedRange.startLineNumber + lineStartDelta, rangeMapping.modifiedRange.endLineNumber + 1 + lineEndDelta);
return new DetailedLineRangeMapping(originalLineRange, modifiedLineRange, [rangeMapping]);
}
function toLineRangeMapping(sequenceDiff) {
return new LineRangeMapping(new LineRange(sequenceDiff.seq1Range.start + 1, sequenceDiff.seq1Range.endExclusive + 1), new LineRange(sequenceDiff.seq2Range.start + 1, sequenceDiff.seq2Range.endExclusive + 1));
}
var DefaultLinesDiffComputer;
var init_defaultLinesDiffComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js"() {
init_arrays();
init_assert();
init_lineRange();
init_offsetRange();
init_range();
init_diffAlgorithm();
init_dynamicProgrammingDiffing();
init_myersDiffAlgorithm();
init_computeMovedLines();
init_heuristicSequenceOptimizations();
init_lineSequence();
init_linesSliceCharSequence();
init_linesDiffComputer();
init_rangeMapping();
DefaultLinesDiffComputer = class {
constructor() {
this.dynamicProgrammingDiffing = new DynamicProgrammingDiffing();
this.myersDiffingAlgorithm = new MyersDiffAlgorithm();
}
computeDiff(originalLines, modifiedLines, options) {
if (originalLines.length <= 1 && equals2(originalLines, modifiedLines, (a, b) => a === b)) {
return new LinesDiff([], [], false);
}
if (originalLines.length === 1 && originalLines[0].length === 0 || modifiedLines.length === 1 && modifiedLines[0].length === 0) {
return new LinesDiff([
new DetailedLineRangeMapping(new LineRange(1, originalLines.length + 1), new LineRange(1, modifiedLines.length + 1), [
new RangeMapping(new Range(1, 1, originalLines.length, originalLines[originalLines.length - 1].length + 1), new Range(1, 1, modifiedLines.length, modifiedLines[modifiedLines.length - 1].length + 1))
])
], [], false);
}
const timeout = options.maxComputationTimeMs === 0 ? InfiniteTimeout.instance : new DateTimeout(options.maxComputationTimeMs);
const considerWhitespaceChanges = !options.ignoreTrimWhitespace;
const perfectHashes = /* @__PURE__ */ new Map();
function getOrCreateHash(text) {
let hash = perfectHashes.get(text);
if (hash === void 0) {
hash = perfectHashes.size;
perfectHashes.set(text, hash);
}
return hash;
}
const originalLinesHashes = originalLines.map((l) => getOrCreateHash(l.trim()));
const modifiedLinesHashes = modifiedLines.map((l) => getOrCreateHash(l.trim()));
const sequence1 = new LineSequence2(originalLinesHashes, originalLines);
const sequence2 = new LineSequence2(modifiedLinesHashes, modifiedLines);
const lineAlignmentResult = (() => {
if (sequence1.length + sequence2.length < 1700) {
return this.dynamicProgrammingDiffing.compute(sequence1, sequence2, timeout, (offset1, offset2) => originalLines[offset1] === modifiedLines[offset2] ? modifiedLines[offset2].length === 0 ? 0.1 : 1 + Math.log(1 + modifiedLines[offset2].length) : 0.99);
}
return this.myersDiffingAlgorithm.compute(sequence1, sequence2, timeout);
})();
let lineAlignments = lineAlignmentResult.diffs;
let hitTimeout = lineAlignmentResult.hitTimeout;
lineAlignments = optimizeSequenceDiffs(sequence1, sequence2, lineAlignments);
lineAlignments = removeVeryShortMatchingLinesBetweenDiffs(sequence1, sequence2, lineAlignments);
const alignments = [];
const scanForWhitespaceChanges = (equalLinesCount) => {
if (!considerWhitespaceChanges) {
return;
}
for (let i = 0; i < equalLinesCount; i++) {
const seq1Offset = seq1LastStart + i;
const seq2Offset = seq2LastStart + i;
if (originalLines[seq1Offset] !== modifiedLines[seq2Offset]) {
const characterDiffs = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(new OffsetRange(seq1Offset, seq1Offset + 1), new OffsetRange(seq2Offset, seq2Offset + 1)), timeout, considerWhitespaceChanges);
for (const a of characterDiffs.mappings) {
alignments.push(a);
}
if (characterDiffs.hitTimeout) {
hitTimeout = true;
}
}
}
};
let seq1LastStart = 0;
let seq2LastStart = 0;
for (const diff2 of lineAlignments) {
assertFn(() => diff2.seq1Range.start - seq1LastStart === diff2.seq2Range.start - seq2LastStart);
const equalLinesCount = diff2.seq1Range.start - seq1LastStart;
scanForWhitespaceChanges(equalLinesCount);
seq1LastStart = diff2.seq1Range.endExclusive;
seq2LastStart = diff2.seq2Range.endExclusive;
const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff2, timeout, considerWhitespaceChanges);
if (characterDiffs.hitTimeout) {
hitTimeout = true;
}
for (const a of characterDiffs.mappings) {
alignments.push(a);
}
}
scanForWhitespaceChanges(originalLines.length - seq1LastStart);
const changes = lineRangeMappingFromRangeMappings(alignments, originalLines, modifiedLines);
let moves = [];
if (options.computeMoves) {
moves = this.computeMoves(changes, originalLines, modifiedLines, originalLinesHashes, modifiedLinesHashes, timeout, considerWhitespaceChanges);
}
assertFn(() => {
function validatePosition(pos, lines) {
if (pos.lineNumber < 1 || pos.lineNumber > lines.length) {
return false;
}
const line = lines[pos.lineNumber - 1];
if (pos.column < 1 || pos.column > line.length + 1) {
return false;
}
return true;
}
function validateRange(range, lines) {
if (range.startLineNumber < 1 || range.startLineNumber > lines.length + 1) {
return false;
}
if (range.endLineNumberExclusive < 1 || range.endLineNumberExclusive > lines.length + 1) {
return false;
}
return true;
}
for (const c of changes) {
if (!c.innerChanges) {
return false;
}
for (const ic of c.innerChanges) {
const valid = validatePosition(ic.modifiedRange.getStartPosition(), modifiedLines) && validatePosition(ic.modifiedRange.getEndPosition(), modifiedLines) && validatePosition(ic.originalRange.getStartPosition(), originalLines) && validatePosition(ic.originalRange.getEndPosition(), originalLines);
if (!valid) {
return false;
}
}
if (!validateRange(c.modified, modifiedLines) || !validateRange(c.original, originalLines)) {
return false;
}
}
return true;
});
return new LinesDiff(changes, moves, hitTimeout);
}
computeMoves(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout, considerWhitespaceChanges) {
const moves = computeMovedLines(changes, originalLines, modifiedLines, hashedOriginalLines, hashedModifiedLines, timeout);
const movesWithDiffs = moves.map((m) => {
const moveChanges = this.refineDiff(originalLines, modifiedLines, new SequenceDiff(m.original.toOffsetRange(), m.modified.toOffsetRange()), timeout, considerWhitespaceChanges);
const mappings = lineRangeMappingFromRangeMappings(moveChanges.mappings, originalLines, modifiedLines, true);
return new MovedText(m, mappings);
});
return movesWithDiffs;
}
refineDiff(originalLines, modifiedLines, diff2, timeout, considerWhitespaceChanges) {
const lineRangeMapping = toLineRangeMapping(diff2);
const rangeMapping = lineRangeMapping.toRangeMapping2(originalLines, modifiedLines);
const slice1 = new LinesSliceCharSequence(originalLines, rangeMapping.originalRange, considerWhitespaceChanges);
const slice2 = new LinesSliceCharSequence(modifiedLines, rangeMapping.modifiedRange, considerWhitespaceChanges);
const diffResult = slice1.length + slice2.length < 500 ? this.dynamicProgrammingDiffing.compute(slice1, slice2, timeout) : this.myersDiffingAlgorithm.compute(slice1, slice2, timeout);
const check = false;
let diffs = diffResult.diffs;
if (check) {
SequenceDiff.assertSorted(diffs);
}
diffs = optimizeSequenceDiffs(slice1, slice2, diffs);
if (check) {
SequenceDiff.assertSorted(diffs);
}
diffs = extendDiffsToEntireWordIfAppropriate(slice1, slice2, diffs);
if (check) {
SequenceDiff.assertSorted(diffs);
}
diffs = removeShortMatches(slice1, slice2, diffs);
if (check) {
SequenceDiff.assertSorted(diffs);
}
diffs = removeVeryShortMatchingTextBetweenLongDiffs(slice1, slice2, diffs);
if (check) {
SequenceDiff.assertSorted(diffs);
}
const result = diffs.map((d) => new RangeMapping(slice1.translateRange(d.seq1Range), slice2.translateRange(d.seq2Range)));
if (check) {
RangeMapping.assertSorted(result);
}
return {
mappings: result,
hitTimeout: diffResult.hitTimeout
};
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputers.js
var linesDiffComputers;
var init_linesDiffComputers = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/diff/linesDiffComputers.js"() {
init_legacyLinesDiffComputer();
init_defaultLinesDiffComputer();
linesDiffComputers = {
getLegacy: () => new LegacyLinesDiffComputer(),
getDefault: () => new DefaultLinesDiffComputer()
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/color.js
function roundFloat(number, decimalPoints) {
const decimal = Math.pow(10, decimalPoints);
return Math.round(number * decimal) / decimal;
}
var RGBA, HSLA, HSVA, Color;
var init_color = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/color.js"() {
RGBA = class {
constructor(r, g, b, a = 1) {
this._rgbaBrand = void 0;
this.r = Math.min(255, Math.max(0, r)) | 0;
this.g = Math.min(255, Math.max(0, g)) | 0;
this.b = Math.min(255, Math.max(0, b)) | 0;
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
}
static equals(a, b) {
return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;
}
};
HSLA = class _HSLA {
constructor(h, s, l, a) {
this._hslaBrand = void 0;
this.h = Math.max(Math.min(360, h), 0) | 0;
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
this.l = roundFloat(Math.max(Math.min(1, l), 0), 3);
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
}
static equals(a, b) {
return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;
}
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h in the set [0, 360], s, and l in the set [0, 1].
*/
static fromRGBA(rgba) {
const r = rgba.r / 255;
const g = rgba.g / 255;
const b = rgba.b / 255;
const a = rgba.a;
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
let h = 0;
let s = 0;
const l = (min + max) / 2;
const chroma = max - min;
if (chroma > 0) {
s = Math.min(l <= 0.5 ? chroma / (2 * l) : chroma / (2 - 2 * l), 1);
switch (max) {
case r:
h = (g - b) / chroma + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / chroma + 2;
break;
case b:
h = (r - g) / chroma + 4;
break;
}
h *= 60;
h = Math.round(h);
}
return new _HSLA(h, s, l, a);
}
static _hue2rgb(p, q2, t) {
if (t < 0) {
t += 1;
}
if (t > 1) {
t -= 1;
}
if (t < 1 / 6) {
return p + (q2 - p) * 6 * t;
}
if (t < 1 / 2) {
return q2;
}
if (t < 2 / 3) {
return p + (q2 - p) * (2 / 3 - t) * 6;
}
return p;
}
/**
* Converts an HSL color value to RGB. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes h in the set [0, 360] s, and l are contained in the set [0, 1] and
* returns r, g, and b in the set [0, 255].
*/
static toRGBA(hsla) {
const h = hsla.h / 360;
const { s, l, a } = hsla;
let r, g, b;
if (s === 0) {
r = g = b = l;
} else {
const q2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
const p = 2 * l - q2;
r = _HSLA._hue2rgb(p, q2, h + 1 / 3);
g = _HSLA._hue2rgb(p, q2, h);
b = _HSLA._hue2rgb(p, q2, h - 1 / 3);
}
return new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a);
}
};
HSVA = class _HSVA {
constructor(h, s, v, a) {
this._hsvaBrand = void 0;
this.h = Math.max(Math.min(360, h), 0) | 0;
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
this.v = roundFloat(Math.max(Math.min(1, v), 0), 3);
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
}
static equals(a, b) {
return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a;
}
// from http://www.rapidtables.com/convert/color/rgb-to-hsv.htm
static fromRGBA(rgba) {
const r = rgba.r / 255;
const g = rgba.g / 255;
const b = rgba.b / 255;
const cmax = Math.max(r, g, b);
const cmin = Math.min(r, g, b);
const delta = cmax - cmin;
const s = cmax === 0 ? 0 : delta / cmax;
let m;
if (delta === 0) {
m = 0;
} else if (cmax === r) {
m = ((g - b) / delta % 6 + 6) % 6;
} else if (cmax === g) {
m = (b - r) / delta + 2;
} else {
m = (r - g) / delta + 4;
}
return new _HSVA(Math.round(m * 60), s, cmax, rgba.a);
}
// from http://www.rapidtables.com/convert/color/hsv-to-rgb.htm
static toRGBA(hsva) {
const { h, s, v, a } = hsva;
const c = v * s;
const x2 = c * (1 - Math.abs(h / 60 % 2 - 1));
const m = v - c;
let [r, g, b] = [0, 0, 0];
if (h < 60) {
r = c;
g = x2;
} else if (h < 120) {
r = x2;
g = c;
} else if (h < 180) {
g = c;
b = x2;
} else if (h < 240) {
g = x2;
b = c;
} else if (h < 300) {
r = x2;
b = c;
} else if (h <= 360) {
r = c;
b = x2;
}
r = Math.round((r + m) * 255);
g = Math.round((g + m) * 255);
b = Math.round((b + m) * 255);
return new RGBA(r, g, b, a);
}
};
Color = class _Color {
static fromHex(hex) {
return _Color.Format.CSS.parseHex(hex) || _Color.red;
}
static equals(a, b) {
if (!a && !b) {
return true;
}
if (!a || !b) {
return false;
}
return a.equals(b);
}
get hsla() {
if (this._hsla) {
return this._hsla;
} else {
return HSLA.fromRGBA(this.rgba);
}
}
get hsva() {
if (this._hsva) {
return this._hsva;
}
return HSVA.fromRGBA(this.rgba);
}
constructor(arg) {
if (!arg) {
throw new Error("Color needs a value");
} else if (arg instanceof RGBA) {
this.rgba = arg;
} else if (arg instanceof HSLA) {
this._hsla = arg;
this.rgba = HSLA.toRGBA(arg);
} else if (arg instanceof HSVA) {
this._hsva = arg;
this.rgba = HSVA.toRGBA(arg);
} else {
throw new Error("Invalid color ctor argument");
}
}
equals(other) {
return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva);
}
/**
* http://www.w3.org/TR/WCAG20/#relativeluminancedef
* Returns the number in the set [0, 1]. O => Darkest Black. 1 => Lightest white.
*/
getRelativeLuminance() {
const R2 = _Color._relativeLuminanceForComponent(this.rgba.r);
const G2 = _Color._relativeLuminanceForComponent(this.rgba.g);
const B2 = _Color._relativeLuminanceForComponent(this.rgba.b);
const luminance = 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B2;
return roundFloat(luminance, 4);
}
static _relativeLuminanceForComponent(color) {
const c = color / 255;
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
}
/**
* http://24ways.org/2010/calculating-color-contrast
* Return 'true' if lighter color otherwise 'false'
*/
isLighter() {
const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1e3;
return yiq >= 128;
}
isLighterThan(another) {
const lum1 = this.getRelativeLuminance();
const lum2 = another.getRelativeLuminance();
return lum1 > lum2;
}
isDarkerThan(another) {
const lum1 = this.getRelativeLuminance();
const lum2 = another.getRelativeLuminance();
return lum1 < lum2;
}
lighten(factor) {
return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a));
}
darken(factor) {
return new _Color(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a));
}
transparent(factor) {
const { r, g, b, a } = this.rgba;
return new _Color(new RGBA(r, g, b, a * factor));
}
isTransparent() {
return this.rgba.a === 0;
}
isOpaque() {
return this.rgba.a === 1;
}
opposite() {
return new _Color(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a));
}
makeOpaque(opaqueBackground) {
if (this.isOpaque() || opaqueBackground.rgba.a !== 1) {
return this;
}
const { r, g, b, a } = this.rgba;
return new _Color(new RGBA(opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r), opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g), opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b), 1));
}
toString() {
if (!this._toString) {
this._toString = _Color.Format.CSS.format(this);
}
return this._toString;
}
static getLighterColor(of, relative2, factor) {
if (of.isLighterThan(relative2)) {
return of;
}
factor = factor ? factor : 0.5;
const lum1 = of.getRelativeLuminance();
const lum2 = relative2.getRelativeLuminance();
factor = factor * (lum2 - lum1) / lum2;
return of.lighten(factor);
}
static getDarkerColor(of, relative2, factor) {
if (of.isDarkerThan(relative2)) {
return of;
}
factor = factor ? factor : 0.5;
const lum1 = of.getRelativeLuminance();
const lum2 = relative2.getRelativeLuminance();
factor = factor * (lum1 - lum2) / lum1;
return of.darken(factor);
}
static {
this.white = new _Color(new RGBA(255, 255, 255, 1));
}
static {
this.black = new _Color(new RGBA(0, 0, 0, 1));
}
static {
this.red = new _Color(new RGBA(255, 0, 0, 1));
}
static {
this.blue = new _Color(new RGBA(0, 0, 255, 1));
}
static {
this.green = new _Color(new RGBA(0, 255, 0, 1));
}
static {
this.cyan = new _Color(new RGBA(0, 255, 255, 1));
}
static {
this.lightgrey = new _Color(new RGBA(211, 211, 211, 1));
}
static {
this.transparent = new _Color(new RGBA(0, 0, 0, 0));
}
};
(function(Color3) {
let Format;
(function(Format2) {
let CSS;
(function(CSS2) {
function formatRGB(color) {
if (color.rgba.a === 1) {
return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`;
}
return Color3.Format.CSS.formatRGBA(color);
}
CSS2.formatRGB = formatRGB;
function formatRGBA(color) {
return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+color.rgba.a.toFixed(2)})`;
}
CSS2.formatRGBA = formatRGBA;
function formatHSL(color) {
if (color.hsla.a === 1) {
return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`;
}
return Color3.Format.CSS.formatHSLA(color);
}
CSS2.formatHSL = formatHSL;
function formatHSLA(color) {
return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`;
}
CSS2.formatHSLA = formatHSLA;
function _toTwoDigitHex(n) {
const r = n.toString(16);
return r.length !== 2 ? "0" + r : r;
}
function formatHex(color) {
return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`;
}
CSS2.formatHex = formatHex;
function formatHexA(color, compact = false) {
if (compact && color.rgba.a === 1) {
return Color3.Format.CSS.formatHex(color);
}
return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`;
}
CSS2.formatHexA = formatHexA;
function format(color) {
if (color.isOpaque()) {
return Color3.Format.CSS.formatHex(color);
}
return Color3.Format.CSS.formatRGBA(color);
}
CSS2.format = format;
function parseHex(hex) {
const length = hex.length;
if (length === 0) {
return null;
}
if (hex.charCodeAt(0) !== 35) {
return null;
}
if (length === 7) {
const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
return new Color3(new RGBA(r, g, b, 1));
}
if (length === 9) {
const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));
return new Color3(new RGBA(r, g, b, a / 255));
}
if (length === 4) {
const r = _parseHexDigit(hex.charCodeAt(1));
const g = _parseHexDigit(hex.charCodeAt(2));
const b = _parseHexDigit(hex.charCodeAt(3));
return new Color3(new RGBA(16 * r + r, 16 * g + g, 16 * b + b));
}
if (length === 5) {
const r = _parseHexDigit(hex.charCodeAt(1));
const g = _parseHexDigit(hex.charCodeAt(2));
const b = _parseHexDigit(hex.charCodeAt(3));
const a = _parseHexDigit(hex.charCodeAt(4));
return new Color3(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255));
}
return null;
}
CSS2.parseHex = parseHex;
function _parseHexDigit(charCode) {
switch (charCode) {
case 48:
return 0;
case 49:
return 1;
case 50:
return 2;
case 51:
return 3;
case 52:
return 4;
case 53:
return 5;
case 54:
return 6;
case 55:
return 7;
case 56:
return 8;
case 57:
return 9;
case 97:
return 10;
case 65:
return 10;
case 98:
return 11;
case 66:
return 11;
case 99:
return 12;
case 67:
return 12;
case 100:
return 13;
case 68:
return 13;
case 101:
return 14;
case 69:
return 14;
case 102:
return 15;
case 70:
return 15;
}
return 0;
}
})(CSS = Format2.CSS || (Format2.CSS = {}));
})(Format = Color3.Format || (Color3.Format = {}));
})(Color || (Color = {}));
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js
function _parseCaptureGroups(captureGroups) {
const values = [];
for (const captureGroup of captureGroups) {
const parsedNumber = Number(captureGroup);
if (parsedNumber || parsedNumber === 0 && captureGroup.replace(/\s/g, "") !== "") {
values.push(parsedNumber);
}
}
return values;
}
function _toIColor(r, g, b, a) {
return {
red: r / 255,
blue: b / 255,
green: g / 255,
alpha: a
};
}
function _findRange(model, match) {
const index = match.index;
const length = match[0].length;
if (!index) {
return;
}
const startPosition = model.positionAt(index);
const range = {
startLineNumber: startPosition.lineNumber,
startColumn: startPosition.column,
endLineNumber: startPosition.lineNumber,
endColumn: startPosition.column + length
};
return range;
}
function _findHexColorInformation(range, hexValue) {
if (!range) {
return;
}
const parsedHexColor = Color.Format.CSS.parseHex(hexValue);
if (!parsedHexColor) {
return;
}
return {
range,
color: _toIColor(parsedHexColor.rgba.r, parsedHexColor.rgba.g, parsedHexColor.rgba.b, parsedHexColor.rgba.a)
};
}
function _findRGBColorInformation(range, matches, isAlpha) {
if (!range || matches.length !== 1) {
return;
}
const match = matches[0];
const captureGroups = match.values();
const parsedRegex = _parseCaptureGroups(captureGroups);
return {
range,
color: _toIColor(parsedRegex[0], parsedRegex[1], parsedRegex[2], isAlpha ? parsedRegex[3] : 1)
};
}
function _findHSLColorInformation(range, matches, isAlpha) {
if (!range || matches.length !== 1) {
return;
}
const match = matches[0];
const captureGroups = match.values();
const parsedRegex = _parseCaptureGroups(captureGroups);
const colorEquivalent = new Color(new HSLA(parsedRegex[0], parsedRegex[1] / 100, parsedRegex[2] / 100, isAlpha ? parsedRegex[3] : 1));
return {
range,
color: _toIColor(colorEquivalent.rgba.r, colorEquivalent.rgba.g, colorEquivalent.rgba.b, colorEquivalent.rgba.a)
};
}
function _findMatches(model, regex) {
if (typeof model === "string") {
return [...model.matchAll(regex)];
} else {
return model.findMatches(regex);
}
}
function computeColors(model) {
const result = [];
const initialValidationRegex = /\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm;
const initialValidationMatches = _findMatches(model, initialValidationRegex);
if (initialValidationMatches.length > 0) {
for (const initialMatch of initialValidationMatches) {
const initialCaptureGroups = initialMatch.filter((captureGroup) => captureGroup !== void 0);
const colorScheme = initialCaptureGroups[1];
const colorParameters = initialCaptureGroups[2];
if (!colorParameters) {
continue;
}
let colorInformation;
if (colorScheme === "rgb") {
const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;
colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
} else if (colorScheme === "rgba") {
const regexParameters = /^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
colorInformation = _findRGBColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
} else if (colorScheme === "hsl") {
const regexParameters = /^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;
colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), false);
} else if (colorScheme === "hsla") {
const regexParameters = /^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;
colorInformation = _findHSLColorInformation(_findRange(model, initialMatch), _findMatches(colorParameters, regexParameters), true);
} else if (colorScheme === "#") {
colorInformation = _findHexColorInformation(_findRange(model, initialMatch), colorScheme + colorParameters);
}
if (colorInformation) {
result.push(colorInformation);
}
}
}
return result;
}
function computeDefaultDocumentColors(model) {
if (!model || typeof model.getValue !== "function" || typeof model.positionAt !== "function") {
return [];
}
return computeColors(model);
}
var init_defaultDocumentColorsComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/languages/defaultDocumentColorsComputer.js"() {
init_color();
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/findSectionHeaders.js
function findSectionHeaders(model, options) {
let headers = [];
if (options.findRegionSectionHeaders && options.foldingRules?.markers) {
const regionHeaders = collectRegionHeaders(model, options);
headers = headers.concat(regionHeaders);
}
if (options.findMarkSectionHeaders) {
const markHeaders = collectMarkHeaders(model);
headers = headers.concat(markHeaders);
}
return headers;
}
function collectRegionHeaders(model, options) {
const regionHeaders = [];
const endLineNumber = model.getLineCount();
for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) {
const lineContent = model.getLineContent(lineNumber);
const match = lineContent.match(options.foldingRules.markers.start);
if (match) {
const range = { startLineNumber: lineNumber, startColumn: match[0].length + 1, endLineNumber: lineNumber, endColumn: lineContent.length + 1 };
if (range.endColumn > range.startColumn) {
const sectionHeader = {
range,
...getHeaderText(lineContent.substring(match[0].length)),
shouldBeInComments: false
};
if (sectionHeader.text || sectionHeader.hasSeparatorLine) {
regionHeaders.push(sectionHeader);
}
}
}
}
return regionHeaders;
}
function collectMarkHeaders(model) {
const markHeaders = [];
const endLineNumber = model.getLineCount();
for (let lineNumber = 1; lineNumber <= endLineNumber; lineNumber++) {
const lineContent = model.getLineContent(lineNumber);
addMarkHeaderIfFound(lineContent, lineNumber, markHeaders);
}
return markHeaders;
}
function addMarkHeaderIfFound(lineContent, lineNumber, sectionHeaders) {
markRegex.lastIndex = 0;
const match = markRegex.exec(lineContent);
if (match) {
const column = match.indices[1][0] + 1;
const endColumn = match.indices[1][1] + 1;
const range = { startLineNumber: lineNumber, startColumn: column, endLineNumber: lineNumber, endColumn };
if (range.endColumn > range.startColumn) {
const sectionHeader = {
range,
...getHeaderText(match[1]),
shouldBeInComments: true
};
if (sectionHeader.text || sectionHeader.hasSeparatorLine) {
sectionHeaders.push(sectionHeader);
}
}
}
}
function getHeaderText(text) {
text = text.trim();
const hasSeparatorLine = text.startsWith("-");
text = text.replace(trimDashesRegex, "");
return { text, hasSeparatorLine };
}
var markRegex, trimDashesRegex;
var init_findSectionHeaders = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/findSectionHeaders.js"() {
markRegex = new RegExp("\\bMARK:\\s*(.*)$", "d");
trimDashesRegex = /^-+|-+$/g;
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/symbols.js
var init_symbols = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/symbols.js"() {
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/async.js
var runWhenGlobalIdle, _runWhenIdle, Promises, AsyncIterableObject;
var init_async = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/base/common/async.js"() {
init_cancellation();
init_errors();
init_event();
init_lifecycle();
init_platform();
init_symbols();
(function() {
if (typeof globalThis.requestIdleCallback !== "function" || typeof globalThis.cancelIdleCallback !== "function") {
_runWhenIdle = (_targetWindow, runner) => {
setTimeout0(() => {
if (disposed) {
return;
}
const end = Date.now() + 15;
const deadline = {
didTimeout: true,
timeRemaining() {
return Math.max(0, end - Date.now());
}
};
runner(Object.freeze(deadline));
});
let disposed = false;
return {
dispose() {
if (disposed) {
return;
}
disposed = true;
}
};
};
} else {
_runWhenIdle = (targetWindow, runner, timeout) => {
const handle = targetWindow.requestIdleCallback(runner, typeof timeout === "number" ? { timeout } : void 0);
let disposed = false;
return {
dispose() {
if (disposed) {
return;
}
disposed = true;
targetWindow.cancelIdleCallback(handle);
}
};
};
}
runWhenGlobalIdle = (runner) => _runWhenIdle(globalThis, runner);
})();
(function(Promises2) {
async function settled(promises) {
let firstError = void 0;
const result = await Promise.all(promises.map((promise) => promise.then((value) => value, (error) => {
if (!firstError) {
firstError = error;
}
return void 0;
})));
if (typeof firstError !== "undefined") {
throw firstError;
}
return result;
}
Promises2.settled = settled;
function withAsyncBody(bodyFn) {
return new Promise(async (resolve2, reject) => {
try {
await bodyFn(resolve2, reject);
} catch (error) {
reject(error);
}
});
}
Promises2.withAsyncBody = withAsyncBody;
})(Promises || (Promises = {}));
AsyncIterableObject = class _AsyncIterableObject {
static fromArray(items) {
return new _AsyncIterableObject((writer) => {
writer.emitMany(items);
});
}
static fromPromise(promise) {
return new _AsyncIterableObject(async (emitter) => {
emitter.emitMany(await promise);
});
}
static fromPromises(promises) {
return new _AsyncIterableObject(async (emitter) => {
await Promise.all(promises.map(async (p) => emitter.emitOne(await p)));
});
}
static merge(iterables) {
return new _AsyncIterableObject(async (emitter) => {
await Promise.all(iterables.map(async (iterable) => {
for await (const item of iterable) {
emitter.emitOne(item);
}
}));
});
}
static {
this.EMPTY = _AsyncIterableObject.fromArray([]);
}
constructor(executor, onReturn) {
this._state = 0;
this._results = [];
this._error = null;
this._onReturn = onReturn;
this._onStateChanged = new Emitter();
queueMicrotask(async () => {
const writer = {
emitOne: (item) => this.emitOne(item),
emitMany: (items) => this.emitMany(items),
reject: (error) => this.reject(error)
};
try {
await Promise.resolve(executor(writer));
this.resolve();
} catch (err) {
this.reject(err);
} finally {
writer.emitOne = void 0;
writer.emitMany = void 0;
writer.reject = void 0;
}
});
}
[Symbol.asyncIterator]() {
let i = 0;
return {
next: async () => {
do {
if (this._state === 2) {
throw this._error;
}
if (i < this._results.length) {
return { done: false, value: this._results[i++] };
}
if (this._state === 1) {
return { done: true, value: void 0 };
}
await Event.toPromise(this._onStateChanged.event);
} while (true);
},
return: async () => {
this._onReturn?.();
return { done: true, value: void 0 };
}
};
}
static map(iterable, mapFn) {
return new _AsyncIterableObject(async (emitter) => {
for await (const item of iterable) {
emitter.emitOne(mapFn(item));
}
});
}
map(mapFn) {
return _AsyncIterableObject.map(this, mapFn);
}
static filter(iterable, filterFn) {
return new _AsyncIterableObject(async (emitter) => {
for await (const item of iterable) {
if (filterFn(item)) {
emitter.emitOne(item);
}
}
});
}
filter(filterFn) {
return _AsyncIterableObject.filter(this, filterFn);
}
static coalesce(iterable) {
return _AsyncIterableObject.filter(iterable, (item) => !!item);
}
coalesce() {
return _AsyncIterableObject.coalesce(this);
}
static async toPromise(iterable) {
const result = [];
for await (const item of iterable) {
result.push(item);
}
return result;
}
toPromise() {
return _AsyncIterableObject.toPromise(this);
}
/**
* The value will be appended at the end.
*
* **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
*/
emitOne(value) {
if (this._state !== 0) {
return;
}
this._results.push(value);
this._onStateChanged.fire();
}
/**
* The values will be appended at the end.
*
* **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
*/
emitMany(values) {
if (this._state !== 0) {
return;
}
this._results = this._results.concat(values);
this._onStateChanged.fire();
}
/**
* Calling `resolve()` will mark the result array as complete.
*
* **NOTE** `resolve()` must be called, otherwise all consumers of this iterable will hang indefinitely, similar to a non-resolved promise.
* **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
*/
resolve() {
if (this._state !== 0) {
return;
}
this._state = 1;
this._onStateChanged.fire();
}
/**
* Writing an error will permanently invalidate this iterable.
* The current users will receive an error thrown, as will all future users.
*
* **NOTE** If `resolve()` or `reject()` have already been called, this method has no effect.
*/
reject(error) {
if (this._state !== 0) {
return;
}
this._state = 2;
this._error = error;
this._onStateChanged.fire();
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js
var PrefixSumComputer, PrefixSumIndexOfResult;
var init_prefixSumComputer = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js"() {
init_arrays();
init_uint();
PrefixSumComputer = class {
constructor(values) {
this.values = values;
this.prefixSum = new Uint32Array(values.length);
this.prefixSumValidIndex = new Int32Array(1);
this.prefixSumValidIndex[0] = -1;
}
insertValues(insertIndex, insertValues) {
insertIndex = toUint32(insertIndex);
const oldValues = this.values;
const oldPrefixSum = this.prefixSum;
const insertValuesLen = insertValues.length;
if (insertValuesLen === 0) {
return false;
}
this.values = new Uint32Array(oldValues.length + insertValuesLen);
this.values.set(oldValues.subarray(0, insertIndex), 0);
this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);
this.values.set(insertValues, insertIndex);
if (insertIndex - 1 < this.prefixSumValidIndex[0]) {
this.prefixSumValidIndex[0] = insertIndex - 1;
}
this.prefixSum = new Uint32Array(this.values.length);
if (this.prefixSumValidIndex[0] >= 0) {
this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
}
return true;
}
setValue(index, value) {
index = toUint32(index);
value = toUint32(value);
if (this.values[index] === value) {
return false;
}
this.values[index] = value;
if (index - 1 < this.prefixSumValidIndex[0]) {
this.prefixSumValidIndex[0] = index - 1;
}
return true;
}
removeValues(startIndex, count) {
startIndex = toUint32(startIndex);
count = toUint32(count);
const oldValues = this.values;
const oldPrefixSum = this.prefixSum;
if (startIndex >= oldValues.length) {
return false;
}
const maxCount = oldValues.length - startIndex;
if (count >= maxCount) {
count = maxCount;
}
if (count === 0) {
return false;
}
this.values = new Uint32Array(oldValues.length - count);
this.values.set(oldValues.subarray(0, startIndex), 0);
this.values.set(oldValues.subarray(startIndex + count), startIndex);
this.prefixSum = new Uint32Array(this.values.length);
if (startIndex - 1 < this.prefixSumValidIndex[0]) {
this.prefixSumValidIndex[0] = startIndex - 1;
}
if (this.prefixSumValidIndex[0] >= 0) {
this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
}
return true;
}
getTotalSum() {
if (this.values.length === 0) {
return 0;
}
return this._getPrefixSum(this.values.length - 1);
}
/**
* Returns the sum of the first `index + 1` many items.
* @returns `SUM(0 <= j <= index, values[j])`.
*/
getPrefixSum(index) {
if (index < 0) {
return 0;
}
index = toUint32(index);
return this._getPrefixSum(index);
}
_getPrefixSum(index) {
if (index <= this.prefixSumValidIndex[0]) {
return this.prefixSum[index];
}
let startIndex = this.prefixSumValidIndex[0] + 1;
if (startIndex === 0) {
this.prefixSum[0] = this.values[0];
startIndex++;
}
if (index >= this.values.length) {
index = this.values.length - 1;
}
for (let i = startIndex; i <= index; i++) {
this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];
}
this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);
return this.prefixSum[index];
}
getIndexOf(sum) {
sum = Math.floor(sum);
this.getTotalSum();
let low = 0;
let high = this.values.length - 1;
let mid = 0;
let midStop = 0;
let midStart = 0;
while (low <= high) {
mid = low + (high - low) / 2 | 0;
midStop = this.prefixSum[mid];
midStart = midStop - this.values[mid];
if (sum < midStart) {
high = mid - 1;
} else if (sum >= midStop) {
low = mid + 1;
} else {
break;
}
}
return new PrefixSumIndexOfResult(mid, sum - midStart);
}
};
PrefixSumIndexOfResult = class {
constructor(index, remainder) {
this.index = index;
this.remainder = remainder;
this._prefixSumIndexOfResultBrand = void 0;
this.index = index;
this.remainder = remainder;
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js
var MirrorTextModel;
var init_mirrorTextModel = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js"() {
init_strings();
init_position();
init_prefixSumComputer();
MirrorTextModel = class {
constructor(uri, lines, eol, versionId) {
this._uri = uri;
this._lines = lines;
this._eol = eol;
this._versionId = versionId;
this._lineStarts = null;
this._cachedTextValue = null;
}
dispose() {
this._lines.length = 0;
}
get version() {
return this._versionId;
}
getText() {
if (this._cachedTextValue === null) {
this._cachedTextValue = this._lines.join(this._eol);
}
return this._cachedTextValue;
}
onEvents(e) {
if (e.eol && e.eol !== this._eol) {
this._eol = e.eol;
this._lineStarts = null;
}
const changes = e.changes;
for (const change of changes) {
this._acceptDeleteRange(change.range);
this._acceptInsertText(new Position(change.range.startLineNumber, change.range.startColumn), change.text);
}
this._versionId = e.versionId;
this._cachedTextValue = null;
}
_ensureLineStarts() {
if (!this._lineStarts) {
const eolLength = this._eol.length;
const linesLength = this._lines.length;
const lineStartValues = new Uint32Array(linesLength);
for (let i = 0; i < linesLength; i++) {
lineStartValues[i] = this._lines[i].length + eolLength;
}
this._lineStarts = new PrefixSumComputer(lineStartValues);
}
}
/**
* All changes to a line's text go through this method
*/
_setLineText(lineIndex, newValue) {
this._lines[lineIndex] = newValue;
if (this._lineStarts) {
this._lineStarts.setValue(lineIndex, this._lines[lineIndex].length + this._eol.length);
}
}
_acceptDeleteRange(range) {
if (range.startLineNumber === range.endLineNumber) {
if (range.startColumn === range.endColumn) {
return;
}
this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));
return;
}
this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1) + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));
this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);
if (this._lineStarts) {
this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);
}
}
_acceptInsertText(position, insertText) {
if (insertText.length === 0) {
return;
}
const insertLines = splitLines(insertText);
if (insertLines.length === 1) {
this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0] + this._lines[position.lineNumber - 1].substring(position.column - 1));
return;
}
insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);
this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1) + insertLines[0]);
const newLengths = new Uint32Array(insertLines.length - 1);
for (let i = 1; i < insertLines.length; i++) {
this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);
newLengths[i - 1] = insertLines[i].length + this._eol.length;
}
if (this._lineStarts) {
this._lineStarts.insertValues(position.lineNumber, newLengths);
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js
var STOP_SYNC_MODEL_DELTA_TIME_MS, WorkerTextModelSyncServer, MirrorModel;
var init_textModelSync_impl = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/textModelSync/textModelSync.impl.js"() {
init_async();
init_lifecycle();
init_uri();
init_position();
init_range();
init_wordHelper();
init_mirrorTextModel();
STOP_SYNC_MODEL_DELTA_TIME_MS = 60 * 1e3;
WorkerTextModelSyncServer = class {
constructor() {
this._models = /* @__PURE__ */ Object.create(null);
}
getModel(uri) {
return this._models[uri];
}
getModels() {
const all = [];
Object.keys(this._models).forEach((key) => all.push(this._models[key]));
return all;
}
$acceptNewModel(data) {
this._models[data.url] = new MirrorModel(URI.parse(data.url), data.lines, data.EOL, data.versionId);
}
$acceptModelChanged(uri, e) {
if (!this._models[uri]) {
return;
}
const model = this._models[uri];
model.onEvents(e);
}
$acceptRemovedModel(uri) {
if (!this._models[uri]) {
return;
}
delete this._models[uri];
}
};
MirrorModel = class extends MirrorTextModel {
get uri() {
return this._uri;
}
get eol() {
return this._eol;
}
getValue() {
return this.getText();
}
findMatches(regex) {
const matches = [];
for (let i = 0; i < this._lines.length; i++) {
const line = this._lines[i];
const offsetToAdd = this.offsetAt(new Position(i + 1, 1));
const iteratorOverMatches = line.matchAll(regex);
for (const match of iteratorOverMatches) {
if (match.index || match.index === 0) {
match.index = match.index + offsetToAdd;
}
matches.push(match);
}
}
return matches;
}
getLinesContent() {
return this._lines.slice(0);
}
getLineCount() {
return this._lines.length;
}
getLineContent(lineNumber) {
return this._lines[lineNumber - 1];
}
getWordAtPosition(position, wordDefinition) {
const wordAtText = getWordAtText(position.column, ensureValidWordDefinition(wordDefinition), this._lines[position.lineNumber - 1], 0);
if (wordAtText) {
return new Range(position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);
}
return null;
}
words(wordDefinition) {
const lines = this._lines;
const wordenize = this._wordenize.bind(this);
let lineNumber = 0;
let lineText = "";
let wordRangesIdx = 0;
let wordRanges = [];
return {
*[Symbol.iterator]() {
while (true) {
if (wordRangesIdx < wordRanges.length) {
const value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);
wordRangesIdx += 1;
yield value;
} else {
if (lineNumber < lines.length) {
lineText = lines[lineNumber];
wordRanges = wordenize(lineText, wordDefinition);
wordRangesIdx = 0;
lineNumber += 1;
} else {
break;
}
}
}
}
};
}
getLineWords(lineNumber, wordDefinition) {
const content = this._lines[lineNumber - 1];
const ranges = this._wordenize(content, wordDefinition);
const words = [];
for (const range of ranges) {
words.push({
word: content.substring(range.start, range.end),
startColumn: range.start + 1,
endColumn: range.end + 1
});
}
return words;
}
_wordenize(content, wordDefinition) {
const result = [];
let match;
wordDefinition.lastIndex = 0;
while (match = wordDefinition.exec(content)) {
if (match[0].length === 0) {
break;
}
result.push({ start: match.index, end: match.index + match[0].length });
}
return result;
}
getValueInRange(range) {
range = this._validateRange(range);
if (range.startLineNumber === range.endLineNumber) {
return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);
}
const lineEnding = this._eol;
const startLineIndex = range.startLineNumber - 1;
const endLineIndex = range.endLineNumber - 1;
const resultLines = [];
resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));
for (let i = startLineIndex + 1; i < endLineIndex; i++) {
resultLines.push(this._lines[i]);
}
resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));
return resultLines.join(lineEnding);
}
offsetAt(position) {
position = this._validatePosition(position);
this._ensureLineStarts();
return this._lineStarts.getPrefixSum(position.lineNumber - 2) + (position.column - 1);
}
positionAt(offset) {
offset = Math.floor(offset);
offset = Math.max(0, offset);
this._ensureLineStarts();
const out = this._lineStarts.getIndexOf(offset);
const lineLength = this._lines[out.index].length;
return {
lineNumber: 1 + out.index,
column: 1 + Math.min(out.remainder, lineLength)
};
}
_validateRange(range) {
const start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });
const end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });
if (start.lineNumber !== range.startLineNumber || start.column !== range.startColumn || end.lineNumber !== range.endLineNumber || end.column !== range.endColumn) {
return {
startLineNumber: start.lineNumber,
startColumn: start.column,
endLineNumber: end.lineNumber,
endColumn: end.column
};
}
return range;
}
_validatePosition(position) {
if (!Position.isIPosition(position)) {
throw new Error("bad position");
}
let { lineNumber, column } = position;
let hasChanged = false;
if (lineNumber < 1) {
lineNumber = 1;
column = 1;
hasChanged = true;
} else if (lineNumber > this._lines.length) {
lineNumber = this._lines.length;
column = this._lines[lineNumber - 1].length + 1;
hasChanged = true;
} else {
const maxCharacter = this._lines[lineNumber - 1].length + 1;
if (column < 1) {
column = 1;
hasChanged = true;
} else if (column > maxCharacter) {
column = maxCharacter;
hasChanged = true;
}
}
if (!hasChanged) {
return position;
} else {
return { lineNumber, column };
}
}
};
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js
var isESM2, BaseEditorSimpleWorker, EditorSimpleWorker;
var init_editorSimpleWorker = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js"() {
init_diff();
init_range();
init_linkComputer();
init_inplaceReplaceSupport();
init_editorBaseApi();
init_editorWorkerHost();
init_stopwatch();
init_unicodeTextModelHighlighter();
init_linesDiffComputers();
init_objects();
init_network();
init_defaultDocumentColorsComputer();
init_findSectionHeaders();
init_textModelSync_impl();
isESM2 = true;
BaseEditorSimpleWorker = class {
constructor() {
this._workerTextModelSyncServer = new WorkerTextModelSyncServer();
}
dispose() {
}
_getModel(uri) {
return this._workerTextModelSyncServer.getModel(uri);
}
_getModels() {
return this._workerTextModelSyncServer.getModels();
}
$acceptNewModel(data) {
this._workerTextModelSyncServer.$acceptNewModel(data);
}
$acceptModelChanged(uri, e) {
this._workerTextModelSyncServer.$acceptModelChanged(uri, e);
}
$acceptRemovedModel(uri) {
this._workerTextModelSyncServer.$acceptRemovedModel(uri);
}
async $computeUnicodeHighlights(url, options, range) {
const model = this._getModel(url);
if (!model) {
return { ranges: [], hasMore: false, ambiguousCharacterCount: 0, invisibleCharacterCount: 0, nonBasicAsciiCharacterCount: 0 };
}
return UnicodeTextModelHighlighter.computeUnicodeHighlights(model, options, range);
}
async $findSectionHeaders(url, options) {
const model = this._getModel(url);
if (!model) {
return [];
}
return findSectionHeaders(model, options);
}
// ---- BEGIN diff --------------------------------------------------------------------------
async $computeDiff(originalUrl, modifiedUrl, options, algorithm) {
const original = this._getModel(originalUrl);
const modified = this._getModel(modifiedUrl);
if (!original || !modified) {
return null;
}
const result = EditorSimpleWorker.computeDiff(original, modified, options, algorithm);
return result;
}
static computeDiff(originalTextModel, modifiedTextModel, options, algorithm) {
const diffAlgorithm = algorithm === "advanced" ? linesDiffComputers.getDefault() : linesDiffComputers.getLegacy();
const originalLines = originalTextModel.getLinesContent();
const modifiedLines = modifiedTextModel.getLinesContent();
const result = diffAlgorithm.computeDiff(originalLines, modifiedLines, options);
const identical = result.changes.length > 0 ? false : this._modelsAreIdentical(originalTextModel, modifiedTextModel);
function getLineChanges(changes) {
return changes.map((m) => [m.original.startLineNumber, m.original.endLineNumberExclusive, m.modified.startLineNumber, m.modified.endLineNumberExclusive, m.innerChanges?.map((m2) => [
m2.originalRange.startLineNumber,
m2.originalRange.startColumn,
m2.originalRange.endLineNumber,
m2.originalRange.endColumn,
m2.modifiedRange.startLineNumber,
m2.modifiedRange.startColumn,
m2.modifiedRange.endLineNumber,
m2.modifiedRange.endColumn
])]);
}
return {
identical,
quitEarly: result.hitTimeout,
changes: getLineChanges(result.changes),
moves: result.moves.map((m) => [
m.lineRangeMapping.original.startLineNumber,
m.lineRangeMapping.original.endLineNumberExclusive,
m.lineRangeMapping.modified.startLineNumber,
m.lineRangeMapping.modified.endLineNumberExclusive,
getLineChanges(m.changes)
])
};
}
static _modelsAreIdentical(original, modified) {
const originalLineCount = original.getLineCount();
const modifiedLineCount = modified.getLineCount();
if (originalLineCount !== modifiedLineCount) {
return false;
}
for (let line = 1; line <= originalLineCount; line++) {
const originalLine = original.getLineContent(line);
const modifiedLine = modified.getLineContent(line);
if (originalLine !== modifiedLine) {
return false;
}
}
return true;
}
static {
this._diffLimit = 1e5;
}
async $computeMoreMinimalEdits(modelUrl, edits, pretty) {
const model = this._getModel(modelUrl);
if (!model) {
return edits;
}
const result = [];
let lastEol = void 0;
edits = edits.slice(0).sort((a, b) => {
if (a.range && b.range) {
return Range.compareRangesUsingStarts(a.range, b.range);
}
const aRng = a.range ? 0 : 1;
const bRng = b.range ? 0 : 1;
return aRng - bRng;
});
let writeIndex = 0;
for (let readIndex = 1; readIndex < edits.length; readIndex++) {
if (Range.getEndPosition(edits[writeIndex].range).equals(Range.getStartPosition(edits[readIndex].range))) {
edits[writeIndex].range = Range.fromPositions(Range.getStartPosition(edits[writeIndex].range), Range.getEndPosition(edits[readIndex].range));
edits[writeIndex].text += edits[readIndex].text;
} else {
writeIndex++;
edits[writeIndex] = edits[readIndex];
}
}
edits.length = writeIndex + 1;
for (let { range, text, eol } of edits) {
if (typeof eol === "number") {
lastEol = eol;
}
if (Range.isEmpty(range) && !text) {
continue;
}
const original = model.getValueInRange(range);
text = text.replace(/\r\n|\n|\r/g, model.eol);
if (original === text) {
continue;
}
if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {
result.push({ range, text });
continue;
}
const changes = stringDiff(original, text, pretty);
const editOffset = model.offsetAt(Range.lift(range).getStartPosition());
for (const change of changes) {
const start = model.positionAt(editOffset + change.originalStart);
const end = model.positionAt(editOffset + change.originalStart + change.originalLength);
const newEdit = {
text: text.substr(change.modifiedStart, change.modifiedLength),
range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }
};
if (model.getValueInRange(newEdit.range) !== newEdit.text) {
result.push(newEdit);
}
}
}
if (typeof lastEol === "number") {
result.push({ eol: lastEol, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });
}
return result;
}
// ---- END minimal edits ---------------------------------------------------------------
async $computeLinks(modelUrl) {
const model = this._getModel(modelUrl);
if (!model) {
return null;
}
return computeLinks(model);
}
// --- BEGIN default document colors -----------------------------------------------------------
async $computeDefaultDocumentColors(modelUrl) {
const model = this._getModel(modelUrl);
if (!model) {
return null;
}
return computeDefaultDocumentColors(model);
}
static {
this._suggestionsLimit = 1e4;
}
async $textualSuggest(modelUrls, leadingWord, wordDef, wordDefFlags) {
const sw = new StopWatch();
const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
const seen = /* @__PURE__ */ new Set();
outer: for (const url of modelUrls) {
const model = this._getModel(url);
if (!model) {
continue;
}
for (const word of model.words(wordDefRegExp)) {
if (word === leadingWord || !isNaN(Number(word))) {
continue;
}
seen.add(word);
if (seen.size > EditorSimpleWorker._suggestionsLimit) {
break outer;
}
}
}
return { words: Array.from(seen), duration: sw.elapsed() };
}
// ---- END suggest --------------------------------------------------------------------------
//#region -- word ranges --
async $computeWordRanges(modelUrl, range, wordDef, wordDefFlags) {
const model = this._getModel(modelUrl);
if (!model) {
return /* @__PURE__ */ Object.create(null);
}
const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
const result = /* @__PURE__ */ Object.create(null);
for (let line = range.startLineNumber; line < range.endLineNumber; line++) {
const words = model.getLineWords(line, wordDefRegExp);
for (const word of words) {
if (!isNaN(Number(word.word))) {
continue;
}
let array = result[word.word];
if (!array) {
array = [];
result[word.word] = array;
}
array.push({
startLineNumber: line,
startColumn: word.startColumn,
endLineNumber: line,
endColumn: word.endColumn
});
}
}
return result;
}
//#endregion
async $navigateValueSet(modelUrl, range, up, wordDef, wordDefFlags) {
const model = this._getModel(modelUrl);
if (!model) {
return null;
}
const wordDefRegExp = new RegExp(wordDef, wordDefFlags);
if (range.startColumn === range.endColumn) {
range = {
startLineNumber: range.startLineNumber,
startColumn: range.startColumn,
endLineNumber: range.endLineNumber,
endColumn: range.endColumn + 1
};
}
const selectionText = model.getValueInRange(range);
const wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);
if (!wordRange) {
return null;
}
const word = model.getValueInRange(wordRange);
const result = BasicInplaceReplace.INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);
return result;
}
};
EditorSimpleWorker = class extends BaseEditorSimpleWorker {
constructor(_host, _foreignModuleFactory) {
super();
this._host = _host;
this._foreignModuleFactory = _foreignModuleFactory;
this._foreignModule = null;
}
async $ping() {
return "pong";
}
// ---- BEGIN foreign module support --------------------------------------------------------------------------
$loadForeignModule(moduleId, createData, foreignHostMethods) {
const proxyMethodRequest = (method, args) => {
return this._host.$fhr(method, args);
};
const foreignHost = createProxyObject(foreignHostMethods, proxyMethodRequest);
const ctx = {
host: foreignHost,
getMirrorModels: () => {
return this._getModels();
}
};
if (this._foreignModuleFactory) {
this._foreignModule = this._foreignModuleFactory(ctx, createData);
return Promise.resolve(getAllMethodNames(this._foreignModule));
}
return new Promise((resolve2, reject) => {
const onModuleCallback = (foreignModule) => {
this._foreignModule = foreignModule.create(ctx, createData);
resolve2(getAllMethodNames(this._foreignModule));
};
if (!isESM2) {
__require([`${moduleId}`], onModuleCallback, reject);
} else {
const url = FileAccess.asBrowserUri(`${moduleId}.js`).toString(true);
import(`${url}`).then(onModuleCallback).catch(reject);
}
});
}
// foreign method request
$fmr(method, args) {
if (!this._foreignModule || typeof this._foreignModule[method] !== "function") {
return Promise.reject(new Error("Missing requestHandler or method: " + method));
}
try {
return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));
} catch (e) {
return Promise.reject(e);
}
}
};
if (typeof importScripts === "function") {
globalThis.monaco = createMonacoBaseAPI();
}
}
});
// ../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/editor.worker.js
var editor_worker_exports = {};
__export(editor_worker_exports, {
initialize: () => initialize
});
function initialize(foreignModule) {
if (initialized) {
return;
}
initialized = true;
const simpleWorker = new SimpleWorkerServer((msg) => {
globalThis.postMessage(msg);
}, (workerServer) => new EditorSimpleWorker(EditorWorkerHost.getChannel(workerServer), foreignModule));
globalThis.onmessage = (e) => {
simpleWorker.onmessage(e.data);
};
}
var initialized;
var init_editor_worker = __esm({
"../../../node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/editor/editor.worker.js"() {
init_simpleWorker();
init_editorSimpleWorker();
init_editorWorkerHost();
initialized = false;
globalThis.onmessage = (e) => {
if (!initialized) {
initialize(null);
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/version.mjs
var version, versionInfo;
var init_version = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/version.mjs"() {
version = "17.1.0";
versionInfo = Object.freeze({
major: 17,
minor: 1,
patch: 0,
preReleaseTag: null
});
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/inspect.mjs
function inspect(value) {
return formatValue(value, []);
}
function formatValue(value, seenValues) {
switch (typeof value) {
case "string":
return JSON.stringify(value);
case "function":
return value.name ? `[function ${value.name}]` : "[function]";
case "object":
return formatObjectValue(value, seenValues);
default:
return String(value);
}
}
function formatObjectValue(value, previouslySeenValues) {
if (value === null) {
return "null";
}
if (previouslySeenValues.includes(value)) {
return "[Circular]";
}
const seenValues = [...previouslySeenValues, value];
if (isJSONable(value)) {
const jsonValue = value.toJSON();
if (jsonValue !== value) {
return typeof jsonValue === "string" ? jsonValue : formatValue(jsonValue, seenValues);
}
} else if (Array.isArray(value)) {
return formatArray(value, seenValues);
}
return formatObject(value, seenValues);
}
function isJSONable(value) {
return typeof value.toJSON === "function";
}
function formatObject(object, seenValues) {
const entries = Object.entries(object);
if (entries.length === 0) {
return "{}";
}
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
return "[" + getObjectTag(object) + "]";
}
const properties = entries.map(([key, value]) => key + ": " + formatValue(value, seenValues));
return "{ " + properties.join(", ") + " }";
}
function formatArray(array, seenValues) {
if (array.length === 0) {
return "[]";
}
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
return "[Array]";
}
const len = Math.min(MAX_ARRAY_LENGTH, array.length);
const remaining = array.length - len;
const items = [];
for (let i = 0; i < len; ++i) {
items.push(formatValue(array[i], seenValues));
}
if (remaining === 1) {
items.push("... 1 more item");
} else if (remaining > 1) {
items.push(`... ${remaining} more items`);
}
return "[" + items.join(", ") + "]";
}
function getObjectTag(object) {
const tag = Object.prototype.toString.call(object).replace(/^\[object /, "").replace(/]$/, "");
if (tag === "Object" && typeof object.constructor === "function") {
const name = object.constructor.name;
if (typeof name === "string" && name !== "") {
return name;
}
}
return tag;
}
var MAX_ARRAY_LENGTH, MAX_RECURSIVE_DEPTH;
var init_inspect = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/inspect.mjs"() {
MAX_ARRAY_LENGTH = 10;
MAX_RECURSIVE_DEPTH = 2;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/instanceOf.mjs
function devInstanceOf(value, symbol, constructor) {
if (value?.__kind === symbol) {
return true;
}
if (typeof value === "object" && value !== null) {
const className = constructor.prototype[Symbol.toStringTag];
const valueClassName = Symbol.toStringTag in value ? value[Symbol.toStringTag] : value.constructor?.name;
if (className === valueClassName) {
const stringifiedValue = inspect(value);
throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`);
}
}
return false;
}
function prodInstanceOf(value, symbol) {
return value?.__kind === symbol;
}
function enableDevInstanceOf() {
instanceOf = devInstanceOf;
}
var instanceOf;
var init_instanceOf = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/instanceOf.mjs"() {
init_inspect();
instanceOf = prodInstanceOf;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/devMode.mjs
function enableDevMode() {
devMode = true;
enableDevInstanceOf();
}
function isDevModeEnabled() {
return devMode;
}
var devMode;
var init_devMode = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/devMode.mjs"() {
init_instanceOf();
devMode = false;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isPromise.mjs
function isPromise(value) {
return value instanceof Promise;
}
function isPromiseLike(value) {
return typeof value?.then === "function";
}
var init_isPromise = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isPromise.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/toError.mjs
function toError(thrownValue) {
return thrownValue instanceof Error ? thrownValue : new NonErrorThrown(thrownValue);
}
var NonErrorThrown;
var init_toError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/toError.mjs"() {
init_inspect();
NonErrorThrown = class extends Error {
constructor(thrownValue) {
super("Unexpected error value: " + inspect(thrownValue));
this.name = "NonErrorThrown";
this.thrownValue = thrownValue;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isObjectLike.mjs
function isObjectLike(value) {
return typeof value == "object" && value !== null;
}
var init_isObjectLike = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isObjectLike.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/AccumulatorMap.mjs
var AccumulatorMap;
var init_AccumulatorMap = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/AccumulatorMap.mjs"() {
AccumulatorMap = class extends Map {
get [Symbol.toStringTag]() {
return "AccumulatorMap";
}
add(key, item) {
const group = this.get(key);
if (group === void 0) {
this.set(key, [item]);
} else {
group.push(item);
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/location.mjs
function getLocation(source, position) {
const matches = source.body.matchAll(LineRegExp);
let match = matches.next().value;
let line = 1;
let lastLineStart = 0;
while (match !== void 0 && match.index < position) {
lastLineStart = match.index + match[0].length;
line++;
match = matches.next().value;
}
return { line, column: position + 1 - lastLineStart };
}
function getLocations(locations) {
if (locations.length < 2) {
return locations.map(({ source, start }) => getLocation(source, start));
}
const bySource = new AccumulatorMap();
locations.forEach(({ source, start }, index) => {
bySource.add(source, {
position: start,
index
});
});
const result = new Array(locations.length);
for (const [source, positions] of bySource) {
const matches = source.body.matchAll(LineRegExp);
let match = matches.next().value;
let line = 1;
let lastLineStart = 0;
for (const { position, index } of positions.toSorted((a, b) => a.position - b.position)) {
while (match !== void 0 && match.index < position) {
lastLineStart = match.index + match[0].length;
line++;
match = matches.next().value;
}
result[index] = {
line,
column: position + 1 - lastLineStart
};
}
}
return result;
}
var LineRegExp;
var init_location = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/location.mjs"() {
init_AccumulatorMap();
LineRegExp = /\r\n|[\n\r]/g;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printLocation.mjs
function printLocation(location) {
return printSourceLocation(location.source, getLocation(location.source, location.start));
}
function printSourceLocation(source, sourceLocation) {
const firstLineColumnOffset = source.locationOffset.column - 1;
const body = "".padStart(firstLineColumnOffset) + source.body;
const lineIndex = sourceLocation.line - 1;
const lineOffset = source.locationOffset.line - 1;
const lineNum = sourceLocation.line + lineOffset;
const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
const columnNum = sourceLocation.column + columnOffset;
const locationStr = `${source.name}:${lineNum}:${columnNum}
`;
const lines = body.split(/\r\n|[\n\r]/g);
const locationLine = lines[lineIndex];
if (locationLine.length > 120) {
const subLines = [];
for (let i = 0; i < locationLine.length; i += 80) {
subLines.push(locationLine.slice(i, i + 80));
}
const zeroBasedColumn = columnNum - 1;
const subLineIndex = Math.min(Math.floor(zeroBasedColumn / 80), subLines.length - 1);
const subLineColumnNum = columnNum - subLineIndex * 80;
return locationStr + printPrefixedLines([
[`${lineNum} |`, subLines[0]],
...subLines.slice(1, subLineIndex + 1).map((subLine) => ["|", subLine]),
["|", "^".padStart(subLineColumnNum)],
["|", subLines[subLineIndex + 1]]
]);
}
return locationStr + printPrefixedLines([
[`${lineNum - 1} |`, lines[lineIndex - 1]],
[`${lineNum} |`, locationLine],
["|", "^".padStart(columnNum)],
[`${lineNum + 1} |`, lines[lineIndex + 1]]
]);
}
function printPrefixedLines(lines) {
const existingLines = lines.filter(([_2, line]) => line !== void 0);
const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
}
var init_printLocation = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printLocation.mjs"() {
init_location();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/GraphQLError.mjs
function undefinedIfEmpty(array) {
return array === void 0 || array.length === 0 ? void 0 : array;
}
var GraphQLError;
var init_GraphQLError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/GraphQLError.mjs"() {
init_isObjectLike();
init_location();
init_printLocation();
GraphQLError = class _GraphQLError extends Error {
constructor(message, options = {}) {
const { nodes, source, positions, path, originalError, cause, extensions } = options;
const hasCause = "cause" in options;
const errorCause = hasCause ? cause : originalError;
const errorOptions = hasCause || originalError != null ? { cause: errorCause } : void 0;
super(message, errorOptions);
this.name = "GraphQLError";
this.path = path ?? void 0;
const underlyingError = originalError ?? (cause instanceof Error ? cause : void 0);
this.originalError = underlyingError;
this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : void 0);
const nodeLocations = undefinedIfEmpty(this.nodes?.map((node) => node.loc).filter((loc) => loc != null));
this.source = source ?? nodeLocations?.[0]?.source;
this.positions = positions ?? nodeLocations?.map((loc) => loc.start);
this.locations = positions && source ? getLocations(positions.map((start) => ({ source, start }))) : nodeLocations && getLocations(nodeLocations);
const originalExtensions = isObjectLike(underlyingError?.extensions) ? underlyingError.extensions : void 0;
this.extensions = extensions ?? originalExtensions ?? /* @__PURE__ */ Object.create(null);
Object.defineProperties(this, {
message: {
writable: true,
enumerable: true
},
name: { enumerable: false },
nodes: { enumerable: false },
source: { enumerable: false },
positions: { enumerable: false },
originalError: { enumerable: false }
});
if (originalError?.stack != null) {
Object.defineProperty(this, "stack", {
value: originalError.stack,
writable: true,
configurable: true
});
} else if (Error.captureStackTrace != null) {
Error.captureStackTrace(this, _GraphQLError);
} else {
Object.defineProperty(this, "stack", {
value: Error().stack,
writable: true,
configurable: true
});
}
}
get [Symbol.toStringTag]() {
return "GraphQLError";
}
toString() {
let output = this.message;
if (this.nodes) {
for (const node of this.nodes) {
if (node.loc) {
output += "\n\n" + printLocation(node.loc);
}
}
} else if (this.source && this.locations) {
for (const location of this.locations) {
output += "\n\n" + printSourceLocation(this.source, location);
}
}
return output;
}
toJSON() {
const formattedError = {
message: this.message
};
if (this.locations != null) {
formattedError.locations = this.locations;
}
if (this.path != null) {
formattedError.path = this.path;
}
if (this.extensions != null && Object.keys(this.extensions).length > 0) {
formattedError.extensions = this.extensions;
}
return formattedError;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/ensureGraphQLError.mjs
function ensureGraphQLError(rawError) {
if (rawError instanceof GraphQLError) {
return rawError;
}
const originalError = toError(rawError);
return new GraphQLError(originalError.message, { originalError });
}
var init_ensureGraphQLError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/ensureGraphQLError.mjs"() {
init_toError();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/capitalize.mjs
function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
}
var init_capitalize = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/capitalize.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/invariant.mjs
function invariant(condition, message) {
if (!condition) {
throw new Error(message ?? "Unexpected invariant triggered.");
}
}
var init_invariant = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/invariant.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/formatList.mjs
function orList(items) {
return formatList("or", items);
}
function andList(items) {
return formatList("and", items);
}
function formatList(conjunction, items) {
if (!(items.length !== 0))
invariant(false);
switch (items.length) {
case 1:
return items[0];
case 2:
return items[0] + " " + conjunction + " " + items[1];
}
const allButLast = items.slice(0, -1);
const lastItem = items.at(-1);
return allButLast.join(", ") + ", " + conjunction + " " + lastItem;
}
var init_formatList = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/formatList.mjs"() {
init_invariant();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isIterableObject.mjs
function isIterableObject(maybeIterable) {
return typeof maybeIterable === "object" && typeof maybeIterable?.[Symbol.iterator] === "function";
}
var init_isIterableObject = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isIterableObject.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/keyMap.mjs
function keyMap(list, keyFn) {
const result = /* @__PURE__ */ Object.create(null);
for (const item of list) {
result[keyFn(item)] = item;
}
return result;
}
var init_keyMap = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/keyMap.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/mapValue.mjs
function mapValue(map, fn2) {
const result = /* @__PURE__ */ Object.create(null);
for (const key of Object.keys(map)) {
result[key] = fn2(map[key], key);
}
return result;
}
var init_mapValue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/mapValue.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/printPathArray.mjs
function printPathArray(path) {
if (path.length === 0) {
return "";
}
return ` at ${path.map((key) => typeof key === "number" ? `[${key}]` : `.${key}`).join("")}`;
}
var init_printPathArray = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/printPathArray.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/ast.mjs
function isNode(maybeNode) {
const maybeKind = maybeNode?.kind;
return typeof maybeKind === "string" && kindValues.has(maybeKind);
}
var Location, Token2, QueryDocumentKeys, kindValues, OperationTypeNode;
var init_ast = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/ast.mjs"() {
Location = class {
constructor(startToken, endToken, source) {
this.start = startToken.start;
this.end = endToken.end;
this.startToken = startToken;
this.endToken = endToken;
this.source = source;
}
get [Symbol.toStringTag]() {
return "Location";
}
toJSON() {
return { start: this.start, end: this.end };
}
};
Token2 = class {
constructor(kind, start, end, line, column, value) {
this.kind = kind;
this.start = start;
this.end = end;
this.line = line;
this.column = column;
this.value = value;
this.prev = null;
this.next = null;
}
get [Symbol.toStringTag]() {
return "Token";
}
toJSON() {
return {
kind: this.kind,
value: this.value,
line: this.line,
column: this.column
};
}
};
QueryDocumentKeys = {
Name: [],
Document: ["definitions"],
OperationDefinition: [
"description",
"name",
"variableDefinitions",
"directives",
"selectionSet"
],
VariableDefinition: [
"description",
"variable",
"type",
"defaultValue",
"directives"
],
Variable: ["name"],
SelectionSet: ["selections"],
Field: ["alias", "name", "arguments", "directives", "selectionSet"],
Argument: ["name", "value"],
FragmentArgument: ["name", "value"],
FragmentSpread: [
"name",
"arguments",
"directives"
],
InlineFragment: ["typeCondition", "directives", "selectionSet"],
FragmentDefinition: [
"description",
"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",
"directives",
"locations"
],
SchemaExtension: ["directives", "operationTypes"],
DirectiveExtension: ["name", "directives"],
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"],
TypeCoordinate: ["name"],
MemberCoordinate: ["name", "memberName"],
ArgumentCoordinate: ["name", "fieldName", "argumentName"],
DirectiveCoordinate: ["name"],
DirectiveArgumentCoordinate: ["name", "argumentName"]
};
kindValues = new Set(Object.keys(QueryDocumentKeys));
OperationTypeNode = {
QUERY: "query",
MUTATION: "mutation",
SUBSCRIPTION: "subscription"
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/kinds_.mjs
var kinds_exports = {};
__export(kinds_exports, {
ARGUMENT: () => ARGUMENT,
ARGUMENT_COORDINATE: () => ARGUMENT_COORDINATE,
BOOLEAN: () => BOOLEAN,
DIRECTIVE: () => DIRECTIVE,
DIRECTIVE_ARGUMENT_COORDINATE: () => DIRECTIVE_ARGUMENT_COORDINATE,
DIRECTIVE_COORDINATE: () => DIRECTIVE_COORDINATE,
DIRECTIVE_DEFINITION: () => DIRECTIVE_DEFINITION,
DIRECTIVE_EXTENSION: () => DIRECTIVE_EXTENSION,
DOCUMENT: () => DOCUMENT,
ENUM: () => ENUM,
ENUM_TYPE_DEFINITION: () => ENUM_TYPE_DEFINITION,
ENUM_TYPE_EXTENSION: () => ENUM_TYPE_EXTENSION,
ENUM_VALUE_DEFINITION: () => ENUM_VALUE_DEFINITION,
FIELD: () => FIELD,
FIELD_DEFINITION: () => FIELD_DEFINITION,
FLOAT: () => FLOAT,
FRAGMENT_ARGUMENT: () => FRAGMENT_ARGUMENT,
FRAGMENT_DEFINITION: () => FRAGMENT_DEFINITION,
FRAGMENT_SPREAD: () => FRAGMENT_SPREAD,
INLINE_FRAGMENT: () => INLINE_FRAGMENT,
INPUT_OBJECT_TYPE_DEFINITION: () => INPUT_OBJECT_TYPE_DEFINITION,
INPUT_OBJECT_TYPE_EXTENSION: () => INPUT_OBJECT_TYPE_EXTENSION,
INPUT_VALUE_DEFINITION: () => INPUT_VALUE_DEFINITION,
INT: () => INT,
INTERFACE_TYPE_DEFINITION: () => INTERFACE_TYPE_DEFINITION,
INTERFACE_TYPE_EXTENSION: () => INTERFACE_TYPE_EXTENSION,
LIST: () => LIST,
LIST_TYPE: () => LIST_TYPE,
MEMBER_COORDINATE: () => MEMBER_COORDINATE,
NAME: () => NAME,
NAMED_TYPE: () => NAMED_TYPE,
NON_NULL_TYPE: () => NON_NULL_TYPE,
NULL: () => NULL,
OBJECT: () => OBJECT,
OBJECT_FIELD: () => OBJECT_FIELD,
OBJECT_TYPE_DEFINITION: () => OBJECT_TYPE_DEFINITION,
OBJECT_TYPE_EXTENSION: () => OBJECT_TYPE_EXTENSION,
OPERATION_DEFINITION: () => OPERATION_DEFINITION,
OPERATION_TYPE_DEFINITION: () => OPERATION_TYPE_DEFINITION,
SCALAR_TYPE_DEFINITION: () => SCALAR_TYPE_DEFINITION,
SCALAR_TYPE_EXTENSION: () => SCALAR_TYPE_EXTENSION,
SCHEMA_DEFINITION: () => SCHEMA_DEFINITION,
SCHEMA_EXTENSION: () => SCHEMA_EXTENSION,
SELECTION_SET: () => SELECTION_SET,
STRING: () => STRING,
TYPE_COORDINATE: () => TYPE_COORDINATE,
UNION_TYPE_DEFINITION: () => UNION_TYPE_DEFINITION,
UNION_TYPE_EXTENSION: () => UNION_TYPE_EXTENSION,
VARIABLE: () => VARIABLE,
VARIABLE_DEFINITION: () => VARIABLE_DEFINITION
});
var NAME, DOCUMENT, OPERATION_DEFINITION, VARIABLE_DEFINITION, SELECTION_SET, FIELD, ARGUMENT, FRAGMENT_ARGUMENT, FRAGMENT_SPREAD, INLINE_FRAGMENT, FRAGMENT_DEFINITION, VARIABLE, INT, FLOAT, STRING, BOOLEAN, NULL, ENUM, LIST, OBJECT, OBJECT_FIELD, DIRECTIVE, NAMED_TYPE, LIST_TYPE, NON_NULL_TYPE, SCHEMA_DEFINITION, OPERATION_TYPE_DEFINITION, SCALAR_TYPE_DEFINITION, OBJECT_TYPE_DEFINITION, FIELD_DEFINITION, INPUT_VALUE_DEFINITION, INTERFACE_TYPE_DEFINITION, UNION_TYPE_DEFINITION, ENUM_TYPE_DEFINITION, ENUM_VALUE_DEFINITION, INPUT_OBJECT_TYPE_DEFINITION, DIRECTIVE_DEFINITION, SCHEMA_EXTENSION, DIRECTIVE_EXTENSION, SCALAR_TYPE_EXTENSION, OBJECT_TYPE_EXTENSION, INTERFACE_TYPE_EXTENSION, UNION_TYPE_EXTENSION, ENUM_TYPE_EXTENSION, INPUT_OBJECT_TYPE_EXTENSION, TYPE_COORDINATE, MEMBER_COORDINATE, ARGUMENT_COORDINATE, DIRECTIVE_COORDINATE, DIRECTIVE_ARGUMENT_COORDINATE;
var init_kinds = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/kinds_.mjs"() {
NAME = "Name";
DOCUMENT = "Document";
OPERATION_DEFINITION = "OperationDefinition";
VARIABLE_DEFINITION = "VariableDefinition";
SELECTION_SET = "SelectionSet";
FIELD = "Field";
ARGUMENT = "Argument";
FRAGMENT_ARGUMENT = "FragmentArgument";
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";
DIRECTIVE_EXTENSION = "DirectiveExtension";
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";
TYPE_COORDINATE = "TypeCoordinate";
MEMBER_COORDINATE = "MemberCoordinate";
ARGUMENT_COORDINATE = "ArgumentCoordinate";
DIRECTIVE_COORDINATE = "DirectiveCoordinate";
DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/kinds.mjs
var init_kinds2 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/kinds.mjs"() {
init_kinds();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/devAssert.mjs
function devAssert(condition, message) {
if (!condition) {
throw new Error(message);
}
}
var init_devAssert = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/devAssert.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/didYouMean.mjs
function didYouMean(firstArg, secondArg) {
const [subMessage, suggestions] = secondArg ? [firstArg, secondArg] : [void 0, firstArg];
if (suggestions.length === 0) {
return "";
}
let message = " Did you mean ";
if (subMessage != null) {
message += subMessage + " ";
}
const suggestionList2 = orList(suggestions.slice(0, MAX_SUGGESTIONS).map((x2) => `"${x2}"`));
return message + suggestionList2 + "?";
}
var MAX_SUGGESTIONS;
var init_didYouMean = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/didYouMean.mjs"() {
init_formatList();
MAX_SUGGESTIONS = 5;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/identityFunc.mjs
function identityFunc(x2) {
return x2;
}
var init_identityFunc = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/identityFunc.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/keyValMap.mjs
function keyValMap(list, keyFn, valFn) {
const result = /* @__PURE__ */ Object.create(null);
for (const item of list) {
result[keyFn(item)] = valFn(item);
}
return result;
}
var init_keyValMap = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/keyValMap.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/naturalCompare.mjs
function naturalCompare(aStr, bStr) {
let aIndex = 0;
let bIndex = 0;
while (aIndex < aStr.length && bIndex < bStr.length) {
let aChar = aStr.charCodeAt(aIndex);
let bChar = bStr.charCodeAt(bIndex);
if (isDigit(aChar) && isDigit(bChar)) {
let aNum = 0;
do {
++aIndex;
aNum = aNum * 10 + aChar - DIGIT_0;
aChar = aStr.charCodeAt(aIndex);
} while (isDigit(aChar) && aNum > 0);
let bNum = 0;
do {
++bIndex;
bNum = bNum * 10 + bChar - DIGIT_0;
bChar = bStr.charCodeAt(bIndex);
} while (isDigit(bChar) && bNum > 0);
if (aNum < bNum) {
return -1;
}
if (aNum > bNum) {
return 1;
}
} else {
if (aChar < bChar) {
return -1;
}
if (aChar > bChar) {
return 1;
}
++aIndex;
++bIndex;
}
}
return aStr.length - bStr.length;
}
function isDigit(code) {
return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;
}
var DIGIT_0, DIGIT_9;
var init_naturalCompare = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/naturalCompare.mjs"() {
DIGIT_0 = 48;
DIGIT_9 = 57;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/suggestionList.mjs
function suggestionList(input, options) {
const optionsByDistance = /* @__PURE__ */ Object.create(null);
const lexicalDistance = new LexicalDistance(input);
const threshold = Math.floor(input.length * 0.4) + 1;
for (const option of options) {
const distance = lexicalDistance.measure(option, threshold);
if (distance !== void 0) {
optionsByDistance[option] = distance;
}
}
return Object.keys(optionsByDistance).sort((a, b) => {
const distanceDiff = optionsByDistance[a] - optionsByDistance[b];
return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);
});
}
function stringToArray(str) {
const strLength = str.length;
const array = new Array(strLength);
for (let i = 0; i < strLength; ++i) {
array[i] = str.charCodeAt(i);
}
return array;
}
var LexicalDistance;
var init_suggestionList = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/suggestionList.mjs"() {
init_naturalCompare();
LexicalDistance = class {
constructor(input) {
this._input = input;
this._inputLowerCase = input.toLowerCase();
this._inputArray = stringToArray(this._inputLowerCase);
this._rows = [
new Array(input.length + 1).fill(0),
new Array(input.length + 1).fill(0),
new Array(input.length + 1).fill(0)
];
}
measure(option, threshold) {
if (this._input === option) {
return 0;
}
const optionLowerCase = option.toLowerCase();
if (this._inputLowerCase === optionLowerCase) {
return 1;
}
let a = stringToArray(optionLowerCase);
let b = this._inputArray;
if (a.length < b.length) {
const tmp = a;
a = b;
b = tmp;
}
const aLength = a.length;
const bLength = b.length;
if (aLength - bLength > threshold) {
return void 0;
}
const rows = this._rows;
for (let j = 0; j <= bLength; j++) {
rows[0][j] = j;
}
for (let i = 1; i <= aLength; i++) {
const upRow = rows[(i - 1) % 3];
const currentRow = rows[i % 3];
let smallestCell = currentRow[0] = i;
for (let j = 1; j <= bLength; j++) {
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
let currentCell = Math.min(upRow[j] + 1, currentRow[j - 1] + 1, upRow[j - 1] + cost);
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
const doubleDiagonalCell = rows[(i - 2) % 3][j - 2];
currentCell = Math.min(currentCell, doubleDiagonalCell + 1);
}
if (currentCell < smallestCell) {
smallestCell = currentCell;
}
currentRow[j] = currentCell;
}
if (smallestCell > threshold) {
return void 0;
}
}
const distance = rows[aLength % 3][bLength];
return distance <= threshold ? distance : void 0;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/toObjMap.mjs
function toObjMapWithSymbols(obj) {
if (obj == null) {
return /* @__PURE__ */ Object.create(null);
}
if (Object.getPrototypeOf(obj) === null) {
return obj;
}
const map = /* @__PURE__ */ Object.create(null);
for (const [key, value] of Object.entries(obj)) {
map[key] = value;
}
for (const key of Object.getOwnPropertySymbols(obj)) {
map[key] = obj[key];
}
return map;
}
var init_toObjMap = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/toObjMap.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/characterClasses.mjs
function isWhiteSpace(code) {
return code === 9 || code === 32;
}
function isDigit2(code) {
return code >= 48 && code <= 57;
}
function isLetter(code) {
return code >= 97 && code <= 122 || code >= 65 && code <= 90;
}
function isNameStart(code) {
return isLetter(code) || code === 95;
}
function isNameContinue(code) {
return isLetter(code) || isDigit2(code) || code === 95;
}
var init_characterClasses = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/characterClasses.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/blockString.mjs
function dedentBlockStringLines(lines) {
let commonIndent = Number.MAX_SAFE_INTEGER;
let firstNonEmptyLine = null;
let lastNonEmptyLine = -1;
for (let i = 0; i < lines.length; ++i) {
const line = lines[i];
const indent = leadingWhitespace(line);
if (indent === line.length) {
continue;
}
firstNonEmptyLine ??= i;
lastNonEmptyLine = i;
if (i !== 0 && indent < commonIndent) {
commonIndent = indent;
}
}
return lines.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice(firstNonEmptyLine ?? 0, lastNonEmptyLine + 1);
}
function leadingWhitespace(str) {
let i = 0;
while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {
++i;
}
return i;
}
function isPrintableAsBlockString(value) {
if (value === "") {
return true;
}
let isEmptyLine = true;
let hasIndent = false;
let hasCommonIndent = true;
let seenNonEmptyLine = false;
for (let i = 0; i < value.length; ++i) {
switch (value.codePointAt(i)) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 11:
case 12:
case 14:
case 15:
return false;
case 13:
return false;
case 10:
if (isEmptyLine && !seenNonEmptyLine) {
return false;
}
seenNonEmptyLine = true;
isEmptyLine = true;
hasIndent = false;
break;
case 9:
case 32:
hasIndent ||= isEmptyLine;
break;
default:
hasCommonIndent &&= hasIndent;
isEmptyLine = false;
}
}
if (isEmptyLine) {
return false;
}
if (hasCommonIndent && seenNonEmptyLine) {
return false;
}
return true;
}
function printBlockString(value, options) {
const escapedValue = value.replaceAll('"""', '\\"""');
const lines = escapedValue.split(/\r\n|[\n\r]/g);
const isSingleLine = lines.length === 1;
const forceLeadingNewLine = lines.length > 1 && lines.slice(1).every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0)));
const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
const hasTrailingSlash = value.endsWith("\\");
const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;
const printAsMultipleLines = !options?.minimize && (!isSingleLine || value.length > 70 || forceTrailingNewline || forceLeadingNewLine || hasTrailingTripleQuotes);
let result = "";
const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));
if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) {
result += "\n";
}
result += escapedValue;
if (printAsMultipleLines || forceTrailingNewline) {
result += "\n";
}
return '"""' + result + '"""';
}
var init_blockString = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/blockString.mjs"() {
init_characterClasses();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printString.mjs
function printString(str) {
return `"${str.replace(escapedRegExp, escapedReplacer)}"`;
}
function escapedReplacer(str) {
return escapeSequences[str.charCodeAt(0)];
}
var escapedRegExp, escapeSequences;
var init_printString = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printString.mjs"() {
escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
escapeSequences = [
"\\u0000",
"\\u0001",
"\\u0002",
"\\u0003",
"\\u0004",
"\\u0005",
"\\u0006",
"\\u0007",
"\\b",
"\\t",
"\\n",
"\\u000B",
"\\f",
"\\r",
"\\u000E",
"\\u000F",
"\\u0010",
"\\u0011",
"\\u0012",
"\\u0013",
"\\u0014",
"\\u0015",
"\\u0016",
"\\u0017",
"\\u0018",
"\\u0019",
"\\u001A",
"\\u001B",
"\\u001C",
"\\u001D",
"\\u001E",
"\\u001F",
"",
"",
'\\"',
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\\\\",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\\u007F",
"\\u0080",
"\\u0081",
"\\u0082",
"\\u0083",
"\\u0084",
"\\u0085",
"\\u0086",
"\\u0087",
"\\u0088",
"\\u0089",
"\\u008A",
"\\u008B",
"\\u008C",
"\\u008D",
"\\u008E",
"\\u008F",
"\\u0090",
"\\u0091",
"\\u0092",
"\\u0093",
"\\u0094",
"\\u0095",
"\\u0096",
"\\u0097",
"\\u0098",
"\\u0099",
"\\u009A",
"\\u009B",
"\\u009C",
"\\u009D",
"\\u009E",
"\\u009F"
];
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/reducer.mjs
function reduce(root, reducer) {
const stack = [];
let frame = {
parent: [root],
keys: void 0,
results: [],
index: -1
};
let node;
do {
let kind;
frame.index++;
const length = frame.keys === void 0 ? frame.parent.length : frame.keys.length;
if (frame.index === length) {
node = frame.results;
kind = frame.keys === void 0 ? void 0 : frame.results.kind;
frame = stack.pop();
} else {
node = frame.keys === void 0 ? frame.parent[frame.index] : frame.parent[frame.keys[frame.index]];
if (node == null && stack.length !== 0) {
continue;
}
if (Array.isArray(node)) {
if (node.length !== 0) {
stack.push(frame);
frame = { parent: node, keys: void 0, results: [], index: -1 };
continue;
}
} else {
const parent = node;
kind = parent?.kind;
const keys = typeof kind === "string" ? QueryDocumentKeys[kind] : void 0;
if (!Array.isArray(keys)) {
throw new Error(`Invalid AST Node: ${inspect(node)}.`);
}
if (keys.length !== 0) {
stack.push(frame);
frame = { parent, keys, results: { ...parent }, index: -1 };
continue;
}
}
}
if (kind !== void 0) {
const reduceNode = reducer[kind];
node = reduceNode?.(node);
}
if (frame.keys === void 0) {
frame.results.push(node);
} else {
frame.results[frame.keys[frame.index]] = node;
}
} while (stack.length !== 0);
return node;
}
var init_reducer = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/reducer.mjs"() {
init_inspect();
init_ast();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printer.mjs
function print(ast, options) {
return render(reduce(ast, printDocASTReducer), options?.maxIndentDepth ?? Infinity);
}
function printForError(ast) {
return print(ast, { maxIndentDepth: 100 });
}
function render(buffer, maxDepth) {
let output = "";
let text = "";
let depth = 0;
let indentation = "";
let part = buffer;
while (part !== void 0) {
const lines = part.lines;
if (part.indentBefore) {
if (depth < maxDepth) {
indentation += " ";
text += " ";
}
depth++;
}
if (typeof lines === "string") {
text += lines;
} else {
text += lines[0];
const newline = !part.isBlockString && depth >= maxDepth ? " " : "\n" + indentation;
for (let i = 1; i < lines.length; i++) {
output += text;
text = newline + lines[i];
}
}
if (part.dedentAfter) {
depth--;
indentation = indentation.slice(0, depth * 2);
}
part = part.next;
}
return output + text;
}
function join2(maybeArray, separator = "") {
if (maybeArray == null || maybeArray.length === 0) {
return EMPTY;
}
let result = EMPTY;
for (const item of maybeArray) {
if (item === void 0 || item.length === 0) {
continue;
}
if (result.length === 0) {
result = typeof item === "string" ? new PrintBuffer(item) : item;
} else {
if (separator !== "") {
result.append(separator);
}
result.append(item);
}
}
return result;
}
function joinedLength(array, separator) {
let length = 0;
for (const item of array) {
if (item.length !== 0) {
length += (length === 0 ? 0 : separator.length) + item.length;
}
}
return length;
}
function block(array) {
return wrap("{\n", join2(array, "\n").indent(), "\n}");
}
function wrap(start, maybeBuffer, end = "") {
return maybeBuffer != null && maybeBuffer.length !== 0 ? start === "" ? maybeBuffer.append(end) : new PrintBuffer(start).append(maybeBuffer).append(end) : EMPTY;
}
function hasMultilineItems(maybeArray) {
return maybeArray?.some((result) => result.newlines !== 0) ?? false;
}
function wrappedLineAndArgs(prefix, args) {
if (args == null || args.length === 0) {
return prefix;
}
return join2([
prefix,
prefix.length + joinedLength(args, ", ") + 2 > MAX_LINE_LENGTH ? wrap("(\n", join2(args, "\n").indent(), "\n)") : wrap("(", join2(args, ", "), ")")
]);
}
var MAX_LINE_LENGTH, PrintBuffer, EMPTY, printDocASTReducer;
var init_printer = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/printer.mjs"() {
init_blockString();
init_printString();
init_reducer();
MAX_LINE_LENGTH = 80;
PrintBuffer = class _PrintBuffer {
constructor(value = "", isBlockString = false) {
this.next = void 0;
this.tail = this;
this.indentBefore = false;
this.dedentAfter = false;
this.length = value.length;
this.lines = value.includes("\n") ? value.split("\n") : value;
this.newlines = typeof this.lines === "string" ? 0 : this.lines.length - 1;
this.isBlockString = isBlockString;
}
append(result) {
if (result.length === 0) {
return this;
}
const next = typeof result === "string" ? new _PrintBuffer(result) : result;
this.tail.next = next;
this.tail = next.tail;
this.length += next.length;
this.newlines += next.newlines;
return this;
}
indent() {
if (this.length === 0) {
return this;
}
this.indentBefore = true;
this.tail.dedentAfter = true;
this.length += 2 * (this.newlines + 1);
return this;
}
};
EMPTY = new PrintBuffer();
printDocASTReducer = {
Name: (node) => new PrintBuffer(node.value),
Variable: (node) => join2(["$", node.name]),
Document: (node) => join2(node.definitions, "\n\n"),
OperationDefinition(node) {
const varDefs = hasMultilineItems(node.variableDefinitions) ? wrap("(\n", join2(node.variableDefinitions, "\n"), "\n)") : wrap("(", join2(node.variableDefinitions, ", "), ")");
const prefix = join2([
wrap("", node.description, "\n"),
join2([
node.operation,
join2([node.name, varDefs]),
join2(node.directives, " ")
], " ")
]);
return join2([
node.operation === "query" && prefix.length === node.operation.length ? "" : join2([prefix, " "]),
node.selectionSet
]);
},
VariableDefinition: ({ variable, type, defaultValue, directives, description }) => join2([
wrap("", description, "\n"),
variable,
": ",
type,
wrap(" = ", defaultValue),
wrap(" ", join2(directives, " "))
]),
SelectionSet: ({ selections }) => selections.length === 0 ? new PrintBuffer("{}") : block(selections),
Field({ alias, name, arguments: args, directives, selectionSet }) {
const prefix = join2([wrap("", alias, ": "), name], "");
return join2([
wrappedLineAndArgs(prefix, args),
wrap(" ", join2(directives, " ")),
wrap(" ", selectionSet)
]);
},
Argument: ({ name, value }) => join2([name, ": ", value]),
FragmentArgument: ({ name, value }) => join2([name, ": ", value]),
FragmentSpread: ({ name, arguments: args, directives }) => {
const prefix = join2(["...", name]);
return join2([
wrappedLineAndArgs(prefix, args),
wrap(" ", join2(directives, " "))
]);
},
InlineFragment: ({ typeCondition, directives, selectionSet }) => join2(["...", wrap("on ", typeCondition), join2(directives, " "), selectionSet], " "),
FragmentDefinition: ({ name, typeCondition, variableDefinitions, directives, selectionSet, description }) => join2([
wrap("", description, "\n"),
"fragment ",
name,
wrap("(", join2(variableDefinitions, ", "), ")"),
" on ",
typeCondition,
" ",
wrap("", join2(directives, " "), " "),
selectionSet
]),
IntValue: ({ value }) => new PrintBuffer(value),
FloatValue: ({ value }) => new PrintBuffer(value),
StringValue: ({ value, block: isBlockString }) => new PrintBuffer(isBlockString === true ? printBlockString(value) : printString(value), isBlockString === true),
BooleanValue: ({ value }) => new PrintBuffer(value ? "true" : "false"),
NullValue: () => new PrintBuffer("null"),
EnumValue: ({ value }) => new PrintBuffer(value),
ListValue: ({ values }) => {
if (2 + joinedLength(values, ", ") > MAX_LINE_LENGTH) {
return wrap("[\n", join2(values, "\n").indent(), "\n]");
}
return join2(["[", join2(values, ", "), "]"]);
},
ObjectValue: ({ fields }) => 4 + joinedLength(fields, ", ") > MAX_LINE_LENGTH ? block(fields) : join2(["{ ", join2(fields, ", "), " }"]),
ObjectField: ({ name, value }) => join2([name, ": ", value]),
Directive: ({ name, arguments: args }) => join2(["@", name, wrap("(", join2(args, ", "), ")")]),
NamedType: ({ name }) => name,
ListType: ({ type }) => join2(["[", type, "]"]),
NonNullType: ({ type }) => join2([type, "!"]),
SchemaDefinition: ({ description, directives, operationTypes }) => join2([
wrap("", description, "\n"),
join2(["schema", join2(directives, " "), block(operationTypes)], " ")
]),
OperationTypeDefinition: ({ operation, type }) => join2([operation, ": ", type]),
ScalarTypeDefinition: ({ description, name, directives }) => join2([
wrap("", description, "\n"),
join2(["scalar", name, join2(directives, " ")], " ")
]),
ObjectTypeDefinition: ({ description, name, interfaces, directives, fields }) => join2([
wrap("", description, "\n"),
join2([
"type",
name,
wrap("implements ", join2(interfaces, " & ")),
join2(directives, " "),
block(fields)
], " ")
]),
FieldDefinition: ({ description, name, arguments: args, type, directives }) => join2([
wrap("", description, "\n"),
name,
hasMultilineItems(args) ? wrap("(\n", join2(args, "\n").indent(), "\n)") : wrap("(", join2(args, ", "), ")"),
": ",
type,
wrap(" ", join2(directives, " "))
]),
InputValueDefinition: ({ description, name, type, defaultValue, directives }) => join2([
wrap("", description, "\n"),
name,
": ",
type,
wrap(" = ", defaultValue),
wrap(" ", join2(directives, " "))
]),
InterfaceTypeDefinition: ({ description, name, interfaces, directives, fields }) => join2([
wrap("", description, "\n"),
join2([
"interface",
name,
wrap("implements ", join2(interfaces, " & ")),
join2(directives, " "),
block(fields)
], " ")
]),
UnionTypeDefinition: ({ description, name, directives, types }) => join2([
wrap("", description, "\n"),
join2(["union", name, join2(directives, " "), wrap("= ", join2(types, " | "))], " ")
]),
EnumTypeDefinition: ({ description, name, directives, values }) => join2([
wrap("", description, "\n"),
join2(["enum", name, join2(directives, " "), block(values)], " ")
]),
EnumValueDefinition: ({ description, name, directives }) => join2([
wrap("", description, "\n"),
join2([name, join2(directives, " ")], " ")
]),
InputObjectTypeDefinition: ({ description, name, directives, fields }) => join2([
wrap("", description, "\n"),
join2(["input", name, join2(directives, " "), block(fields)], " ")
]),
DirectiveDefinition: ({ description, name, arguments: args, directives, repeatable, locations }) => join2([
wrap("", description, "\n"),
"directive @",
name,
hasMultilineItems(args) ? wrap("(\n", join2(args, "\n").indent(), "\n)") : wrap("(", join2(args, ", "), ")"),
wrap(" ", join2(directives, " ")),
repeatable ? " repeatable" : "",
" on ",
join2(locations, " | ")
]),
SchemaExtension: ({ directives, operationTypes }) => join2(["extend schema", join2(directives, " "), block(operationTypes)], " "),
ScalarTypeExtension: ({ name, directives }) => join2(["extend scalar", name, join2(directives, " ")], " "),
ObjectTypeExtension: ({ name, interfaces, directives, fields }) => join2([
"extend type",
name,
wrap("implements ", join2(interfaces, " & ")),
join2(directives, " "),
block(fields)
], " "),
InterfaceTypeExtension: ({ name, interfaces, directives, fields }) => join2([
"extend interface",
name,
wrap("implements ", join2(interfaces, " & ")),
join2(directives, " "),
block(fields)
], " "),
UnionTypeExtension: ({ name, directives, types }) => join2([
"extend union",
name,
join2(directives, " "),
wrap("= ", join2(types, " | "))
], " "),
EnumTypeExtension: ({ name, directives, values }) => join2(["extend enum", name, join2(directives, " "), block(values)], " "),
InputObjectTypeExtension: ({ name, directives, fields }) => join2(["extend input", name, join2(directives, " "), block(fields)], " "),
DirectiveExtension: ({ name, directives }) => join2([join2(["extend directive @", name]), join2(directives, " ")], " "),
TypeCoordinate: ({ name }) => name,
MemberCoordinate: ({ name, memberName }) => join2([name, wrap(".", memberName)]),
ArgumentCoordinate: ({ name, fieldName, argumentName }) => join2([name, wrap(".", fieldName), wrap("(", argumentName, ":)")]),
DirectiveCoordinate: ({ name }) => join2(["@", name]),
DirectiveArgumentCoordinate: ({ name, argumentName }) => join2(["@", name, wrap("(", argumentName, ":)")])
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueFromASTUntyped.mjs
function valueFromASTUntyped(valueNode, variables) {
switch (valueNode.kind) {
case kinds_exports.NULL:
return null;
case kinds_exports.INT:
return parseInt(valueNode.value, 10);
case kinds_exports.FLOAT:
return parseFloat(valueNode.value);
case kinds_exports.STRING:
case kinds_exports.ENUM:
case kinds_exports.BOOLEAN:
return valueNode.value;
case kinds_exports.LIST:
return valueNode.values.map((node) => valueFromASTUntyped(node, variables));
case kinds_exports.OBJECT:
return keyValMap(valueNode.fields, (field) => field.name.value, (field) => valueFromASTUntyped(field.value, variables));
case kinds_exports.VARIABLE:
return variables?.[valueNode.name.value];
}
}
var init_valueFromASTUntyped = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueFromASTUntyped.mjs"() {
init_keyValMap();
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/assertName.mjs
function assertName(name) {
if (name.length === 0) {
throw new GraphQLError("Expected name to be a non-empty string.");
}
for (let i = 1; i < name.length; ++i) {
if (!isNameContinue(name.charCodeAt(i))) {
throw new GraphQLError(`Names must only contain [_a-zA-Z0-9] but "${name}" does not.`);
}
}
if (!isNameStart(name.charCodeAt(0))) {
throw new GraphQLError(`Names must start with [_a-zA-Z] but "${name}" does not.`);
}
return name;
}
function assertEnumValueName(name) {
if (name === "true" || name === "false" || name === "null") {
throw new GraphQLError(`Enum values cannot be named: ${name}`);
}
return assertName(name);
}
var init_assertName = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/assertName.mjs"() {
init_GraphQLError();
init_characterClasses();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/definition.mjs
function isType(type) {
return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type);
}
function assertType(type) {
if (!isType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`);
}
return type;
}
function isScalarType(type) {
return instanceOf(type, scalarSymbol, GraphQLScalarType);
}
function assertScalarType(type) {
if (!isScalarType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`);
}
return type;
}
function isObjectType(type) {
return instanceOf(type, objectSymbol, GraphQLObjectType);
}
function assertObjectType(type) {
if (!isObjectType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`);
}
return type;
}
function isField(field) {
return instanceOf(field, fieldSymbol, GraphQLField);
}
function assertField(field) {
if (!isField(field)) {
throw new Error(`Expected ${inspect(field)} to be a GraphQL field.`);
}
return field;
}
function isArgument(arg) {
return instanceOf(arg, argumentSymbol, GraphQLArgument);
}
function assertArgument(arg) {
if (!isArgument(arg)) {
throw new Error(`Expected ${inspect(arg)} to be a GraphQL argument.`);
}
return arg;
}
function isInterfaceType(type) {
return instanceOf(type, interfaceSymbol, GraphQLInterfaceType);
}
function assertInterfaceType(type) {
if (!isInterfaceType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Interface type.`);
}
return type;
}
function isUnionType(type) {
return instanceOf(type, unionSymbol, GraphQLUnionType);
}
function assertUnionType(type) {
if (!isUnionType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`);
}
return type;
}
function isEnumType(type) {
return instanceOf(type, enumSymbol, GraphQLEnumType);
}
function assertEnumType(type) {
if (!isEnumType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`);
}
return type;
}
function isEnumValue(value) {
return instanceOf(value, enumValueSymbol, GraphQLEnumValue);
}
function assertEnumValue(value) {
if (!isEnumValue(value)) {
throw new Error(`Expected ${inspect(value)} to be a GraphQL Enum value.`);
}
return value;
}
function isInputObjectType(type) {
return instanceOf(type, inputObjectSymbol, GraphQLInputObjectType);
}
function assertInputObjectType(type) {
if (!isInputObjectType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Input Object type.`);
}
return type;
}
function isInputField(field) {
return instanceOf(field, inputFieldSymbol, GraphQLInputField);
}
function assertInputField(field) {
if (!isInputField(field)) {
throw new Error(`Expected ${inspect(field)} to be a GraphQL input field.`);
}
return field;
}
function isListType(type) {
return instanceOf(type, listSymbol, GraphQLList);
}
function assertListType(type) {
if (!isListType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`);
}
return type;
}
function isNonNullType(type) {
return instanceOf(type, nonNullSymbol, GraphQLNonNull);
}
function assertNonNullType(type) {
if (!isNonNullType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);
}
return type;
}
function isInputType(type) {
return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType);
}
function assertInputType(type) {
if (!isInputType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`);
}
return type;
}
function isOutputType(type) {
return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);
}
function assertOutputType(type) {
if (!isOutputType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`);
}
return type;
}
function isLeafType(type) {
return isScalarType(type) || isEnumType(type);
}
function assertLeafType(type) {
if (!isLeafType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`);
}
return type;
}
function isCompositeType(type) {
return isObjectType(type) || isInterfaceType(type) || isUnionType(type);
}
function assertCompositeType(type) {
if (!isCompositeType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL composite type.`);
}
return type;
}
function isAbstractType(type) {
return isInterfaceType(type) || isUnionType(type);
}
function assertAbstractType(type) {
if (!isAbstractType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`);
}
return type;
}
function isWrappingType(type) {
return isListType(type) || isNonNullType(type);
}
function assertWrappingType(type) {
if (!isWrappingType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`);
}
return type;
}
function isNullableType(type) {
return isType(type) && !isNonNullType(type);
}
function assertNullableType(type) {
if (!isNullableType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`);
}
return type;
}
function getNullableType(type) {
if (type) {
return isNonNullType(type) ? type.ofType : type;
}
}
function isNamedType(type) {
return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);
}
function assertNamedType(type) {
if (!isNamedType(type)) {
throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`);
}
return type;
}
function getNamedType(type) {
if (type) {
let unwrappedType = type;
while (isWrappingType(unwrappedType)) {
unwrappedType = unwrappedType.ofType;
}
return unwrappedType;
}
}
function resolveReadonlyArrayThunk(thunk) {
return typeof thunk === "function" ? thunk() : thunk;
}
function resolveObjMapThunk(thunk) {
return typeof thunk === "function" ? thunk() : thunk;
}
function defineInterfaces(interfaces) {
return resolveReadonlyArrayThunk(interfaces ?? []);
}
function defineFieldMap(parentType, fields) {
const fieldMap = resolveObjMapThunk(fields);
return mapValue(fieldMap, (fieldConfig, fieldName) => new GraphQLField(parentType, fieldName, fieldConfig));
}
function isRequiredArgument(arg) {
return isNonNullType(arg.type) && arg.default === void 0 && arg.defaultValue === void 0;
}
function defineTypes(types) {
return resolveReadonlyArrayThunk(types);
}
function defineEnumValues(parentEnum, values) {
const valueMap = resolveObjMapThunk(values);
return Object.entries(valueMap).map(([valueName, valueConfig]) => new GraphQLEnumValue(parentEnum, valueName, valueConfig));
}
function didYouMeanEnumValue(enumType, unknownValueStr) {
const allNames = enumType.getValues().map((value) => value.name);
const suggestedValues = suggestionList(unknownValueStr, allNames);
return didYouMean("the enum value", suggestedValues);
}
function defineInputFieldMap(parentType, fields) {
const fieldMap = resolveObjMapThunk(fields);
return mapValue(fieldMap, (fieldConfig, fieldName) => new GraphQLInputField(parentType, fieldName, fieldConfig));
}
function isRequiredInputField(field) {
return isNonNullType(field.type) && field.defaultValue === void 0 && field.default === void 0;
}
var scalarSymbol, objectSymbol, fieldSymbol, argumentSymbol, interfaceSymbol, unionSymbol, enumSymbol, enumValueSymbol, inputObjectSymbol, inputFieldSymbol, listSymbol, nonNullSymbol, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLField, GraphQLArgument, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLEnumValue, GraphQLInputObjectType, GraphQLInputField;
var init_definition = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/definition.mjs"() {
init_devAssert();
init_didYouMean();
init_identityFunc();
init_inspect();
init_instanceOf();
init_keyMap();
init_keyValMap();
init_mapValue();
init_suggestionList();
init_toObjMap();
init_GraphQLError();
init_kinds2();
init_printer();
init_valueFromASTUntyped();
init_assertName();
scalarSymbol = /* @__PURE__ */ Symbol("Scalar");
objectSymbol = /* @__PURE__ */ Symbol("Object");
fieldSymbol = /* @__PURE__ */ Symbol("Field");
argumentSymbol = /* @__PURE__ */ Symbol("Argument");
interfaceSymbol = /* @__PURE__ */ Symbol("Interface");
unionSymbol = /* @__PURE__ */ Symbol("Union");
enumSymbol = /* @__PURE__ */ Symbol("Enum");
enumValueSymbol = /* @__PURE__ */ Symbol("EnumValue");
inputObjectSymbol = /* @__PURE__ */ Symbol("InputObject");
inputFieldSymbol = /* @__PURE__ */ Symbol("InputField");
listSymbol = /* @__PURE__ */ Symbol("List");
nonNullSymbol = /* @__PURE__ */ Symbol("NonNull");
GraphQLList = class {
constructor(ofType) {
this.__kind = listSymbol;
this.ofType = ofType;
}
get [Symbol.toStringTag]() {
return "GraphQLList";
}
toString() {
return "[" + String(this.ofType) + "]";
}
toJSON() {
return this.toString();
}
};
GraphQLNonNull = class {
constructor(ofType) {
this.__kind = nonNullSymbol;
this.ofType = ofType;
}
get [Symbol.toStringTag]() {
return "GraphQLNonNull";
}
toString() {
return String(this.ofType) + "!";
}
toJSON() {
return this.toString();
}
};
GraphQLScalarType = class {
constructor(config) {
this.__kind = scalarSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.specifiedByURL = config.specifiedByURL;
this.serialize = config.serialize ?? config.coerceOutputValue ?? identityFunc;
this.parseValue = config.parseValue ?? config.coerceInputValue ?? identityFunc;
this.parseLiteral = config.parseLiteral ?? ((node, variables) => this.coerceInputValue(valueFromASTUntyped(node, variables)));
this.coerceOutputValue = config.coerceOutputValue ?? this.serialize;
this.coerceInputValue = config.coerceInputValue ?? this.parseValue;
this.coerceInputLiteral = config.coerceInputLiteral;
this.valueToLiteral = config.valueToLiteral;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
if (config.parseLiteral) {
if (!(typeof config.parseValue === "function" && typeof config.parseLiteral === "function"))
devAssert(false, `${this.name} must provide both "parseValue" and "parseLiteral" functions.`);
}
if (config.coerceInputLiteral) {
if (!(typeof config.coerceInputValue === "function" && typeof config.coerceInputLiteral === "function"))
devAssert(false, `${this.name} must provide both "coerceInputValue" and "coerceInputLiteral" functions.`);
}
}
get [Symbol.toStringTag]() {
return "GraphQLScalarType";
}
toConfig() {
return {
name: this.name,
description: this.description,
specifiedByURL: this.specifiedByURL,
serialize: this.serialize,
parseValue: this.parseValue,
parseLiteral: this.parseLiteral,
coerceOutputValue: this.coerceOutputValue,
coerceInputValue: this.coerceInputValue,
coerceInputLiteral: this.coerceInputLiteral,
valueToLiteral: this.valueToLiteral,
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLObjectType = class {
constructor(config) {
this.__kind = objectSymbol;
this.__kind = objectSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.isTypeOf = config.isTypeOf;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this._fields = defineFieldMap.bind(void 0, this, config.fields);
this._interfaces = defineInterfaces.bind(void 0, config.interfaces);
}
get [Symbol.toStringTag]() {
return "GraphQLObjectType";
}
getFields() {
if (typeof this._fields === "function") {
this._fields = this._fields();
}
return this._fields;
}
getInterfaces() {
if (typeof this._interfaces === "function") {
this._interfaces = this._interfaces();
}
return this._interfaces;
}
toConfig() {
return {
name: this.name,
description: this.description,
interfaces: this.getInterfaces(),
fields: mapValue(this.getFields(), (field) => field.toConfig()),
isTypeOf: this.isTypeOf,
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLField = class {
constructor(parentType, name, config) {
this.__kind = fieldSymbol;
this.parentType = parentType;
this.name = assertName(name);
this.description = config.description;
this.type = config.type;
const argsConfig = config.args;
this.args = argsConfig ? Object.entries(argsConfig).map(([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig)) : [];
this.resolve = config.resolve;
this.subscribe = config.subscribe;
this.deprecationReason = config.deprecationReason;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
}
get [Symbol.toStringTag]() {
return "GraphQLField";
}
toConfig() {
return {
description: this.description,
type: this.type,
args: keyValMap(this.args, (arg) => arg.name, (arg) => arg.toConfig()),
resolve: this.resolve,
subscribe: this.subscribe,
deprecationReason: this.deprecationReason,
extensions: this.extensions,
astNode: this.astNode
};
}
toString() {
return `${this.parentType ?? "<meta>"}.${this.name}`;
}
toJSON() {
return this.toString();
}
};
GraphQLArgument = class {
constructor(parent, name, config) {
this.__kind = argumentSymbol;
this.parent = parent;
this.name = assertName(name);
this.description = config.description;
this.type = config.type;
this.defaultValue = config.defaultValue;
this.default = config.default;
this._memoizedCoercedDefaultValue = void 0;
this.deprecationReason = config.deprecationReason;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
}
get [Symbol.toStringTag]() {
return "GraphQLArgument";
}
toConfig() {
return {
description: this.description,
type: this.type,
defaultValue: this.defaultValue,
default: this.default,
deprecationReason: this.deprecationReason,
extensions: this.extensions,
astNode: this.astNode
};
}
toString() {
return `${this.parent}(${this.name}:)`;
}
toJSON() {
return this.toString();
}
};
GraphQLInterfaceType = class {
constructor(config) {
this.__kind = interfaceSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.resolveType = config.resolveType;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this._fields = defineFieldMap.bind(void 0, this, config.fields);
this._interfaces = defineInterfaces.bind(void 0, config.interfaces);
}
get [Symbol.toStringTag]() {
return "GraphQLInterfaceType";
}
getFields() {
if (typeof this._fields === "function") {
this._fields = this._fields();
}
return this._fields;
}
getInterfaces() {
if (typeof this._interfaces === "function") {
this._interfaces = this._interfaces();
}
return this._interfaces;
}
toConfig() {
return {
name: this.name,
description: this.description,
interfaces: this.getInterfaces(),
fields: mapValue(this.getFields(), (field) => field.toConfig()),
resolveType: this.resolveType,
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLUnionType = class {
constructor(config) {
this.__kind = unionSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.resolveType = config.resolveType;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this._types = defineTypes.bind(void 0, config.types);
}
get [Symbol.toStringTag]() {
return "GraphQLUnionType";
}
getTypes() {
if (typeof this._types === "function") {
this._types = this._types();
}
return this._types;
}
toConfig() {
return {
name: this.name,
description: this.description,
types: this.getTypes(),
resolveType: this.resolveType,
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLEnumType = class {
constructor(config) {
this.__kind = enumSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this._values = defineEnumValues.bind(void 0, this, config.values);
this._valueLookup = null;
this._nameLookup = null;
}
get [Symbol.toStringTag]() {
return "GraphQLEnumType";
}
getValues() {
if (typeof this._values === "function") {
this._values = this._values();
}
return this._values;
}
getValue(name) {
this._nameLookup ??= keyMap(this.getValues(), (value) => value.name);
return this._nameLookup[name];
}
serialize(outputValue) {
return this.coerceOutputValue(outputValue);
}
coerceOutputValue(outputValue) {
this._valueLookup ??= new Map(this.getValues().map((enumValue2) => [enumValue2.value, enumValue2]));
const enumValue = this._valueLookup.get(outputValue);
if (enumValue === void 0) {
throw new GraphQLError(`Enum "${this.name}" cannot represent value: ${inspect(outputValue)}`);
}
return enumValue.name;
}
parseValue(inputValue, hideSuggestions) {
return this.coerceInputValue(inputValue, hideSuggestions);
}
coerceInputValue(inputValue, hideSuggestions) {
if (typeof inputValue !== "string") {
const valueStr = inspect(inputValue);
throw new GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + (hideSuggestions ? "" : didYouMeanEnumValue(this, valueStr)));
}
const enumValue = this.getValue(inputValue);
if (enumValue == null) {
throw new GraphQLError(`Value "${inputValue}" does not exist in "${this.name}" enum.` + (hideSuggestions ? "" : didYouMeanEnumValue(this, inputValue)));
}
return enumValue.value;
}
parseLiteral(valueNode, _variables, hideSuggestions) {
return this.coerceInputLiteral(valueNode, hideSuggestions);
}
coerceInputLiteral(valueNode, hideSuggestions) {
if (valueNode.kind !== kinds_exports.ENUM) {
const valueStr = printForError(valueNode);
throw new GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + (hideSuggestions ? "" : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode });
}
const enumValue = this.getValue(valueNode.value);
if (enumValue == null) {
const valueStr = printForError(valueNode);
throw new GraphQLError(`Value "${valueStr}" does not exist in "${this.name}" enum.` + (hideSuggestions ? "" : didYouMeanEnumValue(this, valueStr)), { nodes: valueNode });
}
return enumValue.value;
}
valueToLiteral(value) {
if (typeof value === "string" && this.getValue(value)) {
return { kind: kinds_exports.ENUM, value };
}
}
toConfig() {
return {
name: this.name,
description: this.description,
values: keyValMap(this.getValues(), (value) => value.name, (value) => value.toConfig()),
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLEnumValue = class {
constructor(parentEnum, name, config) {
this.__kind = enumValueSymbol;
this.parentEnum = parentEnum;
this.name = assertEnumValueName(name);
this.description = config.description;
this.value = config.value !== void 0 ? config.value : name;
this.deprecationReason = config.deprecationReason;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
}
get [Symbol.toStringTag]() {
return "GraphQLEnumValue";
}
toConfig() {
return {
description: this.description,
value: this.value,
deprecationReason: this.deprecationReason,
extensions: this.extensions,
astNode: this.astNode
};
}
toString() {
return `${this.parentEnum.name}.${this.name}`;
}
toJSON() {
return this.toString();
}
};
GraphQLInputObjectType = class {
constructor(config) {
this.__kind = inputObjectSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this.isOneOf = config.isOneOf ?? false;
this._fields = defineInputFieldMap.bind(void 0, this, config.fields);
}
get [Symbol.toStringTag]() {
return "GraphQLInputObjectType";
}
getFields() {
if (typeof this._fields === "function") {
this._fields = this._fields();
}
return this._fields;
}
toConfig() {
return {
name: this.name,
description: this.description,
fields: mapValue(this.getFields(), (field) => field.toConfig()),
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes,
isOneOf: this.isOneOf
};
}
toString() {
return this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLInputField = class {
constructor(parentType, name, config) {
if (!!("resolve" in config))
devAssert(false, `${parentType}.${name} field has a resolve property, but Input Types cannot define resolvers.`);
this.__kind = inputFieldSymbol;
this.parentType = parentType;
this.name = assertName(name);
this.description = config.description;
this.type = config.type;
this.defaultValue = config.defaultValue;
this.default = config.default;
this._memoizedCoercedDefaultValue = void 0;
this.deprecationReason = config.deprecationReason;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
}
get [Symbol.toStringTag]() {
return "GraphQLInputField";
}
toConfig() {
return {
description: this.description,
type: this.type,
defaultValue: this.defaultValue,
default: this.default,
deprecationReason: this.deprecationReason,
extensions: this.extensions,
astNode: this.astNode
};
}
toString() {
return `${this.parentType}.${this.name}`;
}
toJSON() {
return this.toString();
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/typeComparators.mjs
function isEqualType(typeA, typeB) {
if (typeA === typeB) {
return true;
}
if (isNonNullType(typeA) && isNonNullType(typeB)) {
return isEqualType(typeA.ofType, typeB.ofType);
}
if (isListType(typeA) && isListType(typeB)) {
return isEqualType(typeA.ofType, typeB.ofType);
}
return false;
}
function isTypeSubTypeOf(schema, maybeSubType, superType) {
if (maybeSubType === superType) {
return true;
}
if (isNonNullType(superType)) {
if (isNonNullType(maybeSubType)) {
return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);
}
return false;
}
if (isNonNullType(maybeSubType)) {
return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);
}
if (isListType(superType)) {
if (isListType(maybeSubType)) {
return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);
}
return false;
}
if (isListType(maybeSubType)) {
return false;
}
return isAbstractType(superType) && (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && schema.isSubType(superType, maybeSubType);
}
function doTypesOverlap(schema, typeA, typeB) {
if (typeA === typeB) {
return true;
}
if (isAbstractType(typeA)) {
if (isAbstractType(typeB)) {
return schema.getPossibleTypes(typeA).some((type) => schema.isSubType(typeB, type));
}
return schema.isSubType(typeA, typeB);
}
if (isAbstractType(typeB)) {
return schema.isSubType(typeB, typeA);
}
return false;
}
var init_typeComparators = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/typeComparators.mjs"() {
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/Path.mjs
function addPath(prev, key, typename) {
return { prev, key, typename };
}
function pathToArray(path) {
const flattened = [];
let curr = path;
while (curr) {
flattened.push(curr.key);
curr = curr.prev;
}
return flattened.reverse();
}
var init_Path = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/Path.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueToLiteral.mjs
function valueToLiteral(value, type) {
if (isNonNullType(type)) {
if (value == null) {
return;
}
return valueToLiteral(value, type.ofType);
}
if (value == null) {
return { kind: kinds_exports.NULL };
}
if (isListType(type)) {
if (!isIterableObject(value)) {
return valueToLiteral(value, type.ofType);
}
const values = [];
for (const itemValue of value) {
const itemNode = valueToLiteral(itemValue, type.ofType);
if (!itemNode) {
return;
}
values.push(itemNode);
}
return { kind: kinds_exports.LIST, values };
}
if (isInputObjectType(type)) {
if (!isObjectLike(value)) {
return;
}
const fields = [];
const fieldDefs = type.getFields();
const hasUndefinedField = Object.keys(value).some((name) => value[name] !== void 0 && !Object.hasOwn(fieldDefs, name));
if (hasUndefinedField) {
return;
}
for (const field of Object.values(type.getFields())) {
const fieldValue = value[field.name];
if (fieldValue === void 0) {
if (isRequiredInputField(field)) {
return;
}
} else {
const fieldNode = valueToLiteral(value[field.name], field.type);
if (!fieldNode) {
return;
}
fields.push({
kind: kinds_exports.OBJECT_FIELD,
name: { kind: kinds_exports.NAME, value: field.name },
value: fieldNode
});
}
}
return { kind: kinds_exports.OBJECT, fields };
}
const leafType = assertLeafType(type);
if (leafType.valueToLiteral) {
try {
return leafType.valueToLiteral(value);
} catch (_error) {
return;
}
}
return defaultScalarValueToLiteral(value);
}
function defaultScalarValueToLiteral(value) {
if (value == null) {
return { kind: kinds_exports.NULL };
}
switch (typeof value) {
case "boolean":
return { kind: kinds_exports.BOOLEAN, value };
case "string":
return { kind: kinds_exports.STRING, value, block: false };
case "bigint":
return { kind: kinds_exports.INT, value: value.toString() };
case "number": {
if (!Number.isFinite(value)) {
return { kind: kinds_exports.NULL };
}
const stringValue = String(value);
return /^-?(?:0|[1-9][0-9]*)$/.test(stringValue) ? { kind: kinds_exports.INT, value: stringValue } : { kind: kinds_exports.FLOAT, value: stringValue };
}
case "object": {
if (isIterableObject(value)) {
return {
kind: kinds_exports.LIST,
values: Array.from(value, defaultScalarValueToLiteral)
};
}
const objValue = value;
const fields = [];
for (const fieldName of Object.keys(objValue)) {
const fieldValue = objValue[fieldName];
if (fieldValue !== void 0) {
fields.push({
kind: kinds_exports.OBJECT_FIELD,
name: { kind: kinds_exports.NAME, value: fieldName },
value: defaultScalarValueToLiteral(fieldValue)
});
}
}
return { kind: kinds_exports.OBJECT, fields };
}
}
throw new TypeError(`Cannot convert value to AST: ${inspect(value)}.`);
}
var init_valueToLiteral = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueToLiteral.mjs"() {
init_inspect();
init_isIterableObject();
init_isObjectLike();
init_kinds2();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/replaceVariables.mjs
function replaceVariables(valueNode, variableValues, fragmentVariableValues) {
switch (valueNode.kind) {
case kinds_exports.VARIABLE: {
const varName = valueNode.name.value;
const fragmentVariableValueSource = fragmentVariableValues?.sources[varName];
if (fragmentVariableValueSource) {
const value = fragmentVariableValueSource.value;
if (value === void 0) {
const defaultValue = fragmentVariableValueSource.signature.default;
if (defaultValue !== void 0) {
return defaultValue.literal;
}
return { kind: kinds_exports.NULL };
}
return replaceVariables(value, variableValues, fragmentVariableValueSource.fragmentVariableValues);
}
const variableValueSource = variableValues?.sources[varName];
if (variableValueSource == null) {
return { kind: kinds_exports.NULL };
}
if (variableValueSource.value === void 0) {
const defaultValue = variableValueSource.signature.default;
if (defaultValue !== void 0) {
return defaultValue.literal;
}
}
return valueToLiteral(variableValueSource.value, variableValueSource.signature.type);
}
case kinds_exports.OBJECT: {
const newFields = [];
for (const field of valueNode.fields) {
if (field.value.kind === kinds_exports.VARIABLE) {
const scopedVariableSource = fragmentVariableValues?.sources[field.value.name.value] ?? variableValues?.sources[field.value.name.value];
if (scopedVariableSource?.value === void 0 && scopedVariableSource?.signature.default === void 0) {
continue;
}
}
const newFieldNodeValue = replaceVariables(field.value, variableValues, fragmentVariableValues);
newFields.push({
...field,
value: newFieldNodeValue
});
}
return {
...valueNode,
fields: newFields
};
}
case kinds_exports.LIST: {
const newValues = [];
for (const value of valueNode.values) {
const newItemNodeValue = replaceVariables(value, variableValues, fragmentVariableValues);
newValues.push(newItemNodeValue);
}
return {
...valueNode,
values: newValues
};
}
default: {
return valueNode;
}
}
}
var init_replaceVariables = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/replaceVariables.mjs"() {
init_kinds2();
init_valueToLiteral();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/validateInputValue.mjs
function validateInputValue(inputValue, type, onError, hideSuggestions) {
return validateInputValueImpl(inputValue, type, onError, hideSuggestions, void 0);
}
function validateInputValueImpl(inputValue, type, onError, hideSuggestions, path) {
if (isNonNullType(type)) {
if (inputValue === void 0) {
reportInvalidValue(onError, `Expected a value of non-null type "${type}" to be provided.`, path);
return;
}
if (inputValue === null) {
reportInvalidValue(onError, `Expected value of non-null type "${type}" not to be null.`, path);
return;
}
return validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path);
}
if (inputValue == null) {
return;
}
if (isListType(type)) {
if (!isIterableObject(inputValue)) {
validateInputValueImpl(inputValue, type.ofType, onError, hideSuggestions, path);
} else {
let index = 0;
for (const itemValue of inputValue) {
validateInputValueImpl(itemValue, type.ofType, onError, hideSuggestions, addPath(path, index++, void 0));
}
}
} else if (isInputObjectType(type)) {
if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {
reportInvalidValue(onError, `Expected value of type "${type}" to be an object, found: ${inspect(inputValue)}.`, path);
return;
}
const fieldDefs = type.getFields();
for (const field of Object.values(fieldDefs)) {
const fieldValue = inputValue[field.name];
if (fieldValue === void 0) {
if (isRequiredInputField(field)) {
reportInvalidValue(onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${inspect(inputValue)}.`, path);
}
} else {
validateInputValueImpl(fieldValue, field.type, onError, hideSuggestions, addPath(path, field.name, type.name));
}
}
const fields = [];
for (const fieldName of Object.keys(inputValue)) {
if (inputValue[fieldName] === void 0) {
continue;
}
if (!Object.hasOwn(fieldDefs, fieldName)) {
const suggestion = hideSuggestions ? "" : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));
reportInvalidValue(onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ", found"}: ${inspect(inputValue)}.`, path);
continue;
}
fields.push(fieldName);
}
if (type.isOneOf) {
if (fields.length !== 1) {
reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), path);
}
const field = fields[0];
const value = inputValue[field];
if (value === null) {
reportInvalidValue(onError, getOneOfInputObjectErrorMessage(type), addPath(path, field, type.name));
}
}
} else {
assertLeafType(type);
let result;
let caughtError;
try {
result = type.coerceInputValue(inputValue, hideSuggestions);
} catch (error) {
if (error instanceof GraphQLError) {
onError(error, pathToArray(path));
return;
}
caughtError = error;
}
if (result === void 0) {
reportInvalidValue(onError, `Expected value of type "${type}"${caughtError != null ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` : ", found"}: ${inspect(inputValue)}.`, path, ensureGraphQLError(caughtError));
}
}
}
function reportInvalidValue(onError, message, path, originalError) {
onError(new GraphQLError(message, { originalError }), pathToArray(path));
}
function validateInputLiteral(valueNode, type, onError, variables, fragmentVariableValues, hideSuggestions) {
const context = {
static: !variables && !fragmentVariableValues,
onError,
variables,
fragmentVariableValues
};
return validateInputLiteralImpl(context, valueNode, type, hideSuggestions, void 0);
}
function validateInputLiteralImpl(context, valueNode, type, hideSuggestions, path) {
if (valueNode.kind === kinds_exports.VARIABLE) {
if (context.static) {
return;
}
const scopedVariableValues = getScopedVariableValues(context, valueNode);
const value = scopedVariableValues?.coerced[valueNode.name.value];
if (isNonNullType(type)) {
if (value === void 0) {
reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to type "${type}" to provide a runtime value.`, valueNode, path);
} else if (value === null) {
reportInvalidLiteral(context.onError, `Expected variable "$${valueNode.name.value}" provided to non-null type "${type}" not to be null.`, valueNode, path);
}
}
return;
}
if (isNonNullType(type)) {
if (valueNode.kind === kinds_exports.NULL) {
reportInvalidLiteral(context.onError, `Expected value of non-null type "${type}" not to be null.`, valueNode, path);
return;
}
return validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path);
}
if (valueNode.kind === kinds_exports.NULL) {
return;
}
if (isListType(type)) {
if (valueNode.kind !== kinds_exports.LIST) {
validateInputLiteralImpl(context, valueNode, type.ofType, hideSuggestions, path);
} else {
let index = 0;
for (const itemNode of valueNode.values) {
validateInputLiteralImpl(context, itemNode, type.ofType, hideSuggestions, addPath(path, index++, void 0));
}
}
} else if (isInputObjectType(type)) {
if (valueNode.kind !== kinds_exports.OBJECT) {
reportInvalidLiteral(context.onError, `Expected value of type "${type}" to be an object, found: ${printForError(valueNode)}.`, valueNode, path);
return;
}
const fieldDefs = type.getFields();
const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);
for (const field of Object.values(fieldDefs)) {
const fieldNode = fieldNodes[field.name];
if (fieldNode === void 0) {
if (isRequiredInputField(field)) {
reportInvalidLiteral(context.onError, `Expected value of type "${type}" to include required field "${field.name}", found: ${printForError(valueNode)}.`, valueNode, path);
}
} else {
const fieldValueNode = fieldNode.value;
if (fieldValueNode.kind === kinds_exports.VARIABLE && !context.static) {
const scopedVariableValues = getScopedVariableValues(context, fieldValueNode);
const variableName = fieldValueNode.name.value;
const value = scopedVariableValues?.coerced[variableName];
if (type.isOneOf) {
if (value === void 0) {
reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" to provide a runtime value.`, valueNode, path);
} else if (value === null) {
reportInvalidLiteral(context.onError, `Expected variable "$${variableName}" provided to field "${field.name}" for OneOf Input Object type "${type}" not to be null.`, valueNode, path);
}
} else if (value === void 0 && !isRequiredInputField(field)) {
continue;
}
}
validateInputLiteralImpl(context, fieldValueNode, field.type, hideSuggestions, addPath(path, field.name, type.name));
}
}
const fields = valueNode.fields;
const knownFields = [];
for (const fieldNode of fields) {
const fieldName = fieldNode.name.value;
if (!Object.hasOwn(fieldDefs, fieldName)) {
const suggestion = hideSuggestions ? "" : didYouMean(suggestionList(fieldName, Object.keys(fieldDefs)));
reportInvalidLiteral(context.onError, `Expected value of type "${type}" not to include unknown field "${fieldName}"${suggestion ? `.${suggestion} Found` : ", found"}: ${printForError(valueNode)}.`, fieldNode, path);
} else {
knownFields.push(fieldNode);
}
}
if (type.isOneOf) {
const isNotExactlyOneField = knownFields.length !== 1;
if (isNotExactlyOneField) {
reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, path);
return;
}
const fieldValueNode = knownFields[0].value;
if (fieldValueNode.kind === kinds_exports.NULL) {
const fieldName = knownFields[0].name.value;
reportInvalidLiteral(context.onError, getOneOfInputObjectErrorMessage(type), valueNode, addPath(path, fieldName, void 0));
}
}
} else {
assertLeafType(type);
let result;
let caughtError;
try {
result = type.coerceInputLiteral ? type.coerceInputLiteral(replaceVariables(valueNode, context.variables, context.fragmentVariableValues), hideSuggestions) : type.parseLiteral(valueNode, void 0, hideSuggestions);
} catch (error) {
if (error instanceof GraphQLError) {
context.onError(error, pathToArray(path));
return;
}
caughtError = error;
}
if (result === void 0) {
reportInvalidLiteral(context.onError, `Expected value of type "${type}"${caughtError != null ? `, but encountered error "${getCaughtErrorMessage(caughtError)}"; found` : ", found"}: ${printForError(valueNode)}.`, valueNode, path, ensureGraphQLError(caughtError));
}
}
}
function getScopedVariableValues(context, valueNode) {
const variableName = valueNode.name.value;
const { fragmentVariableValues, variables } = context;
return fragmentVariableValues?.sources[variableName] ? fragmentVariableValues : variables;
}
function reportInvalidLiteral(onError, message, valueNode, path, originalError) {
onError(new GraphQLError(message, {
nodes: valueNode,
originalError
}), pathToArray(path));
}
function getCaughtErrorMessage(caughtError) {
if (isObjectLike(caughtError)) {
const message = caughtError.message;
if (typeof message === "string" && message !== "") {
return message;
}
}
return String(caughtError);
}
function getOneOfInputObjectErrorMessage(type) {
return `Within OneOf Input Object type "${type}", exactly one field must be specified, and the value for that field must be non-null.`;
}
var init_validateInputValue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/validateInputValue.mjs"() {
init_didYouMean();
init_inspect();
init_isIterableObject();
init_isObjectLike();
init_keyMap();
init_Path();
init_suggestionList();
init_ensureGraphQLError();
init_GraphQLError();
init_kinds2();
init_printer();
init_definition();
init_replaceVariables();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/directiveLocation.mjs
var DirectiveLocation;
var init_directiveLocation = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/directiveLocation.mjs"() {
DirectiveLocation = {
QUERY: "QUERY",
MUTATION: "MUTATION",
SUBSCRIPTION: "SUBSCRIPTION",
FIELD: "FIELD",
FRAGMENT_DEFINITION: "FRAGMENT_DEFINITION",
FRAGMENT_SPREAD: "FRAGMENT_SPREAD",
INLINE_FRAGMENT: "INLINE_FRAGMENT",
VARIABLE_DEFINITION: "VARIABLE_DEFINITION",
FRAGMENT_VARIABLE_DEFINITION: "FRAGMENT_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",
DIRECTIVE_DEFINITION: "DIRECTIVE_DEFINITION"
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/scalars.mjs
function isSpecifiedScalarType(type) {
return specifiedScalarTypes.some(({ name }) => type.name === name);
}
function coerceOutputValueObject(outputValue) {
if (isObjectLike(outputValue)) {
if (typeof outputValue.valueOf === "function") {
const valueOfResult = outputValue.valueOf();
if (!isObjectLike(valueOfResult)) {
return valueOfResult;
}
}
if (typeof outputValue.toJSON === "function") {
return outputValue.toJSON();
}
}
return outputValue;
}
function coerceIntFromNumber(value) {
if (!Number.isInteger(value)) {
throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`);
}
if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {
throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inspect(value)}`);
}
return value;
}
function coerceIntFromString(value) {
if (value === "") {
throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`);
}
const num = Number(value);
if (!Number.isInteger(num)) {
throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(value)}`);
}
if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {
throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${inspect(value)}`);
}
return num;
}
function coerceIntFromBigInt(value) {
if (value > GRAPHQL_MAX_INT || value < GRAPHQL_MIN_INT) {
throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${String(value)}`);
}
return Number(value);
}
function coerceFloatFromNumber(value) {
if (!Number.isFinite(value)) {
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`);
}
return value;
}
function coerceFloatFromString(value) {
if (value === "") {
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`);
}
const num = Number(value);
if (!Number.isFinite(num)) {
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(value)}`);
}
return num;
}
function coerceFloatFromBigInt(coercedValue) {
const num = Number(coercedValue);
if (!Number.isFinite(num)) {
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)} (value is too large)`);
}
if (BigInt(num) !== coercedValue) {
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)} (value would lose precision)`);
}
return num;
}
function coerceStringFromNumber(value) {
if (!Number.isFinite(value)) {
throw new GraphQLError(`String cannot represent value: ${inspect(value)}`);
}
return String(value);
}
function coerceBooleanFromNumber(value) {
if (!Number.isFinite(value)) {
throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(value)}`);
}
return value !== 0;
}
function coerceIDFromNumber(value) {
if (!Number.isInteger(value)) {
throw new GraphQLError(`ID cannot represent value: ${inspect(value)}`);
}
return String(value);
}
var GRAPHQL_MAX_INT, GRAPHQL_MIN_INT, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID, specifiedScalarTypes;
var init_scalars = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/scalars.mjs"() {
init_inspect();
init_isObjectLike();
init_GraphQLError();
init_kinds2();
init_printer();
init_valueToLiteral();
init_definition();
GRAPHQL_MAX_INT = 2147483647;
GRAPHQL_MIN_INT = -2147483648;
GraphQLInt = new 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.",
coerceOutputValue(outputValue) {
const coercedValue = coerceOutputValueObject(outputValue);
if (typeof coercedValue === "number") {
return coerceIntFromNumber(coercedValue);
}
if (typeof coercedValue === "boolean") {
return coercedValue ? 1 : 0;
}
if (typeof coercedValue === "string") {
return coerceIntFromString(coercedValue);
}
if (typeof coercedValue === "bigint") {
return coerceIntFromBigInt(coercedValue);
}
throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(coercedValue)}`);
},
coerceInputValue(inputValue) {
if (typeof inputValue === "number") {
return coerceIntFromNumber(inputValue);
}
if (typeof inputValue === "bigint") {
return coerceIntFromBigInt(inputValue);
}
throw new GraphQLError(`Int cannot represent non-integer value: ${inspect(inputValue)}`);
},
coerceInputLiteral(valueNode) {
if (valueNode.kind !== kinds_exports.INT) {
throw new GraphQLError(`Int cannot represent non-integer value: ${printForError(valueNode)}`, { nodes: valueNode });
}
const num = parseInt(valueNode.value, 10);
if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {
throw new GraphQLError(`Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, { nodes: valueNode });
}
return num;
},
valueToLiteral(value) {
if ((typeof value === "number" && Number.isInteger(value) || typeof value === "bigint") && value <= GRAPHQL_MAX_INT && value >= GRAPHQL_MIN_INT) {
return { kind: kinds_exports.INT, value: String(value) };
}
}
});
GraphQLFloat = new 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).",
coerceOutputValue(outputValue) {
const coercedValue = coerceOutputValueObject(outputValue);
if (typeof coercedValue === "number") {
return coerceFloatFromNumber(coercedValue);
}
if (typeof coercedValue === "boolean") {
return coercedValue ? 1 : 0;
}
if (typeof coercedValue === "string") {
return coerceFloatFromString(coercedValue);
}
if (typeof coercedValue === "bigint") {
return coerceFloatFromBigInt(coercedValue);
}
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(coercedValue)}`);
},
coerceInputValue(inputValue) {
if (typeof inputValue === "number") {
return coerceFloatFromNumber(inputValue);
}
if (typeof inputValue === "bigint") {
return coerceFloatFromBigInt(inputValue);
}
throw new GraphQLError(`Float cannot represent non numeric value: ${inspect(inputValue)}`);
},
coerceInputLiteral(valueNode) {
if (valueNode.kind !== kinds_exports.FLOAT && valueNode.kind !== kinds_exports.INT) {
throw new GraphQLError(`Float cannot represent non numeric value: ${printForError(valueNode)}`, { nodes: valueNode });
}
return parseFloat(valueNode.value);
},
valueToLiteral(value) {
const literal = defaultScalarValueToLiteral(value);
if (literal.kind === kinds_exports.FLOAT || literal.kind === kinds_exports.INT) {
return literal;
}
}
});
GraphQLString = new 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.",
coerceOutputValue(outputValue) {
const coercedValue = coerceOutputValueObject(outputValue);
if (typeof coercedValue === "string") {
return coercedValue;
}
if (typeof coercedValue === "boolean") {
return coercedValue ? "true" : "false";
}
if (typeof coercedValue === "number") {
return coerceStringFromNumber(coercedValue);
}
if (typeof coercedValue === "bigint") {
return String(coercedValue);
}
throw new GraphQLError(`String cannot represent value: ${inspect(outputValue)}`);
},
coerceInputValue(inputValue) {
if (typeof inputValue !== "string") {
throw new GraphQLError(`String cannot represent a non string value: ${inspect(inputValue)}`);
}
return inputValue;
},
coerceInputLiteral(valueNode) {
if (valueNode.kind !== kinds_exports.STRING) {
throw new GraphQLError(`String cannot represent a non string value: ${printForError(valueNode)}`, { nodes: valueNode });
}
return valueNode.value;
},
valueToLiteral(value) {
const literal = defaultScalarValueToLiteral(value);
if (literal.kind === kinds_exports.STRING) {
return literal;
}
}
});
GraphQLBoolean = new GraphQLScalarType({
name: "Boolean",
description: "The `Boolean` scalar type represents `true` or `false`.",
coerceOutputValue(outputValue) {
const coercedValue = coerceOutputValueObject(outputValue);
if (typeof coercedValue === "boolean") {
return coercedValue;
}
if (typeof coercedValue === "number") {
return coerceBooleanFromNumber(coercedValue);
}
if (typeof coercedValue === "bigint") {
return coercedValue !== 0n;
}
throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`);
},
coerceInputValue(inputValue) {
if (typeof inputValue !== "boolean") {
throw new GraphQLError(`Boolean cannot represent a non boolean value: ${inspect(inputValue)}`);
}
return inputValue;
},
coerceInputLiteral(valueNode) {
if (valueNode.kind !== kinds_exports.BOOLEAN) {
throw new GraphQLError(`Boolean cannot represent a non boolean value: ${printForError(valueNode)}`, { nodes: valueNode });
}
return valueNode.value;
},
valueToLiteral(value) {
const literal = defaultScalarValueToLiteral(value);
if (literal.kind === kinds_exports.BOOLEAN) {
return literal;
}
}
});
GraphQLID = new 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.',
coerceOutputValue(outputValue) {
const coercedValue = coerceOutputValueObject(outputValue);
if (typeof coercedValue === "string") {
return coercedValue;
}
if (typeof coercedValue === "number") {
return coerceIDFromNumber(coercedValue);
}
if (typeof coercedValue === "bigint") {
return String(coercedValue);
}
throw new GraphQLError(`ID cannot represent value: ${inspect(outputValue)}`);
},
coerceInputValue(inputValue) {
if (typeof inputValue === "string") {
return inputValue;
}
if (typeof inputValue === "number") {
return coerceIDFromNumber(inputValue);
}
if (typeof inputValue === "bigint") {
return String(inputValue);
}
throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`);
},
coerceInputLiteral(valueNode) {
if (valueNode.kind !== kinds_exports.STRING && valueNode.kind !== kinds_exports.INT) {
throw new GraphQLError("ID cannot represent a non-string and non-integer value: " + printForError(valueNode), { nodes: valueNode });
}
return valueNode.value;
},
valueToLiteral(value) {
if (typeof value === "string") {
return /^-?(?:0|[1-9][0-9]*)$/.test(value) ? { kind: kinds_exports.INT, value } : { kind: kinds_exports.STRING, value, block: false };
}
if (typeof value === "number") {
return { kind: kinds_exports.INT, value: coerceIDFromNumber(value) };
}
if (typeof value === "bigint") {
return { kind: kinds_exports.INT, value: String(value) };
}
}
});
specifiedScalarTypes = Object.freeze([
GraphQLString,
GraphQLInt,
GraphQLFloat,
GraphQLBoolean,
GraphQLID
]);
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/directives.mjs
function isDirective(directive) {
return instanceOf(directive, directiveSymbol, GraphQLDirective);
}
function assertDirective(directive) {
if (!isDirective(directive)) {
throw new Error(`Expected ${inspect(directive)} to be a GraphQL directive.`);
}
return directive;
}
function isSpecifiedDirective(directive) {
return specifiedDirectives.some(({ name }) => name === directive.name);
}
var directiveSymbol, GraphQLDirective, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeferDirective, GraphQLStreamDirective, DEFAULT_DEPRECATION_REASON, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective, GraphQLOneOfDirective, GraphQLDisableErrorPropagationDirective, specifiedDirectives;
var init_directives = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/directives.mjs"() {
init_devAssert();
init_inspect();
init_instanceOf();
init_isObjectLike();
init_keyValMap();
init_toObjMap();
init_directiveLocation();
init_assertName();
init_definition();
init_scalars();
directiveSymbol = /* @__PURE__ */ Symbol("Directive");
GraphQLDirective = class {
constructor(config) {
this.__kind = directiveSymbol;
this.name = assertName(config.name);
this.description = config.description;
this.locations = config.locations;
this.isRepeatable = config.isRepeatable ?? false;
this.deprecationReason = config.deprecationReason;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
if (!Array.isArray(config.locations))
devAssert(false, `@${this.name} locations must be an Array.`);
const args = config.args ?? {};
if (!(isObjectLike(args) && !Array.isArray(args)))
devAssert(false, `@${this.name} args must be an object with argument names as keys.`);
this.args = Object.entries(args).map(([argName, argConfig]) => new GraphQLArgument(this, argName, argConfig));
}
get [Symbol.toStringTag]() {
return "GraphQLDirective";
}
toConfig() {
return {
name: this.name,
description: this.description,
locations: this.locations,
args: keyValMap(this.args, (arg) => arg.name, (arg) => arg.toConfig()),
isRepeatable: this.isRepeatable,
deprecationReason: this.deprecationReason,
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes
};
}
toString() {
return "@" + this.name;
}
toJSON() {
return this.toString();
}
};
GraphQLIncludeDirective = new GraphQLDirective({
name: "include",
description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
locations: [
DirectiveLocation.FIELD,
DirectiveLocation.FRAGMENT_SPREAD,
DirectiveLocation.INLINE_FRAGMENT
],
args: {
if: {
type: new GraphQLNonNull(GraphQLBoolean),
description: "Included when true."
}
}
});
GraphQLSkipDirective = new GraphQLDirective({
name: "skip",
description: "Directs the executor to skip this field or fragment when the `if` argument is true.",
locations: [
DirectiveLocation.FIELD,
DirectiveLocation.FRAGMENT_SPREAD,
DirectiveLocation.INLINE_FRAGMENT
],
args: {
if: {
type: new GraphQLNonNull(GraphQLBoolean),
description: "Skipped when true."
}
}
});
GraphQLDeferDirective = new GraphQLDirective({
name: "defer",
description: "Directs the executor to defer this fragment when the `if` argument is true or undefined.",
locations: [
DirectiveLocation.FRAGMENT_SPREAD,
DirectiveLocation.INLINE_FRAGMENT
],
args: {
if: {
type: new GraphQLNonNull(GraphQLBoolean),
description: "Deferred when true or undefined.",
default: { value: true }
},
label: {
type: GraphQLString,
description: "Unique name"
}
}
});
GraphQLStreamDirective = new GraphQLDirective({
name: "stream",
description: "Directs the executor to stream plural fields when the `if` argument is true or undefined.",
locations: [DirectiveLocation.FIELD],
args: {
initialCount: {
default: { value: 0 },
type: new GraphQLNonNull(GraphQLInt),
description: "Number of items to return immediately"
},
if: {
type: new GraphQLNonNull(GraphQLBoolean),
description: "Stream when true or undefined.",
default: { value: true }
},
label: {
type: GraphQLString,
description: "Unique name"
}
}
});
DEFAULT_DEPRECATION_REASON = "No longer supported";
GraphQLDeprecatedDirective = new GraphQLDirective({
name: "deprecated",
description: "Marks an element of a GraphQL schema as no longer supported.",
locations: [
DirectiveLocation.FIELD_DEFINITION,
DirectiveLocation.ARGUMENT_DEFINITION,
DirectiveLocation.INPUT_FIELD_DEFINITION,
DirectiveLocation.ENUM_VALUE,
DirectiveLocation.DIRECTIVE_DEFINITION
],
args: {
reason: {
type: new GraphQLNonNull(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/).",
default: { value: DEFAULT_DEPRECATION_REASON }
}
}
});
GraphQLSpecifiedByDirective = new GraphQLDirective({
name: "specifiedBy",
description: "Exposes a URL that specifies the behavior of this scalar.",
locations: [DirectiveLocation.SCALAR],
args: {
url: {
type: new GraphQLNonNull(GraphQLString),
description: "The URL that specifies the behavior of this scalar."
}
}
});
GraphQLOneOfDirective = new GraphQLDirective({
name: "oneOf",
description: "Indicates exactly one field must be supplied and this field must not be `null`.",
locations: [DirectiveLocation.INPUT_OBJECT],
args: {}
});
GraphQLDisableErrorPropagationDirective = new GraphQLDirective({
name: "experimental_disableErrorPropagation",
description: "Disables error propagation.",
locations: [
DirectiveLocation.QUERY,
DirectiveLocation.MUTATION,
DirectiveLocation.SUBSCRIPTION
]
});
specifiedDirectives = Object.freeze([
GraphQLIncludeDirective,
GraphQLSkipDirective,
GraphQLDeprecatedDirective,
GraphQLSpecifiedByDirective,
GraphQLOneOfDirective
]);
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/astFromValue.mjs
function astFromValue(value, type) {
if (isNonNullType(type)) {
const astValue = astFromValue(value, type.ofType);
if (astValue?.kind === kinds_exports.NULL) {
return null;
}
return astValue;
}
if (value === null) {
return { kind: kinds_exports.NULL };
}
if (value === void 0) {
return null;
}
if (isListType(type)) {
const itemType = type.ofType;
if (isIterableObject(value)) {
const valuesNodes = [];
for (const item of value) {
const itemNode = astFromValue(item, itemType);
if (itemNode != null) {
valuesNodes.push(itemNode);
}
}
return { kind: kinds_exports.LIST, values: valuesNodes };
}
return astFromValue(value, itemType);
}
if (isInputObjectType(type)) {
if (!isObjectLike(value)) {
return null;
}
const fieldNodes = [];
for (const field of Object.values(type.getFields())) {
const fieldValue = astFromValue(value[field.name], field.type);
if (fieldValue) {
fieldNodes.push({
kind: kinds_exports.OBJECT_FIELD,
name: { kind: kinds_exports.NAME, value: field.name },
value: fieldValue
});
}
}
return { kind: kinds_exports.OBJECT, fields: fieldNodes };
}
if (isLeafType(type)) {
const coerced = type.coerceOutputValue(value);
if (coerced == null) {
return null;
}
if (typeof coerced === "boolean") {
return { kind: kinds_exports.BOOLEAN, value: coerced };
}
if (typeof coerced === "number" && Number.isFinite(coerced)) {
const stringNum = String(coerced);
return integerStringRegExp.test(stringNum) ? { kind: kinds_exports.INT, value: stringNum } : { kind: kinds_exports.FLOAT, value: stringNum };
}
if (typeof coerced === "bigint") {
return { kind: kinds_exports.INT, value: String(coerced) };
}
if (typeof coerced === "string") {
if (isEnumType(type)) {
return { kind: kinds_exports.ENUM, value: coerced };
}
if (type === GraphQLID && integerStringRegExp.test(coerced)) {
return { kind: kinds_exports.INT, value: coerced };
}
return {
kind: kinds_exports.STRING,
value: coerced
};
}
throw new TypeError(`Cannot convert value to AST: ${inspect(coerced)}.`);
}
invariant(false, "Unexpected input type: " + inspect(type));
}
var integerStringRegExp;
var init_astFromValue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/astFromValue.mjs"() {
init_inspect();
init_invariant();
init_isIterableObject();
init_isObjectLike();
init_kinds2();
init_definition();
init_scalars();
integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getDefaultValueAST.mjs
function getDefaultValueAST(argOrInputField) {
const type = argOrInputField.type;
const defaultInput = argOrInputField.default;
if (defaultInput) {
const literal = defaultInput.literal ?? valueToLiteral(defaultInput.value, type);
if (!(literal != null))
invariant(false, "Invalid default value");
return literal;
}
const defaultValue = argOrInputField.defaultValue;
if (defaultValue !== void 0) {
const valueAST = astFromValue(defaultValue, type);
if (!(valueAST != null))
invariant(false, "Invalid default value");
return valueAST;
}
return void 0;
}
var init_getDefaultValueAST = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getDefaultValueAST.mjs"() {
init_invariant();
init_astFromValue();
init_valueToLiteral();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/introspection.mjs
function isIntrospectionType(type) {
return introspectionTypes.some(({ name }) => type.name === name);
}
var __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, TypeKind, __TypeKind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, introspectionTypes;
var init_introspection = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/introspection.mjs"() {
init_inspect();
init_invariant();
init_directiveLocation();
init_printer();
init_getDefaultValueAST();
init_definition();
init_scalars();
__Schema = new 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: () => ({
description: {
type: GraphQLString,
resolve: (schema) => schema.description
},
types: {
description: "A list of all types supported by this server.",
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),
resolve(schema) {
return Object.values(schema.getTypeMap());
}
},
queryType: {
description: "The type that query operations will be rooted at.",
type: new GraphQLNonNull(__Type),
resolve: (schema) => schema.getQueryType()
},
mutationType: {
description: "If this server supports mutation, the type that mutation operations will be rooted at.",
type: __Type,
resolve: (schema) => schema.getMutationType()
},
subscriptionType: {
description: "If this server support subscription, the type that subscription operations will be rooted at.",
type: __Type,
resolve: (schema) => schema.getSubscriptionType()
},
directives: {
description: "A list of all directives supported by this server.",
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve: (schema, { includeDeprecated }) => includeDeprecated === true ? schema.getDirectives() : schema.getDirectives().filter((directive) => directive.deprecationReason == null)
}
})
});
__Directive = new GraphQLObjectType({
name: "__Directive",
description: "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",
fields: () => ({
name: {
type: new GraphQLNonNull(GraphQLString),
resolve: (directive) => directive.name
},
description: {
type: GraphQLString,
resolve: (directive) => directive.description
},
isRepeatable: {
type: new GraphQLNonNull(GraphQLBoolean),
resolve: (directive) => directive.isRepeatable
},
locations: {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),
resolve: (directive) => directive.locations
},
args: {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve(field, { includeDeprecated }) {
return includeDeprecated === true ? field.args : field.args.filter((arg) => arg.deprecationReason == null);
}
},
isDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
resolve: (directive) => directive.deprecationReason != null
},
deprecationReason: {
type: GraphQLString,
resolve: (directive) => directive.deprecationReason
}
})
});
__DirectiveLocation = new 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: DirectiveLocation.QUERY,
description: "Location adjacent to a query operation."
},
MUTATION: {
value: DirectiveLocation.MUTATION,
description: "Location adjacent to a mutation operation."
},
SUBSCRIPTION: {
value: DirectiveLocation.SUBSCRIPTION,
description: "Location adjacent to a subscription operation."
},
FIELD: {
value: DirectiveLocation.FIELD,
description: "Location adjacent to a field."
},
FRAGMENT_DEFINITION: {
value: DirectiveLocation.FRAGMENT_DEFINITION,
description: "Location adjacent to a fragment definition."
},
FRAGMENT_SPREAD: {
value: DirectiveLocation.FRAGMENT_SPREAD,
description: "Location adjacent to a fragment spread."
},
INLINE_FRAGMENT: {
value: DirectiveLocation.INLINE_FRAGMENT,
description: "Location adjacent to an inline fragment."
},
VARIABLE_DEFINITION: {
value: DirectiveLocation.VARIABLE_DEFINITION,
description: "Location adjacent to an operation variable definition."
},
FRAGMENT_VARIABLE_DEFINITION: {
value: DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION,
description: "Location adjacent to a fragment variable definition."
},
SCHEMA: {
value: DirectiveLocation.SCHEMA,
description: "Location adjacent to a schema definition."
},
SCALAR: {
value: DirectiveLocation.SCALAR,
description: "Location adjacent to a scalar definition."
},
OBJECT: {
value: DirectiveLocation.OBJECT,
description: "Location adjacent to an object type definition."
},
FIELD_DEFINITION: {
value: DirectiveLocation.FIELD_DEFINITION,
description: "Location adjacent to a field definition."
},
ARGUMENT_DEFINITION: {
value: DirectiveLocation.ARGUMENT_DEFINITION,
description: "Location adjacent to an argument definition."
},
INTERFACE: {
value: DirectiveLocation.INTERFACE,
description: "Location adjacent to an interface definition."
},
UNION: {
value: DirectiveLocation.UNION,
description: "Location adjacent to a union definition."
},
ENUM: {
value: DirectiveLocation.ENUM,
description: "Location adjacent to an enum definition."
},
ENUM_VALUE: {
value: DirectiveLocation.ENUM_VALUE,
description: "Location adjacent to an enum value definition."
},
INPUT_OBJECT: {
value: DirectiveLocation.INPUT_OBJECT,
description: "Location adjacent to an input object type definition."
},
INPUT_FIELD_DEFINITION: {
value: DirectiveLocation.INPUT_FIELD_DEFINITION,
description: "Location adjacent to an input object field definition."
},
DIRECTIVE_DEFINITION: {
value: DirectiveLocation.DIRECTIVE_DEFINITION,
description: "Location adjacent to a directive definition."
}
}
});
__Type = new 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: () => ({
kind: {
type: new GraphQLNonNull(__TypeKind),
resolve(type) {
if (isScalarType(type)) {
return TypeKind.SCALAR;
}
if (isObjectType(type)) {
return TypeKind.OBJECT;
}
if (isInterfaceType(type)) {
return TypeKind.INTERFACE;
}
if (isUnionType(type)) {
return TypeKind.UNION;
}
if (isEnumType(type)) {
return TypeKind.ENUM;
}
if (isInputObjectType(type)) {
return TypeKind.INPUT_OBJECT;
}
if (isListType(type)) {
return TypeKind.LIST;
}
if (isNonNullType(type)) {
return TypeKind.NON_NULL;
}
invariant(false, `Unexpected type: "${inspect(type)}".`);
}
},
name: {
type: GraphQLString,
resolve: (type) => "name" in type ? type.name : void 0
},
description: {
type: GraphQLString,
resolve: (type) => "description" in type ? type.description : void 0
},
specifiedByURL: {
type: GraphQLString,
resolve: (obj) => "specifiedByURL" in obj ? obj.specifiedByURL : void 0
},
fields: {
type: new GraphQLList(new GraphQLNonNull(__Field)),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve(type, { includeDeprecated }) {
if (isObjectType(type) || isInterfaceType(type)) {
const fields = Object.values(type.getFields());
return includeDeprecated === true ? fields : fields.filter((field) => field.deprecationReason == null);
}
}
},
interfaces: {
type: new GraphQLList(new GraphQLNonNull(__Type)),
resolve(type) {
if (isObjectType(type) || isInterfaceType(type)) {
return type.getInterfaces();
}
}
},
possibleTypes: {
type: new GraphQLList(new GraphQLNonNull(__Type)),
resolve(type, _args, _context, { schema }) {
if (isAbstractType(type)) {
return schema.getPossibleTypes(type);
}
}
},
enumValues: {
type: new GraphQLList(new GraphQLNonNull(__EnumValue)),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve(type, { includeDeprecated }) {
if (isEnumType(type)) {
const values = type.getValues();
return includeDeprecated === true ? values : values.filter((field) => field.deprecationReason == null);
}
}
},
inputFields: {
type: new GraphQLList(new GraphQLNonNull(__InputValue)),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve(type, { includeDeprecated }) {
if (isInputObjectType(type)) {
const values = Object.values(type.getFields());
return includeDeprecated === true ? values : values.filter((field) => field.deprecationReason == null);
}
}
},
ofType: {
type: __Type,
resolve: (type) => "ofType" in type ? type.ofType : void 0
},
isOneOf: {
type: GraphQLBoolean,
resolve: (type) => {
if (isInputObjectType(type)) {
return type.isOneOf;
}
}
}
})
});
__Field = new 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: () => ({
name: {
type: new GraphQLNonNull(GraphQLString),
resolve: (field) => field.name
},
description: {
type: GraphQLString,
resolve: (field) => field.description
},
args: {
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),
args: {
includeDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
default: { value: false }
}
},
resolve(field, { includeDeprecated }) {
return includeDeprecated === true ? field.args : field.args.filter((arg) => arg.deprecationReason == null);
}
},
type: {
type: new GraphQLNonNull(__Type),
resolve: (field) => field.type
},
isDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
resolve: (field) => field.deprecationReason != null
},
deprecationReason: {
type: GraphQLString,
resolve: (field) => field.deprecationReason
}
})
});
__InputValue = new 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: () => ({
name: {
type: new GraphQLNonNull(GraphQLString),
resolve: (inputValue) => inputValue.name
},
description: {
type: GraphQLString,
resolve: (inputValue) => inputValue.description
},
type: {
type: new GraphQLNonNull(__Type),
resolve: (inputValue) => inputValue.type
},
defaultValue: {
type: GraphQLString,
description: "A GraphQL-formatted string representing the default value for this input value.",
resolve(inputValue) {
const ast = getDefaultValueAST(inputValue);
if (ast) {
return print(ast);
}
return null;
}
},
isDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
resolve: (field) => field.deprecationReason != null
},
deprecationReason: {
type: GraphQLString,
resolve: (obj) => obj.deprecationReason
}
})
});
__EnumValue = new 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: () => ({
name: {
type: new GraphQLNonNull(GraphQLString),
resolve: (enumValue) => enumValue.name
},
description: {
type: GraphQLString,
resolve: (enumValue) => enumValue.description
},
isDeprecated: {
type: new GraphQLNonNull(GraphQLBoolean),
resolve: (enumValue) => enumValue.deprecationReason != null
},
deprecationReason: {
type: GraphQLString,
resolve: (enumValue) => enumValue.deprecationReason
}
})
});
TypeKind = {
SCALAR: "SCALAR",
OBJECT: "OBJECT",
INTERFACE: "INTERFACE",
UNION: "UNION",
ENUM: "ENUM",
INPUT_OBJECT: "INPUT_OBJECT",
LIST: "LIST",
NON_NULL: "NON_NULL"
};
__TypeKind = new GraphQLEnumType({
name: "__TypeKind",
description: "An enum describing what kind of type a given `__Type` is.",
values: {
SCALAR: {
value: TypeKind.SCALAR,
description: "Indicates this type is a scalar."
},
OBJECT: {
value: TypeKind.OBJECT,
description: "Indicates this type is an object. `fields` and `interfaces` are valid fields."
},
INTERFACE: {
value: TypeKind.INTERFACE,
description: "Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."
},
UNION: {
value: TypeKind.UNION,
description: "Indicates this type is a union. `possibleTypes` is a valid field."
},
ENUM: {
value: TypeKind.ENUM,
description: "Indicates this type is an enum. `enumValues` is a valid field."
},
INPUT_OBJECT: {
value: TypeKind.INPUT_OBJECT,
description: "Indicates this type is an input object. `inputFields` is a valid field."
},
LIST: {
value: TypeKind.LIST,
description: "Indicates this type is a list. `ofType` is a valid field."
},
NON_NULL: {
value: TypeKind.NON_NULL,
description: "Indicates this type is a non-null. `ofType` is a valid field."
}
}
});
SchemaMetaFieldDef = new GraphQLField(void 0, "__schema", {
type: new GraphQLNonNull(__Schema),
description: "Access the current type schema of this server.",
resolve: (_source, _args, _context, { schema }) => schema
});
TypeMetaFieldDef = new GraphQLField(void 0, "__type", {
type: __Type,
description: "Request the type information of a single type.",
args: { name: { type: new GraphQLNonNull(GraphQLString) } },
resolve: (_source, { name }, _context, { schema }) => schema.getType(name)
});
TypeNameMetaFieldDef = new GraphQLField(void 0, "__typename", {
type: new GraphQLNonNull(GraphQLString),
description: "The name of the current Object type at runtime.",
resolve: (_source, _args, _context, { parentType }) => parentType.name
});
introspectionTypes = Object.freeze([
__Schema,
__Directive,
__DirectiveLocation,
__Type,
__Field,
__InputValue,
__EnumValue,
__TypeKind
]);
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/schema.mjs
function isSchema(schema) {
return instanceOf(schema, schemaSymbol, GraphQLSchema);
}
function assertSchema(schema) {
if (!isSchema(schema)) {
throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`);
}
return schema;
}
function collectReferencedTypes(type, typeSet) {
const namedType = getNamedType(type);
if (!typeSet.has(namedType)) {
typeSet.add(namedType);
if (isUnionType(namedType)) {
for (const memberType of namedType.getTypes()) {
collectReferencedTypes(memberType, typeSet);
}
} else if (isObjectType(namedType) || isInterfaceType(namedType)) {
for (const interfaceType of namedType.getInterfaces()) {
collectReferencedTypes(interfaceType, typeSet);
}
for (const field of Object.values(namedType.getFields())) {
collectReferencedTypes(field.type, typeSet);
for (const arg of field.args) {
collectReferencedTypes(arg.type, typeSet);
}
}
} else if (isInputObjectType(namedType)) {
for (const field of Object.values(namedType.getFields())) {
collectReferencedTypes(field.type, typeSet);
}
}
}
return typeSet;
}
var schemaSymbol, GraphQLSchema;
var init_schema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/schema.mjs"() {
init_inspect();
init_instanceOf();
init_toObjMap();
init_ast();
init_definition();
init_directives();
init_introspection();
schemaSymbol = /* @__PURE__ */ Symbol("Schema");
GraphQLSchema = class {
constructor(config) {
this.__kind = schemaSymbol;
this.assumeValid = config.assumeValid ?? false;
this.__validationErrors = config.assumeValid === true ? [] : void 0;
this.description = config.description;
this.extensions = toObjMapWithSymbols(config.extensions);
this.astNode = config.astNode;
this.extensionASTNodes = config.extensionASTNodes ?? [];
this._queryType = config.query;
this._mutationType = config.mutation;
this._subscriptionType = config.subscription;
this._directives = config.directives ?? specifiedDirectives;
const allReferencedTypes = new Set(config.types);
if (config.types != null) {
for (const type of config.types) {
allReferencedTypes.delete(type);
collectReferencedTypes(type, allReferencedTypes);
}
}
if (this._queryType != null) {
collectReferencedTypes(this._queryType, allReferencedTypes);
}
if (this._mutationType != null) {
collectReferencedTypes(this._mutationType, allReferencedTypes);
}
if (this._subscriptionType != null) {
collectReferencedTypes(this._subscriptionType, allReferencedTypes);
}
for (const directive of this._directives) {
if (isDirective(directive)) {
for (const arg of directive.args) {
collectReferencedTypes(arg.type, allReferencedTypes);
}
}
}
collectReferencedTypes(__Schema, allReferencedTypes);
this._typeMap = /* @__PURE__ */ Object.create(null);
this._subTypeMap = /* @__PURE__ */ new Map();
this._implementationsMap = /* @__PURE__ */ Object.create(null);
for (const namedType of allReferencedTypes) {
if (namedType == null) {
continue;
}
const typeName = namedType.name;
if (this._typeMap[typeName] !== void 0) {
throw new Error(`Schema must contain uniquely named types but contains multiple types named "${typeName}".`);
}
this._typeMap[typeName] = namedType;
if (isInterfaceType(namedType)) {
for (const iface of namedType.getInterfaces()) {
if (isInterfaceType(iface)) {
let implementations = this._implementationsMap[iface.name];
implementations ??= this._implementationsMap[iface.name] = {
objects: [],
interfaces: []
};
implementations.interfaces.push(namedType);
}
}
} else if (isObjectType(namedType)) {
for (const iface of namedType.getInterfaces()) {
if (isInterfaceType(iface)) {
let implementations = this._implementationsMap[iface.name];
implementations ??= this._implementationsMap[iface.name] = {
objects: [],
interfaces: []
};
implementations.objects.push(namedType);
}
}
}
}
}
get [Symbol.toStringTag]() {
return "GraphQLSchema";
}
getQueryType() {
return this._queryType;
}
getMutationType() {
return this._mutationType;
}
getSubscriptionType() {
return this._subscriptionType;
}
getRootType(operation) {
switch (operation) {
case OperationTypeNode.QUERY:
return this.getQueryType();
case OperationTypeNode.MUTATION:
return this.getMutationType();
case OperationTypeNode.SUBSCRIPTION:
return this.getSubscriptionType();
}
}
getTypeMap() {
return this._typeMap;
}
getType(name) {
return this.getTypeMap()[name];
}
getPossibleTypes(abstractType) {
return isUnionType(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;
}
getImplementations(interfaceType) {
const implementations = this._implementationsMap[interfaceType.name];
return implementations ?? { objects: [], interfaces: [] };
}
isSubType(abstractType, maybeSubType) {
let set = this._subTypeMap.get(abstractType);
if (set === void 0) {
if (isUnionType(abstractType)) {
set = new Set(abstractType.getTypes());
} else {
const implementations = this.getImplementations(abstractType);
set = /* @__PURE__ */ new Set([
...implementations.objects,
...implementations.interfaces
]);
}
this._subTypeMap.set(abstractType, set);
}
return set.has(maybeSubType);
}
getDirectives() {
return this._directives;
}
getDirective(name) {
return this.getDirectives().find((directive) => directive.name === name);
}
getField(parentType, fieldName) {
switch (fieldName) {
case SchemaMetaFieldDef.name:
return this.getQueryType() === parentType ? SchemaMetaFieldDef : void 0;
case TypeMetaFieldDef.name:
return this.getQueryType() === parentType ? TypeMetaFieldDef : void 0;
case TypeNameMetaFieldDef.name:
return TypeNameMetaFieldDef;
}
if ("getFields" in parentType) {
return parentType.getFields()[fieldName];
}
return void 0;
}
toConfig() {
return {
description: this.description,
query: this.getQueryType(),
mutation: this.getMutationType(),
subscription: this.getSubscriptionType(),
types: Object.values(this.getTypeMap()),
directives: this.getDirectives(),
extensions: this.extensions,
astNode: this.astNode,
extensionASTNodes: this.extensionASTNodes,
assumeValid: this.assumeValid
};
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/validate.mjs
function validateSchema(schema) {
assertSchema(schema);
if (schema.__validationErrors) {
return schema.__validationErrors;
}
const context = new SchemaValidationContext(schema);
validateRootTypes(context);
validateDirectives(context);
validateTypes(context);
const errors = context.getErrors();
schema.__validationErrors = errors;
return errors;
}
function assertValidSchema(schema) {
const errors = validateSchema(schema);
if (errors.length !== 0) {
throw new Error(errors.map((error) => error.message).join("\n\n"));
}
}
function validateRootTypes(context) {
const schema = context.schema;
if (schema.getQueryType() == null) {
context.reportError("Query root type must be provided.", schema.astNode);
}
const rootTypesMap = new AccumulatorMap();
for (const operationType of Object.values(OperationTypeNode)) {
const rootType = schema.getRootType(operationType);
if (rootType != null) {
if (!isObjectType(rootType)) {
const operationTypeStr = capitalize(operationType);
const rootTypeStr = inspect(rootType);
context.reportError(operationType === OperationTypeNode.QUERY ? `${operationTypeStr} root type must be Object type, it cannot be ${rootTypeStr}.` : `${operationTypeStr} root type must be Object type if provided, it cannot be ${rootTypeStr}.`, getOperationTypeNode(schema, operationType) ?? rootType.astNode);
} else {
rootTypesMap.add(rootType, operationType);
}
}
}
for (const [rootType, operationTypes] of rootTypesMap) {
if (operationTypes.length > 1) {
const operationList = andList(operationTypes);
context.reportError(`All root types must be different, "${rootType}" type is used as ${operationList} root types.`, operationTypes.map((operationType) => getOperationTypeNode(schema, operationType)));
}
}
}
function getOperationTypeNode(schema, operation) {
return [schema.astNode, ...schema.extensionASTNodes].flatMap((schemaNode) => schemaNode?.operationTypes ?? []).find((operationNode) => operationNode.operation === operation)?.type;
}
function validateDirectives(context) {
for (const directive of context.schema.getDirectives()) {
if (!isDirective(directive)) {
context.reportError(`Expected directive but got: ${inspect(directive)}.`, directive?.astNode);
continue;
}
validateName(context, directive);
if (directive.locations.length === 0) {
context.reportError(`Directive ${directive} must include 1 or more locations.`, directive.astNode);
}
for (const arg of directive.args) {
validateName(context, arg);
if (!isInputType(arg.type)) {
context.reportError(`The type of ${arg} must be Input Type but got: ${inspect(arg.type)}.`, arg.astNode);
}
if (isRequiredArgument(arg) && arg.deprecationReason != null) {
context.reportError(`Required argument ${arg} cannot be deprecated.`, [
getDeprecatedDirectiveNode(arg.astNode),
arg.astNode?.type
]);
}
validateDefaultValue(context, arg);
}
}
}
function validateDefaultValue(context, inputValue) {
const defaultInput = inputValue.default;
if (!defaultInput) {
return;
}
const errors = [];
validateDefaultInput(defaultInput, inputValue.type, (error, path) => {
errors.push([error, path]);
});
if (errors.length === 0) {
return;
}
if (!defaultInput.literal) {
try {
const uncoercedValue = uncoerceDefaultValue(defaultInput.value, inputValue.type);
const uncoercedErrors = [];
validateInputValue(uncoercedValue, inputValue.type, (error, path) => {
uncoercedErrors.push([error, path]);
});
if (uncoercedErrors.length === 0) {
context.reportError(`${inputValue} has invalid default value: ${inspect(defaultInput.value)}. Did you mean: ${inspect(uncoercedValue)}?`, inputValue.astNode?.defaultValue);
return;
}
} catch (_error) {
}
}
for (const [error, path] of errors) {
context.reportError(`${inputValue} has invalid default value${printPathArray(path)}: ${error.message}`, error.nodes ?? inputValue.astNode?.defaultValue);
}
}
function validateDefaultInput(defaultInput, inputType, onError, hideSuggestions) {
if (defaultInput.literal) {
validateInputLiteral(defaultInput.literal, inputType, onError, void 0, void 0, hideSuggestions);
return;
}
validateInputValue(defaultInput.value, inputType, onError, hideSuggestions);
}
function uncoerceDefaultValue(value, type) {
if (isNonNullType(type)) {
return uncoerceDefaultValue(value, type.ofType);
}
if (value === null) {
return null;
}
if (isListType(type)) {
if (isIterableObject(value)) {
return Array.from(value, (itemValue) => uncoerceDefaultValue(itemValue, type.ofType));
}
return [uncoerceDefaultValue(value, type.ofType)];
}
if (isInputObjectType(type)) {
if (!isObjectLike(value))
invariant(false);
const fieldDefs = type.getFields();
return mapValue(value, (fieldValue, fieldName) => {
if (!(fieldName in fieldDefs))
invariant(false);
return uncoerceDefaultValue(fieldValue, fieldDefs[fieldName].type);
});
}
assertLeafType(type);
return type.coerceOutputValue(value);
}
function validateName(context, node) {
if (node.name.startsWith("__")) {
context.reportError(`Name "${node.name}" must not begin with "__", which is reserved by GraphQL introspection.`, node.astNode);
}
}
function validateTypes(context) {
const validateInputObjectDefaultValueCircularRefs = createInputObjectDefaultValueCircularRefsValidator(context);
const typeMap = context.schema.getTypeMap();
const finiteValueStates = /* @__PURE__ */ new Map();
for (const type of Object.values(typeMap)) {
if (!isNamedType(type)) {
context.reportError(`Expected GraphQL named type but got: ${inspect(type)}.`, type.astNode);
continue;
}
if (!isIntrospectionType(type)) {
validateName(context, type);
}
if (isObjectType(type)) {
validateFields(context, type);
validateInterfaces(context, type);
} else if (isInterfaceType(type)) {
validateFields(context, type);
validateInterfaces(context, type);
} else if (isUnionType(type)) {
validateUnionMembers(context, type);
} else if (isEnumType(type)) {
validateEnumValues(context, type);
} else if (isInputObjectType(type)) {
validateInputFields(context, type);
initializeInputObjectFiniteValueState(type);
validateInputObjectDefaultValueCircularRefs(type);
}
}
detectInputObjectNonFiniteValues(context, finiteValueStates);
function initializeInputObjectFiniteValueState(inputObj) {
finiteValueStates.set(inputObj, {
inputObj,
targets: [],
dependents: [],
unresolvedTargetCount: 0,
hasFiniteValue: false
});
}
}
function validateFields(context, type) {
const fields = Object.values(type.getFields());
if (fields.length === 0) {
context.reportError(`Type ${type} must define one or more fields.`, [
type.astNode,
...type.extensionASTNodes
]);
}
for (const field of fields) {
validateName(context, field);
if (!isOutputType(field.type)) {
context.reportError(`The type of ${field} must be Output Type but got: ${inspect(field.type)}.`, field.astNode?.type);
}
for (const arg of field.args) {
validateName(context, arg);
if (!isInputType(arg.type)) {
context.reportError(`The type of ${arg} must be Input Type but got: ${inspect(arg.type)}.`, arg.astNode?.type);
}
if (isRequiredArgument(arg) && arg.deprecationReason != null) {
context.reportError(`Required argument ${arg} cannot be deprecated.`, [
getDeprecatedDirectiveNode(arg.astNode),
arg.astNode?.type
]);
}
validateDefaultValue(context, arg);
}
}
}
function validateInterfaces(context, type) {
const ifaceTypeNames = /* @__PURE__ */ new Set();
for (const iface of type.getInterfaces()) {
if (!isInterfaceType(iface)) {
context.reportError(`Type ${type} must only implement Interface types, it cannot implement ${inspect(iface)}.`, getAllImplementsInterfaceNodes(type, iface));
continue;
}
if (type === iface) {
context.reportError(`Type ${type} cannot implement itself because it would create a circular reference.`, getAllImplementsInterfaceNodes(type, iface));
continue;
}
if (ifaceTypeNames.has(iface.name)) {
context.reportError(`Type ${type} can only implement ${iface} once.`, getAllImplementsInterfaceNodes(type, iface));
continue;
}
ifaceTypeNames.add(iface.name);
validateTypeImplementsAncestors(context, type, iface);
validateTypeImplementsInterface(context, type, iface);
}
}
function validateTypeImplementsInterface(context, type, iface) {
const typeFieldMap = type.getFields();
for (const ifaceField of Object.values(iface.getFields())) {
const typeField = typeFieldMap[ifaceField.name];
if (typeField == null) {
context.reportError(`Interface field ${ifaceField} expected but ${type} does not provide it.`, [ifaceField.astNode, type.astNode, ...type.extensionASTNodes]);
continue;
}
if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {
context.reportError(`Interface field ${ifaceField} expects type ${ifaceField.type} but ${typeField} is type ${typeField.type}.`, [ifaceField.astNode?.type, typeField.astNode?.type]);
}
for (const ifaceArg of ifaceField.args) {
const typeArg = typeField.args.find((arg) => arg.name === ifaceArg.name);
if (!typeArg) {
context.reportError(`Interface field argument ${ifaceArg} expected but ${typeField} does not provide it.`, [ifaceArg.astNode, typeField.astNode]);
continue;
}
if (!isEqualType(ifaceArg.type, typeArg.type)) {
context.reportError(`Interface field argument ${ifaceArg} expects type ${ifaceArg.type} but ${typeArg} is type ${typeArg.type}.`, [ifaceArg.astNode?.type, typeArg.astNode?.type]);
}
}
for (const typeArg of typeField.args) {
if (isRequiredArgument(typeArg)) {
const ifaceArg = ifaceField.args.find((arg) => arg.name === typeArg.name);
if (!ifaceArg) {
context.reportError(`Argument "${typeArg}" must not be required type "${typeArg.type}" if not provided by the Interface field "${ifaceField}".`, [typeArg.astNode, ifaceField.astNode]);
}
}
}
if (typeField.deprecationReason != null && ifaceField.deprecationReason == null) {
context.reportError(`Interface field ${iface.name}.${ifaceField.name} is not deprecated, so implementation field ${type.name}.${typeField.name} must not be deprecated.`, [
getDeprecatedDirectiveNode(typeField.astNode),
typeField.astNode?.type
]);
}
}
}
function validateTypeImplementsAncestors(context, type, iface) {
const ifaceInterfaces = type.getInterfaces();
for (const transitive of iface.getInterfaces()) {
if (!ifaceInterfaces.includes(transitive)) {
context.reportError(transitive === type ? `Type ${type} cannot implement ${iface} because it would create a circular reference.` : `Type ${type} must implement ${transitive} because it is implemented by ${iface}.`, [
...getAllImplementsInterfaceNodes(iface, transitive),
...getAllImplementsInterfaceNodes(type, iface)
]);
}
}
}
function validateUnionMembers(context, union) {
const memberTypes = union.getTypes();
if (memberTypes.length === 0) {
context.reportError(`Union type ${union} must define one or more member types.`, [union.astNode, ...union.extensionASTNodes]);
}
const includedTypeNames = /* @__PURE__ */ new Set();
for (const memberType of memberTypes) {
if (includedTypeNames.has(memberType.name)) {
context.reportError(`Union type ${union} can only include type ${memberType} once.`, getUnionMemberTypeNodes(union, memberType.name));
continue;
}
includedTypeNames.add(memberType.name);
if (!isObjectType(memberType)) {
context.reportError(`Union type ${union} can only include Object types, it cannot include ${inspect(memberType)}.`, getUnionMemberTypeNodes(union, String(memberType)));
}
}
}
function validateEnumValues(context, enumType) {
const enumValues = enumType.getValues();
if (enumValues.length === 0) {
context.reportError(`Enum type ${enumType} must define one or more values.`, [enumType.astNode, ...enumType.extensionASTNodes]);
}
for (const enumValue of enumValues) {
validateName(context, enumValue);
}
}
function validateInputFields(context, inputObj) {
const fields = Object.values(inputObj.getFields());
if (fields.length === 0) {
context.reportError(`Input Object type ${inputObj} must define one or more fields.`, [inputObj.astNode, ...inputObj.extensionASTNodes]);
}
for (const field of fields) {
validateName(context, field);
if (!isInputType(field.type)) {
context.reportError(`The type of ${field} must be Input Type but got: ${inspect(field.type)}.`, field.astNode?.type);
}
if (isRequiredInputField(field) && field.deprecationReason != null) {
context.reportError(`Required input field ${field} cannot be deprecated.`, [getDeprecatedDirectiveNode(field.astNode), field.astNode?.type]);
}
validateDefaultValue(context, field);
if (inputObj.isOneOf) {
validateOneOfInputObjectField(inputObj, field, context);
}
}
}
function validateOneOfInputObjectField(type, field, context) {
if (isNonNullType(field.type)) {
context.reportError(`OneOf input field ${type}.${field.name} must be nullable.`, field.astNode?.type);
}
if (field.default !== void 0 || field.defaultValue !== void 0) {
context.reportError(`OneOf input field ${type}.${field.name} cannot have a default value.`, field.astNode);
}
}
function detectInputObjectNonFiniteValues(context, finiteValueStates) {
const inputObjectsWithFiniteValues = [];
for (const state of finiteValueStates.values()) {
const inputObj = state.inputObj;
const fields = Object.values(inputObj.getFields());
for (const field of fields) {
const target = getFiniteValueTarget(inputObj, field.type);
if (target === void 0) {
continue;
}
state.targets.push({ field, target });
const targetState = finiteValueStates.get(target);
if (targetState !== void 0) {
targetState.dependents.push(state);
}
}
if (inputObj.isOneOf) {
if (fields.length === 0 || state.targets.length < fields.length) {
markInputObjectHasFiniteValue(state);
}
} else {
state.unresolvedTargetCount = state.targets.length;
if (state.targets.length === 0) {
markInputObjectHasFiniteValue(state);
}
}
}
let nextFiniteValueState;
while ((nextFiniteValueState = inputObjectsWithFiniteValues.pop()) !== void 0) {
for (const dependentState of nextFiniteValueState.dependents) {
if (dependentState.hasFiniteValue) {
continue;
}
if (dependentState.inputObj.isOneOf) {
markInputObjectHasFiniteValue(dependentState);
continue;
}
--dependentState.unresolvedTargetCount;
if (dependentState.unresolvedTargetCount === 0) {
markInputObjectHasFiniteValue(dependentState);
}
}
}
const visitedTypes = /* @__PURE__ */ new Set();
const fieldPath = [];
const fieldPathIndexByType = /* @__PURE__ */ new Map();
for (const state of finiteValueStates.values()) {
if (!state.hasFiniteValue) {
reportCycleRecursive(state);
}
}
function markInputObjectHasFiniteValue(finiteValueState) {
if (!finiteValueState.hasFiniteValue) {
finiteValueState.hasFiniteValue = true;
inputObjectsWithFiniteValues.push(finiteValueState);
}
}
function reportCycleRecursive(state) {
const inputObj = state.inputObj;
if (visitedTypes.has(inputObj)) {
return;
}
visitedTypes.add(inputObj);
fieldPathIndexByType.set(inputObj, fieldPath.length);
for (const { field, target } of state.targets) {
const targetState = finiteValueStates.get(target);
if (targetState?.hasFiniteValue !== false) {
continue;
}
const cycleIndex = fieldPathIndexByType.get(target);
fieldPath.push({
fieldStr: `${inputObj}.${field.name}`,
astNode: field.astNode
});
if (cycleIndex === void 0) {
reportCycleRecursive(targetState);
} else {
const cyclePath = fieldPath.slice(cycleIndex);
const pathStr = cyclePath.map((p) => p.fieldStr).join(", ");
context.reportError(`Input Object ${target} cannot be provided a finite value because it references itself through fields: ${pathStr}.`, cyclePath.map((p) => p.astNode));
}
fieldPath.pop();
}
fieldPathIndexByType.delete(inputObj);
}
}
function getFiniteValueTarget(inputObj, fieldType) {
if (inputObj.isOneOf) {
if (isInputObjectType(fieldType)) {
return fieldType;
}
return;
}
if (isNonNullType(fieldType) && isInputObjectType(fieldType.ofType)) {
return fieldType.ofType;
}
}
function createInputObjectDefaultValueCircularRefsValidator(context) {
const visitedFields = /* @__PURE__ */ Object.create(null);
const fieldPath = [];
const fieldPathIndex = /* @__PURE__ */ Object.create(null);
return function validateInputObjectDefaultValueCircularRefs(inputObj) {
return detectValueDefaultValueCycle(inputObj, /* @__PURE__ */ Object.create(null));
};
function detectValueDefaultValueCycle(inputObj, defaultValue) {
if (isIterableObject(defaultValue)) {
for (const itemValue of defaultValue) {
detectValueDefaultValueCycle(inputObj, itemValue);
}
return;
} else if (!isObjectLike(defaultValue)) {
return;
}
for (const field of Object.values(inputObj.getFields())) {
const namedFieldType = getNamedType(field.type);
if (!isInputObjectType(namedFieldType)) {
continue;
}
if (Object.hasOwn(defaultValue, field.name)) {
detectValueDefaultValueCycle(namedFieldType, defaultValue[field.name]);
} else {
detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`);
}
}
}
function detectLiteralDefaultValueCycle(inputObj, defaultValue) {
if (defaultValue.kind === kinds_exports.LIST) {
for (const itemLiteral of defaultValue.values) {
detectLiteralDefaultValueCycle(inputObj, itemLiteral);
}
return;
} else if (defaultValue.kind !== kinds_exports.OBJECT) {
return;
}
const fieldNodes = keyMap(defaultValue.fields, (field) => field.name.value);
for (const field of Object.values(inputObj.getFields())) {
const namedFieldType = getNamedType(field.type);
if (!isInputObjectType(namedFieldType)) {
continue;
}
if (Object.hasOwn(fieldNodes, field.name)) {
detectLiteralDefaultValueCycle(namedFieldType, fieldNodes[field.name].value);
} else {
detectFieldDefaultValueCycle(field, namedFieldType, `${inputObj}.${field.name}`);
}
}
}
function detectFieldDefaultValueCycle(field, fieldType, fieldStr) {
const defaultInput = field.default;
if (defaultInput === void 0) {
return;
}
const cycleIndex = fieldPathIndex[fieldStr];
if (cycleIndex !== void 0) {
context.reportError(`Invalid circular reference. The default value of Input Object field ${fieldStr} references itself${cycleIndex < fieldPath.length ? ` via the default values of: ${fieldPath.slice(cycleIndex).map(([stringForMessage]) => stringForMessage).join(", ")}` : ""}.`, fieldPath.slice(cycleIndex - 1).map(([, node]) => node));
return;
}
if (visitedFields[fieldStr] === void 0) {
visitedFields[fieldStr] = true;
fieldPathIndex[fieldStr] = fieldPath.push([
fieldStr,
field.astNode?.defaultValue
]);
if (defaultInput.literal) {
detectLiteralDefaultValueCycle(fieldType, defaultInput.literal);
} else {
detectValueDefaultValueCycle(fieldType, defaultInput.value);
}
fieldPath.pop();
fieldPathIndex[fieldStr] = void 0;
}
}
}
function getAllImplementsInterfaceNodes(type, iface) {
const { astNode, extensionASTNodes } = type;
const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;
return nodes.flatMap((typeNode) => typeNode.interfaces ?? []).filter((ifaceNode) => ifaceNode.name.value === iface.name);
}
function getUnionMemberTypeNodes(union, typeName) {
const { astNode, extensionASTNodes } = union;
const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes;
return nodes.flatMap((unionNode) => unionNode.types ?? []).filter((typeNode) => typeNode.name.value === typeName);
}
function getDeprecatedDirectiveNode(definitionNode) {
return definitionNode?.directives?.find((node) => node.name.value === GraphQLDeprecatedDirective.name);
}
var SchemaValidationContext;
var init_validate = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/validate.mjs"() {
init_AccumulatorMap();
init_capitalize();
init_formatList();
init_inspect();
init_invariant();
init_isIterableObject();
init_isObjectLike();
init_keyMap();
init_mapValue();
init_printPathArray();
init_GraphQLError();
init_ast();
init_kinds2();
init_typeComparators();
init_validateInputValue();
init_definition();
init_directives();
init_introspection();
init_schema();
SchemaValidationContext = class {
constructor(schema) {
this._errors = [];
this.schema = schema;
}
reportError(message, nodes) {
const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes;
this._errors.push(new GraphQLError(message, { nodes: _nodes }));
}
getErrors() {
return this._errors;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/syntaxError.mjs
function syntaxError(source, position, description) {
return new GraphQLError(`Syntax Error: ${description}`, {
source,
positions: [position]
});
}
var init_syntaxError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/syntaxError.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/diagnostics.mjs
function resolveDiagnosticsChannel() {
let dc2;
try {
const processRef = globalThis.process;
if (typeof processRef?.getBuiltinModule === "function") {
dc2 = processRef.getBuiltinModule("node:diagnostics_channel");
}
} catch {
}
return dc2;
}
function shouldTrace(channel) {
if (channel == null) {
return false;
}
const aggregate = channel.hasSubscribers;
if (aggregate !== void 0) {
return aggregate;
}
for (const key of SUB_CHANNEL_KEYS) {
if (channel[key].hasSubscribers) {
return true;
}
}
return false;
}
function traceMixed(channel, contextInput, fn2) {
const context = contextInput;
return channel.start.runStores(context, () => {
let result;
try {
result = fn2();
} catch (err) {
context.error = err;
channel.error.publish(context);
channel.end.publish(context);
throw err;
}
if (!isPromiseLike(result)) {
context.result = result;
channel.end.publish(context);
return result;
}
channel.end.publish(context);
return result.then((value) => {
context.result = value;
channel.asyncStart.publish(context);
channel.asyncEnd.publish(context);
return value;
}, (err) => {
context.error = err;
channel.error.publish(context);
channel.asyncStart.publish(context);
channel.asyncEnd.publish(context);
throw err;
});
});
}
var dc, parseChannel, validateChannel, executeChannel, executeVariableCoercionChannel, executeRootSelectionSetChannel, subscribeChannel, resolveChannel, SUB_CHANNEL_KEYS;
var init_diagnostics = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/diagnostics.mjs"() {
init_isPromise();
dc = resolveDiagnosticsChannel();
parseChannel = dc?.tracingChannel("graphql:parse");
validateChannel = dc?.tracingChannel("graphql:validate");
executeChannel = dc?.tracingChannel("graphql:execute");
executeVariableCoercionChannel = dc?.tracingChannel("graphql:execute:variableCoercion");
executeRootSelectionSetChannel = dc?.tracingChannel("graphql:execute:rootSelectionSet");
subscribeChannel = dc?.tracingChannel("graphql:subscribe");
resolveChannel = dc?.tracingChannel("graphql:resolve");
SUB_CHANNEL_KEYS = ["start", "end", "asyncStart", "asyncEnd", "error"];
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/tokenKind.mjs
var TokenKind;
var init_tokenKind = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/tokenKind.mjs"() {
TokenKind = {
SOF: "<SOF>",
EOF: "<EOF>",
BANG: "!",
DOLLAR: "$",
AMP: "&",
PAREN_L: "(",
PAREN_R: ")",
DOT: ".",
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"
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/lexer.mjs
function isPunctuatorTokenKind(kind) {
return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.DOT || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
}
function isUnicodeScalarValue(code) {
return code >= 0 && code <= 55295 || code >= 57344 && code <= 1114111;
}
function isSupplementaryCodePoint(body, location) {
return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1));
}
function isLeadingSurrogate(code) {
return code >= 55296 && code <= 56319;
}
function isTrailingSurrogate(code) {
return code >= 56320 && code <= 57343;
}
function printCodePointAt(lexer, location) {
const code = lexer.source.body.codePointAt(location);
if (code === void 0) {
return TokenKind.EOF;
} else if (code >= 32 && code <= 126) {
const char = String.fromCodePoint(code);
return char === '"' ? `'"'` : `"${char}"`;
}
return "U+" + code.toString(16).toUpperCase().padStart(4, "0");
}
function createToken(lexer, kind, start, end, value) {
const line = lexer.line;
const col = 1 + start - lexer.lineStart;
return new Token2(kind, start, end, line, col, value);
}
function readNextToken(lexer, start) {
const body = lexer.source.body;
const bodyLength = body.length;
let position = start;
while (position < bodyLength) {
const code = body.charCodeAt(position);
switch (code) {
case 65279:
case 9:
case 32:
case 44:
++position;
continue;
case 10:
++position;
++lexer.line;
lexer.lineStart = position;
continue;
case 13:
if (body.charCodeAt(position + 1) === 10) {
position += 2;
} else {
++position;
}
++lexer.line;
lexer.lineStart = position;
continue;
case 35:
return readComment(lexer, position);
case 33:
return createToken(lexer, TokenKind.BANG, position, position + 1);
case 36:
return createToken(lexer, TokenKind.DOLLAR, position, position + 1);
case 38:
return createToken(lexer, TokenKind.AMP, position, position + 1);
case 40:
return createToken(lexer, TokenKind.PAREN_L, position, position + 1);
case 41:
return createToken(lexer, TokenKind.PAREN_R, position, position + 1);
case 46: {
const nextCode = body.charCodeAt(position + 1);
if (nextCode === 46 && body.charCodeAt(position + 2) === 46) {
return createToken(lexer, TokenKind.SPREAD, position, position + 3);
}
if (nextCode === 46) {
throw syntaxError(lexer.source, position, 'Unexpected "..", did you mean "..."?');
} else if (isDigit2(nextCode)) {
const digits = lexer.source.body.slice(position + 1, readDigits(lexer, position + 1, nextCode));
throw syntaxError(lexer.source, position, `Invalid number, expected digit before ".", did you mean "0.${digits}"?`);
}
break;
}
case 58:
return createToken(lexer, TokenKind.COLON, position, position + 1);
case 61:
return createToken(lexer, TokenKind.EQUALS, position, position + 1);
case 64:
return createToken(lexer, TokenKind.AT, position, position + 1);
case 91:
return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);
case 93:
return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);
case 123:
return createToken(lexer, TokenKind.BRACE_L, position, position + 1);
case 124:
return createToken(lexer, TokenKind.PIPE, position, position + 1);
case 125:
return createToken(lexer, TokenKind.BRACE_R, position, position + 1);
case 34:
if (body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
return readBlockString(lexer, position);
}
return readString(lexer, position);
}
if (isDigit2(code) || code === 45) {
return readNumber(lexer, position, code);
}
if (isNameStart(code)) {
return readName(lexer, position);
}
throw syntaxError(lexer.source, position, code === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position) ? `Unexpected character: ${printCodePointAt(lexer, position)}.` : `Invalid character: ${printCodePointAt(lexer, position)}.`);
}
return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);
}
function readComment(lexer, start) {
const maxComments = lexer._maxComments;
if (maxComments !== void 0) {
const nextCommentCount = lexer._commentCount + 1;
if (nextCommentCount > maxComments) {
throw syntaxError(lexer.source, start, `Document contains more than ${maxComments} comments. Parsing aborted.`);
}
lexer._commentCount = nextCommentCount;
}
const body = lexer.source.body;
const bodyLength = body.length;
let position = start + 1;
while (position < bodyLength) {
const code = body.charCodeAt(position);
if (code === 10 || code === 13) {
break;
}
if (isUnicodeScalarValue(code)) {
++position;
} else if (isSupplementaryCodePoint(body, position)) {
position += 2;
} else {
break;
}
}
return createToken(lexer, TokenKind.COMMENT, start, position, body.slice(start + 1, position));
}
function readNumber(lexer, start, firstCode) {
const body = lexer.source.body;
let position = start;
let code = firstCode;
let isFloat = false;
if (code === 45) {
code = body.charCodeAt(++position);
}
if (code === 48) {
code = body.charCodeAt(++position);
if (isDigit2(code)) {
throw syntaxError(lexer.source, position, `Invalid number, unexpected digit after 0: ${printCodePointAt(lexer, position)}.`);
}
} else {
position = readDigits(lexer, position, code);
code = body.charCodeAt(position);
}
if (code === 46) {
isFloat = true;
code = body.charCodeAt(++position);
position = readDigits(lexer, position, code);
code = body.charCodeAt(position);
}
if (code === 69 || code === 101) {
isFloat = true;
code = body.charCodeAt(++position);
if (code === 43 || code === 45) {
code = body.charCodeAt(++position);
}
position = readDigits(lexer, position, code);
code = body.charCodeAt(position);
}
if (code === 46 || isNameStart(code)) {
throw syntaxError(lexer.source, position, `Invalid number, expected digit but got: ${printCodePointAt(lexer, position)}.`);
}
return createToken(lexer, isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, body.slice(start, position));
}
function readDigits(lexer, start, firstCode) {
if (!isDigit2(firstCode)) {
throw syntaxError(lexer.source, start, `Invalid number, expected digit but got: ${printCodePointAt(lexer, start)}.`);
}
const body = lexer.source.body;
let position = start + 1;
while (isDigit2(body.charCodeAt(position))) {
++position;
}
return position;
}
function readString(lexer, start) {
const body = lexer.source.body;
const bodyLength = body.length;
let position = start + 1;
let chunkStart = position;
let value = "";
while (position < bodyLength) {
const code = body.charCodeAt(position);
if (code === 34) {
value += body.slice(chunkStart, position);
return createToken(lexer, TokenKind.STRING, start, position + 1, value);
}
if (code === 92) {
value += body.slice(chunkStart, position);
const escape = body.charCodeAt(position + 1) === 117 ? body.charCodeAt(position + 2) === 123 ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position);
value += escape.value;
position += escape.size;
chunkStart = position;
continue;
}
if (code === 10 || code === 13) {
break;
}
if (isUnicodeScalarValue(code)) {
++position;
} else if (isSupplementaryCodePoint(body, position)) {
position += 2;
} else {
throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`);
}
}
throw syntaxError(lexer.source, position, "Unterminated string.");
}
function readEscapedUnicodeVariableWidth(lexer, position) {
const body = lexer.source.body;
let point = 0;
let size = 3;
while (size < 12) {
const code = body.charCodeAt(position + size++);
if (code === 125) {
if (size < 5 || !isUnicodeScalarValue(point)) {
break;
}
return { value: String.fromCodePoint(point), size };
}
point = point << 4 | readHexDigit(code);
if (point < 0) {
break;
}
}
throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + size)}".`);
}
function readEscapedUnicodeFixedWidth(lexer, position) {
const body = lexer.source.body;
const code = read16BitHexCode(body, position + 2);
if (isUnicodeScalarValue(code)) {
return { value: String.fromCodePoint(code), size: 6 };
}
if (isLeadingSurrogate(code)) {
if (body.charCodeAt(position + 6) === 92 && body.charCodeAt(position + 7) === 117) {
const trailingCode = read16BitHexCode(body, position + 8);
if (isTrailingSurrogate(trailingCode)) {
return { value: String.fromCodePoint(code, trailingCode), size: 12 };
}
}
}
throw syntaxError(lexer.source, position, `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".`);
}
function read16BitHexCode(body, position) {
return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3));
}
function readHexDigit(code) {
return code >= 48 && code <= 57 ? code - 48 : code >= 65 && code <= 70 ? code - 55 : code >= 97 && code <= 102 ? code - 87 : -1;
}
function readEscapedCharacter(lexer, position) {
const body = lexer.source.body;
const code = body.charCodeAt(position + 1);
switch (code) {
case 34:
return { value: '"', size: 2 };
case 92:
return { value: "\\", size: 2 };
case 47:
return { value: "/", size: 2 };
case 98:
return { value: "\b", size: 2 };
case 102:
return { value: "\f", size: 2 };
case 110:
return { value: "\n", size: 2 };
case 114:
return { value: "\r", size: 2 };
case 116:
return { value: " ", size: 2 };
}
throw syntaxError(lexer.source, position, `Invalid character escape sequence: "${body.slice(position, position + 2)}".`);
}
function readBlockString(lexer, start) {
const body = lexer.source.body;
const bodyLength = body.length;
let lineStart = lexer.lineStart;
let position = start + 3;
let chunkStart = position;
let currentLine = "";
const blockLines = [];
while (position < bodyLength) {
const code = body.charCodeAt(position);
if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
currentLine += body.slice(chunkStart, position);
blockLines.push(currentLine);
const token = createToken(lexer, TokenKind.BLOCK_STRING, start, position + 3, dedentBlockStringLines(blockLines).join("\n"));
lexer.line += blockLines.length - 1;
lexer.lineStart = lineStart;
return token;
}
if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
currentLine += body.slice(chunkStart, position);
chunkStart = position + 1;
position += 4;
continue;
}
if (code === 10 || code === 13) {
currentLine += body.slice(chunkStart, position);
blockLines.push(currentLine);
if (code === 13 && body.charCodeAt(position + 1) === 10) {
position += 2;
} else {
++position;
}
currentLine = "";
chunkStart = position;
lineStart = position;
continue;
}
if (isUnicodeScalarValue(code)) {
++position;
} else if (isSupplementaryCodePoint(body, position)) {
position += 2;
} else {
throw syntaxError(lexer.source, position, `Invalid character within String: ${printCodePointAt(lexer, position)}.`);
}
}
throw syntaxError(lexer.source, position, "Unterminated string.");
}
function readName(lexer, start) {
const body = lexer.source.body;
const bodyLength = body.length;
let position = start + 1;
while (position < bodyLength) {
const code = body.charCodeAt(position);
if (isNameContinue(code)) {
++position;
} else {
break;
}
}
return createToken(lexer, TokenKind.NAME, start, position, body.slice(start, position));
}
var Lexer;
var init_lexer = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/lexer.mjs"() {
init_syntaxError();
init_ast();
init_blockString();
init_characterClasses();
init_tokenKind();
Lexer = class {
constructor(source) {
const startOfFileToken = new Token2(TokenKind.SOF, 0, 0, 0, 0);
this.source = source;
this.lastToken = startOfFileToken;
this.token = startOfFileToken;
this.line = 1;
this.lineStart = 0;
this._maxComments = void 0;
this._commentCount = 0;
}
get [Symbol.toStringTag]() {
return "Lexer";
}
advance() {
this.lastToken = this.token;
const token = this.token = this.lookahead();
return token;
}
lookahead() {
let token = this.token;
if (token.kind !== TokenKind.EOF) {
do {
if (token.next) {
token = token.next;
} else {
const nextToken = readNextToken(this, token.end);
token.next = nextToken;
nextToken.prev = token;
token = nextToken;
}
} while (token.kind === TokenKind.COMMENT);
}
return token;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/schemaCoordinateLexer.mjs
function readNextToken2(lexer, start) {
const body = lexer.source.body;
const bodyLength = body.length;
const position = start;
if (position < bodyLength) {
const code = body.charCodeAt(position);
switch (code) {
case 46:
return createToken(lexer, TokenKind.DOT, position, position + 1);
case 40:
return createToken(lexer, TokenKind.PAREN_L, position, position + 1);
case 41:
return createToken(lexer, TokenKind.PAREN_R, position, position + 1);
case 58:
return createToken(lexer, TokenKind.COLON, position, position + 1);
case 64:
return createToken(lexer, TokenKind.AT, position, position + 1);
}
if (isNameStart(code)) {
return readName(lexer, position);
}
throw syntaxError(lexer.source, position, `Invalid character: ${printCodePointAt(lexer, position)}.`);
}
return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);
}
var SchemaCoordinateLexer;
var init_schemaCoordinateLexer = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/schemaCoordinateLexer.mjs"() {
init_syntaxError();
init_ast();
init_characterClasses();
init_lexer();
init_tokenKind();
SchemaCoordinateLexer = class {
constructor(source) {
this.line = 1;
this.lineStart = 0;
const startOfFileToken = new Token2(TokenKind.SOF, 0, 0, 0, 0);
this.source = source;
this.lastToken = startOfFileToken;
this.token = startOfFileToken;
}
get [Symbol.toStringTag]() {
return "SchemaCoordinateLexer";
}
advance() {
this.lastToken = this.token;
const token = this.token = this.lookahead();
return token;
}
lookahead() {
let token = this.token;
if (token.kind !== TokenKind.EOF) {
const nextToken = readNextToken2(this, token.end);
token.next = nextToken;
nextToken.prev = token;
token = nextToken;
}
return token;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/source.mjs
function isSource(source) {
return instanceOf(source, sourceSymbol, Source);
}
var sourceSymbol, Source;
var init_source = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/source.mjs"() {
init_devAssert();
init_instanceOf();
sourceSymbol = /* @__PURE__ */ Symbol("Source");
Source = class {
constructor(body, name = "GraphQL request", locationOffset = { line: 1, column: 1 }) {
this.__kind = sourceSymbol;
this.body = body;
this.name = name;
this.locationOffset = locationOffset;
if (!(this.locationOffset.line > 0))
devAssert(false, "line in locationOffset is 1-indexed and must be positive.");
if (!(this.locationOffset.column > 0))
devAssert(false, "column in locationOffset is 1-indexed and must be positive.");
}
get [Symbol.toStringTag]() {
return "Source";
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/parser.mjs
function parse(source, options) {
return shouldTrace(parseChannel) ? parseChannel.traceSync(() => parseImpl(source, options), { source }) : parseImpl(source, options);
}
function parseImpl(source, options) {
const parser = new Parser(source, options);
const document2 = parser.parseDocument();
Object.defineProperty(document2, "tokenCount", {
enumerable: false,
value: parser.tokenCount
});
return document2;
}
function parseValue(source, options) {
const parser = new Parser(source, options);
parser.expectToken(TokenKind.SOF);
const value = parser.parseValueLiteral(false);
parser.expectToken(TokenKind.EOF);
return value;
}
function parseConstValue(source, options) {
const parser = new Parser(source, options);
parser.expectToken(TokenKind.SOF);
const value = parser.parseConstValueLiteral();
parser.expectToken(TokenKind.EOF);
return value;
}
function parseType(source, options) {
const parser = new Parser(source, options);
parser.expectToken(TokenKind.SOF);
const type = parser.parseTypeReference();
parser.expectToken(TokenKind.EOF);
return type;
}
function parseSchemaCoordinate(source) {
const sourceObj = isSource(source) ? source : new Source(source);
const lexer = new SchemaCoordinateLexer(sourceObj);
const parser = new Parser(source, { lexer });
parser.expectToken(TokenKind.SOF);
const coordinate = parser.parseSchemaCoordinate();
parser.expectToken(TokenKind.EOF);
return coordinate;
}
function getTokenDesc(token) {
const value = token.value;
return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : "");
}
function getTokenKindDesc(kind) {
return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind;
}
var Parser;
var init_parser = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/parser.mjs"() {
init_syntaxError();
init_diagnostics();
init_ast();
init_directiveLocation();
init_kinds2();
init_lexer();
init_schemaCoordinateLexer();
init_source();
init_tokenKind();
Parser = class {
constructor(source, options = {}) {
const { lexer, ..._options } = options;
if (lexer) {
this._lexer = lexer;
} else {
const sourceObj = isSource(source) ? source : new Source(source);
this._lexer = new Lexer(sourceObj);
}
this._options = _options;
this._tokenCounter = 0;
this._lexer._maxComments = _options.maxComments;
this._lexer._commentCount = 0;
const maxSourceLength = _options.maxSourceLength;
if (maxSourceLength !== void 0 && this._lexer.source.body.length > maxSourceLength) {
throw syntaxError(this._lexer.source, maxSourceLength, `Source contains more than ${maxSourceLength} UTF-16 code units. Parsing aborted.`);
}
}
get tokenCount() {
return this._tokenCounter;
}
parseName() {
const token = this.expectToken(TokenKind.NAME);
return this.node(token, {
kind: kinds_exports.NAME,
value: token.value
});
}
parseDocument() {
return this.node(this._lexer.token, {
kind: kinds_exports.DOCUMENT,
definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF)
});
}
parseDefinition() {
if (this.peek(TokenKind.BRACE_L)) {
return this.parseOperationDefinition();
}
const hasDescription = this.peekDescription();
const keywordToken = hasDescription ? this._lexer.lookahead() : this._lexer.token;
if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) {
throw syntaxError(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
}
if (keywordToken.kind === TokenKind.NAME) {
switch (keywordToken.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();
}
switch (keywordToken.value) {
case "query":
case "mutation":
case "subscription":
return this.parseOperationDefinition();
case "fragment":
return this.parseFragmentDefinition();
}
if (hasDescription) {
throw syntaxError(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
}
switch (keywordToken.value) {
case "extend":
return this.parseTypeSystemExtension();
}
}
throw this.unexpected(keywordToken);
}
parseOperationDefinition() {
const start = this._lexer.token;
if (this.peek(TokenKind.BRACE_L)) {
return this.node(start, {
kind: kinds_exports.OPERATION_DEFINITION,
operation: OperationTypeNode.QUERY,
description: void 0,
name: void 0,
variableDefinitions: void 0,
directives: void 0,
selectionSet: this.parseSelectionSet()
});
}
const description = this.parseDescription();
const operation = this.parseOperationType();
let name;
if (this.peek(TokenKind.NAME)) {
name = this.parseName();
}
return this.node(start, {
kind: kinds_exports.OPERATION_DEFINITION,
operation,
description,
name,
variableDefinitions: this.parseVariableDefinitions(),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet()
});
}
parseOperationType() {
const operationToken = this.expectToken(TokenKind.NAME);
switch (operationToken.value) {
case "query":
return OperationTypeNode.QUERY;
case "mutation":
return OperationTypeNode.MUTATION;
case "subscription":
return OperationTypeNode.SUBSCRIPTION;
}
throw this.unexpected(operationToken);
}
parseVariableDefinitions() {
return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
}
parseVariableDefinition() {
return this.node(this._lexer.token, {
kind: kinds_exports.VARIABLE_DEFINITION,
description: this.parseDescription(),
variable: this.parseVariable(),
type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseConstValueLiteral() : void 0,
directives: this.parseConstDirectives()
});
}
parseVariable() {
const start = this._lexer.token;
this.expectToken(TokenKind.DOLLAR);
return this.node(start, {
kind: kinds_exports.VARIABLE,
name: this.parseName()
});
}
parseSelectionSet() {
return this.node(this._lexer.token, {
kind: kinds_exports.SELECTION_SET,
selections: this._options.allowEmptySelectionSets === false ? this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R) : this.any(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R)
});
}
parseSelection() {
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
}
parseField() {
const start = this._lexer.token;
const nameOrAlias = this.parseName();
let alias;
let name;
if (this.expectOptionalToken(TokenKind.COLON)) {
alias = nameOrAlias;
name = this.parseName();
} else {
name = nameOrAlias;
}
return this.node(start, {
kind: kinds_exports.FIELD,
alias,
name,
arguments: this.parseArguments(false),
directives: this.parseDirectives(false),
selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0
});
}
parseArguments(isConst) {
const item = isConst ? this.parseConstArgument : this.parseArgument;
return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
}
parseFragmentArguments() {
const item = this.parseFragmentArgument;
return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
}
parseArgument(isConst = false) {
const start = this._lexer.token;
const name = this.parseName();
this.expectToken(TokenKind.COLON);
return this.node(start, {
kind: kinds_exports.ARGUMENT,
name,
value: this.parseValueLiteral(isConst)
});
}
parseConstArgument() {
return this.parseArgument(true);
}
parseFragmentArgument() {
const start = this._lexer.token;
const name = this.parseName();
this.expectToken(TokenKind.COLON);
return this.node(start, {
kind: kinds_exports.FRAGMENT_ARGUMENT,
name,
value: this.parseValueLiteral(false)
});
}
parseFragment() {
const start = this._lexer.token;
this.expectToken(TokenKind.SPREAD);
const hasTypeCondition = this.expectOptionalKeyword("on");
if (!hasTypeCondition && this.peek(TokenKind.NAME)) {
const name = this.parseFragmentName();
if (this.peek(TokenKind.PAREN_L) && this._options.experimentalFragmentArguments) {
return this.node(start, {
kind: kinds_exports.FRAGMENT_SPREAD,
name,
arguments: this.parseFragmentArguments(),
directives: this.parseDirectives(false)
});
}
return this.node(start, {
kind: kinds_exports.FRAGMENT_SPREAD,
name,
directives: this.parseDirectives(false)
});
}
return this.node(start, {
kind: kinds_exports.INLINE_FRAGMENT,
typeCondition: hasTypeCondition ? this.parseNamedType() : void 0,
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet()
});
}
parseFragmentDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("fragment");
if (this._options.experimentalFragmentArguments === true) {
return this.node(start, {
kind: kinds_exports.FRAGMENT_DEFINITION,
description,
name: this.parseFragmentName(),
variableDefinitions: this.parseVariableDefinitions(),
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet()
});
}
return this.node(start, {
kind: kinds_exports.FRAGMENT_DEFINITION,
description,
name: this.parseFragmentName(),
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
directives: this.parseDirectives(false),
selectionSet: this.parseSelectionSet()
});
}
parseFragmentName() {
if (this._lexer.token.value === "on") {
throw this.unexpected();
}
return this.parseName();
}
parseValueLiteral(isConst) {
const token = this._lexer.token;
switch (token.kind) {
case TokenKind.BRACKET_L:
return this.parseList(isConst);
case TokenKind.BRACE_L:
return this.parseObject(isConst);
case TokenKind.INT:
this.advanceLexer();
return this.node(token, {
kind: kinds_exports.INT,
value: token.value
});
case TokenKind.FLOAT:
this.advanceLexer();
return this.node(token, {
kind: kinds_exports.FLOAT,
value: token.value
});
case TokenKind.STRING:
case TokenKind.BLOCK_STRING:
return this.parseStringLiteral();
case TokenKind.NAME:
this.advanceLexer();
switch (token.value) {
case "true":
return this.node(token, {
kind: kinds_exports.BOOLEAN,
value: true
});
case "false":
return this.node(token, {
kind: kinds_exports.BOOLEAN,
value: false
});
case "null":
return this.node(token, { kind: kinds_exports.NULL });
default:
return this.node(token, {
kind: kinds_exports.ENUM,
value: token.value
});
}
case TokenKind.DOLLAR:
if (isConst) {
this.expectToken(TokenKind.DOLLAR);
if (this._lexer.token.kind === TokenKind.NAME) {
const varName = this._lexer.token.value;
throw syntaxError(this._lexer.source, token.start, `Unexpected variable "$${varName}" in constant value.`);
} else {
throw this.unexpected(token);
}
}
return this.parseVariable();
default:
throw this.unexpected();
}
}
parseConstValueLiteral() {
return this.parseValueLiteral(true);
}
parseStringLiteral() {
const token = this._lexer.token;
this.advanceLexer();
return this.node(token, {
kind: kinds_exports.STRING,
value: token.value,
block: token.kind === TokenKind.BLOCK_STRING
});
}
parseList(isConst) {
const item = () => this.parseValueLiteral(isConst);
return this.node(this._lexer.token, {
kind: kinds_exports.LIST,
values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R)
});
}
parseObject(isConst) {
const item = () => this.parseObjectField(isConst);
return this.node(this._lexer.token, {
kind: kinds_exports.OBJECT,
fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R)
});
}
parseObjectField(isConst) {
const start = this._lexer.token;
const name = this.parseName();
this.expectToken(TokenKind.COLON);
return this.node(start, {
kind: kinds_exports.OBJECT_FIELD,
name,
value: this.parseValueLiteral(isConst)
});
}
parseDirectives(isConst) {
const directives = [];
while (this.peek(TokenKind.AT)) {
directives.push(this.parseDirective(isConst));
}
if (directives.length) {
return directives;
}
return void 0;
}
parseConstDirectives() {
return this.parseDirectives(true);
}
parseDirective(isConst) {
const start = this._lexer.token;
this.expectToken(TokenKind.AT);
return this.node(start, {
kind: kinds_exports.DIRECTIVE,
name: this.parseName(),
arguments: this.parseArguments(isConst)
});
}
parseTypeReference() {
const start = this._lexer.token;
let type;
if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
const innerType = this.parseTypeReference();
this.expectToken(TokenKind.BRACKET_R);
type = this.node(start, {
kind: kinds_exports.LIST_TYPE,
type: innerType
});
} else {
type = this.parseNamedType();
}
if (this.expectOptionalToken(TokenKind.BANG)) {
return this.node(start, {
kind: kinds_exports.NON_NULL_TYPE,
type
});
}
return type;
}
parseNamedType() {
return this.node(this._lexer.token, {
kind: kinds_exports.NAMED_TYPE,
name: this.parseName()
});
}
peekDescription() {
return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
}
parseDescription() {
if (this.peekDescription()) {
return this.parseStringLiteral();
}
}
parseSchemaDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("schema");
const directives = this.parseConstDirectives();
const operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
return this.node(start, {
kind: kinds_exports.SCHEMA_DEFINITION,
description,
directives,
operationTypes
});
}
parseOperationTypeDefinition() {
const start = this._lexer.token;
const operation = this.parseOperationType();
this.expectToken(TokenKind.COLON);
const type = this.parseNamedType();
return this.node(start, {
kind: kinds_exports.OPERATION_TYPE_DEFINITION,
operation,
type
});
}
parseScalarTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("scalar");
const name = this.parseName();
const directives = this.parseConstDirectives();
return this.node(start, {
kind: kinds_exports.SCALAR_TYPE_DEFINITION,
description,
name,
directives
});
}
parseObjectTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("type");
const name = this.parseName();
const interfaces = this.parseImplementsInterfaces();
const directives = this.parseConstDirectives();
const fields = this.parseFieldsDefinition();
return this.node(start, {
kind: kinds_exports.OBJECT_TYPE_DEFINITION,
description,
name,
interfaces,
directives,
fields
});
}
parseImplementsInterfaces() {
return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : void 0;
}
parseFieldsDefinition() {
return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
}
parseFieldDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
const name = this.parseName();
const args = this.parseArgumentDefs();
this.expectToken(TokenKind.COLON);
const type = this.parseTypeReference();
const directives = this.parseConstDirectives();
return this.node(start, {
kind: kinds_exports.FIELD_DEFINITION,
description,
name,
arguments: args,
type,
directives
});
}
parseArgumentDefs() {
return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
}
parseInputValueDef() {
const start = this._lexer.token;
const description = this.parseDescription();
const name = this.parseName();
this.expectToken(TokenKind.COLON);
const type = this.parseTypeReference();
let defaultValue;
if (this.expectOptionalToken(TokenKind.EQUALS)) {
defaultValue = this.parseConstValueLiteral();
}
const directives = this.parseConstDirectives();
return this.node(start, {
kind: kinds_exports.INPUT_VALUE_DEFINITION,
description,
name,
type,
defaultValue,
directives
});
}
parseInterfaceTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("interface");
const name = this.parseName();
const interfaces = this.parseImplementsInterfaces();
const directives = this.parseConstDirectives();
const fields = this.parseFieldsDefinition();
return this.node(start, {
kind: kinds_exports.INTERFACE_TYPE_DEFINITION,
description,
name,
interfaces,
directives,
fields
});
}
parseUnionTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("union");
const name = this.parseName();
const directives = this.parseConstDirectives();
const types = this.parseUnionMemberTypes();
return this.node(start, {
kind: kinds_exports.UNION_TYPE_DEFINITION,
description,
name,
directives,
types
});
}
parseUnionMemberTypes() {
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : void 0;
}
parseEnumTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("enum");
const name = this.parseName();
const directives = this.parseConstDirectives();
const values = this.parseEnumValuesDefinition();
return this.node(start, {
kind: kinds_exports.ENUM_TYPE_DEFINITION,
description,
name,
directives,
values
});
}
parseEnumValuesDefinition() {
return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
}
parseEnumValueDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
const name = this.parseEnumValueName();
const directives = this.parseConstDirectives();
return this.node(start, {
kind: kinds_exports.ENUM_VALUE_DEFINITION,
description,
name,
directives
});
}
parseEnumValueName() {
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") {
throw syntaxError(this._lexer.source, this._lexer.token.start, `${getTokenDesc(this._lexer.token)} is reserved and cannot be used for an enum value.`);
}
return this.parseName();
}
parseInputObjectTypeDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("input");
const name = this.parseName();
const directives = this.parseConstDirectives();
const fields = this.parseInputFieldsDefinition();
return this.node(start, {
kind: kinds_exports.INPUT_OBJECT_TYPE_DEFINITION,
description,
name,
directives,
fields
});
}
parseInputFieldsDefinition() {
return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
}
parseTypeSystemExtension() {
const keywordToken = this._lexer.lookahead();
if (keywordToken.kind === TokenKind.NAME) {
switch (keywordToken.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();
case "directive":
return this.parseDirectiveExtension();
}
}
throw this.unexpected(keywordToken);
}
parseSchemaExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("schema");
const directives = this.parseConstDirectives();
const operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
if (directives === void 0 && operationTypes === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.SCHEMA_EXTENSION,
directives,
operationTypes
});
}
parseScalarTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("scalar");
const name = this.parseName();
const directives = this.parseConstDirectives();
if (directives === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.SCALAR_TYPE_EXTENSION,
name,
directives
});
}
parseObjectTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("type");
const name = this.parseName();
const interfaces = this.parseImplementsInterfaces();
const directives = this.parseConstDirectives();
const fields = this.parseFieldsDefinition();
if (interfaces === void 0 && directives === void 0 && fields === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.OBJECT_TYPE_EXTENSION,
name,
interfaces,
directives,
fields
});
}
parseInterfaceTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("interface");
const name = this.parseName();
const interfaces = this.parseImplementsInterfaces();
const directives = this.parseConstDirectives();
const fields = this.parseFieldsDefinition();
if (interfaces === void 0 && directives === void 0 && fields === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.INTERFACE_TYPE_EXTENSION,
name,
interfaces,
directives,
fields
});
}
parseUnionTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("union");
const name = this.parseName();
const directives = this.parseConstDirectives();
const types = this.parseUnionMemberTypes();
if (directives === void 0 && types === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.UNION_TYPE_EXTENSION,
name,
directives,
types
});
}
parseEnumTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("enum");
const name = this.parseName();
const directives = this.parseConstDirectives();
const values = this.parseEnumValuesDefinition();
if (directives === void 0 && values === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.ENUM_TYPE_EXTENSION,
name,
directives,
values
});
}
parseInputObjectTypeExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("input");
const name = this.parseName();
const directives = this.parseConstDirectives();
const fields = this.parseInputFieldsDefinition();
if (directives === void 0 && fields === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.INPUT_OBJECT_TYPE_EXTENSION,
name,
directives,
fields
});
}
parseDirectiveExtension() {
const start = this._lexer.token;
this.expectKeyword("extend");
this.expectKeyword("directive");
this.expectToken(TokenKind.AT);
const name = this.parseName();
const directives = this.parseConstDirectives();
if (directives === void 0) {
throw this.unexpected();
}
return this.node(start, {
kind: kinds_exports.DIRECTIVE_EXTENSION,
name,
directives
});
}
parseDirectiveDefinition() {
const start = this._lexer.token;
const description = this.parseDescription();
this.expectKeyword("directive");
this.expectToken(TokenKind.AT);
const name = this.parseName();
const args = this.parseArgumentDefs();
const directives = this.parseConstDirectives();
const repeatable = this.expectOptionalKeyword("repeatable");
this.expectKeyword("on");
const locations = this.parseDirectiveLocations();
return this.node(start, {
kind: kinds_exports.DIRECTIVE_DEFINITION,
description,
name,
arguments: args,
directives,
repeatable,
locations
});
}
parseDirectiveLocations() {
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
}
parseDirectiveLocation() {
const start = this._lexer.token;
const name = this.parseName();
if (Object.hasOwn(DirectiveLocation, name.value)) {
return name;
}
throw this.unexpected(start);
}
parseSchemaCoordinate() {
const start = this._lexer.token;
const ofDirective = this.expectOptionalToken(TokenKind.AT);
const name = this.parseName();
let memberName;
if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) {
memberName = this.parseName();
}
let argumentName;
if ((ofDirective || memberName) && this.expectOptionalToken(TokenKind.PAREN_L)) {
argumentName = this.parseName();
this.expectToken(TokenKind.COLON);
this.expectToken(TokenKind.PAREN_R);
}
if (ofDirective) {
if (argumentName) {
return this.node(start, {
kind: kinds_exports.DIRECTIVE_ARGUMENT_COORDINATE,
name,
argumentName
});
}
return this.node(start, {
kind: kinds_exports.DIRECTIVE_COORDINATE,
name
});
} else if (memberName) {
if (argumentName) {
return this.node(start, {
kind: kinds_exports.ARGUMENT_COORDINATE,
name,
fieldName: memberName,
argumentName
});
}
return this.node(start, {
kind: kinds_exports.MEMBER_COORDINATE,
name,
memberName
});
}
return this.node(start, {
kind: kinds_exports.TYPE_COORDINATE,
name
});
}
node(startToken, node) {
if (this._options.noLocation !== true) {
node.loc = new Location(startToken, this._lexer.lastToken, this._lexer.source);
}
return node;
}
peek(kind) {
return this._lexer.token.kind === kind;
}
expectToken(kind) {
const token = this._lexer.token;
if (token.kind === kind) {
this.advanceLexer();
return token;
}
throw syntaxError(this._lexer.source, token.start, `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`);
}
expectOptionalToken(kind) {
const token = this._lexer.token;
if (token.kind === kind) {
this.advanceLexer();
return true;
}
return false;
}
expectKeyword(value) {
const token = this._lexer.token;
if (token.kind === TokenKind.NAME && token.value === value) {
this.advanceLexer();
} else {
throw syntaxError(this._lexer.source, token.start, `Expected "${value}", found ${getTokenDesc(token)}.`);
}
}
expectOptionalKeyword(value) {
const token = this._lexer.token;
if (token.kind === TokenKind.NAME && token.value === value) {
this.advanceLexer();
return true;
}
return false;
}
unexpected(atToken) {
const token = atToken ?? this._lexer.token;
return syntaxError(this._lexer.source, token.start, `Unexpected ${getTokenDesc(token)}.`);
}
any(openKind, parseFn, closeKind) {
this.expectToken(openKind);
const nodes = [];
while (!this.expectOptionalToken(closeKind)) {
nodes.push(parseFn.call(this));
}
return nodes;
}
optionalMany(openKind, parseFn, closeKind) {
if (this.expectOptionalToken(openKind)) {
const nodes = [];
do {
nodes.push(parseFn.call(this));
} while (!this.expectOptionalToken(closeKind));
return nodes;
}
return void 0;
}
many(openKind, parseFn, closeKind) {
this.expectToken(openKind);
const nodes = [];
do {
nodes.push(parseFn.call(this));
} while (!this.expectOptionalToken(closeKind));
return nodes;
}
delimitedMany(delimiterKind, parseFn) {
this.expectOptionalToken(delimiterKind);
const nodes = [];
do {
nodes.push(parseFn.call(this));
} while (this.expectOptionalToken(delimiterKind));
return nodes;
}
advanceLexer() {
const { maxLexicalTokens = this._options.maxTokens } = this._options;
const token = this._lexer.advance();
if (token.kind !== TokenKind.EOF) {
++this._tokenCounter;
if (maxLexicalTokens !== void 0 && this._tokenCounter > maxLexicalTokens) {
throw syntaxError(this._lexer.source, token.start, `Document contains more than ${maxLexicalTokens} tokens. Parsing aborted.`);
}
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/visitor.mjs
function visit(root, visitor, visitorKeys = QueryDocumentKeys) {
const enterLeaveMap = /* @__PURE__ */ new Map();
for (const kind of allKinds) {
enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));
}
let stack = void 0;
let inArray = Array.isArray(root);
let keys = [root];
let index = -1;
let edits;
let node = root;
let key = void 0;
let parent = void 0;
const path = [];
const ancestors = [];
do {
index++;
const isLeaving = index === keys.length;
const isEdited = isLeaving && edits !== void 0;
if (isLeaving) {
key = ancestors.length === 0 ? void 0 : path[path.length - 1];
node = parent;
parent = ancestors.pop();
if (edits !== void 0) {
if (inArray) {
node = node.slice();
let editOffset = 0;
for (let editIndex = 0; editIndex < edits.length; editIndex += 2) {
const editKey = edits[editIndex];
const editValue = edits[editIndex + 1];
const arrayKey = editKey - editOffset;
if (editValue === null) {
node.splice(arrayKey, 1);
editOffset++;
} else {
node[arrayKey] = editValue;
}
}
} else {
node = { ...node };
for (let editIndex = 0; editIndex < edits.length; editIndex += 2) {
node[edits[editIndex]] = edits[editIndex + 1];
}
}
}
index = stack.index;
keys = stack.keys;
edits = stack.edits;
inArray = stack.inArray;
stack = stack.prev;
} else if (parent != null) {
key = inArray ? index : keys[index];
node = parent[key];
if (node === null || node === void 0) {
continue;
}
path.push(key);
}
let result;
let nodeIsArray = Array.isArray(node);
if (!nodeIsArray) {
if (!isNode(node))
devAssert(false, `Invalid AST Node: ${inspect(node)}.`);
const visitFn = isLeaving ? enterLeaveMap.get(node.kind)?.leave : enterLeaveMap.get(node.kind)?.enter;
result = visitFn?.call(visitor, node, key, parent, path, ancestors);
if (result === BREAK) {
break;
}
if (result === false) {
if (!isLeaving) {
path.pop();
continue;
}
} else if (result !== void 0) {
(edits ??= []).push(key, result);
if (!isLeaving) {
if (isNode(result)) {
node = result;
nodeIsArray = Array.isArray(node);
} else {
path.pop();
continue;
}
}
}
}
if (result === void 0 && isEdited) {
(edits ??= []).push(key, node);
}
if (isLeaving) {
path.pop();
} else {
stack = { inArray, index, keys, edits, prev: stack };
inArray = nodeIsArray;
keys = inArray ? node : visitorKeys[node.kind] ?? [];
index = -1;
edits = void 0;
if (parent != null) {
ancestors.push(parent);
}
parent = node;
}
} while (stack !== void 0);
if (edits !== void 0) {
return edits.at(-1);
}
return root;
}
function visitInParallel(visitors) {
const skipping = new Array(visitors.length).fill(null);
const mergedVisitor = /* @__PURE__ */ Object.create(null);
for (const kind of allKinds) {
let hasVisitor = false;
const enterList = new Array(visitors.length).fill(void 0);
const leaveList = new Array(visitors.length).fill(void 0);
for (let i = 0; i < visitors.length; ++i) {
const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);
hasVisitor ||= enter != null || leave != null;
enterList[i] = enter;
leaveList[i] = leave;
}
if (!hasVisitor) {
continue;
}
const mergedEnterLeave = {
enter(...args) {
const node = args[0];
for (let i = 0; i < visitors.length; i++) {
if (skipping[i] === null) {
const result = enterList[i]?.apply(visitors[i], args);
if (result === false) {
skipping[i] = node;
} else if (result === BREAK) {
skipping[i] = BREAK;
} else if (result !== void 0) {
return result;
}
}
}
},
leave(...args) {
const node = args[0];
for (let i = 0; i < visitors.length; i++) {
if (skipping[i] === null) {
const result = leaveList[i]?.apply(visitors[i], args);
if (result === BREAK) {
skipping[i] = BREAK;
} else if (result !== void 0 && result !== false) {
return result;
}
} else if (skipping[i] === node) {
skipping[i] = null;
}
}
}
};
mergedVisitor[kind] = mergedEnterLeave;
}
return mergedVisitor;
}
function getEnterLeaveForKind(visitor, kind) {
const kindVisitor = visitor[kind];
if (typeof kindVisitor === "object") {
return kindVisitor;
} else if (typeof kindVisitor === "function") {
return { enter: kindVisitor, leave: void 0 };
}
return { enter: visitor.enter, leave: visitor.leave };
}
var allKinds, BREAK;
var init_visitor = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/visitor.mjs"() {
init_devAssert();
init_inspect();
init_ast();
init_kinds2();
allKinds = Object.values(kinds_exports);
BREAK = Object.freeze({});
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/typeFromAST.mjs
function typeFromAST(schema, typeNode) {
switch (typeNode.kind) {
case kinds_exports.LIST_TYPE: {
const innerType = typeFromAST(schema, typeNode.type);
return innerType && new GraphQLList(innerType);
}
case kinds_exports.NON_NULL_TYPE: {
const innerType = typeFromAST(schema, typeNode.type);
return innerType && new GraphQLNonNull(innerType);
}
case kinds_exports.NAMED_TYPE:
return schema.getType(typeNode.name.value);
}
}
var init_typeFromAST = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/typeFromAST.mjs"() {
init_kinds2();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/TypeInfo.mjs
function getFragmentSignatures(document2) {
const fragmentSignatures = /* @__PURE__ */ new Map();
for (const definition of document2.definitions) {
if (definition.kind === kinds_exports.FRAGMENT_DEFINITION) {
const variableDefinitions = /* @__PURE__ */ new Map();
if (definition.variableDefinitions) {
for (const varDef of definition.variableDefinitions) {
variableDefinitions.set(varDef.variable.name.value, varDef);
}
}
const signature = { definition, variableDefinitions };
fragmentSignatures.set(definition.name.value, signature);
}
}
return fragmentSignatures;
}
function visitWithTypeInfo(typeInfo, visitor) {
return {
enter(...args) {
const node = args[0];
typeInfo.enter(node);
const fn2 = getEnterLeaveForKind(visitor, node.kind).enter;
if (fn2) {
const result = fn2.apply(visitor, args);
if (result !== void 0) {
typeInfo.leave(node);
if (isNode(result)) {
typeInfo.enter(result);
}
}
return result;
}
},
leave(...args) {
const node = args[0];
const fn2 = getEnterLeaveForKind(visitor, node.kind).leave;
let result;
if (fn2) {
result = fn2.apply(visitor, args);
}
typeInfo.leave(node);
return result;
}
};
}
var TypeInfo;
var init_TypeInfo = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/TypeInfo.mjs"() {
init_ast();
init_kinds2();
init_visitor();
init_definition();
init_typeFromAST();
TypeInfo = class {
constructor(schema, initialType, fragmentSignatures) {
this._schema = schema;
this._typeStack = [];
this._parentTypeStack = [];
this._inputTypeStack = [];
this._fieldDefStack = [];
this._defaultValueStack = [];
this._directive = null;
this._argument = null;
this._enumValue = null;
this._fragmentSignaturesByName = fragmentSignatures ?? (() => null);
this._fragmentSignature = null;
this._fragmentArgument = null;
if (initialType) {
if (isInputType(initialType)) {
this._inputTypeStack.push(initialType);
}
if (isCompositeType(initialType)) {
this._parentTypeStack.push(initialType);
}
if (isOutputType(initialType)) {
this._typeStack.push(initialType);
}
}
}
get [Symbol.toStringTag]() {
return "TypeInfo";
}
getType() {
return this._typeStack.at(-1);
}
getParentType() {
return this._parentTypeStack.at(-1);
}
getInputType() {
return this._inputTypeStack.at(-1);
}
getParentInputType() {
return this._inputTypeStack.at(-2);
}
getFieldDef() {
return this._fieldDefStack.at(-1);
}
getDefaultValue() {
return this._defaultValueStack.at(-1);
}
getDirective() {
return this._directive;
}
getArgument() {
return this._argument;
}
getFragmentSignature() {
return this._fragmentSignature;
}
getFragmentSignatureByName() {
return this._fragmentSignaturesByName;
}
getFragmentArgument() {
return this._fragmentArgument;
}
getEnumValue() {
return this._enumValue;
}
enter(node) {
const schema = this._schema;
switch (node.kind) {
case kinds_exports.DOCUMENT: {
const fragmentSignatures = getFragmentSignatures(node);
this._fragmentSignaturesByName = (fragmentName) => fragmentSignatures.get(fragmentName);
break;
}
case kinds_exports.SELECTION_SET: {
const namedType = getNamedType(this.getType());
this._parentTypeStack.push(isCompositeType(namedType) ? namedType : void 0);
break;
}
case kinds_exports.FIELD: {
const parentType = this.getParentType();
let fieldDef;
let fieldType;
if (parentType) {
fieldDef = schema.getField(parentType, node.name.value);
if (fieldDef) {
fieldType = fieldDef.type;
}
}
this._fieldDefStack.push(fieldDef);
this._typeStack.push(isOutputType(fieldType) ? fieldType : void 0);
break;
}
case kinds_exports.DIRECTIVE:
this._directive = schema.getDirective(node.name.value);
break;
case kinds_exports.OPERATION_DEFINITION: {
const rootType = schema.getRootType(node.operation);
this._typeStack.push(isObjectType(rootType) ? rootType : void 0);
break;
}
case kinds_exports.FRAGMENT_SPREAD: {
this._fragmentSignature = this.getFragmentSignatureByName()(node.name.value);
break;
}
case kinds_exports.INLINE_FRAGMENT:
case kinds_exports.FRAGMENT_DEFINITION: {
const typeConditionAST = node.typeCondition;
const outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType());
this._typeStack.push(isOutputType(outputType) ? outputType : void 0);
break;
}
case kinds_exports.VARIABLE_DEFINITION: {
const inputType = typeFromAST(schema, node.type);
this._inputTypeStack.push(isInputType(inputType) ? inputType : void 0);
break;
}
case kinds_exports.ARGUMENT: {
let argDef;
let argType;
const fieldOrDirective = this.getDirective() ?? this.getFieldDef();
if (fieldOrDirective) {
argDef = fieldOrDirective.args.find((arg) => arg.name === node.name.value);
if (argDef) {
argType = argDef.type;
}
}
this._argument = argDef;
this._defaultValueStack.push(argDef?.default ?? argDef?.defaultValue ?? void 0);
this._inputTypeStack.push(isInputType(argType) ? argType : void 0);
break;
}
case kinds_exports.FRAGMENT_ARGUMENT: {
const fragmentSignature = this.getFragmentSignature();
const argDef = fragmentSignature?.variableDefinitions.get(node.name.value);
this._fragmentArgument = argDef;
let argType;
if (argDef) {
argType = typeFromAST(this._schema, argDef.type);
}
this._inputTypeStack.push(isInputType(argType) ? argType : void 0);
break;
}
case kinds_exports.LIST: {
const inputType = this.getInputType();
const listType = inputType && getNullableType(inputType);
this._defaultValueStack.push(void 0);
this._inputTypeStack.push(listType && isListType(listType) ? listType.ofType : void 0);
break;
}
case kinds_exports.OBJECT_FIELD: {
const objectType = getNamedType(this.getInputType());
let inputFieldType;
let inputField;
if (isInputObjectType(objectType)) {
inputField = objectType.getFields()[node.name.value];
if (inputField != null) {
inputFieldType = inputField.type;
}
}
this._defaultValueStack.push(inputField?.default ?? inputField?.defaultValue ?? void 0);
this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : void 0);
break;
}
case kinds_exports.ENUM: {
const enumType = getNamedType(this.getInputType());
let enumValue;
if (isEnumType(enumType)) {
enumValue = enumType.getValue(node.value);
}
this._enumValue = enumValue;
break;
}
default:
}
}
leave(node) {
switch (node.kind) {
case kinds_exports.DOCUMENT:
this._fragmentSignaturesByName = () => null;
break;
case kinds_exports.SELECTION_SET:
this._parentTypeStack.pop();
break;
case kinds_exports.FIELD:
this._fieldDefStack.pop();
this._typeStack.pop();
break;
case kinds_exports.DIRECTIVE:
this._directive = null;
break;
case kinds_exports.FRAGMENT_SPREAD:
this._fragmentSignature = null;
break;
case kinds_exports.OPERATION_DEFINITION:
case kinds_exports.INLINE_FRAGMENT:
case kinds_exports.FRAGMENT_DEFINITION:
this._typeStack.pop();
break;
case kinds_exports.VARIABLE_DEFINITION:
this._inputTypeStack.pop();
break;
case kinds_exports.ARGUMENT:
this._argument = null;
this._defaultValueStack.pop();
this._inputTypeStack.pop();
break;
case kinds_exports.FRAGMENT_ARGUMENT: {
this._fragmentArgument = null;
this._defaultValueStack.pop();
this._inputTypeStack.pop();
break;
}
case kinds_exports.LIST:
case kinds_exports.OBJECT_FIELD:
this._defaultValueStack.pop();
this._inputTypeStack.pop();
break;
case kinds_exports.ENUM:
this._enumValue = null;
break;
default:
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs
function DeferStreamDirectiveLabelRule(context) {
const knownLabels = /* @__PURE__ */ new Map();
return {
Directive(node) {
if (node.name.value === GraphQLDeferDirective.name || node.name.value === GraphQLStreamDirective.name) {
const labelArgument = node.arguments?.find((arg) => arg.name.value === "label");
const labelValue = labelArgument?.value;
if (!labelValue || labelValue.kind === kinds_exports.NULL) {
return;
}
if (labelValue.kind !== kinds_exports.STRING) {
context.reportError(new GraphQLError(`Argument "@${node.name.value}(label:)" must be a static string.`, { nodes: node }));
return;
}
const knownLabel = knownLabels.get(labelValue.value);
if (knownLabel != null) {
context.reportError(new GraphQLError('Value for arguments "defer(label:)" and "stream(label:)" must be unique across all Defer/Stream directive usages.', { nodes: [knownLabel, node] }));
} else {
knownLabels.set(labelValue.value, node);
}
}
}
};
}
var init_DeferStreamDirectiveLabelRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveLabelRule.mjs"() {
init_GraphQLError();
init_kinds2();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs
function DeferStreamDirectiveOnRootFieldRule(context) {
const checkedFragments = /* @__PURE__ */ new Set();
return {
OperationDefinition(node) {
if (node.operation !== "subscription" && node.operation !== "mutation") {
return;
}
const schema = context.getSchema();
const rootType = schema.getRootType(node.operation);
if (rootType) {
const visitedFragments = /* @__PURE__ */ new Set();
if (forbidDeferStream({
context,
operationType: node.operation,
rootType,
checkedFragments,
selectionSet: node.selectionSet,
visitedFragments
})) {
for (const name of visitedFragments) {
checkedFragments.add(name);
}
}
}
}
};
}
function forbidDeferStream({ context, operationType, rootType, checkedFragments, selectionSet, visitedFragments }) {
let valid = true;
for (const selection of selectionSet.selections) {
if (selection.kind === "Field") {
const stream = selection.directives?.find((d) => d.name.value === GraphQLStreamDirective.name);
if (stream) {
valid = false;
context.reportError(new GraphQLError(`Stream directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: stream }));
}
} else if (selection.kind === "FragmentSpread") {
const fragmentName = selection.name.value;
if (visitedFragments.has(fragmentName)) {
continue;
}
visitedFragments.add(fragmentName);
const fragment = context.getFragment(fragmentName);
if (fragment) {
const defer = getDeferDirective(selection);
if (defer !== void 0) {
valid = false;
context.reportError(new GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer }));
}
if (!checkedFragments.has(fragmentName)) {
valid = forbidDeferStream({
context,
operationType,
rootType,
checkedFragments,
selectionSet: fragment.selectionSet,
visitedFragments
}) && valid;
}
}
} else if (selection.kind === "InlineFragment") {
const defer = getDeferDirective(selection);
if (defer !== void 0) {
valid = false;
context.reportError(new GraphQLError(`Defer directive cannot be used on root ${operationType} type "${rootType}".`, { nodes: defer }));
}
valid = forbidDeferStream({
context,
operationType,
rootType,
checkedFragments,
selectionSet: selection.selectionSet,
visitedFragments
}) && valid;
}
}
return valid;
}
function getDeferDirective(fragment) {
return fragment.directives?.find((d) => d.name.value === GraphQLDeferDirective.name);
}
var init_DeferStreamDirectiveOnRootFieldRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveOnRootFieldRule.mjs"() {
init_GraphQLError();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs
function ifArgumentCanBeFalse(node) {
const ifArgument = node.arguments?.find((arg) => arg.name.value === "if");
if (!ifArgument) {
return false;
}
if (ifArgument.value.kind === kinds_exports.BOOLEAN) {
if (ifArgument.value.value) {
return false;
}
} else if (ifArgument.value.kind !== kinds_exports.VARIABLE) {
return false;
}
return true;
}
function canBeSkippedViaSkipDirective(node) {
const ifArgument = node.arguments?.find((arg) => arg.name.value === "if");
if (!ifArgument) {
return true;
}
if (ifArgument.value.kind === kinds_exports.BOOLEAN) {
if (ifArgument.value.value) {
return true;
}
return false;
}
return true;
}
function canBeSkippedViaIncludeDirective(node) {
const ifArgument = node.arguments?.find((arg) => arg.name.value === "if");
if (!ifArgument) {
return false;
}
if (ifArgument?.value.kind === kinds_exports.BOOLEAN) {
if (ifArgument.value.value) {
return false;
}
return true;
}
return true;
}
function DeferStreamDirectiveOnValidOperationsRule(context) {
const checkedFragments = /* @__PURE__ */ new Set();
return {
OperationDefinition(operation) {
if (operation.operation !== OperationTypeNode.SUBSCRIPTION) {
return;
}
const visitedFragments = /* @__PURE__ */ new Set();
if (forbidUnconditionalDeferStream({
context,
checkedFragments,
selectionSet: operation.selectionSet,
parentNodes: [],
visitedFragments
})) {
for (const name of visitedFragments) {
checkedFragments.add(name);
}
}
}
};
}
function forbidUnconditionalDeferStream({ context, checkedFragments, selectionSet, parentNodes, visitedFragments }) {
let valid = true;
for (const selection of selectionSet.selections) {
const skip = selection.directives?.find((d) => d.name.value === GraphQLSkipDirective.name);
if (skip && canBeSkippedViaSkipDirective(skip)) {
continue;
}
const include = selection.directives?.find((d) => d.name.value === GraphQLIncludeDirective.name);
if (include && canBeSkippedViaIncludeDirective(include)) {
continue;
}
for (const directive of selection.directives ?? []) {
if (directive.name.value === GraphQLDeferDirective.name) {
if (!ifArgumentCanBeFalse(directive)) {
valid = false;
context.reportError(new GraphQLError("Defer directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.", { nodes: [directive, ...parentNodes.toReversed()] }));
}
} else if (directive.name.value === GraphQLStreamDirective.name) {
if (!ifArgumentCanBeFalse(directive)) {
valid = false;
context.reportError(new GraphQLError("Stream directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.", { nodes: [directive, ...parentNodes.toReversed()] }));
}
}
}
if (selection.kind === "FragmentSpread") {
const fragmentName = selection.name.value;
if (visitedFragments.has(fragmentName) || checkedFragments.has(fragmentName)) {
continue;
}
visitedFragments.add(fragmentName);
const fragment = context.getFragment(fragmentName);
if (fragment) {
parentNodes.push(selection);
valid = forbidUnconditionalDeferStream({
context,
checkedFragments,
parentNodes,
selectionSet: fragment.selectionSet,
visitedFragments
}) && valid;
parentNodes.pop();
}
} else if (selection.selectionSet) {
valid = forbidUnconditionalDeferStream({
context,
checkedFragments,
selectionSet: selection.selectionSet,
parentNodes,
visitedFragments
}) && valid;
}
}
return valid;
}
var init_DeferStreamDirectiveOnValidOperationsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/DeferStreamDirectiveOnValidOperationsRule.mjs"() {
init_GraphQLError();
init_ast();
init_kinds2();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/predicates.mjs
function isDefinitionNode(node) {
return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node);
}
function isExecutableDefinitionNode(node) {
return node.kind === kinds_exports.OPERATION_DEFINITION || node.kind === kinds_exports.FRAGMENT_DEFINITION;
}
function isSubscriptionOperationDefinitionNode(node) {
return node.operation === OperationTypeNode.SUBSCRIPTION;
}
function isSelectionNode(node) {
return node.kind === kinds_exports.FIELD || node.kind === kinds_exports.FRAGMENT_SPREAD || node.kind === kinds_exports.INLINE_FRAGMENT;
}
function isValueNode(node) {
return node.kind === kinds_exports.VARIABLE || node.kind === kinds_exports.INT || node.kind === kinds_exports.FLOAT || node.kind === kinds_exports.STRING || node.kind === kinds_exports.BOOLEAN || node.kind === kinds_exports.NULL || node.kind === kinds_exports.ENUM || node.kind === kinds_exports.LIST || node.kind === kinds_exports.OBJECT;
}
function isConstValueNode(node) {
return isValueNode(node) && (node.kind === kinds_exports.LIST ? node.values.some(isConstValueNode) : node.kind === kinds_exports.OBJECT ? node.fields.some((field) => isConstValueNode(field.value)) : node.kind !== kinds_exports.VARIABLE);
}
function isTypeNode(node) {
return node.kind === kinds_exports.NAMED_TYPE || node.kind === kinds_exports.LIST_TYPE || node.kind === kinds_exports.NON_NULL_TYPE;
}
function isTypeSystemDefinitionNode(node) {
return node.kind === kinds_exports.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === kinds_exports.DIRECTIVE_DEFINITION;
}
function isTypeDefinitionNode(node) {
return node.kind === kinds_exports.SCALAR_TYPE_DEFINITION || node.kind === kinds_exports.OBJECT_TYPE_DEFINITION || node.kind === kinds_exports.INTERFACE_TYPE_DEFINITION || node.kind === kinds_exports.UNION_TYPE_DEFINITION || node.kind === kinds_exports.ENUM_TYPE_DEFINITION || node.kind === kinds_exports.INPUT_OBJECT_TYPE_DEFINITION;
}
function isTypeSystemExtensionNode(node) {
return node.kind === kinds_exports.SCHEMA_EXTENSION || node.kind === kinds_exports.DIRECTIVE_EXTENSION || isTypeExtensionNode(node);
}
function isTypeExtensionNode(node) {
return node.kind === kinds_exports.SCALAR_TYPE_EXTENSION || node.kind === kinds_exports.OBJECT_TYPE_EXTENSION || node.kind === kinds_exports.INTERFACE_TYPE_EXTENSION || node.kind === kinds_exports.UNION_TYPE_EXTENSION || node.kind === kinds_exports.ENUM_TYPE_EXTENSION || node.kind === kinds_exports.INPUT_OBJECT_TYPE_EXTENSION;
}
function isSchemaCoordinateNode(node) {
return node.kind === kinds_exports.TYPE_COORDINATE || node.kind === kinds_exports.MEMBER_COORDINATE || node.kind === kinds_exports.ARGUMENT_COORDINATE || node.kind === kinds_exports.DIRECTIVE_COORDINATE || node.kind === kinds_exports.DIRECTIVE_ARGUMENT_COORDINATE;
}
var init_predicates = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/predicates.mjs"() {
init_ast();
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs
function ExecutableDefinitionsRule(context) {
return {
Document(node) {
for (const definition of node.definitions) {
if (!isExecutableDefinitionNode(definition)) {
const defName = definition.kind === kinds_exports.SCHEMA_DEFINITION || definition.kind === kinds_exports.SCHEMA_EXTENSION ? "schema" : '"' + definition.name.value + '"';
context.reportError(new GraphQLError(`The ${defName} definition is not executable.`, {
nodes: definition
}));
}
}
return false;
}
};
}
var init_ExecutableDefinitionsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs"() {
init_GraphQLError();
init_kinds2();
init_predicates();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs
function FieldsOnCorrectTypeRule(context) {
return {
Field(node) {
const type = context.getParentType();
if (type) {
const fieldDef = context.getFieldDef();
if (!fieldDef) {
const schema = context.getSchema();
const fieldName = node.name.value;
let suggestion = didYouMean("to use an inline fragment on", context.hideSuggestions ? [] : getSuggestedTypeNames(schema, type, fieldName));
if (suggestion === "") {
suggestion = didYouMean(context.hideSuggestions ? [] : getSuggestedFieldNames(type, fieldName));
}
context.reportError(new GraphQLError(`Cannot query field "${fieldName}" on type "${type}".` + suggestion, { nodes: node }));
}
}
}
};
}
function getSuggestedTypeNames(schema, type, fieldName) {
if (!isAbstractType(type)) {
return [];
}
const suggestedTypes = /* @__PURE__ */ new Set();
const usageCount = /* @__PURE__ */ Object.create(null);
for (const possibleType of schema.getPossibleTypes(type)) {
if (possibleType.getFields()[fieldName] == null) {
continue;
}
suggestedTypes.add(possibleType);
usageCount[possibleType.name] = 1;
for (const possibleInterface of possibleType.getInterfaces()) {
if (possibleInterface.getFields()[fieldName] == null) {
continue;
}
suggestedTypes.add(possibleInterface);
usageCount[possibleInterface.name] = (usageCount[possibleInterface.name] ?? 0) + 1;
}
}
return [...suggestedTypes].sort((typeA, typeB) => {
const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];
if (usageCountDiff !== 0) {
return usageCountDiff;
}
if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {
return -1;
}
if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {
return 1;
}
return naturalCompare(typeA.name, typeB.name);
}).map((x2) => x2.name);
}
function getSuggestedFieldNames(type, fieldName) {
if (isObjectType(type) || isInterfaceType(type)) {
const possibleFieldNames = Object.keys(type.getFields());
return suggestionList(fieldName, possibleFieldNames);
}
return [];
}
var init_FieldsOnCorrectTypeRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs"() {
init_didYouMean();
init_naturalCompare();
init_suggestionList();
init_GraphQLError();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs
function FragmentsOnCompositeTypesRule(context) {
return {
InlineFragment(node) {
const typeCondition = node.typeCondition;
if (typeCondition) {
const type = typeFromAST(context.getSchema(), typeCondition);
if (type && !isCompositeType(type)) {
const typeStr = print(typeCondition);
context.reportError(new GraphQLError(`Fragment cannot condition on non composite type "${typeStr}".`, { nodes: typeCondition }));
}
}
},
FragmentDefinition(node) {
const type = typeFromAST(context.getSchema(), node.typeCondition);
if (type && !isCompositeType(type)) {
const typeStr = print(node.typeCondition);
context.reportError(new GraphQLError(`Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, { nodes: node.typeCondition }));
}
}
};
}
var init_FragmentsOnCompositeTypesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs"() {
init_GraphQLError();
init_printer();
init_definition();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs
function KnownArgumentNamesRule(context) {
return {
...KnownArgumentNamesOnDirectivesRule(context),
FragmentArgument(argNode) {
const fragmentSignature = context.getFragmentSignature();
if (fragmentSignature) {
const varDef = fragmentSignature.variableDefinitions.get(argNode.name.value);
if (!varDef) {
const argName = argNode.name.value;
const suggestions = context.hideSuggestions ? [] : suggestionList(argName, Array.from(fragmentSignature.variableDefinitions.values()).map((varSignature) => varSignature.variable.name.value));
context.reportError(new GraphQLError(`Unknown argument "${argName}" on fragment "${fragmentSignature.definition.name.value}".` + didYouMean(suggestions), { nodes: argNode }));
}
}
},
Argument(argNode) {
const argDef = context.getArgument();
const fieldDef = context.getFieldDef();
if (!argDef && fieldDef) {
const argName = argNode.name.value;
const suggestions = context.hideSuggestions ? [] : suggestionList(argName, fieldDef.args.map((arg) => arg.name));
context.reportError(new GraphQLError(`Unknown argument "${argName}" on field "${fieldDef}".` + didYouMean(suggestions), { nodes: argNode }));
}
}
};
}
function KnownArgumentNamesOnDirectivesRule(context) {
const directiveArgs = /* @__PURE__ */ new Map();
const schema = context.getSchema();
const definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;
for (const directive of definedDirectives) {
directiveArgs.set(directive.name, new Set(directive.args.map((arg) => arg.name)));
}
const astDefinitions = context.getDocument().definitions;
for (const def of astDefinitions) {
if (def.kind === kinds_exports.DIRECTIVE_DEFINITION) {
const argsNodes = def.arguments ?? [];
directiveArgs.set(def.name.value, new Set(argsNodes.map((arg) => arg.name.value)));
}
}
return {
Directive(directiveNode) {
const directiveName = directiveNode.name.value;
const knownArgs = directiveArgs.get(directiveName);
if (directiveNode.arguments != null && knownArgs != null) {
for (const argNode of directiveNode.arguments) {
const argName = argNode.name.value;
if (!knownArgs.has(argName)) {
const suggestions = context.hideSuggestions ? [] : suggestionList(argName, [...knownArgs]);
context.reportError(new GraphQLError(`Unknown argument "${argName}" on directive "@${directiveName}".` + (context.hideSuggestions ? "" : didYouMean(suggestions)), { nodes: argNode }));
}
}
}
return false;
}
};
}
var init_KnownArgumentNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs"() {
init_didYouMean();
init_suggestionList();
init_GraphQLError();
init_kinds2();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs
function KnownDirectivesRule(context) {
const locationsMap = /* @__PURE__ */ new Map();
const schema = context.getSchema();
const definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;
for (const directive of definedDirectives) {
locationsMap.set(directive.name, new Set(directive.locations));
}
const astDefinitions = context.getDocument().definitions;
for (const def of astDefinitions) {
if (def.kind === kinds_exports.DIRECTIVE_DEFINITION) {
locationsMap.set(def.name.value, new Set(def.locations.map((name) => name.value)));
}
}
return {
Directive(node, _key, _parent, _path, ancestors) {
const name = node.name.value;
const locations = locationsMap.get(name);
if (locations == null) {
context.reportError(new GraphQLError(`Unknown directive "@${name}".`, { nodes: node }));
return;
}
const candidateLocation = getDirectiveLocationForASTPath(ancestors);
if (candidateLocation != null && !locations.has(candidateLocation)) {
context.reportError(new GraphQLError(`Directive "@${name}" may not be used on ${candidateLocation}.`, { nodes: node }));
}
}
};
}
function getDirectiveLocationForASTPath(ancestors) {
const appliedTo = ancestors.at(-1);
if (!(appliedTo != null && "kind" in appliedTo))
invariant(false);
switch (appliedTo.kind) {
case kinds_exports.OPERATION_DEFINITION:
return getDirectiveLocationForOperation(appliedTo.operation);
case kinds_exports.FIELD:
return DirectiveLocation.FIELD;
case kinds_exports.FRAGMENT_SPREAD:
return DirectiveLocation.FRAGMENT_SPREAD;
case kinds_exports.INLINE_FRAGMENT:
return DirectiveLocation.INLINE_FRAGMENT;
case kinds_exports.FRAGMENT_DEFINITION:
return DirectiveLocation.FRAGMENT_DEFINITION;
case kinds_exports.VARIABLE_DEFINITION: {
const parentNode = ancestors[ancestors.length - 3];
if (!("kind" in parentNode))
invariant(false);
return parentNode.kind === kinds_exports.OPERATION_DEFINITION ? DirectiveLocation.VARIABLE_DEFINITION : DirectiveLocation.FRAGMENT_VARIABLE_DEFINITION;
}
case kinds_exports.SCHEMA_DEFINITION:
case kinds_exports.SCHEMA_EXTENSION:
return DirectiveLocation.SCHEMA;
case kinds_exports.SCALAR_TYPE_DEFINITION:
case kinds_exports.SCALAR_TYPE_EXTENSION:
return DirectiveLocation.SCALAR;
case kinds_exports.OBJECT_TYPE_DEFINITION:
case kinds_exports.OBJECT_TYPE_EXTENSION:
return DirectiveLocation.OBJECT;
case kinds_exports.FIELD_DEFINITION:
return DirectiveLocation.FIELD_DEFINITION;
case kinds_exports.INTERFACE_TYPE_DEFINITION:
case kinds_exports.INTERFACE_TYPE_EXTENSION:
return DirectiveLocation.INTERFACE;
case kinds_exports.UNION_TYPE_DEFINITION:
case kinds_exports.UNION_TYPE_EXTENSION:
return DirectiveLocation.UNION;
case kinds_exports.ENUM_TYPE_DEFINITION:
case kinds_exports.ENUM_TYPE_EXTENSION:
return DirectiveLocation.ENUM;
case kinds_exports.ENUM_VALUE_DEFINITION:
return DirectiveLocation.ENUM_VALUE;
case kinds_exports.INPUT_OBJECT_TYPE_DEFINITION:
case kinds_exports.INPUT_OBJECT_TYPE_EXTENSION:
return DirectiveLocation.INPUT_OBJECT;
case kinds_exports.INPUT_VALUE_DEFINITION: {
const parentNode = ancestors.at(-3);
if (!(parentNode != null && "kind" in parentNode))
invariant(false);
return parentNode.kind === kinds_exports.INPUT_OBJECT_TYPE_DEFINITION || parentNode.kind === kinds_exports.INPUT_OBJECT_TYPE_EXTENSION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION;
}
case kinds_exports.DIRECTIVE_DEFINITION:
case kinds_exports.DIRECTIVE_EXTENSION:
return DirectiveLocation.DIRECTIVE_DEFINITION;
default:
invariant(false, "Unexpected kind: " + inspect(appliedTo.kind));
}
}
function getDirectiveLocationForOperation(operation) {
switch (operation) {
case OperationTypeNode.QUERY:
return DirectiveLocation.QUERY;
case OperationTypeNode.MUTATION:
return DirectiveLocation.MUTATION;
case OperationTypeNode.SUBSCRIPTION:
return DirectiveLocation.SUBSCRIPTION;
}
}
var init_KnownDirectivesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs"() {
init_inspect();
init_invariant();
init_GraphQLError();
init_ast();
init_directiveLocation();
init_kinds2();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs
function KnownFragmentNamesRule(context) {
return {
FragmentSpread(node) {
const fragmentName = node.name.value;
const fragment = context.getFragment(fragmentName);
if (!fragment) {
context.reportError(new GraphQLError(`Unknown fragment "${fragmentName}".`, {
nodes: node.name
}));
}
}
};
}
var init_KnownFragmentNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs
function KnownOperationTypesRule(context) {
const schema = context.getSchema();
return {
OperationDefinition(node) {
const operation = node.operation;
if (!schema.getRootType(operation)) {
context.reportError(new GraphQLError(`The ${operation} operation is not supported by the schema.`, { nodes: node }));
}
}
};
}
var init_KnownOperationTypesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownOperationTypesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs
function KnownTypeNamesRule(context) {
const { definitions } = context.getDocument();
const existingTypesMap = context.getSchema()?.getTypeMap() ?? {};
let definedTypeNames;
let typeNames;
return {
NamedType(node, _1, parent, _2, ancestors) {
const typeName = node.name.value;
if (!Object.hasOwn(existingTypesMap, typeName) && !(definedTypeNames ??= new Set(definitions.filter(isTypeDefinitionNode).map((def) => def.name.value))).has(typeName)) {
const definitionNode = ancestors[2] ?? parent;
const isSDL = definitionNode != null && isSDLNode(definitionNode);
if (isSDL && standardTypeNames.has(typeName)) {
return;
}
let suggestedTypes = [];
if (!context.hideSuggestions) {
typeNames ??= [
.../* @__PURE__ */ new Set([...Object.keys(existingTypesMap), ...definedTypeNames])
];
suggestedTypes = suggestionList(typeName, isSDL ? [...standardTypeNames, ...typeNames] : typeNames);
}
context.reportError(new GraphQLError(`Unknown type "${typeName}".` + didYouMean(suggestedTypes), { nodes: node }));
}
}
};
}
function isSDLNode(value) {
return "kind" in value && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value));
}
var standardTypeNames;
var init_KnownTypeNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs"() {
init_didYouMean();
init_suggestionList();
init_GraphQLError();
init_predicates();
init_introspection();
init_scalars();
standardTypeNames = new Set([...specifiedScalarTypes, ...introspectionTypes].map((type) => type.name));
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs
function LoneAnonymousOperationRule(context) {
let operationCount = 0;
return {
Document(node) {
operationCount = node.definitions.filter((definition) => definition.kind === kinds_exports.OPERATION_DEFINITION).length;
},
OperationDefinition(node) {
if (!node.name && operationCount > 1) {
context.reportError(new GraphQLError("This anonymous operation must be the only defined operation.", { nodes: node }));
}
}
};
}
var init_LoneAnonymousOperationRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs"() {
init_GraphQLError();
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs
function LoneSchemaDefinitionRule(context) {
const oldSchema = context.getSchema();
const alreadyDefined = oldSchema?.astNode ?? oldSchema?.getQueryType() ?? oldSchema?.getMutationType() ?? oldSchema?.getSubscriptionType();
let schemaDefinitionsCount = 0;
return {
SchemaDefinition(node) {
if (alreadyDefined) {
context.reportError(new GraphQLError("Cannot define a new schema within a schema extension.", { nodes: node }));
return;
}
if (schemaDefinitionsCount > 0) {
context.reportError(new GraphQLError("Must provide only one schema definition.", {
nodes: node
}));
}
++schemaDefinitionsCount;
}
};
}
var init_LoneSchemaDefinitionRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs
function MaxIntrospectionDepthRule(context) {
const checkedFragments = /* @__PURE__ */ Object.create(null);
const exceededFragments = /* @__PURE__ */ Object.create(null);
function checkDepth(node, visitedFragments, depth = 0) {
if (node.kind === kinds_exports.FRAGMENT_SPREAD) {
const fragmentName = node.name.value;
const exceededEntryDepth = exceededFragments[fragmentName];
if (exceededEntryDepth !== void 0 && exceededEntryDepth <= depth) {
return true;
}
const visitedEntryDepth = visitedFragments[fragmentName];
const checkedEntryDepth = checkedFragments[fragmentName];
if (visitedEntryDepth !== void 0 && visitedEntryDepth >= depth || checkedEntryDepth !== void 0 && checkedEntryDepth >= depth) {
return false;
}
const fragment = context.getFragment(fragmentName);
if (!fragment) {
return false;
}
visitedFragments[fragmentName] = depth;
if (checkDepth(fragment, visitedFragments, depth)) {
exceededFragments[fragmentName] = depth;
return true;
}
checkedFragments[fragmentName] = depth;
return false;
}
if (node.kind === kinds_exports.FIELD && (node.name.value === "fields" || node.name.value === "interfaces" || node.name.value === "possibleTypes" || node.name.value === "inputFields")) {
depth++;
if (depth >= MAX_LISTS_DEPTH) {
return true;
}
}
if ("selectionSet" in node && node.selectionSet) {
for (const child of node.selectionSet.selections) {
if (checkDepth(child, visitedFragments, depth)) {
return true;
}
}
}
return false;
}
return {
Field(node) {
if (node.name.value === "__schema" || node.name.value === "__type") {
const visitedFragments = /* @__PURE__ */ Object.create(null);
if (checkDepth(node, visitedFragments)) {
context.reportError(new GraphQLError("Maximum introspection depth exceeded", {
nodes: [node]
}));
return false;
}
}
}
};
}
var MAX_LISTS_DEPTH;
var init_MaxIntrospectionDepthRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs"() {
init_GraphQLError();
init_kinds2();
MAX_LISTS_DEPTH = 3;
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs
function NoFragmentCyclesRule(context) {
const visitedFrags = /* @__PURE__ */ new Set();
const spreadPath = [];
const spreadPathIndexByName = /* @__PURE__ */ Object.create(null);
return {
OperationDefinition: () => false,
FragmentDefinition(node) {
detectCycleRecursive(node);
return false;
}
};
function detectCycleRecursive(fragment) {
if (visitedFrags.has(fragment.name.value)) {
return;
}
const fragmentName = fragment.name.value;
visitedFrags.add(fragmentName);
const spreadNodes = context.getFragmentSpreads(fragment.selectionSet);
if (spreadNodes.length === 0) {
return;
}
spreadPathIndexByName[fragmentName] = spreadPath.length;
for (const spreadNode of spreadNodes) {
const spreadName = spreadNode.name.value;
const cycleIndex = spreadPathIndexByName[spreadName];
spreadPath.push(spreadNode);
if (cycleIndex === void 0) {
const spreadFragment = context.getFragment(spreadName);
if (spreadFragment) {
detectCycleRecursive(spreadFragment);
}
} else {
const cyclePath = spreadPath.slice(cycleIndex);
const viaPath = cyclePath.slice(0, -1).map((s) => '"' + s.name.value + '"').join(", ");
context.reportError(new GraphQLError(`Cannot spread fragment "${spreadName}" within itself` + (viaPath !== "" ? ` via ${viaPath}.` : "."), { nodes: cyclePath }));
}
spreadPath.pop();
}
spreadPathIndexByName[fragmentName] = void 0;
}
}
var init_NoFragmentCyclesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs
function NoUndefinedVariablesRule(context) {
return {
OperationDefinition(operation) {
const variableNameDefined = new Set(operation.variableDefinitions?.map((node) => node.variable.name.value));
const usages = context.getRecursiveVariableUsages(operation);
for (const { node, fragmentVariableDefinition } of usages) {
if (fragmentVariableDefinition) {
continue;
}
const varName = node.name.value;
if (!variableNameDefined.has(varName)) {
context.reportError(new GraphQLError(operation.name ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` : `Variable "$${varName}" is not defined.`, { nodes: [node, operation] }));
}
}
}
};
}
var init_NoUndefinedVariablesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs
function NoUnusedFragmentsRule(context) {
const operations = [];
const fragmentDefs = [];
return {
OperationDefinition(operation) {
operations.push(operation);
return false;
},
FragmentDefinition(node) {
fragmentDefs.push(node);
return false;
},
Document: {
leave() {
const fragmentNameUsed = new Set(context.getRecursivelyReferencedFragmentsForOperations(operations).map((fragment) => fragment.name.value));
for (const fragmentDef of fragmentDefs) {
const fragName = fragmentDef.name.value;
if (!fragmentNameUsed.has(fragName)) {
context.reportError(new GraphQLError(`Fragment "${fragName}" is never used.`, {
nodes: fragmentDef
}));
}
}
}
}
};
}
var init_NoUnusedFragmentsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs
function NoUnusedVariablesRule(context) {
return {
FragmentDefinition(fragment) {
const usages = context.getVariableUsages(fragment);
const argumentNameUsed = new Set(usages.map(({ node }) => node.name.value));
const variableDefinitions = fragment.variableDefinitions ?? [];
for (const varDef of variableDefinitions) {
const argName = varDef.variable.name.value;
if (!argumentNameUsed.has(argName)) {
context.reportError(new GraphQLError(`Variable "$${argName}" is never used in fragment "${fragment.name.value}".`, { nodes: varDef }));
}
}
},
OperationDefinition(operation) {
const usages = context.getRecursiveVariableUsages(operation);
const operationVariableNameUsed = /* @__PURE__ */ new Set();
for (const { node, fragmentVariableDefinition } of usages) {
const varName = node.name.value;
if (!fragmentVariableDefinition) {
operationVariableNameUsed.add(varName);
}
}
const variableDefinitions = operation.variableDefinitions ?? [];
for (const variableDef of variableDefinitions) {
const variableName = variableDef.variable.name.value;
if (!operationVariableNameUsed.has(variableName)) {
context.reportError(new GraphQLError(operation.name ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` : `Variable "$${variableName}" is never used.`, { nodes: variableDef }));
}
}
}
};
}
var init_NoUnusedVariablesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/validationAbortedError.mjs
var validationAbortedError;
var init_validationAbortedError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/validationAbortedError.mjs"() {
init_GraphQLError();
validationAbortedError = new GraphQLError("Validation aborted.");
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs
function OverlappingFieldsCanBeMergedRule(validationContext) {
const ruleContext = {
comparedFieldsAndFragmentPairs: /* @__PURE__ */ new Map(),
comparedFragmentPairs: /* @__PURE__ */ new Map(),
cachedCollectFieldsResults: /* @__PURE__ */ new Map(),
valueInfoByNode: /* @__PURE__ */ new Map(),
fragmentSpreadInfoByNode: /* @__PURE__ */ new Map(),
fragmentSpreadInfoByKey: /* @__PURE__ */ new Map(),
remainingComplexityBudget: MAX_COMPLEXITY_BUDGET
};
let fragmentScope;
return {
FragmentDefinition: {
enter(node) {
const fragmentName = node.name.value;
const fragmentSignature = validationContext.getFragmentSignatureByName()(fragmentName);
fragmentScope = getVariableScope(fragmentSignature);
},
leave() {
fragmentScope = void 0;
}
},
SelectionSet(selectionSet, _key, parent) {
if (parent && "kind" in parent && parent.kind === kinds_exports.INLINE_FRAGMENT) {
return;
}
if (selectionSet.selections.length <= 1 && selectionSet.selections[0]?.kind !== kinds_exports.INLINE_FRAGMENT) {
return;
}
const conflicts = findConflictsWithinSelectionSet(validationContext, ruleContext, validationContext.getParentType(), selectionSet, fragmentScope);
for (const { responseName, reason, fields1, fields2 } of conflicts) {
validationContext.reportError(new GraphQLError(`Fields "${maybeAbbreviate(responseName)}" conflict because ${reason}. Use different aliases on the fields to fetch both if this was intentional.`, { nodes: fields1.concat(fields2) }));
}
}
};
}
function findConflictsWithinSelectionSet(validationContext, ruleContext, parentType, selectionSet, scope) {
const conflicts = [];
const collectFieldsResult = collectFields(validationContext, ruleContext, parentType, selectionSet);
collectConflictsWithin(validationContext, ruleContext, conflicts, collectFieldsResult, scope);
if (collectFieldsResult.spreads.length !== 0 && (collectFieldsResult.groupedFieldSet.size !== 0 || collectFieldsResult.spreads.length > 1)) {
const fragmentSpreads = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult, scope);
for (let i = 0; i < fragmentSpreads.length; i++) {
collectConflictsBetweenFieldsAndFragment(validationContext, ruleContext, conflicts, false, collectFieldsResult, scope, fragmentSpreads[i]);
for (let j = i + 1; j < fragmentSpreads.length; j++) {
collectConflictsBetweenFragments(validationContext, ruleContext, conflicts, false, fragmentSpreads[i], fragmentSpreads[j]);
}
}
}
return conflicts;
}
function collectConflictsBetweenFieldsAndFragment(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult, scope, fragmentSpread) {
spendComplexityBudget(ruleContext, 1);
if (collectFieldsResult.groupedFieldSet.size === 0) {
return;
}
const fragment = fragmentSpread.definition;
let byFragmentScope = ruleContext.comparedFieldsAndFragmentPairs.get(scope);
if (byFragmentScope === void 0) {
byFragmentScope = /* @__PURE__ */ new Map();
ruleContext.comparedFieldsAndFragmentPairs.set(scope, byFragmentScope);
}
let comparedFieldsAndFragmentPairs = byFragmentScope.get(fragmentSpread.scope);
if (comparedFieldsAndFragmentPairs === void 0) {
comparedFieldsAndFragmentPairs = new OrderedPairSet();
byFragmentScope.set(fragmentSpread.scope, comparedFieldsAndFragmentPairs);
}
if (comparedFieldsAndFragmentPairs.has(collectFieldsResult, fragment, areMutuallyExclusive)) {
return;
}
comparedFieldsAndFragmentPairs.add(collectFieldsResult, fragment, areMutuallyExclusive);
if (!fragment) {
return;
}
const collectFieldsResult2 = collectFragmentFields(validationContext, ruleContext, fragment);
const referencedFragmentSpreads = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult2, fragmentSpread.scope);
if (collectFieldsResult === collectFieldsResult2 && scope === fragmentSpread.scope) {
return;
}
collectConflictsBetween(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult, scope, collectFieldsResult2, fragmentSpread.scope);
for (const referencedFragmentSpread of referencedFragmentSpreads) {
collectConflictsBetweenFieldsAndFragment(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult, scope, referencedFragmentSpread);
}
}
function collectConflictsBetweenFragments(validationContext, ruleContext, conflicts, areMutuallyExclusive, fragmentSpread1, fragmentSpread2) {
const fragment1 = fragmentSpread1.definition;
const fragment2 = fragmentSpread2.definition;
const scope1 = fragmentSpread1.scope;
const scope2 = fragmentSpread2.scope;
spendComplexityBudget(ruleContext, 2);
if (fragment1 === fragment2 && scope1 === scope2) {
return;
}
let byScope = ruleContext.comparedFragmentPairs.get(scope1);
let comparedFragmentPairs = byScope?.get(scope2) ?? ruleContext.comparedFragmentPairs.get(scope2)?.get(scope1);
if (comparedFragmentPairs === void 0) {
if (byScope === void 0) {
byScope = /* @__PURE__ */ new Map();
ruleContext.comparedFragmentPairs.set(scope1, byScope);
}
comparedFragmentPairs = new PairSet();
byScope.set(scope2, comparedFragmentPairs);
}
if (fragment1 === fragment2) {
if (comparedFragmentPairs.has(fragment1, fragment2, false)) {
return;
}
comparedFragmentPairs.add(fragment1, fragment2, false);
validationContext.reportError(new GraphQLError(`Spreads "${maybeAbbreviate(fragmentSpread1.node.name.value)}" conflict because ${getFragmentSpreadDescription(ruleContext, fragmentSpread1.node)} and ${getFragmentSpreadDescription(ruleContext, fragmentSpread2.node)} have different fragment arguments.`, { nodes: [fragmentSpread1.node, fragmentSpread2.node] }));
return;
}
if (comparedFragmentPairs.has(fragment1, fragment2, areMutuallyExclusive)) {
return;
}
comparedFragmentPairs.add(fragment1, fragment2, areMutuallyExclusive);
if (!fragment1 || !fragment2) {
return;
}
const collectFieldsResult1 = collectFragmentFields(validationContext, ruleContext, fragment1);
const referencedFragmentSpreads1 = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult1, fragmentSpread1.scope);
const collectFieldsResult2 = collectFragmentFields(validationContext, ruleContext, fragment2);
const referencedFragmentSpreads2 = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult2, fragmentSpread2.scope);
collectConflictsBetween(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult1, fragmentSpread1.scope, collectFieldsResult2, fragmentSpread2.scope);
for (const referencedFragmentSpread2 of referencedFragmentSpreads2) {
collectConflictsBetweenFragments(validationContext, ruleContext, conflicts, areMutuallyExclusive, fragmentSpread1, referencedFragmentSpread2);
}
for (const referencedFragmentSpread1 of referencedFragmentSpreads1) {
collectConflictsBetweenFragments(validationContext, ruleContext, conflicts, areMutuallyExclusive, referencedFragmentSpread1, fragmentSpread2);
}
}
function findConflictsBetweenSubSelectionSets(validationContext, ruleContext, areMutuallyExclusive, parentType1, selectionSet1, scope1, parentType2, selectionSet2, scope2) {
const conflicts = [];
const collectFieldsResult1 = collectFields(validationContext, ruleContext, parentType1, selectionSet1);
const fragmentSpreads1 = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult1, scope1);
const collectFieldsResult2 = collectFields(validationContext, ruleContext, parentType2, selectionSet2);
const fragmentSpreads2 = getFragmentSpreads(validationContext, ruleContext, collectFieldsResult2, scope2);
collectConflictsBetween(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult1, scope1, collectFieldsResult2, scope2);
for (const fragmentSpread2 of fragmentSpreads2) {
collectConflictsBetweenFieldsAndFragment(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult1, scope1, fragmentSpread2);
}
for (const fragmentSpread1 of fragmentSpreads1) {
collectConflictsBetweenFieldsAndFragment(validationContext, ruleContext, conflicts, areMutuallyExclusive, collectFieldsResult2, scope2, fragmentSpread1);
}
for (const fragmentSpread1 of fragmentSpreads1) {
for (const fragmentSpread2 of fragmentSpreads2) {
collectConflictsBetweenFragments(validationContext, ruleContext, conflicts, areMutuallyExclusive, fragmentSpread1, fragmentSpread2);
}
}
return conflicts;
}
function collectConflictsWithin(validationContext, ruleContext, conflicts, collectFieldsResult, scope) {
for (const [responseName, fieldDetailsList] of collectFieldsResult.groupedFieldSet.entries()) {
if (fieldDetailsList.length > 1) {
for (let i = 0; i < fieldDetailsList.length; i++) {
for (let j = i + 1; j < fieldDetailsList.length; j++) {
const conflict = findConflict(validationContext, ruleContext, false, responseName, fieldDetailsList[i], scope, fieldDetailsList[j], scope);
if (conflict) {
conflicts.push(conflict);
}
}
}
}
}
}
function collectConflictsBetween(validationContext, ruleContext, conflicts, parentFieldsAreMutuallyExclusive, collectFieldsResult1, scope1, collectFieldsResult2, scope2) {
if (collectFieldsResult1.groupedFieldSet.size === 0 || collectFieldsResult2.groupedFieldSet.size === 0) {
return;
}
for (const { responseName, fieldDetailsList1, fieldDetailsList2 } of getOverlappingFields(ruleContext, collectFieldsResult1, collectFieldsResult2)) {
for (const fieldDetails1 of fieldDetailsList1) {
for (const fieldDetails2 of fieldDetailsList2) {
const conflict = findConflict(validationContext, ruleContext, parentFieldsAreMutuallyExclusive, responseName, fieldDetails1, scope1, fieldDetails2, scope2);
if (conflict) {
conflicts.push(conflict);
}
}
}
}
}
function getOverlappingFields(ruleContext, collectFieldsResult1, collectFieldsResult2) {
const byCollectFieldsResult = collectFieldsResult1.overlappingFields ??= /* @__PURE__ */ new Map();
const cached = byCollectFieldsResult.get(collectFieldsResult2);
if (cached !== void 0) {
return cached;
}
const overlappingFields = [];
for (const [responseName, fieldDetailsList1] of collectFieldsResult1.groupedFieldSet.entries()) {
spendComplexityBudget(ruleContext, 1);
const fieldDetailsList2 = collectFieldsResult2.groupedFieldSet.get(responseName);
if (fieldDetailsList2 != null) {
overlappingFields.push({
responseName,
fieldDetailsList1,
fieldDetailsList2
});
}
}
byCollectFieldsResult.set(collectFieldsResult2, overlappingFields);
return overlappingFields;
}
function findConflict(validationContext, ruleContext, parentFieldsAreMutuallyExclusive, responseName, fieldDetails1, scope1, fieldDetails2, scope2) {
const { parentType: parentType1, node: node1, definition: def1, streamDirective: streamDirective1 } = fieldDetails1;
const { parentType: parentType2, node: node2, definition: def2, streamDirective: streamDirective2 } = fieldDetails2;
const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && isObjectType(parentType1) && isObjectType(parentType2);
spendComplexityBudget(ruleContext, 2);
if (fieldDetails1.isSimpleLeaf && fieldDetails2.isSimpleLeaf && def1?.type === def2?.type && node1.name.value === node2.name.value) {
return;
}
const fieldInfo1 = getFieldInfo(fieldDetails1);
const fieldInfo2 = getFieldInfo(fieldDetails2);
let comparison = fieldInfo1.comparisons.get(fieldInfo2);
if (comparison === void 0) {
comparison = {};
fieldInfo1.comparisons.set(fieldInfo2, comparison);
}
if (!areMutuallyExclusive) {
const name1 = node1.name.value;
const name2 = node2.name.value;
const sameName = comparison.sameName ??= name1 === name2;
if (!sameName) {
return {
responseName,
reason: `"${maybeAbbreviate(name1)}" and "${maybeAbbreviate(name2)}" are different fields`,
fields1: [node1],
fields2: [node2]
};
}
const comparedArguments = comparison.arguments ??= compareArguments(ruleContext, fieldInfo1.arguments, fieldInfo2.arguments);
if (!sameArguments(ruleContext, comparedArguments, scope1, scope2)) {
return {
responseName,
reason: "they have differing arguments",
fields1: [node1],
fields2: [node2]
};
}
}
if (streamDirective1 || streamDirective2) {
let reason = "they have overlapping stream directives";
if (streamDirective1 && streamDirective2) {
const comparedArguments = comparison.streamArguments ??= compareArguments(ruleContext, fieldInfo1.streamArguments, fieldInfo2.streamArguments);
if (sameArguments(ruleContext, comparedArguments, scope1, scope2)) {
reason += ". See https://github.com/graphql/defer-stream-wg/discussions/100";
}
}
return { responseName, reason, fields1: [node1], fields2: [node2] };
}
const type1 = def1?.type;
const type2 = def2?.type;
if (type1 && type2 && doTypesConflict(ruleContext, type1, type2)) {
const type1String = fieldInfo1.typeString ??= inspect(type1);
const type2String = fieldInfo2.typeString ??= inspect(type2);
return {
responseName,
reason: `they return conflicting types "${type1String}" and "${type2String}"`,
fields1: [node1],
fields2: [node2]
};
}
const selectionSet1 = node1.selectionSet;
const selectionSet2 = node2.selectionSet;
if (selectionSet1 && selectionSet2) {
const conflicts = findConflictsBetweenSubSelectionSets(validationContext, ruleContext, areMutuallyExclusive, fieldInfo1.namedType, selectionSet1, scope1, fieldInfo2.namedType, selectionSet2, scope2);
return subfieldConflicts(conflicts, responseName, node1, node2);
}
}
function getFieldInfo(fieldDetails) {
return fieldDetails.info ??= {
comparisons: /* @__PURE__ */ new Map(),
namedType: getNamedType(fieldDetails.definition?.type),
arguments: getArgumentInfo(fieldDetails.node.arguments),
streamArguments: getArgumentInfo(fieldDetails.streamDirective?.arguments)
};
}
function getArgumentInfo(args) {
if (args === void 0 || args.length === 0) {
return;
}
const values = /* @__PURE__ */ new Map();
for (const { name, value } of args) {
values.set(name.value, value);
}
return {
nodes: args,
values
};
}
function compareArguments(ruleContext, argumentInfo1, argumentInfo2) {
const valuesWithVariables = [];
if (argumentInfo1 === void 0) {
return {
sameStructure: argumentInfo2 === void 0,
valuesWithVariables
};
}
if (argumentInfo1.nodes.length !== argumentInfo2?.nodes.length) {
return { sameStructure: false, valuesWithVariables };
}
for (const arg1 of argumentInfo1.nodes) {
spendComplexityBudget(ruleContext, 1);
const value2 = argumentInfo2.values.get(arg1.name.value);
if (value2 === void 0) {
return { sameStructure: false, valuesWithVariables };
}
const valueInfo1 = getValueInfo(ruleContext, arg1.value);
if (valueInfo1.comparisonKey !== getValueInfo(ruleContext, value2).comparisonKey) {
return { sameStructure: false, valuesWithVariables };
}
if (valueInfo1.variables.length !== 0) {
valuesWithVariables.push(valueInfo1);
}
}
return { sameStructure: true, valuesWithVariables };
}
function sameArguments(ruleContext, comparison, scope1, scope2) {
if (!comparison.sameStructure) {
return false;
}
return scope1 === scope2 || comparison.valuesWithVariables.every((value) => {
spendComplexityBudget(ruleContext, 1);
return !usesLocalVariables(ruleContext, value, scope1) && !usesLocalVariables(ruleContext, value, scope2);
});
}
function usesLocalVariables(ruleContext, value, scope) {
if (scope === void 0) {
return false;
}
const dependencies = value.scopeDependencies ??= /* @__PURE__ */ new Map();
const cached = dependencies.get(scope.signature);
if (cached !== void 0) {
return cached;
}
const dependsOnScope = value.variables.some((variable) => {
spendComplexityBudget(ruleContext, 1);
return scope.signature.variableDefinitions.has(variable);
});
dependencies.set(scope.signature, dependsOnScope);
return dependsOnScope;
}
function getValueInfo(ruleContext, value) {
const cached = ruleContext.valueInfoByNode.get(value);
if (cached !== void 0) {
return cached;
}
const variables = [];
const comparisonKey = JSON.stringify(value, (_key, node) => {
if (!isNode(node)) {
return node;
}
switch (node.kind) {
case kinds_exports.VARIABLE:
variables.push(node.name.value);
return [node.kind, node.name.value];
case kinds_exports.OBJECT:
return [
node.kind,
node.fields.slice().sort((first, second) => first.name.value < second.name.value ? -1 : first.name.value > second.name.value ? 1 : 0)
];
case kinds_exports.OBJECT_FIELD:
return [node.name.value, node.value];
case kinds_exports.LIST:
return [node.kind, node.values];
case kinds_exports.STRING:
return [node.kind, node.value, node.block === true];
default:
return [node.kind, "value" in node ? node.value : null];
}
});
const valueInfo = { comparisonKey, variables };
ruleContext.valueInfoByNode.set(value, valueInfo);
return valueInfo;
}
function doTypesConflict(ruleContext, type1, type2) {
if (type1 === type2) {
return false;
}
spendComplexityBudget(ruleContext, 1);
if (isListType(type1)) {
return isListType(type2) ? doTypesConflict(ruleContext, type1.ofType, type2.ofType) : true;
}
if (isListType(type2)) {
return true;
}
if (isNonNullType(type1)) {
return isNonNullType(type2) ? doTypesConflict(ruleContext, type1.ofType, type2.ofType) : true;
}
if (isNonNullType(type2)) {
return true;
}
if (isLeafType(type1) || isLeafType(type2)) {
return type1 !== type2;
}
return false;
}
function collectFields(validationContext, ruleContext, parentType, selectionSet) {
const { cachedCollectFieldsResults } = ruleContext;
let bySelectionSet = cachedCollectFieldsResults.get(parentType);
if (!bySelectionSet) {
bySelectionSet = /* @__PURE__ */ new Map();
cachedCollectFieldsResults.set(parentType, bySelectionSet);
}
let collectFieldsResult = bySelectionSet.get(selectionSet);
if (!collectFieldsResult) {
const groupedFieldSet = /* @__PURE__ */ new Map();
const spreads = [];
collectFieldsImpl(validationContext, parentType, selectionSet, groupedFieldSet, spreads);
collectFieldsResult = { groupedFieldSet, spreads };
bySelectionSet.set(selectionSet, collectFieldsResult);
}
return collectFieldsResult;
}
function collectFragmentFields(validationContext, ruleContext, fragment) {
const fragmentType = typeFromAST(validationContext.getSchema(), fragment.typeCondition);
return collectFields(validationContext, ruleContext, fragmentType, fragment.selectionSet);
}
function collectFieldsImpl(validationContext, parentType, selectionSet, groupedFieldSet, fragmentSpreads) {
for (const selection of selectionSet.selections) {
switch (selection.kind) {
case kinds_exports.FIELD: {
const fieldName = selection.name.value;
let fieldDef;
if (isObjectType(parentType) || isInterfaceType(parentType)) {
fieldDef = parentType.getFields()[fieldName];
}
const responseName = selection.alias ? selection.alias.value : fieldName;
let fieldDetailsList = groupedFieldSet.get(responseName);
if (fieldDetailsList == null) {
fieldDetailsList = [];
groupedFieldSet.set(responseName, fieldDetailsList);
}
const streamDirective = selection.directives?.find((directive) => directive.name.value === "stream");
fieldDetailsList.push({
parentType,
node: selection,
definition: fieldDef,
isSimpleLeaf: (selection.arguments?.length ?? 0) === 0 && !selection.selectionSet && streamDirective === void 0,
streamDirective
});
break;
}
case kinds_exports.FRAGMENT_SPREAD: {
fragmentSpreads.push(selection);
break;
}
case kinds_exports.INLINE_FRAGMENT: {
const typeCondition = selection.typeCondition;
const inlineFragmentType = typeCondition ? typeFromAST(validationContext.getSchema(), typeCondition) : parentType;
collectFieldsImpl(validationContext, inlineFragmentType, selection.selectionSet, groupedFieldSet, fragmentSpreads);
break;
}
}
}
}
function getFragmentSpreads(validationContext, ruleContext, collectFieldsResult, scope) {
const byScope = collectFieldsResult.byScope ??= /* @__PURE__ */ new Map();
const cached = byScope.get(scope);
if (cached) {
return cached;
}
const spreadsByScope = /* @__PURE__ */ new Map();
const result = [];
for (const spreadNode of collectFieldsResult.spreads) {
const spread = getFragmentSpread(validationContext, ruleContext, spreadNode, scope);
let byDefinition = spreadsByScope.get(spread.scope);
if (byDefinition === void 0) {
byDefinition = /* @__PURE__ */ new Map();
spreadsByScope.set(spread.scope, byDefinition);
}
const previous = byDefinition.get(spread.definition);
if (previous === void 0) {
byDefinition.set(spread.definition, spread);
result.push(spread);
} else {
previous.node = spread.node;
}
}
byScope.set(scope, result);
return result;
}
function getFragmentSpread(validationContext, ruleContext, fragmentSpreadNode, scope) {
spendComplexityBudget(ruleContext, 1);
let fragmentSpreadInfo = ruleContext.fragmentSpreadInfoByNode.get(fragmentSpreadNode);
if (fragmentSpreadInfo === void 0) {
const signature = validationContext.getFragmentSignatureByName()(fragmentSpreadNode.name.value);
const argumentInfo = getArgumentInfo(fragmentSpreadNode.arguments);
const parts = [];
const values = [];
if (signature && argumentInfo !== void 0) {
const argMap = argumentInfo.values;
const names = [];
for (const name of argMap.keys()) {
if (signature.variableDefinitions.has(name)) {
names.push(name);
}
}
for (const name of names.sort()) {
const argument = getValueInfo(ruleContext, argMap.get(name));
parts.push(name, argument.comparisonKey);
if (argument.variables.length !== 0) {
values.push(argument);
}
}
}
const fragmentSpreadInfoKey = JSON.stringify([
signature?.definition.name.value,
parts
]);
fragmentSpreadInfo = ruleContext.fragmentSpreadInfoByKey.get(fragmentSpreadInfoKey);
if (fragmentSpreadInfo === void 0) {
fragmentSpreadInfo = {
signature,
values,
byScope: /* @__PURE__ */ new Map()
};
ruleContext.fragmentSpreadInfoByKey.set(fragmentSpreadInfoKey, fragmentSpreadInfo);
}
ruleContext.fragmentSpreadInfoByNode.set(fragmentSpreadNode, fragmentSpreadInfo);
}
const variableScope = fragmentSpreadInfo.values.some((value) => {
spendComplexityBudget(ruleContext, 1);
return usesLocalVariables(ruleContext, value, scope);
}) ? scope : void 0;
let fragmentScope = fragmentSpreadInfo.byScope.get(variableScope);
if (!fragmentSpreadInfo.byScope.has(variableScope)) {
fragmentScope = getVariableScope(fragmentSpreadInfo.signature);
fragmentSpreadInfo.byScope.set(variableScope, fragmentScope);
}
return {
node: fragmentSpreadNode,
scope: fragmentScope,
definition: fragmentSpreadInfo.signature?.definition
};
}
function getVariableScope(fragmentSignature) {
if (!fragmentSignature || fragmentSignature.variableDefinitions.size === 0) {
return;
}
return { signature: fragmentSignature };
}
function getFragmentSpreadDescription(ruleContext, node) {
const description = {
...node,
name: { ...node.name, value: maybeAbbreviate(node.name.value) },
directives: []
};
let size = 1;
for (const argument of node.arguments ?? []) {
size += 2 + argument.name.value.length + getValueInfo(ruleContext, argument.value).comparisonKey.length;
if (size > MAX_FRAGMENT_ARGUMENT_SIZE) {
return description.name.value + "(...)";
}
}
return print(description).slice(3);
}
function subfieldConflicts(conflicts, responseName, node1, node2) {
if (conflicts.length > 0) {
let message = "";
for (const { responseName: name, reason } of conflicts) {
message += (message === "" ? "" : " and ") + `subfields "${maybeAbbreviate(name)}" conflict because ${reason}`;
if (message.length > MAX_CONFLICT_DETAIL_LENGTH) {
break;
}
}
return {
responseName,
reason: maybeAbbreviate(message),
fields1: collectConflictNodes(node1, conflicts, "fields1"),
fields2: collectConflictNodes(node2, conflicts, "fields2")
};
}
}
function collectConflictNodes(node, conflicts, side) {
const nodes = [node];
for (const conflict of conflicts) {
const remaining = MAX_CONFLICT_NODES - nodes.length;
const retainedNodes = conflict[side].slice(-remaining);
nodes.push(...retainedNodes);
if (nodes.length === MAX_CONFLICT_NODES) {
break;
}
}
return nodes;
}
function maybeAbbreviate(text) {
return text.length > MAX_CONFLICT_DETAIL_LENGTH ? text.slice(0, MAX_CONFLICT_DETAIL_LENGTH) + "..." : text;
}
function spendComplexityBudget(ruleContext, cost) {
ruleContext.remainingComplexityBudget -= cost;
if (ruleContext.remainingComplexityBudget < 0) {
throw validationAbortedError;
}
}
var MAX_CONFLICT_DETAIL_LENGTH, MAX_CONFLICT_NODES, MAX_FRAGMENT_ARGUMENT_SIZE, MAX_COMPLEXITY_BUDGET, OrderedPairSet, PairSet;
var init_OverlappingFieldsCanBeMergedRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs"() {
init_inspect();
init_GraphQLError();
init_ast();
init_kinds2();
init_printer();
init_definition();
init_typeFromAST();
init_validationAbortedError();
MAX_CONFLICT_DETAIL_LENGTH = 1e3;
MAX_CONFLICT_NODES = 20;
MAX_FRAGMENT_ARGUMENT_SIZE = 256;
MAX_COMPLEXITY_BUDGET = 5e5;
OrderedPairSet = class {
constructor() {
this._data = /* @__PURE__ */ new Map();
}
has(a, b, weaklyPresent) {
const result = this._data.get(a)?.get(b);
if (result === void 0) {
return false;
}
return weaklyPresent ? true : weaklyPresent === result;
}
add(a, b, weaklyPresent) {
const map = this._data.get(a);
if (map === void 0) {
this._data.set(a, /* @__PURE__ */ new Map([[b, weaklyPresent]]));
} else {
map.set(b, weaklyPresent);
}
}
};
PairSet = class {
constructor() {
this._orderedPairSet = new OrderedPairSet();
}
has(a, b, weaklyPresent) {
return this._orderedPairSet.has(a, b, weaklyPresent) || this._orderedPairSet.has(b, a, weaklyPresent);
}
add(a, b, weaklyPresent) {
this._orderedPairSet.add(a, b, weaklyPresent);
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs
function PossibleFragmentSpreadsRule(context) {
return {
InlineFragment(node) {
const fragType = context.getType();
const parentType = context.getParentType();
if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) {
const parentTypeStr = inspect(parentType);
const fragTypeStr = inspect(fragType);
context.reportError(new GraphQLError(`Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node }));
}
},
FragmentSpread(node) {
const fragName = node.name.value;
const fragType = getFragmentType(context, fragName);
const parentType = context.getParentType();
if (fragType && parentType && !doTypesOverlap(context.getSchema(), fragType, parentType)) {
const parentTypeStr = inspect(parentType);
const fragTypeStr = inspect(fragType);
context.reportError(new GraphQLError(`Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, { nodes: node }));
}
}
};
}
function getFragmentType(context, name) {
const frag = context.getFragment(name);
if (frag) {
const type = typeFromAST(context.getSchema(), frag.typeCondition);
if (isCompositeType(type)) {
return type;
}
}
}
var init_PossibleFragmentSpreadsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs"() {
init_inspect();
init_GraphQLError();
init_definition();
init_typeComparators();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs
function PossibleTypeExtensionsRule(context) {
const schema = context.getSchema();
const definedTypes = /* @__PURE__ */ new Map();
for (const def of context.getDocument().definitions) {
if (isTypeDefinitionNode(def)) {
definedTypes.set(def.name.value, def);
}
}
return {
ScalarTypeExtension: checkExtension,
ObjectTypeExtension: checkExtension,
InterfaceTypeExtension: checkExtension,
UnionTypeExtension: checkExtension,
EnumTypeExtension: checkExtension,
InputObjectTypeExtension: checkExtension
};
function checkExtension(node) {
const typeName = node.name.value;
const defNode = definedTypes.get(typeName);
const existingType = schema?.getType(typeName);
let expectedKind;
if (defNode != null) {
expectedKind = defKindToExtKind[defNode.kind];
} else if (existingType) {
expectedKind = typeToExtKind(existingType);
}
if (expectedKind != null) {
if (expectedKind !== node.kind) {
const kindStr = extensionKindToTypeName(node.kind);
context.reportError(new GraphQLError(`Cannot extend non-${kindStr} type "${typeName}".`, {
nodes: defNode ? [defNode, node] : node
}));
}
} else {
const allTypeNames = [
...definedTypes.keys(),
...Object.keys(schema?.getTypeMap() ?? {})
];
context.reportError(new GraphQLError(`Cannot extend type "${typeName}" because it is not defined.` + didYouMean(suggestionList(typeName, allTypeNames)), { nodes: node.name }));
}
}
}
function typeToExtKind(type) {
if (isScalarType(type)) {
return kinds_exports.SCALAR_TYPE_EXTENSION;
}
if (isObjectType(type)) {
return kinds_exports.OBJECT_TYPE_EXTENSION;
}
if (isInterfaceType(type)) {
return kinds_exports.INTERFACE_TYPE_EXTENSION;
}
if (isUnionType(type)) {
return kinds_exports.UNION_TYPE_EXTENSION;
}
if (isEnumType(type)) {
return kinds_exports.ENUM_TYPE_EXTENSION;
}
if (isInputObjectType(type)) {
return kinds_exports.INPUT_OBJECT_TYPE_EXTENSION;
}
invariant(false, "Unexpected type: " + inspect(type));
}
function extensionKindToTypeName(kind) {
switch (kind) {
case kinds_exports.SCALAR_TYPE_EXTENSION:
return "scalar";
case kinds_exports.OBJECT_TYPE_EXTENSION:
return "object";
case kinds_exports.INTERFACE_TYPE_EXTENSION:
return "interface";
case kinds_exports.UNION_TYPE_EXTENSION:
return "union";
case kinds_exports.ENUM_TYPE_EXTENSION:
return "enum";
case kinds_exports.INPUT_OBJECT_TYPE_EXTENSION:
return "input object";
default:
invariant(false, "Unexpected kind: " + inspect(kind));
}
}
var defKindToExtKind;
var init_PossibleTypeExtensionsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs"() {
init_didYouMean();
init_inspect();
init_invariant();
init_suggestionList();
init_GraphQLError();
init_kinds2();
init_predicates();
init_definition();
defKindToExtKind = {
[kinds_exports.SCALAR_TYPE_DEFINITION]: kinds_exports.SCALAR_TYPE_EXTENSION,
[kinds_exports.OBJECT_TYPE_DEFINITION]: kinds_exports.OBJECT_TYPE_EXTENSION,
[kinds_exports.INTERFACE_TYPE_DEFINITION]: kinds_exports.INTERFACE_TYPE_EXTENSION,
[kinds_exports.UNION_TYPE_DEFINITION]: kinds_exports.UNION_TYPE_EXTENSION,
[kinds_exports.ENUM_TYPE_DEFINITION]: kinds_exports.ENUM_TYPE_EXTENSION,
[kinds_exports.INPUT_OBJECT_TYPE_DEFINITION]: kinds_exports.INPUT_OBJECT_TYPE_EXTENSION
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs
function ProvidedRequiredArgumentsRule(context) {
const requiredArgsByFragment = /* @__PURE__ */ new Map();
return {
...ProvidedRequiredArgumentsOnDirectivesRule(context),
Field: {
leave(fieldNode) {
const fieldDef = context.getFieldDef();
if (!fieldDef || fieldDef.args.length === 0) {
return false;
}
const providedArgs = new Set(fieldNode.arguments?.map((arg) => arg.name.value));
for (const argDef of fieldDef.args) {
if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) {
context.reportError(new GraphQLError(`Argument "${argDef}" of type "${argDef.type}" is required, but it was not provided.`, { nodes: fieldNode }));
}
}
}
},
FragmentSpread: {
leave(spreadNode) {
const fragmentSignature = context.getFragmentSignature();
if (!fragmentSignature) {
return false;
}
let requiredArgs = requiredArgsByFragment.get(fragmentSignature);
if (!requiredArgs) {
requiredArgs = [...fragmentSignature.variableDefinitions].filter(([, definition]) => isRequiredArgumentNode(definition));
requiredArgsByFragment.set(fragmentSignature, requiredArgs);
}
const providedArgs = new Set(spreadNode.arguments?.map((arg) => arg.name.value));
for (const [varName, variableDefinition] of requiredArgs) {
if (!providedArgs.has(varName)) {
const type = typeFromAST(context.getSchema(), variableDefinition.type);
const argTypeStr = inspect(type);
context.reportError(new GraphQLError(`Fragment "${spreadNode.name.value}" argument "${varName}" of type "${argTypeStr}" is required, but it was not provided.`, { nodes: spreadNode }));
}
}
}
}
};
}
function ProvidedRequiredArgumentsOnDirectivesRule(context) {
const requiredArgsMap = /* @__PURE__ */ new Map();
const schema = context.getSchema();
const definedDirectives = schema?.getDirectives() ?? specifiedDirectives;
for (const directive of definedDirectives) {
requiredArgsMap.set(directive.name, new Map(directive.args.filter(isRequiredArgument).map((arg) => [arg.name, arg])));
}
const astDefinitions = context.getDocument().definitions;
for (const def of astDefinitions) {
if (def.kind === kinds_exports.DIRECTIVE_DEFINITION) {
const argNodes = def.arguments ?? [];
requiredArgsMap.set(def.name.value, new Map(argNodes.filter(isRequiredArgumentNode).map((arg) => [arg.name.value, arg])));
}
}
return {
Directive: {
leave(directiveNode) {
const directiveName = directiveNode.name.value;
const requiredArgs = requiredArgsMap.get(directiveName);
if (requiredArgs != null) {
const argNodes = directiveNode.arguments ?? [];
const argNodeMap = new Set(argNodes.map((arg) => arg.name.value));
for (const [argName, argDef] of requiredArgs.entries()) {
if (!argNodeMap.has(argName)) {
const argType = isType(argDef.type) ? inspect(argDef.type) : print(argDef.type);
context.reportError(new GraphQLError(`Argument "@${directiveName}(${argName}:)" of type "${argType}" is required, but it was not provided.`, { nodes: directiveNode }));
}
}
}
}
}
};
}
function isRequiredArgumentNode(arg) {
return arg.type.kind === kinds_exports.NON_NULL_TYPE && arg.defaultValue == null;
}
var init_ProvidedRequiredArgumentsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs"() {
init_inspect();
init_GraphQLError();
init_kinds2();
init_printer();
init_definition();
init_directives();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs
function ScalarLeafsRule(context) {
return {
Field(node) {
const type = context.getType();
const selectionSet = node.selectionSet;
if (type) {
if (isLeafType(getNamedType(type))) {
if (selectionSet) {
const fieldName = node.name.value;
const typeStr = inspect(type);
context.reportError(new GraphQLError(`Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, { nodes: selectionSet }));
}
} else if (!selectionSet) {
const fieldName = node.name.value;
const typeStr = inspect(type);
context.reportError(new GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, { nodes: node }));
} else if (selectionSet.selections.length === 0 && !context.allowEmptySelectionSets) {
const fieldName = node.name.value;
const typeStr = inspect(type);
context.reportError(new GraphQLError(`Field "${fieldName}" of type "${typeStr}" must have at least one field selected.`, { nodes: node }));
}
}
}
};
}
var init_ScalarLeafsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs"() {
init_inspect();
init_GraphQLError();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/coerceInputValue.mjs
function coerceInputValue(inputValue, type) {
if (isNonNullType(type)) {
if (inputValue == null) {
return;
}
return coerceInputValue(inputValue, type.ofType);
}
if (inputValue == null) {
return null;
}
if (isListType(type)) {
if (!isIterableObject(inputValue)) {
const coercedItem = coerceInputValue(inputValue, type.ofType);
if (coercedItem === void 0) {
return;
}
return [coercedItem];
}
const coercedValue = [];
for (const itemValue of inputValue) {
const coercedItem = coerceInputValue(itemValue, type.ofType);
if (coercedItem === void 0) {
return;
}
coercedValue.push(coercedItem);
}
return coercedValue;
}
if (isInputObjectType(type)) {
if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {
return;
}
const coercedValue = /* @__PURE__ */ Object.create(null);
const fieldDefs = type.getFields();
let definedFieldCount = 0;
for (const fieldName of Object.keys(inputValue)) {
if (inputValue[fieldName] === void 0) {
continue;
}
definedFieldCount++;
if (!Object.hasOwn(fieldDefs, fieldName)) {
return;
}
}
for (const field of Object.values(fieldDefs)) {
const fieldValue = inputValue[field.name];
if (fieldValue === void 0) {
if (isRequiredInputField(field)) {
return;
}
const coercedDefaultValue = coerceDefaultValue(field);
if (coercedDefaultValue !== void 0) {
coercedValue[field.name] = coercedDefaultValue;
}
} else {
const coercedField = coerceInputValue(fieldValue, field.type);
if (coercedField === void 0) {
return;
}
coercedValue[field.name] = coercedField;
}
}
if (type.isOneOf) {
const keys = Object.keys(coercedValue);
if (definedFieldCount !== 1 || keys.length !== 1) {
return;
}
const key = keys[0];
const value = coercedValue[key];
if (value === null) {
return;
}
}
return coercedValue;
}
const leafType = assertLeafType(type);
try {
return leafType.coerceInputValue(inputValue);
} catch (_error) {
}
}
function coerceInputLiteral(valueNode, type, variableValues, fragmentVariableValues) {
if (valueNode.kind === kinds_exports.VARIABLE) {
const coercedVariableValue = getCoercedVariableValue(valueNode, variableValues, fragmentVariableValues);
if (coercedVariableValue == null && isNonNullType(type)) {
return;
}
return coercedVariableValue;
}
if (isNonNullType(type)) {
if (valueNode.kind === kinds_exports.NULL) {
return;
}
return coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues);
}
if (valueNode.kind === kinds_exports.NULL) {
return null;
}
if (isListType(type)) {
if (valueNode.kind !== kinds_exports.LIST) {
const itemValue = coerceInputLiteral(valueNode, type.ofType, variableValues, fragmentVariableValues);
if (itemValue === void 0) {
return;
}
return [itemValue];
}
const coercedValue = [];
for (const itemNode of valueNode.values) {
let itemValue = coerceInputLiteral(itemNode, type.ofType, variableValues, fragmentVariableValues);
if (itemValue === void 0) {
if (itemNode.kind === kinds_exports.VARIABLE && getCoercedVariableValue(itemNode, variableValues, fragmentVariableValues) == null && !isNonNullType(type.ofType)) {
itemValue = null;
} else {
return;
}
}
coercedValue.push(itemValue);
}
return coercedValue;
}
if (isInputObjectType(type)) {
if (valueNode.kind !== kinds_exports.OBJECT) {
return;
}
const coercedValue = /* @__PURE__ */ Object.create(null);
const fieldDefs = type.getFields();
const hasUndefinedField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value));
if (hasUndefinedField) {
return;
}
const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field]));
for (const field of Object.values(fieldDefs)) {
const fieldNode = fieldNodes.get(field.name);
if (!fieldNode || fieldNode.value.kind === kinds_exports.VARIABLE && isMissingVariable(fieldNode.value, variableValues, fragmentVariableValues)) {
if (isRequiredInputField(field)) {
return;
}
const coercedDefaultValue = coerceDefaultValue(field);
if (coercedDefaultValue !== void 0) {
coercedValue[field.name] = coercedDefaultValue;
}
} else {
const fieldValue = coerceInputLiteral(fieldNode.value, field.type, variableValues, fragmentVariableValues);
if (fieldValue === void 0) {
return;
}
coercedValue[field.name] = fieldValue;
}
}
if (type.isOneOf) {
const coercedKeys = Object.keys(coercedValue);
if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {
return;
}
for (const [fieldName, fieldNode] of fieldNodes) {
if (fieldNode.value.kind === kinds_exports.NULL || coercedValue[fieldName] === null) {
return;
}
}
}
return coercedValue;
}
const leafType = assertLeafType(type);
try {
return leafType.coerceInputLiteral ? leafType.coerceInputLiteral(replaceVariables(valueNode, variableValues, fragmentVariableValues)) : leafType.parseLiteral(valueNode, variableValues?.coerced);
} catch (_error) {
}
}
function getCoercedVariableValue(variableNode, variableValues, fragmentVariableValues) {
const varName = variableNode.name.value;
if (fragmentVariableValues?.sources[varName] !== void 0) {
return fragmentVariableValues.coerced[varName];
}
return variableValues?.coerced[varName];
}
function isMissingVariable(variableNode, variableValues, fragmentVariableValues) {
const varName = variableNode.name.value;
const scopedValues = fragmentVariableValues?.sources[varName] !== void 0 ? fragmentVariableValues.coerced : variableValues?.coerced;
return scopedValues?.[varName] === void 0;
}
function coerceDefaultValue(inputValue) {
let coercedDefaultValue = inputValue._memoizedCoercedDefaultValue;
if (coercedDefaultValue !== void 0) {
return coercedDefaultValue;
}
const defaultInput = inputValue.default;
if (defaultInput !== void 0) {
coercedDefaultValue = defaultInput.literal ? coerceInputLiteral(defaultInput.literal, inputValue.type) : coerceInputValue(defaultInput.value, inputValue.type);
if (!(coercedDefaultValue !== void 0))
invariant(false, `Expected value of type "${inputValue.type}" to be valid, found: ${inspect(defaultInput.literal ?? defaultInput.value)}.`);
inputValue._memoizedCoercedDefaultValue = coercedDefaultValue;
return coercedDefaultValue;
}
const defaultValue = inputValue.defaultValue;
if (defaultValue !== void 0) {
inputValue._memoizedCoercedDefaultValue = defaultValue;
}
return defaultValue;
}
var init_coerceInputValue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/coerceInputValue.mjs"() {
init_inspect();
init_invariant();
init_isIterableObject();
init_isObjectLike();
init_kinds2();
init_definition();
init_replaceVariables();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/getVariableSignature.mjs
function getVariableSignature(schema, varDefNode) {
const varName = varDefNode.variable.name.value;
const varType = typeFromAST(schema, varDefNode.type);
if (!isInputType(varType)) {
const varTypeStr = print(varDefNode.type);
return new GraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { nodes: varDefNode.type });
}
const defaultValue = varDefNode.defaultValue;
return {
name: varName,
type: varType,
default: defaultValue && { literal: defaultValue }
};
}
var init_getVariableSignature = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/getVariableSignature.mjs"() {
init_GraphQLError();
init_printer();
init_definition();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/values.mjs
function getVariableValues(schema, varDefNodes, inputs, options) {
const errors = [];
const maxErrors = options?.maxErrors;
try {
const variableValues = coerceVariableValues(schema, varDefNodes, inputs, (error) => {
if (maxErrors != null && errors.length >= maxErrors) {
throw new GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");
}
errors.push(error);
}, options?.hideSuggestions);
if (errors.length === 0) {
return { variableValues };
}
} catch (error) {
errors.push(ensureGraphQLError(error));
}
return { errors };
}
function coerceVariableValues(schema, varDefNodes, inputs, onError, hideSuggestions) {
const sources = /* @__PURE__ */ Object.create(null);
const coerced = /* @__PURE__ */ Object.create(null);
for (const varDefNode of varDefNodes) {
const varSignature = getVariableSignature(schema, varDefNode);
if (varSignature instanceof GraphQLError) {
onError(varSignature);
continue;
}
const { name: varName, type: varType } = varSignature;
const value = Object.hasOwn(inputs, varName) ? inputs[varName] : void 0;
if (value === void 0) {
sources[varName] = { signature: varSignature };
if (varDefNode.defaultValue) {
maybeUseDefaultValue(coerced, varName, varSignature, (error, path) => {
onError(new GraphQLError(`Variable "$${varName}" has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: varDefNode }));
}, hideSuggestions);
continue;
} else if (!isNonNullType(varType)) {
continue;
}
} else {
sources[varName] = { signature: varSignature, value };
}
const coercedValue = coerceInputValue(value, varType);
if (coercedValue !== void 0) {
coerced[varName] = coercedValue;
} else {
validateInputValue(value, varType, (error, path) => {
onError(new GraphQLError(`Variable "$${varName}" has invalid value${printPathArray(path)}: ${error.message}`, { nodes: varDefNode, originalError: error }));
}, hideSuggestions);
}
}
return { sources, coerced };
}
function maybeUseDefaultValue(coercedValues, name, inputValue, onError, hideSuggestions) {
try {
const coercedDefaultValue = coerceDefaultValue(inputValue);
if (coercedDefaultValue !== void 0) {
coercedValues[name] = coercedDefaultValue;
}
} catch (error) {
const defaultInput = inputValue.default;
if (defaultInput === void 0) {
throw error;
}
let reportedValidationError = false;
validateDefaultInput(defaultInput, inputValue.type, (defaultError, path) => {
reportedValidationError = true;
onError(defaultError, path);
}, hideSuggestions);
if (!reportedValidationError) {
onError(ensureGraphQLError(error), []);
}
}
}
function getFragmentVariableValues(fragmentSpreadNode, fragmentSignatures, variableValues, fragmentVariableValues, hideSuggestions) {
const argumentNodes = fragmentSpreadNode.arguments ?? [];
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
const sources = /* @__PURE__ */ Object.create(null);
const coerced = /* @__PURE__ */ Object.create(null);
for (const [varName, varSignature] of Object.entries(fragmentSignatures)) {
const argumentNode = argNodeMap.get(varName);
if (argumentNode !== void 0) {
sources[varName] = fragmentVariableValues == null ? { signature: varSignature, value: argumentNode.value } : {
signature: varSignature,
value: argumentNode.value,
fragmentVariableValues
};
} else {
sources[varName] = {
signature: varSignature
};
}
coerceArgument(coerced, fragmentSpreadNode, varName, varSignature, argumentNode, variableValues, fragmentVariableValues, hideSuggestions);
}
return { sources, coerced };
}
function getArgumentValues(def, node, variableValues, fragmentVariableValues, hideSuggestions) {
const coercedValues = /* @__PURE__ */ Object.create(null);
if (def.args.length === 0) {
return coercedValues;
}
const argumentNodes = node.arguments ?? [];
const argNodeMap = new Map(argumentNodes.map((arg) => [arg.name.value, arg]));
for (const argDef of def.args) {
const name = argDef.name;
coerceArgument(coercedValues, node, name, argDef, argNodeMap.get(argDef.name), variableValues, fragmentVariableValues, hideSuggestions);
}
return coercedValues;
}
function coerceArgument(coercedValues, node, argName, argDef, argumentNode, variableValues, fragmentVariableValues, hideSuggestions) {
const argType = argDef.type;
const onArgDefaultValueError = (error, path) => {
throw new GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} has invalid default value${printPathArray(path)}: ${error.message}`, { nodes: node });
};
if (!argumentNode) {
if (isRequiredArgument(argDef)) {
throw new GraphQLError(`${printArgumentOrFragmentVariable(argDef, node)} of required type "${argType}" was not provided.`, { nodes: node });
}
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
return;
}
const valueNode = argumentNode.value;
if (valueNode.kind === kinds_exports.VARIABLE) {
const variableName = valueNode.name.value;
const scopedVariableValues = fragmentVariableValues?.sources[variableName] ? fragmentVariableValues : variableValues;
if ((scopedVariableValues == null || !Object.hasOwn(scopedVariableValues.coerced, variableName)) && !isRequiredArgument(argDef)) {
maybeUseDefaultValue(coercedValues, argName, argDef, onArgDefaultValueError, hideSuggestions);
return;
}
}
const coercedValue = coerceInputLiteral(valueNode, argType, variableValues, fragmentVariableValues);
if (coercedValue === void 0) {
validateInputLiteral(valueNode, argType, (error, path) => {
error.message = `${printArgumentOrFragmentVariable(argDef, node)} has invalid value${printPathArray(path)}: ${error.message}`;
throw error;
}, variableValues, fragmentVariableValues, hideSuggestions);
invariant(false, "Invalid argument");
}
coercedValues[argName] = coercedValue;
}
function printArgumentOrFragmentVariable(argDef, node) {
return isArgument(argDef) ? `Argument "${argDef}"` : `Variable "$${argDef.name}" defined by fragment "${node.name.value}"`;
}
function getDirectiveValues(directiveDef, node, variableValues, fragmentVariableValues, hideSuggestions) {
const directiveNode = node.directives?.find((directive) => directive.name.value === directiveDef.name);
if (directiveNode) {
return getArgumentValues(directiveDef, directiveNode, variableValues, fragmentVariableValues, hideSuggestions);
}
}
var init_values = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/values.mjs"() {
init_invariant();
init_printPathArray();
init_ensureGraphQLError();
init_GraphQLError();
init_kinds2();
init_definition();
init_validate();
init_coerceInputValue();
init_validateInputValue();
init_getVariableSignature();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/collectFields.mjs
function collectFields2(schema, fragments, variableValues, runtimeType, selectionSet, hideSuggestions, forbidSkipAndInclude = false, visit2 = visitSelectionSets) {
const groupedFieldSet = new AccumulatorMap();
const newDeferUsages = [];
const context = {
schema,
fragments,
variableValues,
runtimeType,
visitedFragmentNames: /* @__PURE__ */ new Map(),
hideSuggestions,
forbiddenDirectiveInstances: [],
forbidSkipAndInclude
};
visit2(context, selectionSet, groupedFieldSet, newDeferUsages);
return {
groupedFieldSet,
newDeferUsages,
forbiddenDirectiveInstances: context.forbiddenDirectiveInstances
};
}
function collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions) {
const context = {
schema,
fragments,
variableValues,
runtimeType: returnType,
visitedFragmentNames: /* @__PURE__ */ new Map(),
hideSuggestions,
forbiddenDirectiveInstances: [],
forbidSkipAndInclude: false
};
const subGroupedFieldSet = new AccumulatorMap();
const newDeferUsages = [];
for (const fieldDetail of fieldDetailsList) {
const selectionSet = fieldDetail.node.selectionSet;
if (selectionSet) {
const { deferUsage, fragmentVariableValues } = fieldDetail;
visitSelectionSets(context, selectionSet, subGroupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues);
}
}
return {
groupedFieldSet: subGroupedFieldSet,
newDeferUsages
};
}
function visitSelectionSets(context, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues, recurse = visitSelectionSets) {
const { schema, fragments, variableValues, runtimeType, visitedFragmentNames, hideSuggestions } = context;
for (const selection of selectionSet.selections) {
switch (selection.kind) {
case kinds_exports.FIELD: {
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
continue;
}
groupedFieldSet.add(getFieldEntryKey(selection), {
node: selection,
deferUsage,
fragmentVariableValues
});
break;
}
case kinds_exports.INLINE_FRAGMENT: {
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues) || !doesFragmentConditionMatch(schema, selection, runtimeType)) {
continue;
}
const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage);
if (!newDeferUsage) {
recurse(context, selection.selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues, recurse);
} else {
newDeferUsages.push(newDeferUsage);
recurse(context, selection.selectionSet, groupedFieldSet, newDeferUsages, newDeferUsage, fragmentVariableValues, recurse);
}
break;
}
case kinds_exports.FRAGMENT_SPREAD: {
const fragName = selection.name.value;
if (!shouldIncludeNode(context, selection, variableValues, fragmentVariableValues)) {
continue;
}
const fragment = fragments[fragName];
if (fragment == null || !doesFragmentConditionMatch(schema, fragment.definition, runtimeType)) {
continue;
}
const newDeferUsage = getDeferUsage(variableValues, fragmentVariableValues, selection, deferUsage);
const maybeNewDeferUsage = newDeferUsage ?? deferUsage;
let visitedDeferSet = visitedFragmentNames.get(fragName);
if (!visitedDeferSet) {
visitedDeferSet = /* @__PURE__ */ new Set();
visitedFragmentNames.set(fragName, visitedDeferSet);
}
if (visitedDeferSet.has(null) || maybeNewDeferUsage && visitedDeferSet.has(maybeNewDeferUsage.directiveNode)) {
continue;
}
if (newDeferUsage) {
newDeferUsages.push(newDeferUsage);
}
visitedDeferSet.add(maybeNewDeferUsage?.directiveNode ?? null);
const fragmentVariableSignatures = fragment.variableSignatures;
let newFragmentVariableValues;
if (fragmentVariableSignatures) {
newFragmentVariableValues = getFragmentVariableValues(selection, fragmentVariableSignatures, variableValues, fragmentVariableValues, hideSuggestions);
}
recurse(context, fragment.definition.selectionSet, groupedFieldSet, newDeferUsages, maybeNewDeferUsage, newFragmentVariableValues, recurse);
break;
}
}
}
}
function getDeferUsage(variableValues, fragmentVariableValues, node, parentDeferUsage) {
const directiveNode = node.directives?.find((directive) => directive.name.value === GraphQLDeferDirective.name);
if (!directiveNode) {
return;
}
const defer = getArgumentValues(GraphQLDeferDirective, directiveNode, variableValues, fragmentVariableValues);
if (defer.if === false) {
return;
}
return {
label: typeof defer.label === "string" ? defer.label : void 0,
directiveNode,
parentDeferUsage
};
}
function shouldIncludeNode(context, node, variableValues, fragmentVariableValues) {
const skipDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLSkipDirective.name);
if (skipDirectiveNode && context.forbidSkipAndInclude) {
context.forbiddenDirectiveInstances.push(skipDirectiveNode);
return false;
}
const skip = skipDirectiveNode ? getArgumentValues(GraphQLSkipDirective, skipDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) : void 0;
if (skip?.if === true) {
return false;
}
const includeDirectiveNode = node.directives?.find((directive) => directive.name.value === GraphQLIncludeDirective.name);
if (includeDirectiveNode && context.forbidSkipAndInclude) {
context.forbiddenDirectiveInstances.push(includeDirectiveNode);
return false;
}
const include = includeDirectiveNode ? getArgumentValues(GraphQLIncludeDirective, includeDirectiveNode, variableValues, fragmentVariableValues, context.hideSuggestions) : void 0;
if (include?.if === false) {
return false;
}
return true;
}
function doesFragmentConditionMatch(schema, fragment, type) {
const typeConditionNode = fragment.typeCondition;
if (!typeConditionNode) {
return true;
}
const conditionalType = typeFromAST(schema, typeConditionNode);
if (conditionalType === type) {
return true;
}
if (isAbstractType(conditionalType)) {
return schema.isSubType(conditionalType, type);
}
return false;
}
function getFieldEntryKey(node) {
return node.alias ? node.alias.value : node.name.value;
}
var init_collectFields = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/collectFields.mjs"() {
init_AccumulatorMap();
init_kinds2();
init_definition();
init_directives();
init_typeFromAST();
init_values();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs
function toNodes(fieldDetailsList) {
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
}
function SingleFieldSubscriptionsRule(context) {
let fragments;
const visitSelectionSets2 = (visitContext, selectionSet, groupedFieldSet, newDeferUsages, ...[deferUsage, fragmentVariableValues]) => {
context.spendFragmentWork(selectionSet.selections.length);
for (const selection of selectionSet.selections) {
const directives = selection.directives;
if (directives !== void 0) {
context.spendFragmentWork(directives.length);
const defer = directives.find((directive) => directive.name.value === GraphQLDeferDirective.name);
context.spendFragmentWork(defer?.arguments?.length ?? 0);
}
}
visitSelectionSets(visitContext, selectionSet, groupedFieldSet, newDeferUsages, deferUsage, fragmentVariableValues, visitSelectionSets2);
};
return {
OperationDefinition(node) {
if (node.operation === "subscription") {
const schema = context.getSchema();
const subscriptionType = schema.getSubscriptionType();
if (subscriptionType) {
const operationName = node.name ? node.name.value : null;
const variableValues = {
sources: /* @__PURE__ */ Object.create(null),
coerced: /* @__PURE__ */ Object.create(null)
};
if (!fragments) {
fragments = /* @__PURE__ */ Object.create(null);
for (const definition of context.getDocument().definitions) {
if (definition.kind === kinds_exports.FRAGMENT_DEFINITION) {
fragments[definition.name.value] = { definition };
}
}
}
const { groupedFieldSet, forbiddenDirectiveInstances } = collectFields2(schema, fragments, variableValues, subscriptionType, node.selectionSet, context.hideSuggestions, true, visitSelectionSets2);
if (forbiddenDirectiveInstances.length > 0) {
context.reportError(new GraphQLError(operationName != null ? `Subscription "${operationName}" must not use \`@skip\` or \`@include\` directives in the top level selection.` : "Anonymous Subscription must not use `@skip` or `@include` directives in the top level selection.", { nodes: forbiddenDirectiveInstances }));
return;
}
if (groupedFieldSet.size === 0) {
context.reportError(new GraphQLError(operationName != null ? `Subscription "${operationName}" must select one top level field.` : "Anonymous Subscription must select one top level field.", { nodes: node.selectionSet }));
} else if (groupedFieldSet.size > 1) {
const fieldDetailsLists = [...groupedFieldSet.values()];
const extraFieldDetailsLists = fieldDetailsLists.slice(1);
const extraFieldSelections = extraFieldDetailsLists.flatMap((fieldDetailsList) => toNodes(fieldDetailsList));
context.reportError(new GraphQLError(operationName != null ? `Subscription "${operationName}" must select only one top level field.` : "Anonymous Subscription must select only one top level field.", { nodes: extraFieldSelections }));
}
for (const fieldDetailsList of groupedFieldSet.values()) {
const fieldName = toNodes(fieldDetailsList)[0].name.value;
if (fieldName.startsWith("__")) {
context.reportError(new GraphQLError(operationName != null ? `Subscription "${operationName}" must not select an introspection top level field.` : "Anonymous Subscription must not select an introspection top level field.", { nodes: toNodes(fieldDetailsList) }));
}
}
}
}
}
};
}
var init_SingleFieldSubscriptionsRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs"() {
init_GraphQLError();
init_kinds2();
init_directives();
init_collectFields();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs
function StreamDirectiveOnListFieldRule(context) {
return {
Directive(node) {
const fieldDef = context.getFieldDef();
const parentType = context.getParentType();
if (fieldDef && parentType && node.name.value === GraphQLStreamDirective.name && !(isListType(fieldDef.type) || isWrappingType(fieldDef.type) && isListType(fieldDef.type.ofType))) {
context.reportError(new GraphQLError(`Directive "@stream" cannot be used on non-list field "${parentType}.${fieldDef.name}".`, { nodes: node }));
}
}
};
}
var init_StreamDirectiveOnListFieldRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/StreamDirectiveOnListFieldRule.mjs"() {
init_GraphQLError();
init_definition();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/groupBy.mjs
function groupBy(list, keyFn) {
const result = new AccumulatorMap();
for (const item of list) {
result.add(keyFn(item), item);
}
return result;
}
var init_groupBy = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/groupBy.mjs"() {
init_AccumulatorMap();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs
function UniqueArgumentDefinitionNamesRule(context) {
return {
DirectiveDefinition(directiveNode) {
const argumentNodes = directiveNode.arguments ?? [];
return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes);
},
InterfaceTypeDefinition: checkArgUniquenessPerField,
InterfaceTypeExtension: checkArgUniquenessPerField,
ObjectTypeDefinition: checkArgUniquenessPerField,
ObjectTypeExtension: checkArgUniquenessPerField
};
function checkArgUniquenessPerField(typeNode) {
const typeName = typeNode.name.value;
const fieldNodes = typeNode.fields ?? [];
for (const fieldDef of fieldNodes) {
const fieldName = fieldDef.name.value;
const argumentNodes = fieldDef.arguments ?? [];
checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes);
}
return false;
}
function checkArgUniqueness(parentName, argumentNodes) {
const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);
for (const [argName, argNodes] of seenArgs) {
if (argNodes.length > 1) {
context.reportError(new GraphQLError(`Argument "${parentName}(${argName}:)" can only be defined once.`, { nodes: argNodes.map((node) => node.name) }));
}
}
return false;
}
}
var init_UniqueArgumentDefinitionNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs"() {
init_groupBy();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs
function UniqueArgumentNamesRule(context) {
return {
Field: checkArgUniqueness,
Directive: checkArgUniqueness
};
function checkArgUniqueness(parentNode) {
const argumentNodes = parentNode.arguments ?? [];
const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);
for (const [argName, argNodes] of seenArgs) {
if (argNodes.length > 1) {
context.reportError(new GraphQLError(`There can be only one argument named "${argName}".`, { nodes: argNodes.map((node) => node.name) }));
}
}
}
}
var init_UniqueArgumentNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs"() {
init_groupBy();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs
function UniqueDirectiveNamesRule(context) {
const knownDirectiveNames = /* @__PURE__ */ new Map();
const schema = context.getSchema();
return {
DirectiveDefinition(node) {
const directiveName = node.name.value;
if (schema?.getDirective(directiveName)) {
context.reportError(new GraphQLError(`Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, { nodes: node.name }));
return;
}
const knownName = knownDirectiveNames.get(directiveName);
if (knownName) {
context.reportError(new GraphQLError(`There can be only one directive named "@${directiveName}".`, { nodes: [knownName, node.name] }));
} else {
knownDirectiveNames.set(directiveName, node.name);
}
return false;
}
};
}
var init_UniqueDirectiveNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs
function UniqueDirectivesPerLocationRule(context) {
const uniqueDirectiveMap = /* @__PURE__ */ new Map();
const schema = context.getSchema();
const definedDirectives = schema ? schema.getDirectives() : specifiedDirectives;
for (const directive of definedDirectives) {
uniqueDirectiveMap.set(directive.name, !directive.isRepeatable);
}
const astDefinitions = context.getDocument().definitions;
for (const def of astDefinitions) {
if (def.kind === kinds_exports.DIRECTIVE_DEFINITION) {
uniqueDirectiveMap.set(def.name.value, !def.repeatable);
}
}
const schemaDirectives = /* @__PURE__ */ new Map();
const typeDirectivesMap = /* @__PURE__ */ new Map();
const directiveDirectivesMap = /* @__PURE__ */ new Map();
return {
enter(node) {
if (!("directives" in node) || !node.directives) {
return;
}
let seenDirectives;
if (node.kind === kinds_exports.SCHEMA_DEFINITION || node.kind === kinds_exports.SCHEMA_EXTENSION) {
seenDirectives = schemaDirectives;
} else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {
const typeName = node.name.value;
seenDirectives = typeDirectivesMap.get(typeName);
if (seenDirectives === void 0) {
seenDirectives = /* @__PURE__ */ new Map();
typeDirectivesMap.set(typeName, seenDirectives);
}
} else if (node.kind === kinds_exports.DIRECTIVE_DEFINITION || node.kind === kinds_exports.DIRECTIVE_EXTENSION) {
const directiveName = node.name.value;
seenDirectives = directiveDirectivesMap.get(directiveName);
if (seenDirectives === void 0) {
seenDirectives = /* @__PURE__ */ new Map();
directiveDirectivesMap.set(directiveName, seenDirectives);
}
} else {
seenDirectives = /* @__PURE__ */ new Map();
}
for (const directive of node.directives) {
const directiveName = directive.name.value;
if (uniqueDirectiveMap.get(directiveName) === true) {
const seenDirective = seenDirectives.get(directiveName);
if (seenDirective != null) {
context.reportError(new GraphQLError(`The directive "@${directiveName}" can only be used once at this location.`, { nodes: [seenDirective, directive] }));
} else {
seenDirectives.set(directiveName, directive);
}
}
}
}
};
}
var init_UniqueDirectivesPerLocationRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs"() {
init_GraphQLError();
init_kinds2();
init_predicates();
init_directives();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs
function UniqueEnumValueNamesRule(context) {
const schema = context.getSchema();
const existingTypeMap = schema ? schema.getTypeMap() : /* @__PURE__ */ Object.create(null);
const knownValueNames = /* @__PURE__ */ new Map();
return {
EnumTypeDefinition: checkValueUniqueness,
EnumTypeExtension: checkValueUniqueness
};
function checkValueUniqueness(node) {
const typeName = node.name.value;
let valueNames = knownValueNames.get(typeName);
if (valueNames == null) {
valueNames = /* @__PURE__ */ new Map();
knownValueNames.set(typeName, valueNames);
}
const valueNodes = node.values ?? [];
for (const valueDef of valueNodes) {
const valueName = valueDef.name.value;
const existingType = existingTypeMap[typeName];
if (isEnumType(existingType) && existingType.getValue(valueName)) {
context.reportError(new GraphQLError(`Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: valueDef.name }));
continue;
}
const knownValueName = valueNames.get(valueName);
if (knownValueName != null) {
context.reportError(new GraphQLError(`Enum value "${typeName}.${valueName}" can only be defined once.`, { nodes: [knownValueName, valueDef.name] }));
} else {
valueNames.set(valueName, valueDef.name);
}
}
return false;
}
}
var init_UniqueEnumValueNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs"() {
init_GraphQLError();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs
function UniqueFieldDefinitionNamesRule(context) {
const schema = context.getSchema();
const existingTypeMap = schema ? schema.getTypeMap() : /* @__PURE__ */ Object.create(null);
const knownFieldNames = /* @__PURE__ */ new Map();
return {
InputObjectTypeDefinition: checkFieldUniqueness,
InputObjectTypeExtension: checkFieldUniqueness,
InterfaceTypeDefinition: checkFieldUniqueness,
InterfaceTypeExtension: checkFieldUniqueness,
ObjectTypeDefinition: checkFieldUniqueness,
ObjectTypeExtension: checkFieldUniqueness
};
function checkFieldUniqueness(node) {
const typeName = node.name.value;
let fieldNames = knownFieldNames.get(typeName);
if (fieldNames == null) {
fieldNames = /* @__PURE__ */ new Map();
knownFieldNames.set(typeName, fieldNames);
}
const fieldNodes = node.fields ?? [];
for (const fieldDef of fieldNodes) {
const fieldName = fieldDef.name.value;
if (hasField(existingTypeMap[typeName], fieldName)) {
context.reportError(new GraphQLError(`Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, { nodes: fieldDef.name }));
continue;
}
const knownFieldName = fieldNames.get(fieldName);
if (knownFieldName != null) {
context.reportError(new GraphQLError(`Field "${typeName}.${fieldName}" can only be defined once.`, { nodes: [knownFieldName, fieldDef.name] }));
} else {
fieldNames.set(fieldName, fieldDef.name);
}
}
return false;
}
}
function hasField(type, fieldName) {
if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {
return type.getFields()[fieldName] != null;
}
return false;
}
var init_UniqueFieldDefinitionNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs"() {
init_GraphQLError();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs
function UniqueFragmentNamesRule(context) {
const knownFragmentNames = /* @__PURE__ */ new Map();
return {
OperationDefinition: () => false,
FragmentDefinition(node) {
const fragmentName = node.name.value;
const knownFragmentName = knownFragmentNames.get(fragmentName);
if (knownFragmentName != null) {
context.reportError(new GraphQLError(`There can be only one fragment named "${fragmentName}".`, { nodes: [knownFragmentName, node.name] }));
} else {
knownFragmentNames.set(fragmentName, node.name);
}
return false;
}
};
}
var init_UniqueFragmentNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs
function UniqueInputFieldNamesRule(context) {
const knownNameStack = [];
let knownNames = /* @__PURE__ */ new Map();
return {
ObjectValue: {
enter() {
knownNameStack.push(knownNames);
knownNames = /* @__PURE__ */ new Map();
},
leave() {
const prevKnownNames = knownNameStack.pop();
if (!(prevKnownNames != null))
invariant(false);
knownNames = prevKnownNames;
}
},
ObjectField(node) {
const fieldName = node.name.value;
const knownName = knownNames.get(fieldName);
if (knownName != null) {
context.reportError(new GraphQLError(`There can be only one input field named "${fieldName}".`, { nodes: [knownName, node.name] }));
} else {
knownNames.set(fieldName, node.name);
}
}
};
}
var init_UniqueInputFieldNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs"() {
init_invariant();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs
function UniqueOperationNamesRule(context) {
const knownOperationNames = /* @__PURE__ */ new Map();
return {
OperationDefinition(node) {
const operationName = node.name;
if (operationName != null) {
const knownOperationName = knownOperationNames.get(operationName.value);
if (knownOperationName != null) {
context.reportError(new GraphQLError(`There can be only one operation named "${operationName.value}".`, { nodes: [knownOperationName, operationName] }));
} else {
knownOperationNames.set(operationName.value, operationName);
}
}
return false;
},
FragmentDefinition: () => false
};
}
var init_UniqueOperationNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs
function UniqueOperationTypesRule(context) {
const schema = context.getSchema();
const definedOperationTypes = /* @__PURE__ */ new Map();
const existingOperationTypes = schema ? {
query: schema.getQueryType(),
mutation: schema.getMutationType(),
subscription: schema.getSubscriptionType()
} : {};
return {
SchemaDefinition: checkOperationTypes,
SchemaExtension: checkOperationTypes
};
function checkOperationTypes(node) {
const operationTypesNodes = node.operationTypes ?? [];
for (const operationType of operationTypesNodes) {
const operation = operationType.operation;
const alreadyDefinedOperationType = definedOperationTypes.get(operation);
if (existingOperationTypes[operation]) {
context.reportError(new GraphQLError(`Type for ${operation} already defined in the schema. It cannot be redefined.`, { nodes: operationType }));
} else if (alreadyDefinedOperationType) {
context.reportError(new GraphQLError(`There can be only one ${operation} type in schema.`, { nodes: [alreadyDefinedOperationType, operationType] }));
} else {
definedOperationTypes.set(operation, operationType);
}
}
return false;
}
}
var init_UniqueOperationTypesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs
function UniqueTypeNamesRule(context) {
const knownTypeNames = /* @__PURE__ */ new Map();
const schema = context.getSchema();
return {
ScalarTypeDefinition: checkTypeName,
ObjectTypeDefinition: checkTypeName,
InterfaceTypeDefinition: checkTypeName,
UnionTypeDefinition: checkTypeName,
EnumTypeDefinition: checkTypeName,
InputObjectTypeDefinition: checkTypeName
};
function checkTypeName(node) {
const typeName = node.name.value;
if (schema?.getType(typeName)) {
context.reportError(new GraphQLError(`Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, { nodes: node.name }));
return;
}
const knownNameNode = knownTypeNames.get(typeName);
if (knownNameNode != null) {
context.reportError(new GraphQLError(`There can be only one type named "${typeName}".`, {
nodes: [knownNameNode, node.name]
}));
} else {
knownTypeNames.set(typeName, node.name);
}
return false;
}
}
var init_UniqueTypeNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs"() {
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs
function UniqueVariableNamesRule(context) {
return {
OperationDefinition(operationNode) {
const variableDefinitions = operationNode.variableDefinitions ?? [];
const seenVariableDefinitions = groupBy(variableDefinitions, (node) => node.variable.name.value);
for (const [variableName, variableNodes] of seenVariableDefinitions) {
if (variableNodes.length > 1) {
context.reportError(new GraphQLError(`There can be only one variable named "$${variableName}".`, { nodes: variableNodes.map((node) => node.variable.name) }));
}
}
}
};
}
var init_UniqueVariableNamesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs"() {
init_groupBy();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs
function ValuesOfCorrectTypeRule(context) {
return {
NullValue: (node) => isValidValueNode(context, node, context.getInputType()),
ListValue: (node) => isValidValueNode(context, node, context.getParentInputType()),
ObjectValue: (node) => isValidValueNode(context, node, context.getInputType()),
EnumValue: (node) => isValidValueNode(context, node, context.getInputType()),
IntValue: (node) => isValidValueNode(context, node, context.getInputType()),
FloatValue: (node) => isValidValueNode(context, node, context.getInputType()),
StringValue: (node) => isValidValueNode(context, node, context.getInputType()),
BooleanValue: (node) => isValidValueNode(context, node, context.getInputType())
};
}
function isValidValueNode(context, node, inputType) {
if (inputType) {
validateInputLiteral(node, inputType, (error) => {
context.reportError(error);
}, void 0, void 0, context.hideSuggestions);
}
return false;
}
var init_ValuesOfCorrectTypeRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs"() {
init_validateInputValue();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs
function VariablesAreInputTypesRule(context) {
return {
VariableDefinition(node) {
const type = typeFromAST(context.getSchema(), node.type);
if (type !== void 0 && !isInputType(type)) {
const variableName = node.variable.name.value;
const typeName = print(node.type);
context.reportError(new GraphQLError(`Variable "$${variableName}" cannot be non-input type "${typeName}".`, { nodes: node.type }));
}
}
};
}
var init_VariablesAreInputTypesRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs"() {
init_GraphQLError();
init_printer();
init_definition();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs
function VariablesInAllowedPositionRule(context) {
let varDefMap;
return {
OperationDefinition: {
enter(operation) {
varDefMap = /* @__PURE__ */ new Map();
if (operation.variableDefinitions) {
for (const varDef of operation.variableDefinitions) {
varDefMap.set(varDef.variable.name.value, varDef);
}
}
},
leave(operation) {
const usages = context.getRecursiveVariableUsages(operation);
for (const { node, type, parentType, defaultValue, fragmentVariableDefinition } of usages) {
const varName = node.name.value;
let varDef = fragmentVariableDefinition;
varDef ??= varDefMap.get(varName);
if (varDef && type) {
const schema = context.getSchema();
const varType = typeFromAST(schema, varDef.type);
if (varType && !allowedVariableUsage(schema, varType, varDef.defaultValue, type, defaultValue)) {
context.reportError(new GraphQLError(`Variable "$${varName}" of type "${varType}" used in position expecting type "${type}".`, { nodes: [varDef, node] }));
}
if (isInputObjectType(parentType) && parentType.isOneOf && isNullableType(varType)) {
context.reportError(new GraphQLError(`Variable "$${varName}" is of type "${varType}" but must be non-nullable to be used for OneOf Input Object "${parentType}".`, { nodes: [varDef, node] }));
}
}
}
}
}
};
}
function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) {
if (isNonNullType(locationType) && !isNonNullType(varType)) {
const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== kinds_exports.NULL;
const hasLocationDefaultValue = locationDefaultValue !== void 0;
if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {
return false;
}
const nullableLocationType = locationType.ofType;
return isTypeSubTypeOf(schema, varType, nullableLocationType);
}
return isTypeSubTypeOf(schema, varType, locationType);
}
var init_VariablesInAllowedPositionRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs"() {
init_GraphQLError();
init_kinds2();
init_definition();
init_typeComparators();
init_typeFromAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/specifiedRules.mjs
var recommendedRules, specifiedRules, specifiedSDLRules;
var init_specifiedRules = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/specifiedRules.mjs"() {
init_DeferStreamDirectiveLabelRule();
init_DeferStreamDirectiveOnRootFieldRule();
init_DeferStreamDirectiveOnValidOperationsRule();
init_ExecutableDefinitionsRule();
init_FieldsOnCorrectTypeRule();
init_FragmentsOnCompositeTypesRule();
init_KnownArgumentNamesRule();
init_KnownDirectivesRule();
init_KnownFragmentNamesRule();
init_KnownOperationTypesRule();
init_KnownTypeNamesRule();
init_LoneAnonymousOperationRule();
init_LoneSchemaDefinitionRule();
init_MaxIntrospectionDepthRule();
init_NoFragmentCyclesRule();
init_NoUndefinedVariablesRule();
init_NoUnusedFragmentsRule();
init_NoUnusedVariablesRule();
init_OverlappingFieldsCanBeMergedRule();
init_PossibleFragmentSpreadsRule();
init_PossibleTypeExtensionsRule();
init_ProvidedRequiredArgumentsRule();
init_ScalarLeafsRule();
init_SingleFieldSubscriptionsRule();
init_StreamDirectiveOnListFieldRule();
init_UniqueArgumentDefinitionNamesRule();
init_UniqueArgumentNamesRule();
init_UniqueDirectiveNamesRule();
init_UniqueDirectivesPerLocationRule();
init_UniqueEnumValueNamesRule();
init_UniqueFieldDefinitionNamesRule();
init_UniqueFragmentNamesRule();
init_UniqueInputFieldNamesRule();
init_UniqueOperationNamesRule();
init_UniqueOperationTypesRule();
init_UniqueTypeNamesRule();
init_UniqueVariableNamesRule();
init_ValuesOfCorrectTypeRule();
init_VariablesAreInputTypesRule();
init_VariablesInAllowedPositionRule();
recommendedRules = Object.freeze([
MaxIntrospectionDepthRule
]);
specifiedRules = Object.freeze([
ExecutableDefinitionsRule,
KnownOperationTypesRule,
UniqueOperationNamesRule,
LoneAnonymousOperationRule,
SingleFieldSubscriptionsRule,
KnownTypeNamesRule,
FragmentsOnCompositeTypesRule,
VariablesAreInputTypesRule,
ScalarLeafsRule,
FieldsOnCorrectTypeRule,
UniqueFragmentNamesRule,
KnownFragmentNamesRule,
NoUnusedFragmentsRule,
PossibleFragmentSpreadsRule,
NoFragmentCyclesRule,
UniqueVariableNamesRule,
NoUndefinedVariablesRule,
NoUnusedVariablesRule,
KnownDirectivesRule,
UniqueDirectivesPerLocationRule,
DeferStreamDirectiveOnRootFieldRule,
DeferStreamDirectiveOnValidOperationsRule,
DeferStreamDirectiveLabelRule,
StreamDirectiveOnListFieldRule,
KnownArgumentNamesRule,
UniqueArgumentNamesRule,
ValuesOfCorrectTypeRule,
ProvidedRequiredArgumentsRule,
VariablesInAllowedPositionRule,
OverlappingFieldsCanBeMergedRule,
UniqueInputFieldNamesRule,
...recommendedRules
]);
specifiedSDLRules = Object.freeze([
LoneSchemaDefinitionRule,
UniqueOperationTypesRule,
UniqueTypeNamesRule,
UniqueEnumValueNamesRule,
UniqueFieldDefinitionNamesRule,
UniqueArgumentDefinitionNamesRule,
UniqueDirectiveNamesRule,
KnownTypeNamesRule,
KnownDirectivesRule,
UniqueDirectivesPerLocationRule,
PossibleTypeExtensionsRule,
KnownArgumentNamesOnDirectivesRule,
UniqueArgumentNamesRule,
UniqueInputFieldNamesRule,
ProvidedRequiredArgumentsOnDirectivesRule
]);
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/SetMap.mjs
var SetMap2;
var init_SetMap = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/SetMap.mjs"() {
SetMap2 = class {
constructor() {
this._entries = /* @__PURE__ */ new Map();
this._memberIds = /* @__PURE__ */ new Map();
this._nextMemberId = 0;
}
get size() {
return this._entries.size;
}
get(members) {
return this._entries.get(this._key(members))?.value;
}
getOrInsert(members, value) {
const key = this._key(members);
const entry = this._entries.get(key);
if (entry !== void 0) {
return entry.value;
}
this._entries.set(key, { members, value });
return value;
}
getOrInsertComputed(members, computeValue) {
const entry = this._entries.get(this._key(members));
if (entry !== void 0) {
return entry.value;
}
const value = computeValue(members);
this.set(members, value);
return value;
}
has(members) {
return this._entries.has(this._key(members));
}
set(members, value) {
const key = this._key(members);
const entry = this._entries.get(key);
if (entry !== void 0) {
entry.value = value;
return this;
}
this._entries.set(key, { members, value });
return this;
}
*keys() {
for (const entry of this._entries.values()) {
yield entry.members;
}
}
*values() {
for (const entry of this._entries.values()) {
yield entry.value;
}
}
*entries() {
for (const entry of this._entries.values()) {
yield [entry.members, entry.value];
}
}
[Symbol.iterator]() {
return this.entries();
}
_key(members) {
const ids = [];
for (const member of members) {
let id = this._memberIds.get(member);
if (id === void 0) {
id = this._nextMemberId++;
this._memberIds.set(member, id);
}
ids.push(id);
}
ids.sort((id1, id2) => id1 - id2);
return ids.join(",");
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/ValidationContext.mjs
var ASTValidationContext, SDLValidationContext, ValidationContext;
var init_ValidationContext = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/ValidationContext.mjs"() {
init_SetMap();
init_kinds2();
init_visitor();
init_TypeInfo();
init_validationAbortedError();
ASTValidationContext = class {
constructor(ast, onError) {
this._remainingFragmentWork = 5e4;
this._ast = ast;
this._fragments = void 0;
this._fragmentSpreads = /* @__PURE__ */ new Map();
this._recursivelyReferencedFragments = new SetMap2();
this._onError = onError;
}
get [Symbol.toStringTag]() {
return "ASTValidationContext";
}
reportError(error) {
this._onError(error);
}
getDocument() {
return this._ast;
}
getFragment(name) {
let fragments;
if (this._fragments) {
fragments = this._fragments;
} else {
fragments = /* @__PURE__ */ Object.create(null);
for (const defNode of this.getDocument().definitions) {
if (defNode.kind === kinds_exports.FRAGMENT_DEFINITION) {
fragments[defNode.name.value] = defNode;
}
}
this._fragments = fragments;
}
return fragments[name];
}
getFragmentSpreads(node) {
let spreads = this._fragmentSpreads.get(node);
if (!spreads) {
spreads = [];
const setsToVisit = [node];
let set;
while (set = setsToVisit.pop()) {
for (const selection of set.selections) {
if (selection.kind === kinds_exports.FRAGMENT_SPREAD) {
spreads.push(selection);
} else if (selection.selectionSet) {
setsToVisit.push(selection.selectionSet);
}
}
}
this._fragmentSpreads.set(node, spreads);
}
return spreads;
}
getRecursivelyReferencedFragments(operation) {
return this.getRecursivelyReferencedFragmentsForOperations([operation]);
}
getRecursivelyReferencedFragmentsForOperations(operations) {
const fragmentNames = new Set(operations.flatMap(({ selectionSet }) => this.getFragmentSpreads(selectionSet).map(({ name }) => name.value)));
let fragments = this._recursivelyReferencedFragments.get(fragmentNames);
if (!fragments) {
fragments = [];
this.spendFragmentWork(fragmentNames.size);
const collectedNames = new Set(fragmentNames);
for (const fragName of collectedNames) {
const fragment = this.getFragment(fragName);
if (fragment) {
fragments.push(fragment);
const spreads = this.getFragmentSpreads(fragment.selectionSet);
this.spendFragmentWork(spreads.length);
for (const spread of spreads) {
collectedNames.add(spread.name.value);
}
}
}
this._recursivelyReferencedFragments.set(fragmentNames, fragments);
}
return fragments;
}
spendFragmentWork(cost) {
this._remainingFragmentWork -= cost;
if (this._remainingFragmentWork < 0) {
throw validationAbortedError;
}
}
};
SDLValidationContext = class extends ASTValidationContext {
constructor(ast, schema, onError) {
super(ast, onError);
this._schema = schema;
}
get hideSuggestions() {
return false;
}
get [Symbol.toStringTag]() {
return "SDLValidationContext";
}
getSchema() {
return this._schema;
}
};
ValidationContext = class extends ASTValidationContext {
constructor(schema, ast, typeInfo, onError, hideSuggestionsOrOptions) {
const options = typeof hideSuggestionsOrOptions === "boolean" ? { hideSuggestions: hideSuggestionsOrOptions } : hideSuggestionsOrOptions ?? {};
const { hideSuggestions, allowEmptySelectionSets } = options;
super(ast, onError);
this._schema = schema;
this._typeInfo = typeInfo;
this._variableUsages = /* @__PURE__ */ new Map();
this._recursiveVariableUsages = /* @__PURE__ */ new Map();
this._hideSuggestions = hideSuggestions ?? false;
this._allowEmptySelectionSets = allowEmptySelectionSets ?? true;
}
get [Symbol.toStringTag]() {
return "ValidationContext";
}
get hideSuggestions() {
return this._hideSuggestions;
}
get allowEmptySelectionSets() {
return this._allowEmptySelectionSets;
}
getSchema() {
return this._schema;
}
getVariableUsages(node) {
let usages = this._variableUsages.get(node);
if (!usages) {
const newUsages = [];
const typeInfo = new TypeInfo(this._schema, void 0, this._typeInfo.getFragmentSignatureByName());
const fragmentDefinition = node.kind === kinds_exports.FRAGMENT_DEFINITION ? node : void 0;
visit(node, visitWithTypeInfo(typeInfo, {
VariableDefinition: () => false,
Variable(variable) {
let fragmentVariableDefinition;
if (fragmentDefinition) {
const fragmentSignature = typeInfo.getFragmentSignatureByName()(fragmentDefinition.name.value);
fragmentVariableDefinition = fragmentSignature?.variableDefinitions.get(variable.name.value);
}
newUsages.push({
node: variable,
type: typeInfo.getInputType(),
parentType: typeInfo.getParentInputType(),
defaultValue: typeInfo.getDefaultValue(),
fragmentVariableDefinition
});
}
}));
usages = newUsages;
this._variableUsages.set(node, usages);
}
return usages;
}
getRecursiveVariableUsages(operation) {
let usages = this._recursiveVariableUsages.get(operation);
if (!usages) {
const fragments = this.getRecursivelyReferencedFragments(operation);
let fragmentUsages = this._recursiveVariableUsages.get(fragments);
if (!fragmentUsages) {
this.spendFragmentWork(fragments.length);
fragmentUsages = fragments.flatMap((frag) => {
const localUsages = this.getVariableUsages(frag);
this.spendFragmentWork(localUsages.length);
return localUsages;
});
this._recursiveVariableUsages.set(fragments, fragmentUsages);
}
this.spendFragmentWork(fragmentUsages.length);
usages = this.getVariableUsages(operation).concat(fragmentUsages);
this._recursiveVariableUsages.set(operation, usages);
}
return usages;
}
getType() {
return this._typeInfo.getType();
}
getParentType() {
return this._typeInfo.getParentType();
}
getInputType() {
return this._typeInfo.getInputType();
}
getParentInputType() {
return this._typeInfo.getParentInputType();
}
getFieldDef() {
return this._typeInfo.getFieldDef();
}
getDirective() {
return this._typeInfo.getDirective();
}
getArgument() {
return this._typeInfo.getArgument();
}
getFragmentSignature() {
return this._typeInfo.getFragmentSignature();
}
getFragmentSignatureByName() {
return this._typeInfo.getFragmentSignatureByName();
}
getEnumValue() {
return this._typeInfo.getEnumValue();
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/validate.mjs
function validate(schema, documentAST, rules = specifiedRules, options) {
return shouldTrace(validateChannel) ? validateChannel.traceSync(() => validateImpl(schema, documentAST, rules, options), { schema, document: documentAST }) : validateImpl(schema, documentAST, rules, options);
}
function validateImpl(schema, documentAST, rules, options) {
const maxErrors = options?.maxErrors ?? 100;
const hideSuggestions = options?.hideSuggestions ?? false;
const allowEmptySelectionSets = options?.allowEmptySelectionSets ?? true;
assertValidSchema(schema);
const errors = [];
const typeInfo = new TypeInfo(schema);
const context = new ValidationContext(schema, documentAST, typeInfo, (error) => {
if (errors.length >= maxErrors) {
throw tooManyValidationErrorsError;
}
errors.push(error);
}, { hideSuggestions, allowEmptySelectionSets });
const visitor = visitInParallel(rules.map((rule) => rule(context)));
try {
visit(documentAST, visitWithTypeInfo(typeInfo, visitor), QueryDocumentKeysToValidate);
} catch (e) {
if (e === tooManyValidationErrorsError || e === validationAbortedError) {
errors.push(e);
} else {
throw e;
}
}
return errors;
}
function validateSDL(documentAST, schemaToExtend, rules = specifiedSDLRules) {
const errors = [];
const context = new SDLValidationContext(documentAST, schemaToExtend, (error) => {
errors.push(error);
});
const visitors = rules.map((rule) => rule(context));
visit(documentAST, visitInParallel(visitors));
return errors;
}
function assertValidSDL(documentAST) {
const errors = validateSDL(documentAST);
if (errors.length !== 0) {
throw new Error(errors.map((error) => error.message).join("\n\n"));
}
}
function assertValidSDLExtension(documentAST, schema) {
const errors = validateSDL(documentAST, schema);
if (errors.length !== 0) {
throw new Error(errors.map((error) => error.message).join("\n\n"));
}
}
var QueryDocumentKeysToValidate, tooManyValidationErrorsError;
var init_validate2 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/validate.mjs"() {
init_mapValue();
init_GraphQLError();
init_ast();
init_visitor();
init_validate();
init_TypeInfo();
init_diagnostics();
init_specifiedRules();
init_validationAbortedError();
init_ValidationContext();
QueryDocumentKeysToValidate = mapValue(QueryDocumentKeys, (keys) => keys.filter((key) => key !== "description"));
tooManyValidationErrorsError = new GraphQLError("Too many validation errors, error limit reached. Validation aborted.");
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isAsyncIterable.mjs
function isAsyncIterable(maybeAsyncIterable) {
return typeof maybeAsyncIterable?.[Symbol.asyncIterator] === "function";
}
var init_isAsyncIterable = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isAsyncIterable.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/locatedError.mjs
function locatedError(rawOriginalError, nodes, path) {
const originalError = toError(rawOriginalError);
if (isLocatedGraphQLError(originalError)) {
return originalError;
}
return new GraphQLError(originalError.message, {
nodes: originalError.nodes ?? nodes,
source: originalError.source,
positions: originalError.positions,
path,
originalError
});
}
function isLocatedGraphQLError(error) {
return Array.isArray(error.path);
}
var init_locatedError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/locatedError.mjs"() {
init_toError();
init_GraphQLError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/index.mjs
var init_type = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/type/index.mjs"() {
init_schema();
init_definition();
init_directives();
init_scalars();
init_introspection();
init_validate();
init_assertName();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getOperationAST.mjs
function getOperationAST(documentAST, operationName) {
let operation = null;
for (const definition of documentAST.definitions) {
if (definition.kind === kinds_exports.OPERATION_DEFINITION) {
if (operationName == null) {
if (operation) {
return null;
}
operation = definition;
} else if (definition.name?.value === operationName) {
return definition;
}
}
}
return operation;
}
var init_getOperationAST = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getOperationAST.mjs"() {
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/buildResolveInfo.mjs
function buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, parentType, path, getAbortSignal, getAsyncHelpers) {
const { schema, fragmentDefinitions, rootValue, operation, variableValues } = validatedExecutionArgs;
return {
fieldName: fieldDef.name,
fieldNodes,
returnType: fieldDef.type,
parentType,
path,
schema,
fragments: fragmentDefinitions,
rootValue,
operation,
variableValues,
getAbortSignal,
getAsyncHelpers
};
}
var init_buildResolveInfo = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/buildResolveInfo.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseWithResolvers.mjs
function promiseWithResolvers() {
let resolve2;
let reject;
const promise = new Promise((res, rej) => {
resolve2 = res;
reject = rej;
});
return { promise, resolve: resolve2, reject };
}
var init_promiseWithResolvers = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseWithResolvers.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/cancellablePromise.mjs
function withCancellation(originalPromise) {
const { promise, resolve: resolve2, reject } = promiseWithResolvers();
let settled = false;
const settleResolve = (value) => {
if (settled) {
return;
}
settled = true;
resolve2(value);
};
const settleReject = (error) => {
if (settled) {
return;
}
settled = true;
reject(error);
};
originalPromise.then(settleResolve, settleReject);
return {
promise,
abort(reason) {
settleReject(reason);
}
};
}
function cancellablePromise(promise, abortSignal) {
const withAbort = withCancellation(promise);
if (abortSignal.aborted) {
withAbort.abort(abortSignal.reason);
return withAbort.promise;
}
const onAbort = () => {
abortSignal.removeEventListener("abort", onAbort);
withAbort.abort(abortSignal.reason);
};
abortSignal.addEventListener("abort", onAbort);
withAbort.promise.then(() => {
abortSignal.removeEventListener("abort", onAbort);
}, () => {
abortSignal.removeEventListener("abort", onAbort);
});
return withAbort.promise;
}
var init_cancellablePromise = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/cancellablePromise.mjs"() {
init_promiseWithResolvers();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/AsyncWorkTracker.mjs
var AsyncWorkTracker;
var init_AsyncWorkTracker = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/AsyncWorkTracker.mjs"() {
init_isPromise();
AsyncWorkTracker = class {
constructor() {
this.pendingAsyncWork = /* @__PURE__ */ new Set();
}
add(promiseLike) {
const pendingAsyncWork = this.pendingAsyncWork;
const promiseToSettle = promiseLike.then(() => {
pendingAsyncWork.delete(promiseToSettle);
}, () => {
pendingAsyncWork.delete(promiseToSettle);
});
pendingAsyncWork.add(promiseToSettle);
}
addValues(values) {
for (const value of values) {
if (isPromiseLike(value)) {
this.add(value);
}
}
}
wait() {
if (this.pendingAsyncWork.size === 0) {
return;
}
return this.waitForPendingAsyncWork();
}
promiseAllTrackOnReject(values) {
const promise = Promise.all(values);
promise.then(void 0, () => {
this.addValues(values);
});
return promise;
}
async waitForPendingAsyncWork() {
while (this.pendingAsyncWork.size > 0) {
await Promise.allSettled(Array.from(this.pendingAsyncWork));
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/createSharedExecutionContext.mjs
function createSharedExecutionContext(abortSignal) {
const asyncWorkTracker = new AsyncWorkTracker();
let resolveInfoHelpers;
const promiseAll = (values) => asyncWorkTracker.promiseAllTrackOnReject(values);
const getAsyncHelpers = () => resolveInfoHelpers ??= {
promiseAll,
track: (maybePromises) => asyncWorkTracker.addValues(maybePromises)
};
return {
asyncWorkTracker,
getAbortSignal: () => abortSignal,
getAsyncHelpers,
promiseAll
};
}
var init_createSharedExecutionContext = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/createSharedExecutionContext.mjs"() {
init_AsyncWorkTracker();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize2.mjs
function memoize2(fn2) {
let cache0;
return function memoized(a1, a2) {
cache0 ??= /* @__PURE__ */ new WeakMap();
let cache1 = cache0.get(a1);
if (cache1 === void 0) {
cache1 = /* @__PURE__ */ new WeakMap();
cache0.set(a1, cache1);
}
let fnResult = cache1.get(a2);
if (fnResult === void 0) {
fnResult = fn2(a1, a2);
cache1.set(a2, fnResult);
}
return fnResult;
};
}
var init_memoize2 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize2.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize3.mjs
function memoize3(fn2) {
let cache0;
return function memoized(a1, a2, a3) {
cache0 ??= /* @__PURE__ */ new WeakMap();
let cache1 = cache0.get(a1);
if (cache1 === void 0) {
cache1 = /* @__PURE__ */ new WeakMap();
cache0.set(a1, cache1);
}
let cache2 = cache1.get(a2);
if (cache2 === void 0) {
cache2 = /* @__PURE__ */ new WeakMap();
cache1.set(a2, cache2);
}
let fnResult = cache2.get(a3);
if (fnResult === void 0) {
fnResult = fn2(a1, a2, a3);
cache2.set(a3, fnResult);
}
return fnResult;
};
}
var init_memoize3 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize3.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseForObject.mjs
function promiseForObject(object, promiseAll) {
const keys = Object.keys(object);
const values = Object.values(object);
return promiseAll(values).then((resolvedValues) => {
const resolvedObject = /* @__PURE__ */ Object.create(null);
for (let i = 0; i < keys.length; ++i) {
resolvedObject[keys[i]] = resolvedValues[i];
}
return resolvedObject;
});
}
var init_promiseForObject = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseForObject.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseReduce.mjs
function promiseReduce(values, callbackFn, initialValue) {
let accumulator = initialValue;
for (const value of values) {
accumulator = isPromise(accumulator) ? accumulator.then((resolved) => callbackFn(resolved, value)) : callbackFn(accumulator, value);
}
return accumulator;
}
var init_promiseReduce = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/promiseReduce.mjs"() {
init_isPromise();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs
function getAbortReasonMessage(reason) {
if (reason instanceof Error) {
return reason.message;
}
if (typeof reason === "object" && reason !== null && "message" in reason && typeof reason.message === "string") {
return reason.message;
}
return String(reason);
}
var AbortedGraphQLExecutionError;
var init_AbortedGraphQLExecutionError = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/AbortedGraphQLExecutionError.mjs"() {
AbortedGraphQLExecutionError = class extends Error {
constructor(reason, result) {
super(getAbortReasonMessage(reason), { cause: reason });
this.name = "AbortedGraphQLExecutionError";
this.abortedResult = result;
}
get [Symbol.toStringTag]() {
return "AbortedGraphQLExecutionError";
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/collectIteratorPromises.mjs
function collectIteratorPromises(iterator) {
const promises = [];
try {
while (true) {
const iteration = iterator.next();
if (iteration.done) {
return promises;
}
if (isPromiseLike(iteration.value)) {
promises.push(iteration.value);
}
}
} catch {
return promises;
}
}
var init_collectIteratorPromises = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/collectIteratorPromises.mjs"() {
init_isPromise();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/getStreamUsage.mjs
function getStreamUsage(validatedExecutionArgs, fieldDetailsList) {
const { operation, variableValues } = validatedExecutionArgs;
const stream = getDirectiveValues(GraphQLStreamDirective, fieldDetailsList[0].node, variableValues, fieldDetailsList[0].fragmentVariableValues);
if (!stream) {
return;
}
if (stream.if === false) {
return;
}
if (!(typeof stream.initialCount === "number"))
invariant(false, "initialCount must be a number");
if (!(stream.initialCount >= 0))
invariant(false, "initialCount must be a positive integer");
if (!(operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");
const streamedFieldDetailsList = fieldDetailsList.map((fieldDetails) => ({
node: fieldDetails.node,
deferUsage: void 0,
fragmentVariableValues: fieldDetails.fragmentVariableValues
}));
return {
initialCount: stream.initialCount,
label: typeof stream.label === "string" ? stream.label : void 0,
fieldDetailsList: streamedFieldDetailsList
};
}
var init_getStreamUsage = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/getStreamUsage.mjs"() {
init_invariant();
init_ast();
init_directives();
init_values();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/hooks.mjs
function runHookSafely(hook, info) {
try {
hook?.(info);
} catch {
}
}
function runAsyncWorkFinishedHook(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook) {
const maybeWaitForAsyncWork = sharedExecutionContext.asyncWorkTracker.wait();
if (maybeWaitForAsyncWork === void 0) {
runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });
return;
}
maybeWaitForAsyncWork.then(() => {
runHookSafely(asyncWorkFinishedHook, { validatedExecutionArgs });
}).catch(() => void 0);
}
var init_hooks = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/hooks.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs
async function returnIteratorCatchingErrors(iterator) {
try {
await iterator.return?.();
} catch {
}
}
var init_returnIteratorCatchingErrors = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/returnIteratorCatchingErrors.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/Executor.mjs
function toNodes2(fieldDetailsList) {
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
}
var collectSubfields2, getStreamUsage2, CollectedErrors, defaultAbortReason, Executor;
var init_Executor = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/Executor.mjs"() {
init_inspect();
init_invariant();
init_isAsyncIterable();
init_isIterableObject();
init_isPromise();
init_memoize2();
init_memoize3();
init_Path();
init_promiseForObject();
init_promiseReduce();
init_ensureGraphQLError();
init_GraphQLError();
init_locatedError();
init_ast();
init_definition();
init_diagnostics();
init_AbortedGraphQLExecutionError();
init_buildResolveInfo();
init_cancellablePromise();
init_collectFields();
init_collectIteratorPromises();
init_createSharedExecutionContext();
init_getStreamUsage();
init_hooks();
init_returnIteratorCatchingErrors();
init_values();
collectSubfields2 = memoize3((validatedExecutionArgs, returnType, fieldDetailsList) => {
const { schema, fragments, variableValues, hideSuggestions } = validatedExecutionArgs;
return collectSubfields(schema, fragments, variableValues, returnType, fieldDetailsList, hideSuggestions);
});
getStreamUsage2 = memoize2((validatedExecutionArgs, fieldDetailsList) => getStreamUsage(validatedExecutionArgs, fieldDetailsList));
CollectedErrors = class {
constructor() {
this._errorPositions = /* @__PURE__ */ new Set();
this._errors = [];
}
get errors() {
return this._errors;
}
add(error, path) {
if (this.hasNulledPosition(path)) {
return;
}
this._errorPositions.add(path);
this._errors.push(error);
}
hasNulledPosition(startPath) {
let path = startPath;
while (path !== void 0) {
if (this._errorPositions.has(path)) {
return true;
}
path = path.prev;
}
return this._errorPositions.has(void 0);
}
};
defaultAbortReason = new Error("This operation was aborted");
Executor = class {
constructor(validatedExecutionArgs, sharedExecutionContext) {
this.validatedExecutionArgs = validatedExecutionArgs;
this.aborted = false;
this.abortReason = defaultAbortReason;
this.collectedErrors = new CollectedErrors();
if (sharedExecutionContext === void 0) {
this.resolverAbortController = new AbortController();
this.sharedExecutionContext = createSharedExecutionContext(this.resolverAbortController.signal);
} else {
this.sharedExecutionContext = sharedExecutionContext;
}
const { getAbortSignal, getAsyncHelpers, promiseAll } = this.sharedExecutionContext;
this.getAbortSignal = getAbortSignal;
this.getAsyncHelpers = getAsyncHelpers;
this.promiseAll = promiseAll;
}
executeRootSelectionSet(serially) {
if (!shouldTrace(executeRootSelectionSetChannel)) {
return this.executeRootSelectionSetImpl(serially);
}
return traceMixed(executeRootSelectionSetChannel, this.buildExecuteContextFromValidatedArgs(this.validatedExecutionArgs), () => this.executeRootSelectionSetImpl(serially));
}
buildExecuteContextFromValidatedArgs(args) {
return {
schema: args.schema,
document: args.document,
operation: args.operation,
rawVariableValues: args.rawVariableValues,
operationName: args.operation.name?.value,
operationType: args.operation.operation
};
}
executeRootSelectionSetImpl(serially) {
const externalAbortSignal = this.validatedExecutionArgs.externalAbortSignal;
let removeExternalAbortListener;
if (externalAbortSignal) {
externalAbortSignal.throwIfAborted();
const onExternalAbort = () => {
this.abort(externalAbortSignal.reason);
};
removeExternalAbortListener = () => externalAbortSignal.removeEventListener("abort", onExternalAbort);
externalAbortSignal.addEventListener("abort", onExternalAbort);
}
const maybeRemoveExternalAbortListener = () => {
removeExternalAbortListener?.();
};
let result;
try {
const { schema, fragments, rootValue, operation, variableValues, hideSuggestions } = this.validatedExecutionArgs;
const { operation: operationType, selectionSet } = operation;
const rootType = schema.getRootType(operationType);
if (rootType == null) {
throw new GraphQLError(`Schema is not configured to execute ${operationType} operation.`, { nodes: operation });
}
const { groupedFieldSet, newDeferUsages } = collectFields2(schema, fragments, variableValues, rootType, selectionSet, hideSuggestions);
result = this.executeCollectedRootFields(rootType, rootValue, groupedFieldSet, serially ?? operationType === OperationTypeNode.MUTATION, newDeferUsages);
if (isPromise(result)) {
const promise = result.then((data) => {
maybeRemoveExternalAbortListener();
return this.buildResponse(data);
}, (error) => {
maybeRemoveExternalAbortListener();
this.collectedErrors.add(ensureGraphQLError(error), void 0);
return this.buildResponse(null);
});
this.sharedExecutionContext.asyncWorkTracker.add(promise);
const { promise: cancellablePromise2, abort: abortResultPromise } = withCancellation(promise.then((resolved) => this.finish(resolved)));
this.abortResultPromise = () => {
abortResultPromise(this.createAbortedExecutionError(promise));
};
if (this.aborted) {
this.abortResultPromise();
}
return cancellablePromise2;
}
maybeRemoveExternalAbortListener();
} catch (error) {
maybeRemoveExternalAbortListener();
this.collectedErrors.add(ensureGraphQLError(error), void 0);
return this.finish(this.buildResponse(null));
}
return this.finish(this.buildResponse(result));
}
abort(reason) {
if (this.aborted) {
return;
}
this.aborted = true;
if (reason !== void 0) {
this.abortReason = reason;
}
this.abortResultPromise?.();
this.resolverAbortController?.abort(this.abortReason);
}
finish(result) {
if (this.aborted) {
throw this.createAbortedExecutionError(result);
}
this.aborted = true;
return result;
}
createAbortedExecutionError(result) {
return new AbortedGraphQLExecutionError(this.abortReason, result);
}
getFinishSharedExecution() {
const resolverAbortController = this.resolverAbortController;
const asyncWorkFinishedHook = this.validatedExecutionArgs.hooks?.asyncWorkFinished;
if (asyncWorkFinishedHook === void 0) {
return () => resolverAbortController?.abort();
}
const validatedExecutionArgs = this.validatedExecutionArgs;
const sharedExecutionContext = this.sharedExecutionContext;
return () => {
resolverAbortController?.abort();
runAsyncWorkFinishedHook(validatedExecutionArgs, sharedExecutionContext, asyncWorkFinishedHook);
};
}
buildResponse(data) {
this.getFinishSharedExecution()();
const errors = this.collectedErrors.errors;
return errors.length ? { errors, data } : { data };
}
executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, _newDeferUsages) {
return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, void 0);
}
executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, positionContext) {
return serially ? this.executeFieldsSerially(rootType, rootValue, void 0, groupedFieldSet, positionContext) : this.executeFields(rootType, rootValue, void 0, groupedFieldSet, positionContext);
}
executeFieldsSerially(parentType, sourceValue, path, groupedFieldSet, positionContext) {
let tracingChannel = shouldTrace(resolveChannel) ? resolveChannel : void 0;
return promiseReduce(groupedFieldSet, (results, [responseName, fieldDetailsList]) => {
if (this.aborted) {
throw new Error("Aborted!");
}
const fieldPath = addPath(path, responseName, parentType.name);
const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel);
if (result === void 0) {
return results;
}
if (isPromise(result)) {
return result.then((resolved) => {
results[responseName] = resolved;
tracingChannel = shouldTrace(resolveChannel) ? resolveChannel : void 0;
return results;
});
}
results[responseName] = result;
return results;
}, /* @__PURE__ */ Object.create(null));
}
executeFields(parentType, sourceValue, path, groupedFieldSet, positionContext) {
const results = /* @__PURE__ */ Object.create(null);
let containsPromise = false;
const tracingChannel = shouldTrace(resolveChannel) ? resolveChannel : void 0;
try {
for (const [responseName, fieldDetailsList] of groupedFieldSet) {
const fieldPath = addPath(path, responseName, parentType.name);
const result = this.executeField(parentType, sourceValue, fieldDetailsList, fieldPath, positionContext, tracingChannel);
if (result !== void 0) {
results[responseName] = result;
if (isPromise(result)) {
containsPromise = true;
}
}
}
} catch (error) {
if (containsPromise) {
this.sharedExecutionContext.asyncWorkTracker.addValues(Object.values(results));
}
throw error;
}
if (!containsPromise) {
return results;
}
return promiseForObject(results, this.promiseAll);
}
executeField(parentType, source, fieldDetailsList, path, positionContext, tracingChannel) {
const validatedExecutionArgs = this.validatedExecutionArgs;
const { schema, contextValue, variableValues, hideSuggestions } = validatedExecutionArgs;
const firstFieldDetails = fieldDetailsList[0];
const firstNode = firstFieldDetails.node;
const fieldName = firstNode.name.value;
const fieldDef = schema.getField(parentType, fieldName);
if (!fieldDef) {
return;
}
const returnType = fieldDef.type;
let resolveFn = fieldDef.resolve ?? validatedExecutionArgs.fieldResolver;
if (tracingChannel !== void 0) {
const originalResolveFn = resolveFn;
resolveFn = (s, args, c, info2) => traceMixed(tracingChannel, this.buildResolveContext(args, info2, fieldDef.resolve === void 0), () => originalResolveFn(s, args, c, info2));
}
const info = buildResolveInfo(validatedExecutionArgs, fieldDef, toNodes2(fieldDetailsList), parentType, path, this.getAbortSignal, this.getAsyncHelpers);
try {
const args = getArgumentValues(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions);
const result = resolveFn(source, args, contextValue, info);
if (isPromiseLike(result)) {
return this.completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext);
}
const completed = this.completeValue(returnType, fieldDetailsList, info, path, result, positionContext);
if (isPromise(completed)) {
return completed.then(void 0, (rawError) => {
this.handleFieldError(rawError, returnType, fieldDetailsList, path);
return null;
});
}
return completed;
} catch (rawError) {
this.handleFieldError(rawError, returnType, fieldDetailsList, path);
return null;
}
}
buildResolveContext(args, info, isDefaultResolver) {
let cachedFieldPath;
return {
fieldName: info.fieldName,
alias: String(info.path.key),
parentType: info.parentType.name,
fieldType: String(info.returnType),
args,
isDefaultResolver,
get fieldPath() {
cachedFieldPath ??= pathToArray(info.path).join(".");
return cachedFieldPath;
}
};
}
handleFieldError(rawError, returnType, fieldDetailsList, path) {
const error = locatedError(rawError, toNodes2(fieldDetailsList), pathToArray(path));
if (this.validatedExecutionArgs.errorPropagation && isNonNullType(returnType)) {
throw error;
}
this.collectedErrors.add(error, path);
}
completeValue(returnType, fieldDetailsList, info, path, result, positionContext) {
if (result instanceof Error) {
throw result;
}
if (isNonNullType(returnType)) {
const completed = this.completeValue(returnType.ofType, fieldDetailsList, info, path, result, positionContext);
if (completed === null) {
throw new Error(`Cannot return null for non-nullable field ${info.parentType}.${info.fieldName}.`);
}
return completed;
}
if (result == null) {
return null;
}
if (isListType(returnType)) {
return this.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext);
}
if (isLeafType(returnType)) {
return this.completeLeafValue(returnType, result);
}
if (isAbstractType(returnType)) {
return this.completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext);
}
if (isObjectType(returnType)) {
return this.completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext);
}
invariant(false, "Cannot complete value of unexpected output type: " + inspect(returnType));
}
async completePromisedValue(returnType, fieldDetailsList, info, path, result, positionContext) {
try {
const resolved = await result;
if (this.aborted) {
throw new Error("Aborted!");
}
let completed = this.completeValue(returnType, fieldDetailsList, info, path, resolved, positionContext);
if (isPromise(completed)) {
completed = await completed;
}
return completed;
} catch (rawError) {
this.handleFieldError(rawError, returnType, fieldDetailsList, path);
return null;
}
}
async completeAsyncIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) {
const streamUsage = typeof path.key === "number" ? void 0 : getStreamUsage2(this.validatedExecutionArgs, fieldDetailsList);
let containsPromise = false;
const completedResults = [];
const asyncIterator = items[Symbol.asyncIterator]();
let index = 0;
let iteration;
try {
while (true) {
if (streamUsage?.initialCount === index && this.handleStream(index, path, { handle: asyncIterator, isAsync: true }, streamUsage, info, itemType)) {
break;
}
const itemPath = addPath(path, index, void 0);
try {
iteration = await asyncIterator.next();
} catch (rawError) {
throw locatedError(rawError, toNodes2(fieldDetailsList), pathToArray(path));
}
if (this.aborted || iteration.done) {
break;
}
const item = iteration.value;
if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) {
containsPromise = true;
}
index++;
}
} catch (error) {
this.sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(asyncIterator));
if (containsPromise) {
this.sharedExecutionContext.asyncWorkTracker.addValues(completedResults);
}
throw error;
}
if (this.aborted) {
if (!iteration?.done) {
this.sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(asyncIterator));
}
throw new Error("Aborted!");
}
return containsPromise ? this.promiseAll(completedResults) : completedResults;
}
handleStream(_index, _path, _iterator, _streamUsage, _info, _itemType) {
return false;
}
completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) {
const itemType = returnType.ofType;
if (isAsyncIterable(result)) {
return this.completeAsyncIterableValue(itemType, fieldDetailsList, info, path, result, positionContext);
}
if (!isIterableObject(result)) {
throw new GraphQLError(`Expected Iterable, but did not find one for field "${info.parentType}.${info.fieldName}".`);
}
return this.completeIterableValue(itemType, fieldDetailsList, info, path, result, positionContext);
}
completeIterableValue(itemType, fieldDetailsList, info, path, items, positionContext) {
const streamUsage = typeof path.key === "number" ? void 0 : getStreamUsage2(this.validatedExecutionArgs, fieldDetailsList);
let containsPromise = false;
const completedResults = [];
let index = 0;
const iterator = items[Symbol.iterator]();
try {
while (true) {
if (streamUsage?.initialCount === index && this.handleStream(index, path, { handle: iterator }, streamUsage, info, itemType)) {
break;
}
const iteration = iterator.next();
if (iteration.done) {
break;
}
const item = iteration.value;
const itemPath = addPath(path, index, void 0);
if (this.completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) {
containsPromise = true;
}
index++;
}
} catch (error) {
const asyncWorkTracker = this.sharedExecutionContext.asyncWorkTracker;
if (containsPromise) {
asyncWorkTracker.addValues(completedResults);
}
asyncWorkTracker.addValues(collectIteratorPromises(iterator));
throw error;
}
return containsPromise ? this.promiseAll(completedResults) : completedResults;
}
completeMaybePromisedListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) {
if (isPromiseLike(item)) {
completedResults.push(this.completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext));
return true;
} else if (this.completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext)) {
return true;
}
return false;
}
completeListItemValue(item, completedResults, itemType, fieldDetailsList, info, itemPath, positionContext) {
try {
const completedItem = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, positionContext);
if (isPromise(completedItem)) {
completedResults.push(completedItem.then(void 0, (rawError) => {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
return null;
}));
return true;
}
completedResults.push(completedItem);
} catch (rawError) {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
completedResults.push(null);
}
return false;
}
async completePromisedListItemValue(item, itemType, fieldDetailsList, info, itemPath, positionContext) {
try {
const resolved = await item;
if (this.aborted) {
throw new Error("Aborted!");
}
let completed = this.completeValue(itemType, fieldDetailsList, info, itemPath, resolved, positionContext);
if (isPromise(completed)) {
completed = await completed;
}
return completed;
} catch (rawError) {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
return null;
}
}
completeLeafValue(returnType, result) {
const coerced = returnType.coerceOutputValue(result);
if (coerced == null) {
throw new Error(`Expected \`${inspect(returnType)}.coerceOutputValue(${inspect(result)})\` to return non-nullable value, returned: ${inspect(coerced)}`);
}
return coerced;
}
completeAbstractValue(returnType, fieldDetailsList, info, path, result, positionContext) {
const validatedExecutionArgs = this.validatedExecutionArgs;
const { schema, contextValue } = validatedExecutionArgs;
const resolveTypeFn = returnType.resolveType ?? validatedExecutionArgs.typeResolver;
const runtimeType = resolveTypeFn(result, contextValue, info, returnType);
if (isPromiseLike(runtimeType)) {
return runtimeType.then((resolvedRuntimeType) => {
if (this.aborted) {
throw new Error("Aborted!");
}
return this.completeObjectValue(this.ensureValidRuntimeType(resolvedRuntimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext);
});
}
return this.completeObjectValue(this.ensureValidRuntimeType(runtimeType, schema, returnType, fieldDetailsList, info, result), fieldDetailsList, info, path, result, positionContext);
}
ensureValidRuntimeType(runtimeTypeName, schema, returnType, fieldDetailsList, info, result) {
if (runtimeTypeName == null) {
throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}". Either the "${returnType}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: toNodes2(fieldDetailsList) });
}
if (typeof runtimeTypeName !== "string") {
throw new GraphQLError(`Abstract type "${returnType}" must resolve to an Object type at runtime for field "${info.parentType}.${info.fieldName}" with value ${inspect(result)}, received "${inspect(runtimeTypeName)}", which is not a valid Object type name.`);
}
const runtimeType = schema.getType(runtimeTypeName);
if (runtimeType == null) {
throw new GraphQLError(`Abstract type "${returnType}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: toNodes2(fieldDetailsList) });
}
if (!isObjectType(runtimeType)) {
throw new GraphQLError(`Abstract type "${returnType}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: toNodes2(fieldDetailsList) });
}
if (!schema.isSubType(returnType, runtimeType)) {
throw new GraphQLError(`Runtime Object type "${runtimeType}" is not a possible type for "${returnType}".`, { nodes: toNodes2(fieldDetailsList) });
}
return runtimeType;
}
completeObjectValue(returnType, fieldDetailsList, info, path, result, positionContext) {
if (returnType.isTypeOf) {
const isTypeOf = returnType.isTypeOf(result, this.validatedExecutionArgs.contextValue, info);
if (isPromiseLike(isTypeOf)) {
return isTypeOf.then((resolvedIsTypeOf) => {
if (this.aborted) {
throw new Error("Aborted!");
}
if (!resolvedIsTypeOf) {
throw this.invalidReturnTypeError(returnType, result, fieldDetailsList);
}
return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext);
});
}
if (!isTypeOf) {
throw this.invalidReturnTypeError(returnType, result, fieldDetailsList);
}
}
return this.collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext);
}
invalidReturnTypeError(returnType, result, fieldDetailsList) {
return new GraphQLError(`Expected value of type "${returnType}" but got: ${inspect(result)}.`, { nodes: toNodes2(fieldDetailsList) });
}
collectAndExecuteSubfields(returnType, fieldDetailsList, path, result, positionContext) {
const { groupedFieldSet, newDeferUsages } = collectSubfields2(this.validatedExecutionArgs, returnType, fieldDetailsList);
return this.executeCollectedSubfields(returnType, result, path, groupedFieldSet, newDeferUsages, positionContext);
}
executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, _newDeferUsages, _positionContext) {
return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, void 0);
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs
var UNEXPECTED_MULTIPLE_PAYLOADS, ExecutorThrowingOnIncremental;
var init_ExecutorThrowingOnIncremental = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/ExecutorThrowingOnIncremental.mjs"() {
init_invariant();
init_ast();
init_Executor();
UNEXPECTED_MULTIPLE_PAYLOADS = "Executing this GraphQL operation would unexpectedly produce multiple payloads (due to @defer or @stream directive)";
ExecutorThrowingOnIncremental = class extends Executor {
executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) {
if (newDeferUsages.length > 0) {
if (!(this.validatedExecutionArgs.operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");
const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
this.abort(reason);
throw reason;
}
return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, void 0);
}
executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages) {
if (newDeferUsages.length > 0) {
if (!(this.validatedExecutionArgs.operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");
const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
this.abort(reason);
throw reason;
}
return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, void 0);
}
completeListValue(returnType, fieldDetailsList, info, path, result, positionContext) {
const streamUsage = getStreamUsage2(this.validatedExecutionArgs, fieldDetailsList);
if (streamUsage !== void 0) {
if (!(this.validatedExecutionArgs.operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@stream` directive not supported on subscription operations. Disable `@stream` by setting the `if` argument to `false`.");
const reason = new Error(UNEXPECTED_MULTIPLE_PAYLOADS);
this.abort(reason);
throw reason;
}
return super.completeListValue(returnType, fieldDetailsList, info, path, result, positionContext);
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize1.mjs
function memoize1(fn2) {
let cache0;
return function memoized(a1) {
cache0 ??= /* @__PURE__ */ new WeakMap();
let fnResult = cache0.get(a1);
if (fnResult === void 0) {
fnResult = fn2(a1);
cache0.set(a1, fnResult);
}
return fnResult;
};
}
var init_memoize1 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/memoize1.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isSameSet.mjs
function isSameSet(setA, setB) {
if (setA.size !== setB.size) {
return false;
}
for (const item of setA) {
if (!setB.has(item)) {
return false;
}
}
return true;
}
var init_isSameSet = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/jsutils/isSameSet.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs
function buildExecutionPlan(originalGroupedFieldSet, parentDeferUsages = /* @__PURE__ */ new Set()) {
const groupedFieldSet = /* @__PURE__ */ new Map();
const newGroupedFieldSets = new SetMap2();
for (const [responseKey, fieldDetailsList] of originalGroupedFieldSet) {
const filteredDeferUsageSet = getFilteredDeferUsageSet(fieldDetailsList);
if (isSameSet(filteredDeferUsageSet, parentDeferUsages)) {
groupedFieldSet.set(responseKey, fieldDetailsList);
continue;
}
const newGroupedFieldSet = newGroupedFieldSets.getOrInsertComputed(filteredDeferUsageSet, () => /* @__PURE__ */ new Map());
newGroupedFieldSet.set(responseKey, fieldDetailsList);
}
return {
groupedFieldSet,
newGroupedFieldSets
};
}
function getFilteredDeferUsageSet(fieldDetailsList) {
const filteredDeferUsageSet = /* @__PURE__ */ new Set();
for (const fieldDetails of fieldDetailsList) {
const deferUsage = fieldDetails.deferUsage;
if (deferUsage === void 0) {
filteredDeferUsageSet.clear();
return filteredDeferUsageSet;
}
filteredDeferUsageSet.add(deferUsage);
}
for (const deferUsage of filteredDeferUsageSet) {
let parentDeferUsage = deferUsage.parentDeferUsage;
while (parentDeferUsage !== void 0) {
if (filteredDeferUsageSet.has(parentDeferUsage)) {
filteredDeferUsageSet.delete(deferUsage);
break;
}
parentDeferUsage = parentDeferUsage.parentDeferUsage;
}
}
return filteredDeferUsageSet;
}
var init_buildExecutionPlan = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/buildExecutionPlan.mjs"() {
init_isSameSet();
init_SetMap();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/Computation.mjs
var Computation;
var init_Computation = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/Computation.mjs"() {
init_isPromise();
Computation = class {
constructor(fn2, onAbort) {
this._fn = fn2;
this._onAbort = onAbort;
}
prime() {
if (this._maybePromise) {
return this._maybePromise;
}
try {
const result = this._fn();
if (isPromise(result)) {
this._maybePromise = { status: "pending", promise: result };
result.then((value) => {
this._maybePromise = { status: "fulfilled", value };
}, (reason) => {
this._maybePromise = { status: "rejected", reason };
});
} else {
this._maybePromise = { status: "fulfilled", value: result };
}
} catch (reason) {
this._maybePromise = { status: "rejected", reason };
}
return this._maybePromise;
}
result() {
const maybePromise = this.prime();
switch (maybePromise.status) {
case "fulfilled":
return maybePromise.value;
case "rejected":
throw maybePromise.reason;
case "pending": {
return maybePromise.promise;
}
}
}
abort(reason) {
const maybePromise = this._maybePromise;
if (!maybePromise) {
this._maybePromise = {
status: "rejected",
reason
};
return;
}
const status = maybePromise.status;
if (status === "pending") {
this._maybePromise = {
status: "rejected",
reason
};
if (this._onAbort) {
return this._onAbort(reason);
}
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/withConcurrentAbruptClose.mjs
function withConcurrentAbruptClose(generator, beforeReturn, beforeThrow = beforeReturn) {
let completed = false;
let abruptCloseRequested = false;
const runAbruptCloseFn = (fn2) => {
if (completed || abruptCloseRequested) {
return;
}
abruptCloseRequested = true;
return ignoreErrors(fn2);
};
return {
[Symbol.asyncIterator]() {
return this;
},
next() {
const result = generator.next();
result.then((iteration) => {
if (iteration.done) {
completed = true;
}
}).catch(() => void 0);
return result;
},
async return() {
await runAbruptCloseFn(beforeReturn);
return generator.return();
},
async throw(error) {
await runAbruptCloseFn(() => beforeThrow(error));
return generator.throw(error);
},
async [asyncDispose]() {
await runAbruptCloseFn(beforeReturn);
if (typeof generator[asyncDispose] === "function") {
await generator[asyncDispose]();
}
}
};
}
function ignoreErrors(fn2) {
try {
const result = fn2();
if (isPromise(result)) {
return result.catch(() => {
});
}
} catch {
}
}
var asyncDispose;
var init_withConcurrentAbruptClose = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/withConcurrentAbruptClose.mjs"() {
init_isPromise();
asyncDispose = Symbol.asyncDispose ?? /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/mapAsyncIterable.mjs
function mapAsyncIterable(iterable, callback) {
const iterator = iterable[Symbol.asyncIterator]();
const returnFn = iterator.return?.bind(iterator);
const throwFn = iterator.throw?.bind(iterator);
const onReturn = returnFn ? () => callIgnoringErrors(returnFn) : () => Promise.resolve();
const onThrow = throwFn ? (reason) => callIgnoringErrors(() => throwFn(reason)) : onReturn;
return withConcurrentAbruptClose(mapAsyncIterableImpl(iterable, callback), onReturn, onThrow);
}
async function callIgnoringErrors(fn2) {
try {
await fn2();
} catch {
}
}
async function* mapAsyncIterableImpl(iterable, mapFn) {
for await (const value of iterable) {
const result = mapFn(value);
if (isPromise(result)) {
yield await result;
continue;
}
yield result;
}
}
var init_mapAsyncIterable = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/mapAsyncIterable.mjs"() {
init_isPromise();
init_withConcurrentAbruptClose();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/Queue.mjs
var Queue;
var init_Queue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/Queue.mjs"() {
init_invariant();
init_isPromise();
init_promiseWithResolvers();
init_withConcurrentAbruptClose();
Queue = class {
constructor(executor, initialCapacity = 1) {
this._backlog = 0;
this._waiters = [];
this._entries = [];
this._isStopped = false;
this._stopRequested = false;
this._stopCleanupCallbacks = [];
this._batchRequests = /* @__PURE__ */ new Set();
this._capacity = this._normalizeCapacity(initialCapacity);
const { promise: started, resolve: resolveStarted } = promiseWithResolvers();
this._resolveStarted = resolveStarted;
try {
const result = executor({
push: this._push.bind(this),
stop: this._stop.bind(this),
onStop: this._onStop.bind(this),
started
});
if (isPromise(result)) {
result.catch(this._stop.bind(this));
}
} catch (error) {
const stopped = this._stop(error);
if (isPromise(stopped)) {
stopped.catch(() => void 0);
}
}
}
subscribe(reducer = (generator) => Array.from(generator)) {
const generator = this._iteratorLoop(reducer);
return withConcurrentAbruptClose(generator, () => this.cancel(), this.abort.bind(this));
}
cancel() {
if (this._stopRequested) {
return this._stopCompletion;
}
return this._terminate(void 0, () => {
this._isStopped = true;
this._batchRequests.forEach((request) => request.resolve(void 0));
this._batchRequests.clear();
});
}
abort(reason) {
if (this._stopRequested) {
return this._stopCompletion;
}
return this._terminate(reason, () => {
this._isStopped = true;
if (this._batchRequests.size) {
this._batchRequests.forEach((request) => request.reject(reason));
this._batchRequests.clear();
return;
}
this._entries.push({
kind: "item",
settled: { status: "rejected", reason }
});
});
}
async forEachBatch(reducer) {
const sub = this.subscribe(async (generator) => {
const { promise: drained, resolve: resolve2 } = promiseWithResolvers();
const wrappedBatch = (function* wrapper() {
yield* generator;
resolve2();
})();
await Promise.all([reducer(wrappedBatch), drained]);
});
for await (const _2 of sub) {
}
}
setCapacity(nextCapacity) {
this._capacity = this._normalizeCapacity(nextCapacity);
this._flush();
}
getCapacity() {
return this._capacity;
}
isStopped() {
return this._isStopped;
}
_normalizeCapacity(capacity) {
return Math.max(1, Math.floor(capacity));
}
_flush() {
while (this._waiters.length > 0 && this._backlog < this._capacity) {
this._waiters.shift()?.();
}
}
_reserve() {
this._backlog += 1;
if (this._backlog < this._capacity) {
return void 0;
}
const { promise, resolve: resolve2 } = promiseWithResolvers();
this._waiters.push(resolve2);
return promise;
}
_release() {
if (this._backlog > 0) {
this._backlog -= 1;
}
this._flush();
}
_onStop(cleanup) {
if (this._stopRequested) {
throw new Error("Cannot register onStop cleanup after stop has been requested.");
}
this._stopCleanupCallbacks.push(cleanup);
}
_runStopCleanup(reason, afterCleanup) {
this._stopRequested = true;
const cleanupPromises = this._stopCleanupCallbacks.flatMap((cleanupCallback) => {
try {
const result = cleanupCallback(reason);
return isPromise(result) ? [result] : [];
} catch {
return [];
}
});
const cleanup = cleanupPromises.length > 0 ? Promise.allSettled(cleanupPromises).then(() => void 0) : void 0;
if (isPromise(cleanup)) {
this._stopCompletion = cleanup.then(afterCleanup, afterCleanup).then(() => void 0);
return this._stopCompletion;
}
afterCleanup();
}
async *_iteratorLoop(reducer) {
this._resolveStarted();
let nextBatch;
while (nextBatch = await this._waitForNextBatch()) {
let reduced = reducer(nextBatch);
if (isPromise(reduced)) {
reduced = await reduced;
}
if (reduced === void 0) {
continue;
}
yield reduced;
}
}
_waitForNextBatch() {
const { promise, resolve: resolve2, reject } = promiseWithResolvers();
this._batchRequests.add({ resolve: resolve2, reject });
this._deliverBatchIfReady();
return promise;
}
_push(item) {
if (this._stopRequested) {
return;
}
const maybePushPromise = this._reserve();
if (isPromise(item)) {
const entry = { kind: "item" };
this._entries.push(entry);
item.then((resolved) => {
entry.settled = { status: "fulfilled", value: resolved };
this._deliverBatchIfReady();
}, (reason) => {
entry.settled = { status: "rejected", reason };
this._deliverBatchIfReady();
});
} else {
this._entries.push({
kind: "item",
settled: { status: "fulfilled", value: item }
});
this._deliverBatchIfReady();
}
return maybePushPromise;
}
_terminate(reason, afterCleanup) {
for (const entry of this._entries) {
if (entry.kind === "item") {
this._release();
}
}
this._entries.length = 0;
return this._runStopCleanup(reason, afterCleanup);
}
_stop(reason) {
if (this._stopRequested) {
return this._stopCompletion;
}
const stopCompletion = this._runStopCleanup(reason, () => {
if (reason === void 0) {
if (this._entries.length === 0) {
this._isStopped = true;
this._deliverBatchIfReady();
return;
}
this._entries.push({ kind: "stop" });
this._deliverBatchIfReady();
return;
}
this._entries.push({
kind: "item",
settled: { status: "rejected", reason }
});
this._entries.push({ kind: "stop" });
this._deliverBatchIfReady();
});
if (isPromise(stopCompletion)) {
stopCompletion.catch(() => void 0);
}
return stopCompletion;
}
_deliverBatchIfReady() {
if (!this._batchRequests.size) {
return;
}
const headEntry = this._entries[0];
const requests = this._batchRequests;
if (headEntry !== void 0) {
if (!(headEntry.kind !== "stop"))
invariant(false);
const settled = headEntry.settled;
if (settled !== void 0) {
if (settled.status === "fulfilled") {
this._batchRequests = /* @__PURE__ */ new Set();
requests.forEach((request) => request.resolve(this._drainBatch()));
return;
}
this._entries.shift();
this._release();
this._isStopped = true;
this._batchRequests = /* @__PURE__ */ new Set();
requests.forEach((request) => request.reject(settled.reason));
}
} else if (this._isStopped) {
this._batchRequests = /* @__PURE__ */ new Set();
requests.forEach((request) => request.resolve(void 0));
}
}
*_drainBatch() {
while (true) {
const entry = this._entries[0];
if (entry === void 0) {
return;
}
if (entry.kind === "stop") {
this._isStopped = true;
this._entries.shift();
return;
}
const settled = entry.settled;
if (settled === void 0 || settled.status === "rejected") {
return;
}
this._entries.shift();
this._release();
yield settled.value;
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/WorkQueue.mjs
function createWorkQueue(initialWork) {
const rootGroups = /* @__PURE__ */ new Set();
const rootStreams = /* @__PURE__ */ new Set();
const groupNodes = /* @__PURE__ */ new Map();
const taskNodes = /* @__PURE__ */ new Map();
let pushGraphEvent;
let stopGraphEvents;
const { newGroups: initialRootGroups, newStreams: initialRootStreams } = maybeIntegrateWork(initialWork);
const nonEmptyInitialRootGroups = pruneEmptyGroups(initialRootGroups);
for (const group of nonEmptyInitialRootGroups) {
rootGroups.add(group);
}
for (const stream of initialRootStreams) {
rootStreams.add(stream);
}
const events = new Queue(({ push: _push, stop: _stop, onStop, started }) => {
pushGraphEvent = _push;
stopGraphEvents = _stop;
started.then(() => {
for (const group of rootGroups) {
startGroup(group);
}
for (const stream of rootStreams) {
startStream(stream);
}
});
onStop((reason) => cancel(reason));
}, 1).subscribe((graphEvents) => handleGraphEvents(graphEvents));
return {
initialGroups: nonEmptyInitialRootGroups,
initialStreams: initialRootStreams,
events
};
function cancel(reason) {
const cancelPromises = [];
for (const group of rootGroups) {
cancelGroup(group, reason, cancelPromises);
}
for (const stream of rootStreams) {
cancelStream(stream, reason, cancelPromises);
}
if (cancelPromises.length > 0) {
return Promise.allSettled(cancelPromises).then(() => void 0);
}
}
function cancelGroup(group, reason, cancelPromises) {
const groupNode = groupNodes.get(group);
if (groupNode) {
for (const task of groupNode.tasks) {
cancelTask(task, reason, cancelPromises);
}
for (const childGroup of groupNode.childGroups) {
cancelGroup(childGroup, reason, cancelPromises);
}
}
}
function cancelTask(task, reason, cancelPromises) {
const abortResult = task.computation.abort(reason);
if (isPromise(abortResult)) {
cancelPromises.push(abortResult);
}
const taskNode = taskNodes.get(task);
if (taskNode) {
for (const childStream of taskNode.childStreams) {
cancelStream(childStream, reason, cancelPromises);
}
}
}
function cancelStream(stream, reason, cancelPromises) {
const abortResult = stream.queue.abort(reason);
if (isPromise(abortResult)) {
cancelPromises.push(abortResult);
}
}
function maybeIntegrateWork(work, parentTask) {
if (!work) {
return { newGroups: [], newStreams: [] };
}
const { groups, tasks, streams } = work;
const newGroups = groups ? addGroups(groups, parentTask) : [];
if (tasks) {
for (const task of tasks) {
addTask(task);
}
}
const newStreams = streams ? addStreams(streams, parentTask) : [];
return { newGroups, newStreams };
}
function addGroups(originalGroups, parentTask) {
const groupSet = new Set(originalGroups);
const visited = /* @__PURE__ */ new Set();
const newRootGroups = [];
for (const group of originalGroups) {
addGroup(group, groupSet, newRootGroups, visited, parentTask);
}
return newRootGroups;
}
function addGroup(group, groupSet, newRootGroups, visited, parentTask) {
if (visited.has(group)) {
return;
}
visited.add(group);
const parent = group.parent;
if (parent !== void 0) {
if (groupSet.has(parent)) {
addGroup(parent, groupSet, newRootGroups, visited, parentTask);
}
if (!groupNodes.has(parent)) {
return;
}
}
const groupNode = {
childGroups: [],
tasks: /* @__PURE__ */ new Set(),
pending: 0
};
groupNodes.set(group, groupNode);
if (parentTask === void 0 && !parent) {
newRootGroups.push(group);
} else if (parent) {
groupNodes.get(parent)?.childGroups.push(group);
}
}
function addTask(task) {
for (const group of task.groups) {
const groupNode = groupNodes.get(group);
if (groupNode) {
groupNode.tasks.add(task);
groupNode.pending++;
if (rootGroups.has(group)) {
startTask(task);
}
}
}
}
function addStreams(streams, parentTask) {
if (!parentTask) {
return streams;
}
const taskNode = taskNodes.get(parentTask);
if (taskNode) {
taskNode.childStreams.push(...streams);
}
return [];
}
function pruneEmptyGroups(newGroups, nonEmptyNewGroups = []) {
for (const newGroup of newGroups) {
const newGroupState = groupNodes.get(newGroup);
if (newGroupState) {
if (newGroupState.tasks.size === 0) {
groupNodes.delete(newGroup);
pruneEmptyGroups(newGroupState.childGroups, nonEmptyNewGroups);
} else {
nonEmptyNewGroups.push(newGroup);
}
}
}
return nonEmptyNewGroups;
}
function startNewWork(newGroups, newStreams) {
const groupEvents = [];
const groupsToStart = [...newGroups];
const streamsToStart = [...newStreams];
for (const group of groupsToStart) {
rootGroups.add(group);
startGroup(group);
const groupNode = groupNodes.get(group);
if (groupNode) {
maybeFinishGroup(group, groupNode, groupEvents, groupsToStart, streamsToStart);
}
}
for (const stream of streamsToStart) {
rootStreams.add(stream);
startStream(stream);
}
return groupEvents;
}
function startGroup(group) {
const groupNode = groupNodes.get(group);
if (groupNode) {
for (const task of groupNode.tasks) {
startTask(task);
}
}
}
function startTask(task) {
const alreadyStarted = taskNodes.has(task);
if (!alreadyStarted) {
taskNodes.set(task, {
value: void 0,
childStreams: []
});
}
try {
const result = task.computation.result();
if (alreadyStarted) {
return;
}
if (isPromise(result)) {
result.then((resolved) => {
pushGraphEvent({ kind: "TASK_SUCCESS", task, result: resolved });
}, (error) => {
pushGraphEvent({ kind: "TASK_FAILURE", task, error });
});
} else {
pushGraphEvent({ kind: "TASK_SUCCESS", task, result });
}
} catch (error) {
pushGraphEvent({ kind: "TASK_FAILURE", task, error });
}
}
async function startStream(stream) {
try {
await stream.queue.forEachBatch(async (items) => {
const pushed = pushGraphEvent({
kind: "STREAM_ITEMS",
stream,
items
});
if (isPromise(pushed)) {
await pushed;
}
});
pushGraphEvent({ kind: "STREAM_SUCCESS", stream });
} catch (error) {
pushGraphEvent({ kind: "STREAM_FAILURE", stream, error });
}
}
function handleGraphEvents(graphEvents) {
const workQueueEvents = [];
for (const graphEvent of graphEvents) {
switch (graphEvent.kind) {
case "TASK_SUCCESS":
workQueueEvents.push(...taskSuccess(graphEvent));
break;
case "TASK_FAILURE":
workQueueEvents.push(...taskFailure(graphEvent));
break;
case "STREAM_ITEMS":
workQueueEvents.push(...streamItems(graphEvent));
break;
case "STREAM_SUCCESS":
if (rootStreams.has(graphEvent.stream)) {
rootStreams.delete(graphEvent.stream);
workQueueEvents.push(graphEvent);
}
break;
case "STREAM_FAILURE":
rootStreams.delete(graphEvent.stream);
workQueueEvents.push(graphEvent);
break;
}
}
if (rootGroups.size === 0 && rootStreams.size === 0) {
stopGraphEvents();
workQueueEvents.push({ kind: "WORK_QUEUE_TERMINATION" });
}
return workQueueEvents.length > 0 ? workQueueEvents : void 0;
}
function taskSuccess(graphEvent) {
const { task, result } = graphEvent;
const { value, work } = result;
const taskNode = taskNodes.get(task);
if (!taskNode) {
return [];
}
taskNode.value = value;
maybeIntegrateWork(work, task);
const groupEvents = [];
const newGroups = [];
const newStreams = [];
for (const group of task.groups) {
const groupNode = groupNodes.get(group);
if (groupNode) {
groupNode.pending--;
maybeFinishGroup(group, groupNode, groupEvents, newGroups, newStreams);
}
}
return [...groupEvents, ...startNewWork(newGroups, newStreams)];
}
function maybeFinishGroup(group, groupNode, groupEvents, newGroups, newStreams) {
if (!rootGroups.has(group)) {
return;
}
if (groupNode.pending === 0) {
const { groupValuesEvent, groupSuccessEvent, newGroups: childNewGroups, newStreams: childNewStreams } = finishGroupSuccess(group, groupNode);
if (groupValuesEvent) {
groupEvents.push(groupValuesEvent);
}
groupEvents.push(groupSuccessEvent);
newGroups.push(...childNewGroups);
newStreams.push(...childNewStreams);
}
}
function taskFailure(graphEvent) {
const { task, error } = graphEvent;
if (!taskNodes.has(task)) {
return [];
}
const groupFailureEvents = [];
for (const group of task.groups) {
const groupNode = groupNodes.get(group);
if (groupNode && rootGroups.has(group)) {
groupFailureEvents.push(finishGroupFailure(group, groupNode, error));
}
}
return groupFailureEvents;
}
function streamItems(graphEvent) {
const { stream, items } = graphEvent;
const values = [];
const newGroups = [];
const newStreams = [];
for (const { value, work } of items) {
const { newGroups: itemNewGroups, newStreams: itemNewStreams } = maybeIntegrateWork(work);
const nonEmptyNewGroups = pruneEmptyGroups(itemNewGroups);
const groupEvents = startNewWork(nonEmptyNewGroups, itemNewStreams);
if (!(groupEvents.length === 0))
invariant(false);
values.push(value);
newGroups.push(...nonEmptyNewGroups);
newStreams.push(...itemNewStreams);
}
const streamValuesEvent = {
kind: "STREAM_VALUES",
stream,
values,
newGroups,
newStreams
};
if (stream.queue.isStopped()) {
rootStreams.delete(stream);
return [streamValuesEvent, { kind: "STREAM_SUCCESS", stream }];
}
return [streamValuesEvent];
}
function finishGroupSuccess(group, groupNode) {
groupNodes.delete(group);
const values = [];
const newStreams = [];
for (const task of groupNode.tasks) {
const taskNode = taskNodes.get(task);
if (taskNode) {
const { value, childStreams } = taskNode;
if (value !== void 0) {
values.push(value);
}
for (const childStream of childStreams) {
newStreams.push(childStream);
}
removeTask(task);
}
}
const newGroups = pruneEmptyGroups(groupNode.childGroups);
rootGroups.delete(group);
return {
groupValuesEvent: values.length ? { kind: "GROUP_VALUES", group, values } : void 0,
groupSuccessEvent: {
kind: "GROUP_SUCCESS",
group,
newGroups,
newStreams
},
newGroups,
newStreams
};
}
function finishGroupFailure(group, groupNode, error) {
removeGroup(group, groupNode);
return { kind: "GROUP_FAILURE", group, error };
}
function removeGroup(group, groupNode) {
rootGroups.delete(group);
groupNodes.delete(group);
for (const task of groupNode.tasks) {
if (task.groups.every((taskGroup) => !groupNodes.has(taskGroup))) {
removeTask(task);
}
}
for (const childGroup of groupNode.childGroups) {
const childGroupState = groupNodes.get(childGroup);
if (childGroupState) {
removeGroup(childGroup, childGroupState);
}
}
}
function removeTask(task) {
for (const group of task.groups) {
const groupNode = groupNodes.get(group);
groupNode?.tasks.delete(task);
}
taskNodes.delete(task);
}
}
var init_WorkQueue = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/WorkQueue.mjs"() {
init_invariant();
init_isPromise();
init_Queue();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs
var IncrementalPublisher;
var init_IncrementalPublisher = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/IncrementalPublisher.mjs"() {
init_memoize1();
init_Path();
init_ensureGraphQLError();
init_mapAsyncIterable();
init_withConcurrentAbruptClose();
init_WorkQueue();
IncrementalPublisher = class {
constructor() {
this._ids = /* @__PURE__ */ new Map();
this._nextId = 0;
this._cachedPathToArray = memoize1((path) => pathToArray(path));
}
buildResponse(data, errors, work, abortSignal, onFinished) {
const { initialGroups, initialStreams, events } = createWorkQueue(work);
function abort() {
subsequentResults.throw(abortSignal?.reason).catch(() => {
});
}
if (abortSignal) {
abortSignal.addEventListener("abort", abort);
}
const onWorkQueueFinished = () => {
onFinished();
abortSignal?.removeEventListener("abort", abort);
};
const pending = this._toPendingResults(initialGroups, initialStreams);
const initialResult = errors.length ? { errors, data, pending, hasNext: true } : { data, pending, hasNext: true };
const subsequentResults = withConcurrentAbruptClose(mapAsyncIterable(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished());
return {
initialResult,
subsequentResults
};
}
_pathToArray(path) {
if (path == null) {
return [];
}
return this._cachedPathToArray(path);
}
_ensureId(deferredFragmentOrStream) {
let id = this._ids.get(deferredFragmentOrStream);
if (id !== void 0) {
return id;
}
id = String(this._nextId++);
this._ids.set(deferredFragmentOrStream, id);
return id;
}
_toPendingResults(newGroups, newStreams) {
const pendingResults = [];
for (const collection of [newGroups, newStreams]) {
for (const node of collection) {
const id = this._ensureId(node);
const pendingResult = {
id,
path: this._pathToArray(node.path)
};
if (node.label !== void 0) {
pendingResult.label = node.label;
}
pendingResults.push(pendingResult);
}
}
return pendingResults;
}
_handleBatch(batch, onWorkQueueFinished) {
const context = {
pending: [],
incremental: [],
completed: [],
hasNext: true
};
for (const event of batch) {
this._handleWorkQueueEvent(event, context, onWorkQueueFinished);
}
const { incremental, completed, pending, hasNext } = context;
const result = { hasNext };
if (pending.length > 0) {
result.pending = pending;
}
if (incremental.length > 0) {
result.incremental = incremental;
}
if (completed.length > 0) {
result.completed = completed;
}
return result;
}
_handleWorkQueueEvent(event, context, onWorkQueueFinished) {
switch (event.kind) {
case "GROUP_VALUES": {
const group = event.group;
const id = this._ensureId(group);
for (const value of event.values) {
const { bestId, subPath } = this._getBestIdAndSubPath(id, group, value);
const incrementalEntry = {
id: bestId,
data: value.data
};
if (value.errors !== void 0) {
incrementalEntry.errors = value.errors;
}
if (subPath !== void 0) {
incrementalEntry.subPath = subPath;
}
context.incremental.push(incrementalEntry);
}
break;
}
case "GROUP_SUCCESS": {
const group = event.group;
const id = this._ensureId(group);
context.completed.push({ id });
this._ids.delete(group);
if (event.newGroups.length > 0 || event.newStreams.length > 0) {
context.pending.push(...this._toPendingResults(event.newGroups, event.newStreams));
}
break;
}
case "GROUP_FAILURE": {
const { group, error } = event;
const id = this._ensureId(group);
context.completed.push({
id,
errors: [ensureGraphQLError(error)]
});
this._ids.delete(group);
break;
}
case "STREAM_VALUES": {
const stream = event.stream;
const id = this._ensureId(stream);
const { values, newGroups, newStreams } = event;
const items = [];
const errors = [];
for (const value of values) {
items.push(value.item);
if (value.errors !== void 0) {
errors.push(...value.errors);
}
}
context.incremental.push(errors.length > 0 ? { id, items, errors } : { id, items });
if (newGroups.length > 0 || newStreams.length > 0) {
context.pending.push(...this._toPendingResults(newGroups, newStreams));
}
break;
}
case "STREAM_SUCCESS": {
const stream = event.stream;
context.completed.push({
id: this._ensureId(stream)
});
this._ids.delete(stream);
break;
}
case "STREAM_FAILURE": {
const stream = event.stream;
context.completed.push({
id: this._ensureId(stream),
errors: [ensureGraphQLError(event.error)]
});
this._ids.delete(stream);
break;
}
case "WORK_QUEUE_TERMINATION": {
onWorkQueueFinished?.();
context.hasNext = false;
break;
}
}
}
_getBestIdAndSubPath(initialId, initialDeferredFragmentRecord, executionGroupValue) {
let maxLength = this._pathToArray(initialDeferredFragmentRecord.path).length;
let bestId = initialId;
for (const deliveryGroup of executionGroupValue.deliveryGroups) {
if (deliveryGroup === initialDeferredFragmentRecord) {
continue;
}
const id = this._ids.get(deliveryGroup);
if (id === void 0) {
continue;
}
const path = this._pathToArray(deliveryGroup.path);
const length = path.length;
if (length > maxLength) {
maxLength = length;
bestId = id;
}
}
const subPath = executionGroupValue.path.slice(maxLength);
return {
bestId,
subPath: subPath.length > 0 ? subPath : void 0
};
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs
function toNodes3(fieldDetailsList) {
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
}
function getDeliveryGroups(deferUsageSet, deliveryGroupMap) {
return Array.from(deferUsageSet).map((deferUsage) => deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap));
}
function deliveryGroupFromDeferUsage(deferUsage, deliveryGroupMap) {
return deliveryGroupMap.get(deferUsage);
}
var buildExecutionPlanFromInitial, buildExecutionPlanFromDeferred, IncrementalExecutor;
var init_IncrementalExecutor = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/incremental/IncrementalExecutor.mjs"() {
init_invariant();
init_isPromise();
init_memoize1();
init_memoize2();
init_Path();
init_locatedError();
init_ast();
init_collectIteratorPromises();
init_Executor();
init_returnIteratorCatchingErrors();
init_buildExecutionPlan();
init_Computation();
init_IncrementalPublisher();
init_Queue();
buildExecutionPlanFromInitial = memoize1((groupedFieldSet) => buildExecutionPlan(groupedFieldSet));
buildExecutionPlanFromDeferred = memoize2((groupedFieldSet, deferUsageSet) => buildExecutionPlan(groupedFieldSet, deferUsageSet));
IncrementalExecutor = class _IncrementalExecutor extends Executor {
constructor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet) {
super(validatedExecutionArgs, sharedExecutionContext);
this.deferUsageSet = deferUsageSet;
this.groups = [];
this.tasks = [];
this.streams = [];
}
getCreateSubExecutor() {
const validatedExecutionArgs = this.validatedExecutionArgs;
const sharedExecutionContext = this.sharedExecutionContext;
return (deferUsageSet) => new _IncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet);
}
abort(reason) {
super.abort(reason);
for (const task of this.tasks) {
const aborted = task.computation.abort(reason);
if (!!isPromise(aborted))
invariant(false);
}
for (const stream of this.streams) {
const aborted = stream.queue.abort(reason);
if (!!isPromise(aborted))
invariant(false);
}
}
buildResponse(data) {
const work = this.getIncrementalWork();
const { tasks, streams } = work;
if (tasks?.length === 0 && streams?.length === 0) {
return super.buildResponse(data);
}
const errors = this.collectedErrors.errors;
if (!(data !== null))
invariant(false);
const incrementalPublisher = new IncrementalPublisher();
return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution());
}
executeCollectedRootFields(rootType, rootValue, originalGroupedFieldSet, serially, newDeferUsages) {
if (newDeferUsages.length === 0) {
return this.executeRootGroupedFieldSet(rootType, rootValue, originalGroupedFieldSet, serially, void 0);
}
if (!(this.validatedExecutionArgs.operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");
const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, void 0, void 0);
const { groupedFieldSet, newGroupedFieldSets } = this.buildRootExecutionPlan(originalGroupedFieldSet);
const data = this.executeRootGroupedFieldSet(rootType, rootValue, groupedFieldSet, serially, newDeliveryGroupMap);
this.groups.push(...newDeliveryGroups);
if (newGroupedFieldSets.size > 0) {
this.collectExecutionGroups(rootType, rootValue, void 0, newGroupedFieldSets, newDeliveryGroupMap);
}
return data;
}
buildRootExecutionPlan(originalGroupedFieldSet) {
return buildExecutionPlanFromInitial(originalGroupedFieldSet);
}
executeCollectedSubfields(parentType, sourceValue, path, originalGroupedFieldSet, newDeferUsages, deliveryGroupMap) {
if (newDeferUsages.length > 0) {
if (!(this.validatedExecutionArgs.operation.operation !== OperationTypeNode.SUBSCRIPTION))
invariant(false, "`@defer` directive not supported on subscription operations. Disable `@defer` by setting the `if` argument to `false`.");
}
if (deliveryGroupMap === void 0 && newDeferUsages.length === 0) {
return this.executeFields(parentType, sourceValue, path, originalGroupedFieldSet, deliveryGroupMap);
}
const { newDeliveryGroups, newDeliveryGroupMap } = this.getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path);
const { groupedFieldSet, newGroupedFieldSets } = this.buildSubExecutionPlan(originalGroupedFieldSet);
const data = this.executeFields(parentType, sourceValue, path, groupedFieldSet, newDeliveryGroupMap);
this.groups.push(...newDeliveryGroups);
if (newGroupedFieldSets.size > 0) {
this.collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, newDeliveryGroupMap);
}
return data;
}
buildSubExecutionPlan(originalGroupedFieldSet) {
return this.deferUsageSet === void 0 ? buildExecutionPlanFromInitial(originalGroupedFieldSet) : buildExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet);
}
collectExecutionGroups(parentType, sourceValue, path, newGroupedFieldSets, deliveryGroupMap) {
const createSubExecutor = this.getCreateSubExecutor();
for (const [deferUsageSet, groupedFieldSet] of newGroupedFieldSets) {
const deliveryGroups = getDeliveryGroups(deferUsageSet, deliveryGroupMap);
const executor = createSubExecutor(deferUsageSet);
const executionGroup = {
groups: deliveryGroups,
path,
computation: new Computation(() => executor.executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap), (reason) => executor.abort(reason))
};
const parentDeferUsages = this.deferUsageSet;
if (this.validatedExecutionArgs.enableEarlyExecution) {
if (this.shouldDefer(parentDeferUsages, deferUsageSet)) {
Promise.resolve().then(() => executionGroup.computation.prime());
} else {
executionGroup.computation.prime();
}
}
this.tasks.push(executionGroup);
}
}
executeExecutionGroup(deliveryGroups, parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap) {
let result;
try {
result = this.executeFields(parentType, sourceValue, path, groupedFieldSet, deliveryGroupMap);
} catch (error) {
this.abort();
throw error;
}
if (isPromise(result)) {
return result.then((resolved) => this.buildExecutionGroupResult(deliveryGroups, path, resolved), (error) => {
this.abort();
throw error;
});
}
return this.buildExecutionGroupResult(deliveryGroups, path, result);
}
buildExecutionGroupResult(deliveryGroups, path, result) {
const data = result;
const errors = this.collectedErrors.errors;
return this.finish({
value: errors.length ? { deliveryGroups, path: pathToArray(path), errors, data } : { deliveryGroups, path: pathToArray(path), data },
work: this.getIncrementalWork()
});
}
getIncrementalWork() {
const { groups, tasks, streams, collectedErrors } = this;
if (collectedErrors.errors.length === 0) {
return { groups, tasks, streams };
}
const cancellationReason = new Error("Cancelled secondary to null within original result");
const filteredTasks = [];
for (const task of tasks) {
if (collectedErrors.hasNulledPosition(task.path)) {
const aborted = task.computation.abort(cancellationReason);
if (!!isPromise(aborted))
invariant(false);
} else {
filteredTasks.push(task);
}
}
const filteredStreams = [];
for (const stream of streams) {
if (collectedErrors.hasNulledPosition(stream.path)) {
const aborted = stream.queue.abort(cancellationReason);
if (!!isPromise(aborted))
invariant(false);
} else {
filteredStreams.push(stream);
}
}
return {
groups,
tasks: filteredTasks,
streams: filteredStreams
};
}
getNewDeliveryGroupMap(newDeferUsages, deliveryGroupMap, path) {
const newDeliveryGroups = [];
const newDeliveryGroupMap = new Map(deliveryGroupMap);
for (const newDeferUsage of newDeferUsages) {
const parentDeferUsage = newDeferUsage.parentDeferUsage;
const parent = parentDeferUsage === void 0 ? void 0 : deliveryGroupFromDeferUsage(parentDeferUsage, newDeliveryGroupMap);
const deliveryGroup = {
path,
label: newDeferUsage.label,
parent
};
newDeliveryGroups.push(deliveryGroup);
newDeliveryGroupMap.set(newDeferUsage, deliveryGroup);
}
return {
newDeliveryGroups,
newDeliveryGroupMap
};
}
shouldDefer(parentDeferUsages, deferUsages) {
return parentDeferUsages === void 0 || !Array.from(deferUsages).every((deferUsage) => parentDeferUsages.has(deferUsage));
}
handleStream(index, path, iterator, streamUsage, info, itemType) {
const { handle, isAsync } = iterator;
const queue = this.buildStreamItemQueue(index, path, handle, streamUsage.fieldDetailsList, info, itemType, isAsync);
const itemStream = {
label: streamUsage.label,
path,
queue,
initialCount: index
};
this.streams.push(itemStream);
return true;
}
buildStreamItemQueue(initialIndex, streamPath, iterator, fieldDetailsList, info, itemType, isAsync) {
const createSubExecutor = this.getCreateSubExecutor();
const { enableEarlyExecution } = this.validatedExecutionArgs;
const sharedExecutionContext = this.sharedExecutionContext;
const queue = new Queue(async ({ push, stop, onStop, started }) => {
const abortStreamItems = /* @__PURE__ */ new Set();
let finishedNormally = false;
let stopRequested = false;
onStop((reason) => {
stopRequested = true;
if (!finishedNormally) {
for (const abortStreamItem of abortStreamItems) {
abortStreamItem(reason);
}
if (isAsync) {
sharedExecutionContext.asyncWorkTracker.add(returnIteratorCatchingErrors(iterator));
} else {
sharedExecutionContext.asyncWorkTracker.addValues(collectIteratorPromises(iterator));
}
}
});
await (enableEarlyExecution ? Promise.resolve() : started);
if (stopRequested) {
return;
}
let index = initialIndex;
while (true) {
let iteration;
try {
if (isAsync) {
iteration = await iterator.next();
if (stopRequested) {
return;
}
} else {
iteration = iterator.next();
}
} catch (rawError) {
throw locatedError(rawError, toNodes3(fieldDetailsList), pathToArray(streamPath));
}
if (iteration.done) {
finishedNormally = true;
const stopped = stop();
if (isPromise(stopped)) {
stopped.catch(() => void 0);
}
return;
}
const itemPath = addPath(streamPath, index, void 0);
const executor = createSubExecutor();
let streamItemResult = executor.completeStreamItem(itemPath, iteration.value, fieldDetailsList, info, itemType);
if (isPromise(streamItemResult)) {
if (enableEarlyExecution) {
const abortStreamItem = (reason) => executor.abort(reason);
abortStreamItems.add(abortStreamItem);
streamItemResult = streamItemResult.finally(() => {
abortStreamItems.delete(abortStreamItem);
});
} else {
streamItemResult = await streamItemResult;
if (stopRequested) {
return;
}
}
}
const pushResult = push(streamItemResult);
if (isPromise(pushResult)) {
await pushResult;
if (stopRequested) {
return;
}
}
index += 1;
}
}, 100);
return queue;
}
completeStreamItem(itemPath, item, fieldDetailsList, info, itemType) {
if (isPromiseLike(item)) {
return this.completePromisedValue(itemType, fieldDetailsList, info, itemPath, item, void 0).then((resolvedItem) => this.buildStreamItemResult(resolvedItem), (rawError) => {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
return this.buildStreamItemResult(null);
}).then(void 0, (error) => {
this.abort();
throw error;
});
}
let result;
try {
try {
result = this.completeValue(itemType, fieldDetailsList, info, itemPath, item, void 0);
} catch (rawError) {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
return this.buildStreamItemResult(null);
}
} catch (error) {
this.abort();
throw error;
}
if (isPromise(result)) {
return result.then((resolved) => this.buildStreamItemResult(resolved), (rawError) => {
this.handleFieldError(rawError, itemType, fieldDetailsList, itemPath);
return this.buildStreamItemResult(null);
}).then(void 0, (error) => {
this.abort();
throw error;
});
}
return this.buildStreamItemResult(result);
}
buildStreamItemResult(result) {
const item = result;
const errors = this.collectedErrors.errors;
const work = this.getIncrementalWork();
return this.finish(errors.length > 0 ? { value: { item, errors }, work } : { value: { item }, work });
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/execute.mjs
function execute(args) {
if (!shouldTrace(executeChannel)) {
return executeImpl(args);
}
return traceMixed(executeChannel, buildOperationContextFromArgs(args), () => executeImpl(args));
}
function buildOperationContextFromArgs(args) {
let operation;
const resolveOperation = () => {
if (operation === void 0) {
operation = getOperationAST(args.document, args.operationName);
}
return operation;
};
return {
schema: args.schema,
document: args.document,
rawVariableValues: args.variableValues,
get operationName() {
return args.operationName ?? resolveOperation()?.name?.value;
},
get operationType() {
return resolveOperation()?.operation;
}
};
}
function executeImpl(args) {
if (args.schema.getDirective("defer") || args.schema.getDirective("stream")) {
throw new Error(UNEXPECTED_EXPERIMENTAL_DIRECTIVES);
}
const validatedExecutionArgs = validateExecutionArgs(args);
if (!("schema" in validatedExecutionArgs)) {
return { errors: validatedExecutionArgs };
}
return executeRootSelectionSet(validatedExecutionArgs);
}
function experimentalExecuteIncrementally(args) {
if (!shouldTrace(executeChannel)) {
return experimentalExecuteIncrementallyImpl(args);
}
return traceMixed(executeChannel, buildOperationContextFromArgs(args), () => experimentalExecuteIncrementallyImpl(args));
}
function experimentalExecuteIncrementallyImpl(args) {
const validatedExecutionArgs = validateExecutionArgs(args);
if (!("schema" in validatedExecutionArgs)) {
return { errors: validatedExecutionArgs };
}
return experimentalExecuteRootSelectionSet(validatedExecutionArgs);
}
function executeRootSelectionSet(validatedExecutionArgs) {
return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet();
}
function experimentalExecuteRootSelectionSet(validatedExecutionArgs) {
return new IncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet();
}
function executeSync(args) {
const result = experimentalExecuteIncrementally(args);
if (isPromise(result) || "initialResult" in result) {
throw new Error("GraphQL execution failed to complete synchronously.");
}
return result;
}
function executeSubscriptionEvent(validatedExecutionArgs) {
return new ExecutorThrowingOnIncremental(validatedExecutionArgs).executeRootSelectionSet(false);
}
function subscribe(args) {
if (!shouldTrace(subscribeChannel)) {
return subscribeImpl(args);
}
return traceMixed(subscribeChannel, buildOperationContextFromArgs(args), () => subscribeImpl(args));
}
function subscribeImpl(args) {
const validatedExecutionArgs = validateSubscriptionArgs(args);
if (!("schema" in validatedExecutionArgs)) {
return { errors: validatedExecutionArgs };
}
const resultOrStream = createSourceEventStream(validatedExecutionArgs);
if (isPromise(resultOrStream)) {
return resultOrStream.then((resolvedResultOrStream) => isAsyncIterable(resolvedResultOrStream) ? mapSourceToResponseEvent(validatedExecutionArgs, resolvedResultOrStream) : resolvedResultOrStream);
}
return isAsyncIterable(resultOrStream) ? mapSourceToResponseEvent(validatedExecutionArgs, resultOrStream) : resultOrStream;
}
function createSourceEventStream(validatedExecutionArgs) {
if (!("operation" in validatedExecutionArgs)) {
throw new GraphQLError("Passing ExecutionArgs to createSourceEventStream() was removed in graphql-js@17.0.0; call validateSubscriptionArgs() first and pass the result instead, or use subscribe() for the full subscription pipeline.");
}
try {
const eventStream = executeSubscription(validatedExecutionArgs);
if (isPromise(eventStream)) {
return eventStream.then(void 0, (error) => ({
errors: [ensureGraphQLError(error)]
}));
}
return eventStream;
} catch (error) {
return { errors: [ensureGraphQLError(error)] };
}
}
function validateExecutionArgs(args) {
const { schema, document: document2, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, abortSignal: externalAbortSignal, enableEarlyExecution, hooks, options } = args;
assertValidSchema(schema);
let operation;
const fragmentDefinitions = /* @__PURE__ */ Object.create(null);
const fragments = /* @__PURE__ */ Object.create(null);
const fragmentVariableSignatureErrors = [];
for (const definition of document2.definitions) {
switch (definition.kind) {
case kinds_exports.OPERATION_DEFINITION:
if (operationName == null) {
if (operation !== void 0) {
return [
new GraphQLError("Must provide operation name if query contains multiple operations.")
];
}
operation = definition;
} else if (definition.name?.value === operationName) {
operation = definition;
}
break;
case kinds_exports.FRAGMENT_DEFINITION: {
fragmentDefinitions[definition.name.value] = definition;
let variableSignatures;
if (definition.variableDefinitions) {
const signatures = /* @__PURE__ */ Object.create(null);
for (const varDef of definition.variableDefinitions) {
const signature = getVariableSignature(schema, varDef);
if (signature instanceof GraphQLError) {
fragmentVariableSignatureErrors.push(signature);
continue;
}
signatures[signature.name] = signature;
}
variableSignatures = signatures;
}
fragments[definition.name.value] = { definition, variableSignatures };
break;
}
default:
}
}
if (!operation) {
if (operationName != null) {
return [new GraphQLError(`Unknown operation named "${operationName}".`)];
}
return [new GraphQLError("Must provide an operation.")];
}
if (fragmentVariableSignatureErrors.length > 0) {
return fragmentVariableSignatureErrors;
}
const variableDefinitions = operation.variableDefinitions ?? [];
const hideSuggestions = args.hideSuggestions ?? false;
const coercionInput = rawVariableValues ?? {};
const coercionOptions = {
maxErrors: options?.maxCoercionErrors ?? 50,
hideSuggestions
};
const coercionChannel = executeVariableCoercionChannel;
const variableValuesOrErrors = shouldTrace(coercionChannel) ? traceMixed(coercionChannel, {
schema,
document: document2,
operation,
rawVariableValues,
operationName: operation.name?.value,
operationType: operation.operation
}, () => getVariableValues(schema, variableDefinitions, coercionInput, coercionOptions)) : getVariableValues(schema, variableDefinitions, coercionInput, coercionOptions);
if (variableValuesOrErrors.errors) {
return variableValuesOrErrors.errors;
}
const errorPropagation = !operation.directives?.find((directive) => directive.name.value === GraphQLDisableErrorPropagationDirective.name);
return {
schema,
document: document2,
fragmentDefinitions,
fragments,
rootValue,
contextValue,
operation,
variableValues: variableValuesOrErrors.variableValues,
fieldResolver: fieldResolver ?? defaultFieldResolver,
typeResolver: typeResolver ?? defaultTypeResolver,
subscribeFieldResolver: subscribeFieldResolver ?? defaultFieldResolver,
hideSuggestions,
errorPropagation,
externalAbortSignal: externalAbortSignal ?? void 0,
enableEarlyExecution: enableEarlyExecution === true,
hooks: hooks ?? void 0,
rawVariableValues
};
}
function validateSubscriptionArgs(args) {
const validatedExecutionArgs = validateExecutionArgs(args);
if (!("schema" in validatedExecutionArgs)) {
return validatedExecutionArgs;
}
assertSubscriptionExecutionArgs(validatedExecutionArgs);
return validatedExecutionArgs;
}
function assertSubscriptionExecutionArgs(validatedExecutionArgs) {
if (!isSubscriptionOperationDefinitionNode(validatedExecutionArgs.operation)) {
throw new GraphQLError("Expected subscription operation.");
}
}
function mapSourceToResponseEvent(validatedExecutionArgs, sourceEventStream, rootSelectionSetExecutor = executeSubscriptionEvent) {
function mapFn(payload) {
const perEventExecutionArgs = {
...validatedExecutionArgs,
rootValue: payload
};
return rootSelectionSetExecutor(perEventExecutionArgs);
}
const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;
if (externalAbortSignal) {
const generator = mapAsyncIterable(sourceEventStream, mapFn);
return {
...generator,
next: () => cancellablePromise(generator.next(), externalAbortSignal)
};
}
return mapAsyncIterable(sourceEventStream, mapFn);
}
function executeSubscription(validatedExecutionArgs) {
const { schema, fragments, rootValue, contextValue, operation, variableValues, hideSuggestions, externalAbortSignal } = validatedExecutionArgs;
const rootType = schema.getSubscriptionType();
if (rootType == null) {
throw new GraphQLError("Schema is not configured to execute subscription operation.", { nodes: operation });
}
const { groupedFieldSet } = collectFields2(schema, fragments, variableValues, rootType, operation.selectionSet, hideSuggestions);
const firstRootField = groupedFieldSet.entries().next().value;
const [responseName, fieldDetailsList] = firstRootField;
const firstFieldDetails = fieldDetailsList[0];
const firstNode = firstFieldDetails.node;
const fieldName = firstNode.name.value;
const fieldDef = schema.getField(rootType, fieldName);
const fieldNodes = fieldDetailsList.map((fieldDetails) => fieldDetails.node);
if (!fieldDef) {
throw new GraphQLError(`The subscription field "${fieldName}" is not defined.`, { nodes: fieldNodes });
}
const sharedExecutionContext = createSharedExecutionContext(externalAbortSignal);
const path = addPath(void 0, responseName, rootType.name);
const info = buildResolveInfo(validatedExecutionArgs, fieldDef, fieldNodes, rootType, path, sharedExecutionContext.getAbortSignal, sharedExecutionContext.getAsyncHelpers);
try {
const args = getArgumentValues(fieldDef, firstNode, variableValues, firstFieldDetails.fragmentVariableValues, hideSuggestions);
const resolveFn = fieldDef.subscribe ?? validatedExecutionArgs.subscribeFieldResolver;
const result = resolveFn(rootValue, args, contextValue, info);
if (isPromiseLike(result)) {
const promisedResult = Promise.resolve(result);
const promise = externalAbortSignal ? cancellablePromise(promisedResult, externalAbortSignal) : promisedResult;
return promise.then(assertEventStream).then(void 0, (error) => {
throw locatedError(error, toNodes4(fieldDetailsList), pathToArray(path));
});
}
return assertEventStream(result);
} catch (error) {
throw locatedError(error, fieldNodes, pathToArray(path));
}
}
function assertEventStream(result) {
if (result instanceof Error) {
throw result;
}
if (!isAsyncIterable(result)) {
throw new GraphQLError(`Subscription field must return Async Iterable. Received: ${inspect(result)}.`);
}
return result;
}
function toNodes4(fieldDetailsList) {
return fieldDetailsList.map((fieldDetails) => fieldDetails.node);
}
var UNEXPECTED_EXPERIMENTAL_DIRECTIVES, defaultTypeResolver, defaultFieldResolver;
var init_execute = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/execute.mjs"() {
init_inspect();
init_isAsyncIterable();
init_isObjectLike();
init_isPromise();
init_Path();
init_ensureGraphQLError();
init_GraphQLError();
init_locatedError();
init_kinds2();
init_predicates();
init_directives();
init_type();
init_getOperationAST();
init_diagnostics();
init_buildResolveInfo();
init_cancellablePromise();
init_collectFields();
init_createSharedExecutionContext();
init_ExecutorThrowingOnIncremental();
init_getVariableSignature();
init_IncrementalExecutor();
init_mapAsyncIterable();
init_values();
UNEXPECTED_EXPERIMENTAL_DIRECTIVES = "The provided schema unexpectedly contains experimental directives (@defer or @stream). These directives may only be utilized if experimental execution features are explicitly enabled.";
defaultTypeResolver = function(value, contextValue, info, abstractType) {
if (isObjectLike(value) && typeof value.__typename === "string") {
return value.__typename;
}
const possibleTypes = info.schema.getPossibleTypes(abstractType);
const promisedIsTypeOfResults = [];
try {
for (let i = 0; i < possibleTypes.length; i++) {
const type = possibleTypes[i];
if (type.isTypeOf) {
const isTypeOfResult = type.isTypeOf(value, contextValue, info);
if (isPromiseLike(isTypeOfResult)) {
promisedIsTypeOfResults[i] = isTypeOfResult;
} else if (isTypeOfResult) {
if (promisedIsTypeOfResults.length) {
info.getAsyncHelpers().track(promisedIsTypeOfResults);
}
return type.name;
}
}
}
} catch (error) {
if (promisedIsTypeOfResults.length) {
info.getAsyncHelpers().track(promisedIsTypeOfResults);
}
throw error;
}
if (promisedIsTypeOfResults.length) {
return info.getAsyncHelpers().promiseAll(promisedIsTypeOfResults).then((isTypeOfResults) => {
for (let i = 0; i < isTypeOfResults.length; i++) {
if (isTypeOfResults[i]) {
return possibleTypes[i].name;
}
}
});
}
};
defaultFieldResolver = function(source, args, contextValue, info) {
if (isObjectLike(source) || typeof source === "function") {
const property = source[info.fieldName];
if (typeof property === "function") {
return source[info.fieldName](args, contextValue, info);
}
return property;
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/harness.mjs
var defaultHarness;
var init_harness = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/harness.mjs"() {
init_parser();
init_validate2();
init_execute();
defaultHarness = {
parse,
validate,
execute,
subscribe
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/graphql.mjs
function graphql(args) {
return new Promise((resolve2) => resolve2(graphqlImpl(args)));
}
function graphqlSync(args) {
const result = graphqlImpl(args);
if (isPromise(result)) {
throw new Error("GraphQL execution failed to complete synchronously.");
}
return result;
}
function graphqlImpl(args) {
const harness = args.harness ?? defaultHarness;
const { schema, source } = args;
const schemaValidationErrors = validateSchema(schema);
if (schemaValidationErrors.length > 0) {
return { errors: schemaValidationErrors };
}
let document2;
try {
document2 = harness.parse(source, args);
} catch (syntaxError2) {
return { errors: [ensureGraphQLError(syntaxError2)] };
}
if (isPromise(document2)) {
return document2.then((resolvedDocument) => validateAndExecute(harness, args, schema, resolvedDocument), (syntaxError2) => ({ errors: [ensureGraphQLError(syntaxError2)] }));
}
return validateAndExecute(harness, args, schema, document2);
}
function validateAndExecute(harness, args, schema, document2) {
const validationResult = harness.validate(schema, document2, args.rules, args);
if (isPromise(validationResult)) {
return validationResult.then((resolvedValidationResult) => checkValidationAndExecute(harness, args, resolvedValidationResult, document2));
}
return checkValidationAndExecute(harness, args, validationResult, document2);
}
function checkValidationAndExecute(harness, args, validationResult, document2) {
if (validationResult.length > 0) {
return { errors: validationResult };
}
return harness.execute({ ...args, document: document2 });
}
var init_graphql = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/graphql.mjs"() {
init_isPromise();
init_ensureGraphQLError();
init_validate();
init_harness();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/index.mjs
var init_language = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/language/index.mjs"() {
init_source();
init_location();
init_printLocation();
init_tokenKind();
init_lexer();
init_parser();
init_printer();
init_visitor();
init_ast();
init_predicates();
init_directiveLocation();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs
function buildIncrementalResult(originalIncrementalResult, label, errors) {
const incrementalResult = originalIncrementalResult;
if (errors !== void 0) {
incrementalResult.errors = errors;
}
if (label !== void 0) {
incrementalResult.label = label;
}
return incrementalResult;
}
var BranchingIncrementalPublisher;
var init_BranchingIncrementalPublisher = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalPublisher.mjs"() {
init_Path();
init_ensureGraphQLError();
init_WorkQueue();
init_mapAsyncIterable();
init_withConcurrentAbruptClose();
BranchingIncrementalPublisher = class {
constructor() {
this._indices = /* @__PURE__ */ new Map();
}
buildResponse(data, errors, work, abortSignal, onFinished) {
const { initialStreams, events } = createWorkQueue(work);
for (const stream of initialStreams) {
this._indices.set(stream, stream.initialCount);
}
function abort() {
subsequentResults.throw(abortSignal?.reason).catch(() => {
});
}
if (abortSignal) {
abortSignal.addEventListener("abort", abort);
}
const onWorkQueueFinished = () => {
onFinished();
abortSignal?.removeEventListener("abort", abort);
};
const initialResult = errors.length ? { errors, data, hasNext: true } : { data, hasNext: true };
const subsequentResults = withConcurrentAbruptClose(mapAsyncIterable(events, (batch) => this._handleBatch(batch, onWorkQueueFinished)), () => onWorkQueueFinished());
return {
initialResult,
subsequentResults
};
}
_handleBatch(batch, onWorkQueueFinished) {
const context = {
incremental: [],
hasNext: true
};
for (const event of batch) {
this._handleWorkQueueEvent(event, context, onWorkQueueFinished);
}
const { incremental, hasNext } = context;
const result = { hasNext };
if (incremental.length > 0) {
result.incremental = incremental;
}
return result;
}
_handleWorkQueueEvent(event, context, onWorkQueueFinished) {
switch (event.kind) {
case "GROUP_VALUES": {
const group = event.group;
for (const value of event.values) {
context.incremental.push(buildIncrementalResult({
data: value.data,
path: pathToArray(group.path)
}, group.label, value.errors));
}
break;
}
case "GROUP_SUCCESS": {
break;
}
case "GROUP_FAILURE": {
const group = event.group;
context.incremental.push(buildIncrementalResult({
data: null,
path: pathToArray(group.path)
}, group.label, [ensureGraphQLError(event.error)]));
break;
}
case "STREAM_VALUES": {
const stream = event.stream;
const { values } = event;
const items = [];
const errors = [];
for (const value of values) {
items.push(value.item);
if (value.errors !== void 0) {
errors.push(...value.errors);
}
}
let index = this._indices.get(stream);
if (index === void 0) {
index = stream.initialCount;
this._indices.set(stream, index);
}
this._indices.set(stream, index + items.length);
context.incremental.push(buildIncrementalResult({
items,
path: pathToArray(addPath(stream.path, index, void 0))
}, stream.label, errors.length > 0 ? errors : void 0));
break;
}
case "STREAM_SUCCESS": {
this._indices.delete(event.stream);
break;
}
case "STREAM_FAILURE": {
this._indices.delete(event.stream);
const stream = event.stream;
context.incremental.push(buildIncrementalResult({
items: null,
path: pathToArray(stream.path)
}, stream.label, [ensureGraphQLError(event.error)]));
break;
}
case "WORK_QUEUE_TERMINATION": {
onWorkQueueFinished?.();
context.hasNext = false;
break;
}
}
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs
function buildBranchingExecutionPlan(originalGroupedFieldSet, parentDeferUsages = /* @__PURE__ */ new Set()) {
const groupedFieldSet = new AccumulatorMap();
const newGroupedFieldSets = new SetMap2();
for (const [responseKey, fieldGroup] of originalGroupedFieldSet) {
for (const fieldDetails of fieldGroup) {
const deferUsage = fieldDetails.deferUsage;
const deferUsageSet = deferUsage === void 0 ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([deferUsage]);
if (isSameSet(parentDeferUsages, deferUsageSet)) {
groupedFieldSet.add(responseKey, fieldDetails);
} else {
const newGroupedFieldSet = newGroupedFieldSets.getOrInsertComputed(deferUsageSet, () => new AccumulatorMap());
newGroupedFieldSet.add(responseKey, fieldDetails);
}
}
}
return {
groupedFieldSet,
newGroupedFieldSets
};
}
var buildBranchingExecutionPlanFromInitial, buildBranchingExecutionPlanFromDeferred, BranchingIncrementalExecutor;
var init_BranchingIncrementalExecutor = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/BranchingIncrementalExecutor.mjs"() {
init_AccumulatorMap();
init_invariant();
init_isSameSet();
init_memoize1();
init_memoize2();
init_SetMap();
init_IncrementalExecutor();
init_BranchingIncrementalPublisher();
buildBranchingExecutionPlanFromInitial = memoize1((groupedFieldSet) => buildBranchingExecutionPlan(groupedFieldSet));
buildBranchingExecutionPlanFromDeferred = memoize2((groupedFieldSet, deferUsageSet) => buildBranchingExecutionPlan(groupedFieldSet, deferUsageSet));
BranchingIncrementalExecutor = class _BranchingIncrementalExecutor extends IncrementalExecutor {
getCreateSubExecutor() {
const validatedExecutionArgs = this.validatedExecutionArgs;
const sharedExecutionContext = this.sharedExecutionContext;
return (deferUsageSet) => new _BranchingIncrementalExecutor(validatedExecutionArgs, sharedExecutionContext, deferUsageSet);
}
buildResponse(data) {
const work = this.getIncrementalWork();
const { tasks, streams } = work;
if (tasks?.length === 0 && streams?.length === 0) {
return super.buildResponse(data);
}
const errors = this.collectedErrors.errors;
if (!(data !== null))
invariant(false);
const incrementalPublisher = new BranchingIncrementalPublisher();
return incrementalPublisher.buildResponse(data, errors, work, this.validatedExecutionArgs.externalAbortSignal, this.getFinishSharedExecution());
}
buildRootExecutionPlan(originalGroupedFieldSet) {
return buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet);
}
buildSubExecutionPlan(originalGroupedFieldSet) {
return this.deferUsageSet === void 0 ? buildBranchingExecutionPlanFromInitial(originalGroupedFieldSet) : buildBranchingExecutionPlanFromDeferred(originalGroupedFieldSet, this.deferUsageSet);
}
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs
function legacyExecuteIncrementally(args) {
const validatedExecutionArgs = validateExecutionArgs(args);
if (!("schema" in validatedExecutionArgs)) {
return { errors: validatedExecutionArgs };
}
return legacyExecuteRootSelectionSet(validatedExecutionArgs);
}
function legacyExecuteRootSelectionSet(validatedExecutionArgs) {
return new BranchingIncrementalExecutor(validatedExecutionArgs).executeRootSelectionSet();
}
var init_legacyExecuteIncrementally = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/legacyIncremental/legacyExecuteIncrementally.mjs"() {
init_execute();
init_BranchingIncrementalExecutor();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/index.mjs
var init_execution = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/execution/index.mjs"() {
init_Path();
init_execute();
init_legacyExecuteIncrementally();
init_AbortedGraphQLExecutionError();
init_values();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs
function NoDeprecatedCustomRule(context) {
return {
Field(node) {
const fieldDef = context.getFieldDef();
const deprecationReason = fieldDef?.deprecationReason;
if (fieldDef && deprecationReason != null) {
context.reportError(new GraphQLError(`The field ${fieldDef} is deprecated. ${deprecationReason}`, { nodes: node }));
}
},
Argument(node) {
const argDef = context.getArgument();
const deprecationReason = argDef?.deprecationReason;
if (argDef && deprecationReason != null) {
context.reportError(new GraphQLError(`The argument "${argDef}" is deprecated. ${deprecationReason}`, { nodes: node }));
}
},
ObjectField(node) {
const inputObjectDef = getNamedType(context.getParentInputType());
if (isInputObjectType(inputObjectDef)) {
const inputFieldDef = inputObjectDef.getFields()[node.name.value];
const deprecationReason = inputFieldDef?.deprecationReason;
if (deprecationReason != null) {
context.reportError(new GraphQLError(`The input field ${inputFieldDef} is deprecated. ${deprecationReason}`, { nodes: node }));
}
}
},
EnumValue(node) {
const enumValueDef = context.getEnumValue();
const deprecationReason = enumValueDef?.deprecationReason;
if (enumValueDef && deprecationReason != null) {
context.reportError(new GraphQLError(`The enum value "${enumValueDef}" is deprecated. ${deprecationReason}`, { nodes: node }));
}
}
};
}
var init_NoDeprecatedCustomRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs"() {
init_GraphQLError();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs
function NoSchemaIntrospectionCustomRule(context) {
return {
Field(node) {
const type = getNamedType(context.getType());
if (type && isIntrospectionType(type)) {
context.reportError(new GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, { nodes: node }));
}
}
};
}
var init_NoSchemaIntrospectionCustomRule = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs"() {
init_GraphQLError();
init_definition();
init_introspection();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/index.mjs
var init_validation = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/validation/index.mjs"() {
init_validate2();
init_ValidationContext();
init_specifiedRules();
init_DeferStreamDirectiveLabelRule();
init_DeferStreamDirectiveOnRootFieldRule();
init_DeferStreamDirectiveOnValidOperationsRule();
init_ExecutableDefinitionsRule();
init_FieldsOnCorrectTypeRule();
init_FragmentsOnCompositeTypesRule();
init_KnownArgumentNamesRule();
init_KnownDirectivesRule();
init_KnownFragmentNamesRule();
init_KnownOperationTypesRule();
init_KnownTypeNamesRule();
init_LoneAnonymousOperationRule();
init_NoFragmentCyclesRule();
init_NoUndefinedVariablesRule();
init_NoUnusedFragmentsRule();
init_NoUnusedVariablesRule();
init_OverlappingFieldsCanBeMergedRule();
init_PossibleFragmentSpreadsRule();
init_ProvidedRequiredArgumentsRule();
init_ScalarLeafsRule();
init_SingleFieldSubscriptionsRule();
init_StreamDirectiveOnListFieldRule();
init_UniqueArgumentNamesRule();
init_UniqueDirectivesPerLocationRule();
init_UniqueFragmentNamesRule();
init_UniqueInputFieldNamesRule();
init_UniqueOperationNamesRule();
init_UniqueVariableNamesRule();
init_ValuesOfCorrectTypeRule();
init_VariablesAreInputTypesRule();
init_VariablesInAllowedPositionRule();
init_MaxIntrospectionDepthRule();
init_LoneSchemaDefinitionRule();
init_UniqueOperationTypesRule();
init_UniqueTypeNamesRule();
init_UniqueEnumValueNamesRule();
init_UniqueFieldDefinitionNamesRule();
init_UniqueArgumentDefinitionNamesRule();
init_UniqueDirectiveNamesRule();
init_PossibleTypeExtensionsRule();
init_NoDeprecatedCustomRule();
init_NoSchemaIntrospectionCustomRule();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/index.mjs
var init_error = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/error/index.mjs"() {
init_GraphQLError();
init_syntaxError();
init_locatedError();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getIntrospectionQuery.mjs
function getIntrospectionQuery(options) {
const optionsWithDefault = {
descriptions: true,
specifiedByUrl: false,
directiveIsRepeatable: false,
schemaDescription: false,
inputValueDeprecation: false,
experimentalDirectiveDeprecation: false,
oneOf: false,
typeDepth: 9,
...options
};
const descriptions = optionsWithDefault.descriptions ? "description" : "";
const specifiedByUrl = optionsWithDefault.specifiedByUrl ? "specifiedByURL" : "";
const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? "isRepeatable" : "";
const schemaDescription = optionsWithDefault.schemaDescription ? descriptions : "";
function inputDeprecation(str) {
return optionsWithDefault.inputValueDeprecation ? str : "";
}
function experimentalDirectiveDeprecation(str) {
return optionsWithDefault.experimentalDirectiveDeprecation ? str : "";
}
const oneOf = optionsWithDefault.oneOf ? "isOneOf" : "";
function ofType(level, indent) {
if (level <= 0) {
return "";
}
if (level > 100) {
throw new Error("Please set typeDepth to a reasonable value between 0 and 100; the default is 9.");
}
return `
${indent}ofType {
${indent} name
${indent} kind${ofType(level - 1, indent + " ")}
${indent}}`;
}
return `
query IntrospectionQuery {
__schema {
${schemaDescription}
queryType { name kind }
mutationType { name kind }
subscriptionType { name kind }
types {
...FullType
}
directives${experimentalDirectiveDeprecation("(includeDeprecated: true)")} {
name
${descriptions}
${directiveIsRepeatable}
${experimentalDirectiveDeprecation("isDeprecated")}
${experimentalDirectiveDeprecation("deprecationReason")}
locations
args${inputDeprecation("(includeDeprecated: true)")} {
...InputValue
}
}
}
}
fragment FullType on __Type {
kind
name
${descriptions}
${specifiedByUrl}
${oneOf}
fields(includeDeprecated: true) {
name
${descriptions}
args${inputDeprecation("(includeDeprecated: true)")} {
...InputValue
}
type {
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields${inputDeprecation("(includeDeprecated: true)")} {
...InputValue
}
interfaces {
...TypeRef
}
enumValues(includeDeprecated: true) {
name
${descriptions}
isDeprecated
deprecationReason
}
possibleTypes {
...TypeRef
}
}
fragment InputValue on __InputValue {
name
${descriptions}
type { ...TypeRef }
defaultValue
${inputDeprecation("isDeprecated")}
${inputDeprecation("deprecationReason")}
}
fragment TypeRef on __Type {
kind
name${ofType(optionsWithDefault.typeDepth, " ")}
}
`;
}
var init_getIntrospectionQuery = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/getIntrospectionQuery.mjs"() {
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/introspectionFromSchema.mjs
function introspectionFromSchema(schema, options) {
const optionsWithDefaults = {
specifiedByUrl: true,
directiveIsRepeatable: true,
schemaDescription: true,
inputValueDeprecation: true,
experimentalDirectiveDeprecation: true,
oneOf: true,
...options
};
const document2 = parse(getIntrospectionQuery(optionsWithDefaults));
const result = executeSync({ schema, document: document2 });
if (!(result.errors == null && result.data != null))
invariant(false);
return result.data;
}
var init_introspectionFromSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/introspectionFromSchema.mjs"() {
init_invariant();
init_parser();
init_execute();
init_getIntrospectionQuery();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/buildClientSchema.mjs
function buildClientSchema(introspection, options) {
if (!(isObjectLike(introspection) && isObjectLike(introspection.__schema)))
devAssert(false, `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${inspect(introspection)}.`);
const schemaIntrospection = introspection.__schema;
const typeMap = new Map(schemaIntrospection.types.map((typeIntrospection) => [
typeIntrospection.name,
buildType(typeIntrospection)
]));
for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) {
if (typeMap.has(stdType.name)) {
typeMap.set(stdType.name, stdType);
}
}
const queryType = schemaIntrospection.queryType != null ? getObjectType(schemaIntrospection.queryType) : null;
const mutationType = schemaIntrospection.mutationType != null ? getObjectType(schemaIntrospection.mutationType) : null;
const subscriptionType = schemaIntrospection.subscriptionType != null ? getObjectType(schemaIntrospection.subscriptionType) : null;
const directives = schemaIntrospection.directives != null ? schemaIntrospection.directives.map(buildDirective) : [];
return new GraphQLSchema({
description: schemaIntrospection.description,
query: queryType,
mutation: mutationType,
subscription: subscriptionType,
types: [...typeMap.values()],
directives,
assumeValid: options?.assumeValid
});
function getType(typeRef) {
if (typeRef.kind === TypeKind.LIST) {
const itemRef = typeRef.ofType;
if (itemRef == null) {
throw new Error("Decorated type deeper than introspection query.");
}
return new GraphQLList(getType(itemRef));
}
if (typeRef.kind === TypeKind.NON_NULL) {
const nullableRef = typeRef.ofType;
if (nullableRef == null) {
throw new Error("Decorated type deeper than introspection query.");
}
const nullableType = getType(nullableRef);
return new GraphQLNonNull(assertNullableType(nullableType));
}
return getNamedType2(typeRef);
}
function getNamedType2(typeRef) {
const typeName = typeRef.name;
if (!typeName) {
throw new Error(`Unknown type reference: ${inspect(typeRef)}.`);
}
const type = typeMap.get(typeName);
if (type == null) {
throw new Error(`Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`);
}
return type;
}
function getObjectType(typeRef) {
return assertObjectType(getNamedType2(typeRef));
}
function getInterfaceType(typeRef) {
return assertInterfaceType(getNamedType2(typeRef));
}
function buildType(type) {
switch (type.kind) {
case TypeKind.SCALAR:
return buildScalarDef(type);
case TypeKind.OBJECT:
return buildObjectDef(type);
case TypeKind.INTERFACE:
return buildInterfaceDef(type);
case TypeKind.UNION:
return buildUnionDef(type);
case TypeKind.ENUM:
return buildEnumDef(type);
case TypeKind.INPUT_OBJECT:
return buildInputObjectDef(type);
default:
throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${inspect(type)}.`);
}
}
function buildScalarDef(scalarIntrospection) {
return new GraphQLScalarType({
name: scalarIntrospection.name,
description: scalarIntrospection.description,
specifiedByURL: scalarIntrospection.specifiedByURL
});
}
function buildImplementationsList(implementingIntrospection) {
if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === TypeKind.INTERFACE) {
return [];
}
if (implementingIntrospection.interfaces == null) {
const implementingIntrospectionStr = inspect(implementingIntrospection);
throw new Error(`Introspection result missing interfaces: ${implementingIntrospectionStr}.`);
}
return implementingIntrospection.interfaces.map(getInterfaceType);
}
function buildObjectDef(objectIntrospection) {
return new GraphQLObjectType({
name: objectIntrospection.name,
description: objectIntrospection.description,
interfaces: () => buildImplementationsList(objectIntrospection),
fields: () => buildFieldDefMap(objectIntrospection)
});
}
function buildInterfaceDef(interfaceIntrospection) {
return new GraphQLInterfaceType({
name: interfaceIntrospection.name,
description: interfaceIntrospection.description,
interfaces: () => buildImplementationsList(interfaceIntrospection),
fields: () => buildFieldDefMap(interfaceIntrospection)
});
}
function buildUnionDef(unionIntrospection) {
if (unionIntrospection.possibleTypes == null) {
const unionIntrospectionStr = inspect(unionIntrospection);
throw new Error(`Introspection result missing possibleTypes: ${unionIntrospectionStr}.`);
}
return new GraphQLUnionType({
name: unionIntrospection.name,
description: unionIntrospection.description,
types: () => unionIntrospection.possibleTypes.map(getObjectType)
});
}
function buildEnumDef(enumIntrospection) {
if (enumIntrospection.enumValues == null) {
const enumIntrospectionStr = inspect(enumIntrospection);
throw new Error(`Introspection result missing enumValues: ${enumIntrospectionStr}.`);
}
return new GraphQLEnumType({
name: enumIntrospection.name,
description: enumIntrospection.description,
values: keyValMap(enumIntrospection.enumValues, (valueIntrospection) => valueIntrospection.name, (valueIntrospection) => ({
description: valueIntrospection.description,
deprecationReason: valueIntrospection.deprecationReason
}))
});
}
function buildInputObjectDef(inputObjectIntrospection) {
if (inputObjectIntrospection.inputFields == null) {
const inputObjectIntrospectionStr = inspect(inputObjectIntrospection);
throw new Error(`Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`);
}
return new GraphQLInputObjectType({
name: inputObjectIntrospection.name,
description: inputObjectIntrospection.description,
fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields),
isOneOf: inputObjectIntrospection.isOneOf
});
}
function buildFieldDefMap(typeIntrospection) {
if (typeIntrospection.fields == null) {
throw new Error(`Introspection result missing fields: ${inspect(typeIntrospection)}.`);
}
return keyValMap(typeIntrospection.fields, (fieldIntrospection) => fieldIntrospection.name, buildField);
}
function buildField(fieldIntrospection) {
const type = getType(fieldIntrospection.type);
if (!isOutputType(type)) {
const typeStr = inspect(type);
throw new Error(`Introspection must provide output type for fields, but received: ${typeStr}.`);
}
if (fieldIntrospection.args == null) {
const fieldIntrospectionStr = inspect(fieldIntrospection);
throw new Error(`Introspection result missing field args: ${fieldIntrospectionStr}.`);
}
return {
description: fieldIntrospection.description,
deprecationReason: fieldIntrospection.deprecationReason,
type,
args: buildInputValueDefMap(fieldIntrospection.args)
};
}
function buildInputValueDefMap(inputValueIntrospections) {
return keyValMap(inputValueIntrospections, (inputValue) => inputValue.name, buildInputValue);
}
function buildInputValue(inputValueIntrospection) {
const type = getType(inputValueIntrospection.type);
if (!isInputType(type)) {
const typeStr = inspect(type);
throw new Error(`Introspection must provide input type for arguments, but received: ${typeStr}.`);
}
return {
description: inputValueIntrospection.description,
type,
default: inputValueIntrospection.defaultValue != null ? { literal: parseConstValue(inputValueIntrospection.defaultValue) } : void 0,
deprecationReason: inputValueIntrospection.deprecationReason
};
}
function buildDirective(directiveIntrospection) {
if (directiveIntrospection.args == null) {
const directiveIntrospectionStr = inspect(directiveIntrospection);
throw new Error(`Introspection result missing directive args: ${directiveIntrospectionStr}.`);
}
if (directiveIntrospection.locations == null) {
const directiveIntrospectionStr = inspect(directiveIntrospection);
throw new Error(`Introspection result missing directive locations: ${directiveIntrospectionStr}.`);
}
return new GraphQLDirective({
name: directiveIntrospection.name,
description: directiveIntrospection.description,
isRepeatable: directiveIntrospection.isRepeatable,
deprecationReason: directiveIntrospection.deprecationReason,
locations: directiveIntrospection.locations.slice(),
args: buildInputValueDefMap(directiveIntrospection.args)
});
}
}
var init_buildClientSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/buildClientSchema.mjs"() {
init_devAssert();
init_inspect();
init_isObjectLike();
init_keyValMap();
init_parser();
init_definition();
init_directives();
init_introspection();
init_scalars();
init_schema();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/mapSchemaConfig.mjs
function mapSchemaConfig(schemaConfig, configMapperMapFn) {
const configMapperMap = configMapperMapFn({
getNamedType: getNamedType2,
setNamedType,
getNamedTypes
});
const mappedTypeMap = /* @__PURE__ */ new Map();
for (const type of schemaConfig.types) {
const typeName = type.name;
const mappedNamedType = mapNamedType(type);
if (mappedNamedType) {
mappedTypeMap.set(typeName, mappedNamedType);
}
}
const mappedDirectives = [];
for (const directive of schemaConfig.directives) {
if (isSpecifiedDirective(directive)) {
mappedDirectives.push(directive);
continue;
}
const mappedDirectiveConfig = mapDirective(directive.toConfig());
if (mappedDirectiveConfig) {
mappedDirectives.push(new GraphQLDirective(mappedDirectiveConfig));
}
}
const mappedSchemaConfig = {
...schemaConfig,
query: schemaConfig.query && getNamedType2(schemaConfig.query.name),
mutation: schemaConfig.mutation && getNamedType2(schemaConfig.mutation.name),
subscription: schemaConfig.subscription && getNamedType2(schemaConfig.subscription.name),
types: Array.from(mappedTypeMap.values()),
directives: mappedDirectives
};
const schemaMapper = configMapperMap[SchemaElementKind.SCHEMA];
return schemaMapper == null ? mappedSchemaConfig : schemaMapper(mappedSchemaConfig);
function getType(type) {
if (isListType(type)) {
return new GraphQLList(getType(type.ofType));
}
if (isNonNullType(type)) {
return new GraphQLNonNull(getType(type.ofType));
}
return getNamedType2(type.name);
}
function getNamedType2(typeName) {
const type = stdTypeMap.get(typeName) ?? mappedTypeMap.get(typeName);
if (!(type !== void 0))
invariant(false, `Unknown type: "${typeName}".`);
return type;
}
function setNamedType(type) {
mappedTypeMap.set(type.name, type);
}
function getNamedTypes() {
return Array.from(mappedTypeMap.values());
}
function mapNamedType(type) {
if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {
return type;
}
if (isScalarType(type)) {
return mapScalarType(type);
}
if (isObjectType(type)) {
return mapObjectType(type);
}
if (isInterfaceType(type)) {
return mapInterfaceType(type);
}
if (isUnionType(type)) {
return mapUnionType(type);
}
if (isEnumType(type)) {
return mapEnumType(type);
}
if (isInputObjectType(type)) {
return mapInputObjectType(type);
}
invariant(false, "Unexpected type: " + inspect(type));
}
function mapScalarType(type) {
let mappedConfig = type.toConfig();
const mapper = configMapperMap[SchemaElementKind.SCALAR];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLScalarType(mappedConfig);
}
function mapObjectType(type) {
const config = type.toConfig();
let mappedConfig = {
...config,
interfaces: () => config.interfaces.map((iface) => getNamedType2(iface.name)),
fields: () => mapFields(config.fields, type.name)
};
const mapper = configMapperMap[SchemaElementKind.OBJECT];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLObjectType(mappedConfig);
}
function mapFields(fieldMap, parentTypeName) {
const newFieldMap = /* @__PURE__ */ Object.create(null);
for (const [fieldName, field] of Object.entries(fieldMap)) {
let mappedField = {
...field,
type: getType(field.type),
args: mapArgs(field.args, fieldName, parentTypeName)
};
const mapper = configMapperMap[SchemaElementKind.FIELD];
if (mapper) {
mappedField = mapper(mappedField, parentTypeName);
}
newFieldMap[fieldName] = mappedField;
}
return newFieldMap;
}
function mapArgs(argumentMap, fieldOrDirectiveName, parentTypeName) {
const newArgumentMap = /* @__PURE__ */ Object.create(null);
for (const [argName, arg] of Object.entries(argumentMap)) {
let mappedArg = {
...arg,
type: getType(arg.type)
};
const mapper = configMapperMap[SchemaElementKind.ARGUMENT];
if (mapper) {
mappedArg = mapper(mappedArg, fieldOrDirectiveName, parentTypeName);
}
newArgumentMap[argName] = mappedArg;
}
return newArgumentMap;
}
function mapInterfaceType(type) {
const config = type.toConfig();
let mappedConfig = {
...config,
interfaces: () => config.interfaces.map((iface) => getNamedType2(iface.name)),
fields: () => mapFields(config.fields, type.name)
};
const mapper = configMapperMap[SchemaElementKind.INTERFACE];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLInterfaceType(mappedConfig);
}
function mapUnionType(type) {
const config = type.toConfig();
let mappedConfig = {
...config,
types: () => config.types.map((memberType) => getNamedType2(memberType.name))
};
const mapper = configMapperMap[SchemaElementKind.UNION];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLUnionType(mappedConfig);
}
function mapEnumType(type) {
const config = type.toConfig();
let mappedConfig = {
...config,
values: () => {
const newEnumValues = /* @__PURE__ */ Object.create(null);
for (const [valueName, value] of Object.entries(config.values)) {
const mappedValue = mapEnumValue(value, valueName, type.name);
newEnumValues[valueName] = mappedValue;
}
return newEnumValues;
}
};
const mapper = configMapperMap[SchemaElementKind.ENUM];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLEnumType(mappedConfig);
}
function mapEnumValue(valueConfig, valueName, enumName) {
const mappedConfig = { ...valueConfig };
const mapper = configMapperMap[SchemaElementKind.ENUM_VALUE];
return mapper == null ? mappedConfig : mapper(mappedConfig, valueName, enumName);
}
function mapInputObjectType(type) {
const config = type.toConfig();
let mappedConfig = {
...config,
fields: () => {
const newInputFieldMap = /* @__PURE__ */ Object.create(null);
for (const [fieldName, field] of Object.entries(config.fields)) {
const mappedField = mapInputField(field, fieldName, type.name);
newInputFieldMap[fieldName] = mappedField;
}
return newInputFieldMap;
}
};
const mapper = configMapperMap[SchemaElementKind.INPUT_OBJECT];
mappedConfig = mapper == null ? mappedConfig : mapper(mappedConfig);
return new GraphQLInputObjectType(mappedConfig);
}
function mapInputField(inputFieldConfig, inputFieldName, inputObjectTypeName) {
const mappedConfig = {
...inputFieldConfig,
type: getType(inputFieldConfig.type)
};
const mapper = configMapperMap[SchemaElementKind.INPUT_FIELD];
return mapper == null ? mappedConfig : mapper(mappedConfig, inputFieldName, inputObjectTypeName);
}
function mapDirective(config) {
const mappedConfig = {
...config,
args: mapArgs(config.args, config.name, void 0)
};
const mapper = configMapperMap[SchemaElementKind.DIRECTIVE];
return mapper == null ? mappedConfig : mapper(mappedConfig);
}
}
var SchemaElementKind, stdTypeMap;
var init_mapSchemaConfig = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/mapSchemaConfig.mjs"() {
init_inspect();
init_invariant();
init_definition();
init_directives();
init_introspection();
init_scalars();
SchemaElementKind = {
SCHEMA: "SCHEMA",
SCALAR: "SCALAR",
OBJECT: "OBJECT",
FIELD: "FIELD",
ARGUMENT: "ARGUMENT",
INTERFACE: "INTERFACE",
UNION: "UNION",
ENUM: "ENUM",
ENUM_VALUE: "ENUM_VALUE",
INPUT_OBJECT: "INPUT_OBJECT",
INPUT_FIELD: "INPUT_FIELD",
DIRECTIVE: "DIRECTIVE"
};
stdTypeMap = new Map([...specifiedScalarTypes, ...introspectionTypes].map((type) => [
type.name,
type
]));
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/extendSchema.mjs
function extendSchema(schema, documentAST, options) {
assertSchema(schema);
if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {
assertValidSDLExtension(documentAST, schema);
}
const schemaConfig = schema.toConfig();
const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);
return schemaConfig === extendedConfig ? schema : new GraphQLSchema(extendedConfig);
}
function extendSchemaImpl(schemaConfig, documentAST, options) {
const typeDefs = [];
const scalarExtensions = new AccumulatorMap();
const objectExtensions = new AccumulatorMap();
const interfaceExtensions = new AccumulatorMap();
const unionExtensions = new AccumulatorMap();
const enumExtensions = new AccumulatorMap();
const inputObjectExtensions = new AccumulatorMap();
const directiveExtensions = new AccumulatorMap();
const directiveDefs = [];
let schemaDef;
const schemaExtensions = [];
let isSchemaChanged = false;
for (const def of documentAST.definitions) {
switch (def.kind) {
case kinds_exports.SCHEMA_DEFINITION:
schemaDef = def;
break;
case kinds_exports.SCHEMA_EXTENSION:
schemaExtensions.push(def);
break;
case kinds_exports.DIRECTIVE_DEFINITION:
directiveDefs.push(def);
break;
case kinds_exports.DIRECTIVE_EXTENSION:
directiveExtensions.add(def.name.value, def);
break;
case kinds_exports.SCALAR_TYPE_DEFINITION:
case kinds_exports.OBJECT_TYPE_DEFINITION:
case kinds_exports.INTERFACE_TYPE_DEFINITION:
case kinds_exports.UNION_TYPE_DEFINITION:
case kinds_exports.ENUM_TYPE_DEFINITION:
case kinds_exports.INPUT_OBJECT_TYPE_DEFINITION:
typeDefs.push(def);
break;
case kinds_exports.SCALAR_TYPE_EXTENSION:
scalarExtensions.add(def.name.value, def);
break;
case kinds_exports.OBJECT_TYPE_EXTENSION:
objectExtensions.add(def.name.value, def);
break;
case kinds_exports.INTERFACE_TYPE_EXTENSION:
interfaceExtensions.add(def.name.value, def);
break;
case kinds_exports.UNION_TYPE_EXTENSION:
unionExtensions.add(def.name.value, def);
break;
case kinds_exports.ENUM_TYPE_EXTENSION:
enumExtensions.add(def.name.value, def);
break;
case kinds_exports.INPUT_OBJECT_TYPE_EXTENSION:
inputObjectExtensions.add(def.name.value, def);
break;
default:
continue;
}
isSchemaChanged = true;
}
if (!isSchemaChanged) {
return schemaConfig;
}
return mapSchemaConfig(schemaConfig, (context) => {
const { getNamedType: getNamedType2, setNamedType, getNamedTypes } = context;
return {
[SchemaElementKind.SCHEMA]: (config) => {
for (const typeNode of typeDefs) {
const type = stdTypeMap2.get(typeNode.name.value) ?? buildNamedType(typeNode);
setNamedType(type);
}
const operationTypes = {
query: config.query && getNamedType2(config.query.name),
mutation: config.mutation && getNamedType2(config.mutation.name),
subscription: config.subscription && getNamedType2(config.subscription.name),
...schemaDef && getOperationTypes([schemaDef]),
...getOperationTypes(schemaExtensions)
};
return {
description: schemaDef?.description?.value ?? config.description,
...operationTypes,
types: getNamedTypes(),
directives: [
...config.directives.map(extendDirective),
...directiveDefs.map(buildDirective)
],
extensions: config.extensions,
astNode: schemaDef ?? config.astNode,
extensionASTNodes: config.extensionASTNodes.concat(schemaExtensions),
assumeValid: options?.assumeValid ?? false
};
},
[SchemaElementKind.INPUT_OBJECT]: (config) => {
const extensions = inputObjectExtensions.get(config.name) ?? [];
return {
...config,
fields: () => ({
...config.fields(),
...buildInputFieldMap(extensions)
}),
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
},
[SchemaElementKind.ENUM]: (config) => {
const extensions = enumExtensions.get(config.name) ?? [];
return {
...config,
values: () => ({
...config.values(),
...buildEnumValueMap(extensions)
}),
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
},
[SchemaElementKind.SCALAR]: (config) => {
const extensions = scalarExtensions.get(config.name) ?? [];
let specifiedByURL = config.specifiedByURL;
for (const extensionNode of extensions) {
specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;
}
return {
...config,
specifiedByURL,
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
},
[SchemaElementKind.OBJECT]: (config) => {
const extensions = objectExtensions.get(config.name) ?? [];
return {
...config,
interfaces: () => [
...config.interfaces(),
...buildInterfaces(extensions)
],
fields: () => ({
...config.fields(),
...buildFieldMap(extensions)
}),
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
},
[SchemaElementKind.INTERFACE]: (config) => {
const extensions = interfaceExtensions.get(config.name) ?? [];
return {
...config,
interfaces: () => [
...config.interfaces(),
...buildInterfaces(extensions)
],
fields: () => ({
...config.fields(),
...buildFieldMap(extensions)
}),
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
},
[SchemaElementKind.UNION]: (config) => {
const extensions = unionExtensions.get(config.name) ?? [];
return {
...config,
types: () => [...config.types(), ...buildUnionTypes(extensions)],
extensionASTNodes: config.extensionASTNodes.concat(extensions)
};
}
};
function getOperationTypes(nodes) {
const opTypes = {};
for (const node of nodes) {
const operationTypesNodes = node.operationTypes ?? [];
for (const operationType of operationTypesNodes) {
opTypes[operationType.operation] = namedTypeFromAST(operationType.type);
}
}
return opTypes;
}
function namedTypeFromAST(node) {
const name = node.name.value;
const type = getNamedType2(name);
if (!(type !== void 0))
invariant(false, `Unknown type: "${name}".`);
return type;
}
function typeFromAST2(node) {
if (node.kind === kinds_exports.LIST_TYPE) {
return new GraphQLList(typeFromAST2(node.type));
}
if (node.kind === kinds_exports.NON_NULL_TYPE) {
return new GraphQLNonNull(typeFromAST2(node.type));
}
return namedTypeFromAST(node);
}
function buildDirective(node) {
const extensionASTNodes = directiveExtensions.get(node.name.value) ?? [];
const deprecationReason = getDeprecationReason(node) ?? extensionASTNodes.map((extensionNode) => getDeprecationReason(extensionNode)).find((reason) => reason != null);
return new GraphQLDirective({
name: node.name.value,
description: node.description?.value,
locations: node.locations.map(({ value }) => value),
isRepeatable: node.repeatable,
args: buildArgumentMap(node.arguments),
deprecationReason,
astNode: node,
extensionASTNodes
});
}
function extendDirective(directive) {
const extensionASTNodes = directiveExtensions.get(directive.name) ?? [];
if (extensionASTNodes.length === 0) {
return directive;
}
const deprecationReason = directive.deprecationReason ?? extensionASTNodes.map((extensionNode) => getDeprecationReason(extensionNode)).find((reason) => reason != null);
return new GraphQLDirective({
...directive.toConfig(),
deprecationReason,
extensionASTNodes: directive.extensionASTNodes.concat(extensionASTNodes)
});
}
function buildFieldMap(nodes) {
const fieldConfigMap = /* @__PURE__ */ Object.create(null);
for (const node of nodes) {
const nodeFields = node.fields ?? [];
for (const field of nodeFields) {
fieldConfigMap[field.name.value] = {
type: typeFromAST2(field.type),
description: field.description?.value,
args: buildArgumentMap(field.arguments),
deprecationReason: getDeprecationReason(field),
astNode: field
};
}
}
return fieldConfigMap;
}
function buildArgumentMap(args) {
const argsNodes = args ?? [];
const argConfigMap = /* @__PURE__ */ Object.create(null);
for (const arg of argsNodes) {
const type = typeFromAST2(arg.type);
argConfigMap[arg.name.value] = {
type,
description: arg.description?.value,
default: arg.defaultValue && { literal: arg.defaultValue },
deprecationReason: getDeprecationReason(arg),
astNode: arg
};
}
return argConfigMap;
}
function buildInputFieldMap(nodes) {
const inputFieldMap = /* @__PURE__ */ Object.create(null);
for (const node of nodes) {
const fieldsNodes = node.fields ?? [];
for (const field of fieldsNodes) {
const type = typeFromAST2(field.type);
inputFieldMap[field.name.value] = {
type,
description: field.description?.value,
default: field.defaultValue && { literal: field.defaultValue },
deprecationReason: getDeprecationReason(field),
astNode: field
};
}
}
return inputFieldMap;
}
function buildEnumValueMap(nodes) {
const enumValueMap = /* @__PURE__ */ Object.create(null);
for (const node of nodes) {
const valuesNodes = node.values ?? [];
for (const value of valuesNodes) {
enumValueMap[value.name.value] = {
description: value.description?.value,
deprecationReason: getDeprecationReason(value),
astNode: value
};
}
}
return enumValueMap;
}
function buildInterfaces(nodes) {
return nodes.flatMap((node) => node.interfaces?.map(namedTypeFromAST) ?? []);
}
function buildUnionTypes(nodes) {
return nodes.flatMap((node) => node.types?.map(namedTypeFromAST) ?? []);
}
function buildNamedType(astNode) {
const name = astNode.name.value;
switch (astNode.kind) {
case kinds_exports.OBJECT_TYPE_DEFINITION: {
const extensionASTNodes = objectExtensions.get(name) ?? [];
const allNodes = [astNode, ...extensionASTNodes];
return new GraphQLObjectType({
name,
description: astNode.description?.value,
interfaces: () => buildInterfaces(allNodes),
fields: () => buildFieldMap(allNodes),
astNode,
extensionASTNodes
});
}
case kinds_exports.INTERFACE_TYPE_DEFINITION: {
const extensionASTNodes = interfaceExtensions.get(name) ?? [];
const allNodes = [astNode, ...extensionASTNodes];
return new GraphQLInterfaceType({
name,
description: astNode.description?.value,
interfaces: () => buildInterfaces(allNodes),
fields: () => buildFieldMap(allNodes),
astNode,
extensionASTNodes
});
}
case kinds_exports.ENUM_TYPE_DEFINITION: {
const extensionASTNodes = enumExtensions.get(name) ?? [];
const allNodes = [astNode, ...extensionASTNodes];
return new GraphQLEnumType({
name,
description: astNode.description?.value,
values: () => buildEnumValueMap(allNodes),
astNode,
extensionASTNodes
});
}
case kinds_exports.UNION_TYPE_DEFINITION: {
const extensionASTNodes = unionExtensions.get(name) ?? [];
const allNodes = [astNode, ...extensionASTNodes];
return new GraphQLUnionType({
name,
description: astNode.description?.value,
types: () => buildUnionTypes(allNodes),
astNode,
extensionASTNodes
});
}
case kinds_exports.SCALAR_TYPE_DEFINITION: {
const extensionASTNodes = scalarExtensions.get(name) ?? [];
let specifiedByURL = getSpecifiedByURL(astNode);
for (const extensionNode of extensionASTNodes) {
specifiedByURL = getSpecifiedByURL(extensionNode) ?? specifiedByURL;
}
return new GraphQLScalarType({
name,
description: astNode.description?.value,
specifiedByURL,
astNode,
extensionASTNodes
});
}
case kinds_exports.INPUT_OBJECT_TYPE_DEFINITION: {
const extensionASTNodes = inputObjectExtensions.get(name) ?? [];
const allNodes = [astNode, ...extensionASTNodes];
return new GraphQLInputObjectType({
name,
description: astNode.description?.value,
fields: () => buildInputFieldMap(allNodes),
astNode,
extensionASTNodes,
isOneOf: isOneOf(astNode)
});
}
}
}
});
}
function getDeprecationReason(node) {
const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node);
return deprecated?.reason;
}
function getSpecifiedByURL(node) {
const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node);
return specifiedBy?.url;
}
function isOneOf(node) {
return Boolean(getDirectiveValues(GraphQLOneOfDirective, node));
}
var stdTypeMap2;
var init_extendSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/extendSchema.mjs"() {
init_AccumulatorMap();
init_invariant();
init_kinds2();
init_definition();
init_directives();
init_introspection();
init_scalars();
init_schema();
init_validate2();
init_values();
init_mapSchemaConfig();
stdTypeMap2 = new Map([...specifiedScalarTypes, ...introspectionTypes].map((type) => [
type.name,
type
]));
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/buildASTSchema.mjs
function buildASTSchema(documentAST, options) {
if (options?.assumeValid !== true && options?.assumeValidSDL !== true) {
assertValidSDL(documentAST);
}
const emptySchemaConfig = {
description: void 0,
types: [],
directives: [],
extensions: /* @__PURE__ */ Object.create(null),
extensionASTNodes: [],
assumeValid: false
};
const config = extendSchemaImpl(emptySchemaConfig, documentAST, options);
if (config.astNode == null) {
for (const type of config.types) {
switch (type.name) {
case "Query":
config.query = type;
break;
case "Mutation":
config.mutation = type;
break;
case "Subscription":
config.subscription = type;
break;
}
}
}
const directives = [
...config.directives,
...specifiedDirectives.filter((stdDirective) => config.directives.every((directive) => directive.name !== stdDirective.name))
];
return new GraphQLSchema({ ...config, directives });
}
function buildSchema(source, options) {
const document2 = parse(source, options);
return buildASTSchema(document2, {
assumeValidSDL: options?.assumeValidSDL,
assumeValid: options?.assumeValid
});
}
var init_buildASTSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/buildASTSchema.mjs"() {
init_parser();
init_directives();
init_schema();
init_validate2();
init_extendSchema();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/lexicographicSortSchema.mjs
function lexicographicSortSchema(schema) {
return new GraphQLSchema(mapSchemaConfig(schema.toConfig(), () => ({
[SchemaElementKind.OBJECT]: (config) => ({
...config,
interfaces: () => sortByName(config.interfaces()),
fields: () => sortObjMap(config.fields())
}),
[SchemaElementKind.FIELD]: (config) => ({
...config,
args: sortObjMap(config.args)
}),
[SchemaElementKind.INTERFACE]: (config) => ({
...config,
interfaces: () => sortByName(config.interfaces()),
fields: () => sortObjMap(config.fields())
}),
[SchemaElementKind.UNION]: (config) => ({
...config,
types: () => sortByName(config.types())
}),
[SchemaElementKind.ENUM]: (config) => ({
...config,
values: () => sortObjMap(config.values())
}),
[SchemaElementKind.INPUT_OBJECT]: (config) => ({
...config,
fields: () => sortObjMap(config.fields())
}),
[SchemaElementKind.DIRECTIVE]: (config) => ({
...config,
locations: sortBy(config.locations, (x2) => x2),
args: sortObjMap(config.args)
}),
[SchemaElementKind.SCHEMA]: (config) => ({
...config,
types: sortByName(config.types),
directives: sortByName(config.directives)
})
})));
}
function sortObjMap(map) {
const sortedMap = /* @__PURE__ */ Object.create(null);
for (const key of Object.keys(map).sort(naturalCompare)) {
sortedMap[key] = map[key];
}
return sortedMap;
}
function sortByName(array) {
return sortBy(array, (obj) => obj.name);
}
function sortBy(array, mapToKey) {
return array.slice().sort((obj1, obj2) => {
const key1 = mapToKey(obj1);
const key2 = mapToKey(obj2);
return naturalCompare(key1, key2);
});
}
var init_lexicographicSortSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/lexicographicSortSchema.mjs"() {
init_naturalCompare();
init_schema();
init_mapSchemaConfig();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/printSchema.mjs
function printSchema(schema) {
return printFilteredSchema(schema, (n) => !isSpecifiedDirective(n), isDefinedType);
}
function printIntrospectionSchema(schema) {
return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType);
}
function isDefinedType(type) {
return !isSpecifiedScalarType(type) && !isIntrospectionType(type);
}
function printFilteredSchema(schema, directiveFilter, typeFilter) {
const directives = schema.getDirectives().filter(directiveFilter);
const types = Object.values(schema.getTypeMap()).filter(typeFilter);
return [
printSchemaDefinition(schema),
...directives.map((directive) => printDirective(directive)),
...types.map((type) => printType(type))
].filter(Boolean).join("\n\n");
}
function printSchemaDefinition(schema) {
const queryType = schema.getQueryType();
const mutationType = schema.getMutationType();
const subscriptionType = schema.getSubscriptionType();
if (!queryType && !mutationType && !subscriptionType) {
return;
}
if (schema.description != null || !hasDefaultRootOperationTypes(schema)) {
return printDescription(schema) + "schema {\n" + (queryType ? ` query: ${queryType}
` : "") + (mutationType ? ` mutation: ${mutationType}
` : "") + (subscriptionType ? ` subscription: ${subscriptionType}
` : "") + "}";
}
}
function hasDefaultRootOperationTypes(schema) {
return schema.getQueryType() == schema.getType("Query") && schema.getMutationType() == schema.getType("Mutation") && schema.getSubscriptionType() == schema.getType("Subscription");
}
function printType(type) {
if (isScalarType(type)) {
return printScalar(type);
}
if (isObjectType(type)) {
return printObject(type);
}
if (isInterfaceType(type)) {
return printInterface(type);
}
if (isUnionType(type)) {
return printUnion(type);
}
if (isEnumType(type)) {
return printEnum(type);
}
if (isInputObjectType(type)) {
return printInputObject(type);
}
invariant(false, "Unexpected type: " + inspect(type));
}
function printScalar(type) {
return printDescription(type) + `scalar ${type}` + printSpecifiedByURL(type);
}
function printImplementedInterfaces(type) {
const interfaces = type.getInterfaces();
return interfaces.length ? " implements " + interfaces.map((i) => i.name).join(" & ") : "";
}
function printObject(type) {
return printDescription(type) + `type ${type}` + printImplementedInterfaces(type) + printFields(type);
}
function printInterface(type) {
return printDescription(type) + `interface ${type}` + printImplementedInterfaces(type) + printFields(type);
}
function printUnion(type) {
const types = type.getTypes();
const possibleTypes = types.length ? " = " + types.join(" | ") : "";
return printDescription(type) + `union ${type.name}` + possibleTypes;
}
function printEnum(type) {
const values = type.getValues().map((value, i) => printDescription(value, " ", !i) + " " + value.name + printDeprecated(value.deprecationReason));
return printDescription(type) + `enum ${type}` + printBlock(values);
}
function printInputObject(type) {
const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, " ", !i) + " " + printInputValue(f));
return printDescription(type) + `input ${type}` + (type.isOneOf ? " @oneOf" : "") + printBlock(fields);
}
function printFields(type) {
const fields = Object.values(type.getFields()).map((f, i) => printDescription(f, " ", !i) + " " + f.name + printArgs(f.args, " ") + ": " + String(f.type) + printDeprecated(f.deprecationReason));
return printBlock(fields);
}
function printBlock(items) {
return items.length !== 0 ? " {\n" + items.join("\n") + "\n}" : "";
}
function printArgs(args, indentation = "") {
if (args.length === 0) {
return "";
}
if (args.every((arg) => arg.description == null)) {
return "(" + args.map(printInputValue).join(", ") + ")";
}
return "(\n" + args.map((arg, i) => printDescription(arg, " " + indentation, !i) + " " + indentation + printInputValue(arg)).join("\n") + "\n" + indentation + ")";
}
function printInputValue(argOrInputField) {
let argDecl = argOrInputField.name + ": " + String(argOrInputField.type);
const defaultValueAST = getDefaultValueAST(argOrInputField);
if (defaultValueAST) {
argDecl += ` = ${print(defaultValueAST)}`;
}
return argDecl + printDeprecated(argOrInputField.deprecationReason);
}
function printDirective(directive) {
return printDescription(directive) + `directive ${directive}` + printArgs(directive.args) + printDeprecated(directive.deprecationReason) + (directive.isRepeatable ? " repeatable" : "") + " on " + directive.locations.join(" | ");
}
function printDeprecated(reason) {
if (reason == null) {
return "";
}
if (reason !== DEFAULT_DEPRECATION_REASON) {
const astValue = print({ kind: kinds_exports.STRING, value: reason });
return ` @deprecated(reason: ${astValue})`;
}
return " @deprecated";
}
function printSpecifiedByURL(scalar) {
if (scalar.specifiedByURL == null) {
return "";
}
const astValue = print({
kind: kinds_exports.STRING,
value: scalar.specifiedByURL
});
return ` @specifiedBy(url: ${astValue})`;
}
function printDescription(def, indentation = "", firstInBlock = true) {
const { description } = def;
if (description == null) {
return "";
}
const blockString = print({
kind: kinds_exports.STRING,
value: description,
block: isPrintableAsBlockString(description)
});
const prefix = indentation && !firstInBlock ? "\n" + indentation : indentation;
return prefix + blockString.replaceAll("\n", "\n" + indentation) + "\n";
}
var init_printSchema = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/printSchema.mjs"() {
init_inspect();
init_invariant();
init_blockString();
init_kinds2();
init_printer();
init_definition();
init_directives();
init_introspection();
init_scalars();
init_getDefaultValueAST();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueFromAST.mjs
function valueFromAST(valueNode, type, variables) {
if (!valueNode) {
return;
}
if (valueNode.kind === kinds_exports.VARIABLE) {
const variableName = valueNode.name.value;
if (variables == null || !Object.hasOwn(variables, variableName)) {
return;
}
const variableValue = variables[variableName];
if (variableValue === void 0) {
return;
}
if (variableValue === null && isNonNullType(type)) {
return;
}
return variableValue;
}
if (isNonNullType(type)) {
if (valueNode.kind === kinds_exports.NULL) {
return;
}
return valueFromAST(valueNode, type.ofType, variables);
}
if (valueNode.kind === kinds_exports.NULL) {
return null;
}
if (isListType(type)) {
const itemType = type.ofType;
if (valueNode.kind === kinds_exports.LIST) {
const coercedValues = [];
for (const itemNode of valueNode.values) {
if (isMissingVariable2(itemNode, variables)) {
if (isNonNullType(itemType)) {
return;
}
coercedValues.push(null);
} else {
const itemValue = valueFromAST(itemNode, itemType, variables);
if (itemValue === void 0) {
return;
}
coercedValues.push(itemValue);
}
}
return coercedValues;
}
const coercedValue = valueFromAST(valueNode, itemType, variables);
if (coercedValue === void 0) {
return;
}
return [coercedValue];
}
if (isInputObjectType(type)) {
if (valueNode.kind !== kinds_exports.OBJECT) {
return;
}
const coercedObj = /* @__PURE__ */ Object.create(null);
const fieldDefs = type.getFields();
const hasUnknownField = valueNode.fields.some((field) => !Object.hasOwn(fieldDefs, field.name.value));
if (hasUnknownField) {
return;
}
const fieldNodes = new Map(valueNode.fields.map((field) => [field.name.value, field]));
for (const field of Object.values(fieldDefs)) {
const fieldNode = fieldNodes.get(field.name);
if (fieldNode == null || isMissingVariable2(fieldNode.value, variables)) {
if (field.defaultValue !== void 0) {
coercedObj[field.name] = field.defaultValue;
} else if (isNonNullType(field.type)) {
return;
}
continue;
}
const fieldValue = valueFromAST(fieldNode.value, field.type, variables);
if (fieldValue === void 0) {
return;
}
coercedObj[field.name] = fieldValue;
}
if (type.isOneOf) {
const coercedKeys = Object.keys(coercedObj);
if (fieldNodes.size !== 1 || coercedKeys.length !== 1) {
return;
}
for (const [fieldName, fieldNode] of fieldNodes) {
if (fieldNode.value.kind === kinds_exports.NULL || coercedObj[fieldName] === null) {
return;
}
}
}
return coercedObj;
}
if (isLeafType(type)) {
let result;
try {
result = type.parseLiteral(valueNode, variables);
} catch (_error) {
return;
}
if (result === void 0) {
return;
}
return result;
}
invariant(false, "Unexpected input type: " + inspect(type));
}
function isMissingVariable2(valueNode, variables) {
return valueNode.kind === kinds_exports.VARIABLE && (variables == null || !Object.hasOwn(variables, valueNode.name.value) || variables[valueNode.name.value] === void 0);
}
var init_valueFromAST = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/valueFromAST.mjs"() {
init_inspect();
init_invariant();
init_kinds2();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/concatAST.mjs
function concatAST(documents) {
const definitions = [];
for (const doc of documents) {
definitions.push(...doc.definitions);
}
return { kind: kinds_exports.DOCUMENT, definitions };
}
var init_concatAST = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/concatAST.mjs"() {
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/separateOperations.mjs
function separateOperations(documentAST) {
const operations = [];
const depGraph = /* @__PURE__ */ Object.create(null);
for (const definitionNode of documentAST.definitions) {
switch (definitionNode.kind) {
case kinds_exports.OPERATION_DEFINITION:
operations.push(definitionNode);
break;
case kinds_exports.FRAGMENT_DEFINITION:
depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet);
break;
default:
}
}
const separatedDocumentASTs = /* @__PURE__ */ Object.create(null);
for (const operation of operations) {
const dependencies = /* @__PURE__ */ new Set();
for (const fragmentName of collectDependencies(operation.selectionSet)) {
collectTransitiveDependencies(dependencies, depGraph, fragmentName);
}
const operationName = operation.name ? operation.name.value : "";
separatedDocumentASTs[operationName] = {
kind: kinds_exports.DOCUMENT,
definitions: documentAST.definitions.filter((node) => node === operation || node.kind === kinds_exports.FRAGMENT_DEFINITION && dependencies.has(node.name.value))
};
}
return separatedDocumentASTs;
}
function collectTransitiveDependencies(collected, depGraph, fromName) {
if (!collected.has(fromName)) {
collected.add(fromName);
const immediateDeps = depGraph[fromName];
if (immediateDeps !== void 0) {
for (const toName of immediateDeps) {
collectTransitiveDependencies(collected, depGraph, toName);
}
}
}
}
function collectDependencies(selectionSet) {
const dependencies = [];
visit(selectionSet, {
FragmentSpread(node) {
dependencies.push(node.name.value);
}
});
return dependencies;
}
var init_separateOperations = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/separateOperations.mjs"() {
init_kinds2();
init_visitor();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/stripIgnoredCharacters.mjs
function stripIgnoredCharacters(source) {
const sourceObj = isSource(source) ? source : new Source(source);
const body = sourceObj.body;
const lexer = new Lexer(sourceObj);
let strippedBody = "";
let wasLastAddedTokenNonPunctuator = false;
while (lexer.advance().kind !== TokenKind.EOF) {
const currentToken = lexer.token;
const tokenKind = currentToken.kind;
const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind);
if (wasLastAddedTokenNonPunctuator) {
if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) {
strippedBody += " ";
}
}
const tokenBody = body.slice(currentToken.start, currentToken.end);
if (tokenKind === TokenKind.BLOCK_STRING) {
strippedBody += printBlockString(currentToken.value, { minimize: true });
} else {
strippedBody += tokenBody;
}
wasLastAddedTokenNonPunctuator = isNonPunctuator;
}
return strippedBody;
}
var init_stripIgnoredCharacters = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/stripIgnoredCharacters.mjs"() {
init_blockString();
init_lexer();
init_source();
init_tokenKind();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/sortValueNode.mjs
function sortValueNode(valueNode) {
switch (valueNode.kind) {
case kinds_exports.OBJECT:
return {
...valueNode,
fields: sortFields(valueNode.fields)
};
case kinds_exports.LIST:
return {
...valueNode,
values: valueNode.values.map(sortValueNode)
};
case kinds_exports.INT:
case kinds_exports.FLOAT:
case kinds_exports.STRING:
case kinds_exports.BOOLEAN:
case kinds_exports.NULL:
case kinds_exports.ENUM:
case kinds_exports.VARIABLE:
return valueNode;
}
}
function sortFields(fields) {
return fields.map((fieldNode) => ({
...fieldNode,
value: sortValueNode(fieldNode.value)
})).sort((fieldA, fieldB) => naturalCompare(fieldA.name.value, fieldB.name.value));
}
var init_sortValueNode = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/sortValueNode.mjs"() {
init_naturalCompare();
init_kinds2();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/findSchemaChanges.mjs
function findBreakingChanges(oldSchema, newSchema) {
return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in BreakingChangeType);
}
function findDangerousChanges(oldSchema, newSchema) {
return findSchemaChanges(oldSchema, newSchema).filter((change) => change.type in DangerousChangeType);
}
function findSchemaChanges(oldSchema, newSchema) {
return [
...findTypeChanges(oldSchema, newSchema),
...findDirectiveChanges(oldSchema, newSchema)
];
}
function findDirectiveChanges(oldSchema, newSchema) {
const schemaChanges = [];
const directivesDiff = diff(oldSchema.getDirectives(), newSchema.getDirectives());
for (const oldDirective of directivesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_REMOVED,
description: `Directive ${oldDirective} was removed.`
});
}
for (const newDirective of directivesDiff.added) {
schemaChanges.push({
type: SafeChangeType.DIRECTIVE_ADDED,
description: `Directive @${newDirective.name} was added.`
});
}
for (const [oldDirective, newDirective] of directivesDiff.persisted) {
const argsDiff = diff(oldDirective.args, newDirective.args);
for (const newArg of argsDiff.added) {
if (isRequiredArgument(newArg)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,
description: `A required argument ${newArg} was added.`
});
} else {
schemaChanges.push({
type: SafeChangeType.OPTIONAL_DIRECTIVE_ARG_ADDED,
description: `An optional argument @${oldDirective.name}(${newArg.name}:) was added.`
});
}
}
for (const oldArg of argsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,
description: `Argument ${oldArg} was removed.`
});
}
for (const [oldArg, newArg] of argsDiff.persisted) {
const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type);
const oldDefaultValueStr = getDefaultValue(oldArg);
const newDefaultValueStr = getDefaultValue(newArg);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.ARG_CHANGED_KIND,
description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ${String(oldArg.type)} to ${String(newArg.type)}.`
});
} else if (oldDefaultValueStr !== void 0) {
if (newDefaultValueStr === void 0) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `@${oldDirective.name}(${oldArg.name}:) defaultValue was removed.`
});
} else if (oldDefaultValueStr !== newDefaultValueStr) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `@${oldDirective.name}(${oldArg.name}:) has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`
});
}
} else if (newDefaultValueStr !== void 0 && oldDefaultValueStr === void 0) {
schemaChanges.push({
type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,
description: `@${oldDirective.name}(${oldArg.name}:) added a defaultValue ${newDefaultValueStr}.`
});
} else if (oldArg.type.toString() !== newArg.type.toString()) {
schemaChanges.push({
type: SafeChangeType.ARG_CHANGED_KIND_SAFE,
description: `Argument @${oldDirective.name}(${oldArg.name}:) has changed type from ${String(oldArg.type)} to ${String(newArg.type)}.`
});
}
if (oldArg.description !== newArg.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of @${oldDirective.name}(${oldDirective.name}) has changed to "${newArg.description}".`
});
}
}
if (oldDirective.isRepeatable && !newDirective.isRepeatable) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,
description: `Repeatable flag was removed from ${oldDirective}.`
});
} else if (newDirective.isRepeatable && !oldDirective.isRepeatable) {
schemaChanges.push({
type: SafeChangeType.DIRECTIVE_REPEATABLE_ADDED,
description: `Repeatable flag was added to @${oldDirective.name}.`
});
}
if (oldDirective.description !== newDirective.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of @${oldDirective.name} has changed to "${newDirective.description}".`
});
}
for (const location of oldDirective.locations) {
if (!newDirective.locations.includes(location)) {
schemaChanges.push({
type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,
description: `${location} was removed from ${oldDirective}.`
});
}
}
for (const location of newDirective.locations) {
if (!oldDirective.locations.includes(location)) {
schemaChanges.push({
type: SafeChangeType.DIRECTIVE_LOCATION_ADDED,
description: `${location} was added to @${oldDirective.name}.`
});
}
}
}
return schemaChanges;
}
function findTypeChanges(oldSchema, newSchema) {
const schemaChanges = [];
const typesDiff = diff(Object.values(oldSchema.getTypeMap()), Object.values(newSchema.getTypeMap()));
for (const oldType of typesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.TYPE_REMOVED,
description: isSpecifiedScalarType(oldType) ? `Standard scalar ${oldType} was removed because it is not referenced anymore.` : `${oldType} was removed.`
});
}
for (const newType of typesDiff.added) {
schemaChanges.push({
type: SafeChangeType.TYPE_ADDED,
description: `${newType} was added.`
});
}
for (const [oldType, newType] of typesDiff.persisted) {
if (oldType.description !== newType.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of ${oldType.name} has changed to "${newType.description}".`
});
}
if (isEnumType(oldType) && isEnumType(newType)) {
schemaChanges.push(...findEnumTypeChanges(oldType, newType));
} else if (isUnionType(oldType) && isUnionType(newType)) {
schemaChanges.push(...findUnionTypeChanges(oldType, newType));
} else if (isInputObjectType(oldType) && isInputObjectType(newType)) {
schemaChanges.push(...findInputObjectTypeChanges(oldType, newType));
} else if (isObjectType(oldType) && isObjectType(newType)) {
schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType));
} else if (isInterfaceType(oldType) && isInterfaceType(newType)) {
schemaChanges.push(...findFieldChanges(oldType, newType), ...findImplementedInterfacesChanges(oldType, newType));
} else if (oldType.constructor !== newType.constructor) {
schemaChanges.push({
type: BreakingChangeType.TYPE_CHANGED_KIND,
description: `${oldType} changed from ${typeKindName(oldType)} to ${typeKindName(newType)}.`
});
}
}
return schemaChanges;
}
function findInputObjectTypeChanges(oldType, newType) {
const schemaChanges = [];
const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields()));
for (const newField of fieldsDiff.added) {
if (isRequiredInputField(newField)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,
description: `A required field ${newField} was added.`
});
} else {
schemaChanges.push({
type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,
description: `An optional field ${newField} was added.`
});
}
}
for (const oldField of fieldsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.FIELD_REMOVED,
description: `Field ${oldField} was removed.`
});
}
for (const [oldField, newField] of fieldsDiff.persisted) {
const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldField.type, newField.type);
const oldDefaultValueStr = getDefaultValue(oldField);
const newDefaultValueStr = getDefaultValue(newField);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.FIELD_CHANGED_KIND,
description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`
});
} else if (oldDefaultValueStr !== void 0) {
if (newDefaultValueStr === void 0) {
schemaChanges.push({
type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,
description: `${oldField} defaultValue was removed.`
});
} else if (oldDefaultValueStr !== newDefaultValueStr) {
schemaChanges.push({
type: DangerousChangeType.INPUT_FIELD_DEFAULT_VALUE_CHANGE,
description: `${oldField} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`
});
}
} else if (newDefaultValueStr !== void 0 && oldDefaultValueStr === void 0) {
schemaChanges.push({
type: SafeChangeType.INPUT_FIELD_DEFAULT_VALUE_ADDED,
description: `${oldField} added a defaultValue ${newDefaultValueStr}.`
});
} else if (oldField.type.toString() !== newField.type.toString()) {
schemaChanges.push({
type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,
description: `Field ${oldType}.${oldField.name} changed type from ${String(oldField.type)} to ${String(newField.type)}.`
});
}
if (oldField.description !== newField.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of input-field ${newType}.${newField.name} has changed to "${newField.description}".`
});
}
}
return schemaChanges;
}
function findUnionTypeChanges(oldType, newType) {
const schemaChanges = [];
const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());
for (const newPossibleType of possibleTypesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.TYPE_ADDED_TO_UNION,
description: `${newPossibleType} was added to union type ${oldType}.`
});
}
for (const oldPossibleType of possibleTypesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,
description: `${oldPossibleType} was removed from union type ${oldType}.`
});
}
return schemaChanges;
}
function findEnumTypeChanges(oldType, newType) {
const schemaChanges = [];
const valuesDiff = diff(oldType.getValues(), newType.getValues());
for (const newValue of valuesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.VALUE_ADDED_TO_ENUM,
description: `Enum value ${newValue} was added.`
});
}
for (const oldValue of valuesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,
description: `Enum value ${oldValue} was removed.`
});
}
for (const [oldValue, newValue] of valuesDiff.persisted) {
if (oldValue.description !== newValue.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of enum value ${oldType}.${oldValue.name} has changed to "${newValue.description}".`
});
}
}
return schemaChanges;
}
function findImplementedInterfacesChanges(oldType, newType) {
const schemaChanges = [];
const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());
for (const newInterface of interfacesDiff.added) {
schemaChanges.push({
type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,
description: `${newInterface} added to interfaces implemented by ${oldType}.`
});
}
for (const oldInterface of interfacesDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,
description: `${oldType} no longer implements interface ${oldInterface}.`
});
}
return schemaChanges;
}
function findFieldChanges(oldType, newType) {
const schemaChanges = [];
const fieldsDiff = diff(Object.values(oldType.getFields()), Object.values(newType.getFields()));
for (const oldField of fieldsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.FIELD_REMOVED,
description: `Field ${oldField} was removed.`
});
}
for (const newField of fieldsDiff.added) {
schemaChanges.push({
type: SafeChangeType.FIELD_ADDED,
description: `Field ${oldType}.${newField.name} was added.`
});
}
for (const [oldField, newField] of fieldsDiff.persisted) {
schemaChanges.push(...findArgChanges(oldField, newField));
const isSafe = isChangeSafeForObjectOrInterfaceField(oldField.type, newField.type);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.FIELD_CHANGED_KIND,
description: `Field ${newField} changed type from ${oldField.type} to ${newField.type}.`
});
} else if (oldField.type.toString() !== newField.type.toString()) {
schemaChanges.push({
type: SafeChangeType.FIELD_CHANGED_KIND_SAFE,
description: `Field ${oldType}.${oldField.name} changed type from ${String(oldField.type)} to ${String(newField.type)}.`
});
}
if (oldField.description !== newField.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of field ${oldType}.${oldField.name} has changed to "${newField.description}".`
});
}
}
return schemaChanges;
}
function findArgChanges(oldField, newField) {
const schemaChanges = [];
const argsDiff = diff(oldField.args, newField.args);
for (const oldArg of argsDiff.removed) {
schemaChanges.push({
type: BreakingChangeType.ARG_REMOVED,
description: `Argument ${oldArg} was removed.`
});
}
for (const [oldArg, newArg] of argsDiff.persisted) {
const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(oldArg.type, newArg.type);
const oldDefaultValueStr = getDefaultValue(oldArg);
const newDefaultValueStr = getDefaultValue(newArg);
if (!isSafe) {
schemaChanges.push({
type: BreakingChangeType.ARG_CHANGED_KIND,
description: `Argument ${newArg} has changed type from ${oldArg.type} to ${newArg.type}.`
});
} else if (oldDefaultValueStr !== void 0) {
if (newDefaultValueStr === void 0) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `${oldArg} defaultValue was removed.`
});
} else if (oldDefaultValueStr !== newDefaultValueStr) {
schemaChanges.push({
type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,
description: `${oldArg} has changed defaultValue from ${oldDefaultValueStr} to ${newDefaultValueStr}.`
});
}
} else if (newDefaultValueStr !== void 0 && oldDefaultValueStr === void 0) {
schemaChanges.push({
type: SafeChangeType.ARG_DEFAULT_VALUE_ADDED,
description: `${oldArg} added a defaultValue ${newDefaultValueStr}.`
});
} else if (oldArg.type.toString() !== newArg.type.toString()) {
schemaChanges.push({
type: SafeChangeType.ARG_CHANGED_KIND_SAFE,
description: `Argument ${oldArg} has changed type from ${String(oldArg.type)} to ${String(newArg.type)}.`
});
}
if (oldArg.description !== newArg.description) {
schemaChanges.push({
type: SafeChangeType.DESCRIPTION_CHANGED,
description: `Description of argument ${oldArg} has changed to "${newArg.description}".`
});
}
}
for (const newArg of argsDiff.added) {
if (isRequiredArgument(newArg)) {
schemaChanges.push({
type: BreakingChangeType.REQUIRED_ARG_ADDED,
description: `A required argument ${newArg} was added.`
});
} else {
schemaChanges.push({
type: DangerousChangeType.OPTIONAL_ARG_ADDED,
description: `An optional argument ${newArg} was added.`
});
}
}
return schemaChanges;
}
function isChangeSafeForObjectOrInterfaceField(oldType, newType) {
if (isListType(oldType)) {
return isListType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType) || isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType);
}
if (isNonNullType(oldType)) {
return isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType);
}
return isNamedType(newType) && oldType.name === newType.name || isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType);
}
function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) {
if (isListType(oldType)) {
return isListType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType);
}
if (isNonNullType(oldType)) {
return isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType) || !isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType);
}
return isNamedType(newType) && oldType.name === newType.name;
}
function typeKindName(type) {
if (isScalarType(type)) {
return "a Scalar type";
}
if (isObjectType(type)) {
return "an Object type";
}
if (isInterfaceType(type)) {
return "an Interface type";
}
if (isUnionType(type)) {
return "a Union type";
}
if (isEnumType(type)) {
return "an Enum type";
}
if (isInputObjectType(type)) {
return "an Input type";
}
invariant(false, "Unexpected type: " + inspect(type));
}
function getDefaultValue(argOrInputField) {
const ast = getDefaultValueAST(argOrInputField);
if (ast) {
return print(sortValueNode(ast));
}
}
function diff(oldArray, newArray) {
const added = [];
const removed = [];
const persisted = [];
const oldMap = keyMap(oldArray, ({ name }) => name);
const newMap = keyMap(newArray, ({ name }) => name);
for (const oldItem of oldArray) {
const newItem = newMap[oldItem.name];
if (newItem === void 0) {
removed.push(oldItem);
} else {
persisted.push([oldItem, newItem]);
}
}
for (const newItem of newArray) {
if (oldMap[newItem.name] === void 0) {
added.push(newItem);
}
}
return { added, persisted, removed };
}
var BreakingChangeType, DangerousChangeType, SafeChangeType;
var init_findSchemaChanges = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/findSchemaChanges.mjs"() {
init_inspect();
init_invariant();
init_keyMap();
init_printer();
init_definition();
init_scalars();
init_getDefaultValueAST();
init_sortValueNode();
BreakingChangeType = {
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"
};
DangerousChangeType = {
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",
INPUT_FIELD_DEFAULT_VALUE_CHANGE: "INPUT_FIELD_DEFAULT_VALUE_CHANGE"
};
SafeChangeType = {
DESCRIPTION_CHANGED: "DESCRIPTION_CHANGED",
TYPE_ADDED: "TYPE_ADDED",
OPTIONAL_INPUT_FIELD_ADDED: "OPTIONAL_INPUT_FIELD_ADDED",
OPTIONAL_ARG_ADDED: "OPTIONAL_ARG_ADDED",
DIRECTIVE_ADDED: "DIRECTIVE_ADDED",
FIELD_ADDED: "FIELD_ADDED",
DIRECTIVE_REPEATABLE_ADDED: "DIRECTIVE_REPEATABLE_ADDED",
DIRECTIVE_LOCATION_ADDED: "DIRECTIVE_LOCATION_ADDED",
OPTIONAL_DIRECTIVE_ARG_ADDED: "OPTIONAL_DIRECTIVE_ARG_ADDED",
FIELD_CHANGED_KIND_SAFE: "FIELD_CHANGED_KIND_SAFE",
ARG_CHANGED_KIND_SAFE: "ARG_CHANGED_KIND_SAFE",
ARG_DEFAULT_VALUE_ADDED: "ARG_DEFAULT_VALUE_ADDED",
INPUT_FIELD_DEFAULT_VALUE_ADDED: "INPUT_FIELD_DEFAULT_VALUE_ADDED"
};
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs
function resolveSchemaCoordinate(schema, schemaCoordinate) {
return resolveASTSchemaCoordinate(schema, parseSchemaCoordinate(schemaCoordinate));
}
function resolveTypeCoordinate(schema, schemaCoordinate) {
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName);
if (type == null) {
return;
}
return { kind: "NamedType", type };
}
function resolveMemberCoordinate(schema, schemaCoordinate) {
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName);
if (!type) {
throw new Error(`Expected ${inspect(typeName)} to be defined as a type in the schema.`);
}
if (!isEnumType(type) && !isInputObjectType(type) && !isObjectType(type) && !isInterfaceType(type)) {
throw new Error(`Expected ${inspect(typeName)} to be an Enum, Input Object, Object or Interface type.`);
}
if (isEnumType(type)) {
const enumValueName = schemaCoordinate.memberName.value;
const enumValue = type.getValue(enumValueName);
if (enumValue == null) {
return;
}
return { kind: "EnumValue", type, enumValue };
}
if (isInputObjectType(type)) {
const inputFieldName = schemaCoordinate.memberName.value;
const inputField = type.getFields()[inputFieldName];
if (inputField == null) {
return;
}
return { kind: "InputField", type, inputField };
}
const fieldName = schemaCoordinate.memberName.value;
const field = schema.getField(type, fieldName);
if (field == null) {
return;
}
return { kind: "Field", type, field };
}
function resolveArgumentCoordinate(schema, schemaCoordinate) {
const typeName = schemaCoordinate.name.value;
const type = schema.getType(typeName);
if (type == null) {
throw new Error(`Expected ${inspect(typeName)} to be defined as a type in the schema.`);
}
if (!isObjectType(type) && !isInterfaceType(type)) {
throw new Error(`Expected ${inspect(typeName)} to be an object type or interface type.`);
}
const fieldName = schemaCoordinate.fieldName.value;
const field = schema.getField(type, fieldName);
if (field == null) {
throw new Error(`Expected ${inspect(fieldName)} to exist as a field of type ${inspect(typeName)} in the schema.`);
}
const fieldArgumentName = schemaCoordinate.argumentName.value;
const fieldArgument = field.args.find((arg) => arg.name === fieldArgumentName);
if (fieldArgument == null) {
return;
}
return { kind: "FieldArgument", type, field, fieldArgument };
}
function resolveDirectiveCoordinate(schema, schemaCoordinate) {
const directiveName = schemaCoordinate.name.value;
const directive = schema.getDirective(directiveName);
if (!directive) {
return;
}
return { kind: "Directive", directive };
}
function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {
const directiveName = schemaCoordinate.name.value;
const directive = schema.getDirective(directiveName);
if (!directive) {
throw new Error(`Expected ${inspect(directiveName)} to be defined as a directive in the schema.`);
}
const { argumentName: { value: directiveArgumentName } } = schemaCoordinate;
const directiveArgument = directive.args.find((arg) => arg.name === directiveArgumentName);
if (!directiveArgument) {
return;
}
return { kind: "DirectiveArgument", directive, directiveArgument };
}
function resolveASTSchemaCoordinate(schema, schemaCoordinate) {
switch (schemaCoordinate.kind) {
case kinds_exports.TYPE_COORDINATE:
return resolveTypeCoordinate(schema, schemaCoordinate);
case kinds_exports.MEMBER_COORDINATE:
return resolveMemberCoordinate(schema, schemaCoordinate);
case kinds_exports.ARGUMENT_COORDINATE:
return resolveArgumentCoordinate(schema, schemaCoordinate);
case kinds_exports.DIRECTIVE_COORDINATE:
return resolveDirectiveCoordinate(schema, schemaCoordinate);
case kinds_exports.DIRECTIVE_ARGUMENT_COORDINATE:
return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate);
}
}
var init_resolveSchemaCoordinate = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs"() {
init_inspect();
init_kinds2();
init_parser();
init_definition();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/index.mjs
var init_utilities = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/utilities/index.mjs"() {
init_getIntrospectionQuery();
init_getOperationAST();
init_introspectionFromSchema();
init_buildClientSchema();
init_buildASTSchema();
init_extendSchema();
init_lexicographicSortSchema();
init_printSchema();
init_typeFromAST();
init_valueFromAST();
init_valueFromASTUntyped();
init_astFromValue();
init_TypeInfo();
init_replaceVariables();
init_valueToLiteral();
init_coerceInputValue();
init_validateInputValue();
init_concatAST();
init_separateOperations();
init_stripIgnoredCharacters();
init_typeComparators();
init_findSchemaChanges();
init_resolveSchemaCoordinate();
}
});
// ../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/index.mjs
var graphql_exports = {};
__export(graphql_exports, {
AbortedGraphQLExecutionError: () => AbortedGraphQLExecutionError,
BREAK: () => BREAK,
BreakingChangeType: () => BreakingChangeType,
DEFAULT_DEPRECATION_REASON: () => DEFAULT_DEPRECATION_REASON,
DangerousChangeType: () => DangerousChangeType,
DeferStreamDirectiveLabelRule: () => DeferStreamDirectiveLabelRule,
DeferStreamDirectiveOnRootFieldRule: () => DeferStreamDirectiveOnRootFieldRule,
DeferStreamDirectiveOnValidOperationsRule: () => DeferStreamDirectiveOnValidOperationsRule,
DirectiveLocation: () => DirectiveLocation,
ExecutableDefinitionsRule: () => ExecutableDefinitionsRule,
FieldsOnCorrectTypeRule: () => FieldsOnCorrectTypeRule,
FragmentsOnCompositeTypesRule: () => FragmentsOnCompositeTypesRule,
GRAPHQL_MAX_INT: () => GRAPHQL_MAX_INT,
GRAPHQL_MIN_INT: () => GRAPHQL_MIN_INT,
GraphQLBoolean: () => GraphQLBoolean,
GraphQLDeferDirective: () => GraphQLDeferDirective,
GraphQLDeprecatedDirective: () => GraphQLDeprecatedDirective,
GraphQLDirective: () => GraphQLDirective,
GraphQLEnumType: () => GraphQLEnumType,
GraphQLError: () => GraphQLError,
GraphQLFloat: () => GraphQLFloat,
GraphQLID: () => GraphQLID,
GraphQLIncludeDirective: () => GraphQLIncludeDirective,
GraphQLInputObjectType: () => GraphQLInputObjectType,
GraphQLInt: () => GraphQLInt,
GraphQLInterfaceType: () => GraphQLInterfaceType,
GraphQLList: () => GraphQLList,
GraphQLNonNull: () => GraphQLNonNull,
GraphQLObjectType: () => GraphQLObjectType,
GraphQLOneOfDirective: () => GraphQLOneOfDirective,
GraphQLScalarType: () => GraphQLScalarType,
GraphQLSchema: () => GraphQLSchema,
GraphQLSkipDirective: () => GraphQLSkipDirective,
GraphQLSpecifiedByDirective: () => GraphQLSpecifiedByDirective,
GraphQLStreamDirective: () => GraphQLStreamDirective,
GraphQLString: () => GraphQLString,
GraphQLUnionType: () => GraphQLUnionType,
Kind: () => kinds_exports,
KnownArgumentNamesRule: () => KnownArgumentNamesRule,
KnownDirectivesRule: () => KnownDirectivesRule,
KnownFragmentNamesRule: () => KnownFragmentNamesRule,
KnownOperationTypesRule: () => KnownOperationTypesRule,
KnownTypeNamesRule: () => KnownTypeNamesRule,
Lexer: () => Lexer,
Location: () => Location,
LoneAnonymousOperationRule: () => LoneAnonymousOperationRule,
LoneSchemaDefinitionRule: () => LoneSchemaDefinitionRule,
MaxIntrospectionDepthRule: () => MaxIntrospectionDepthRule,
NoDeprecatedCustomRule: () => NoDeprecatedCustomRule,
NoFragmentCyclesRule: () => NoFragmentCyclesRule,
NoSchemaIntrospectionCustomRule: () => NoSchemaIntrospectionCustomRule,
NoUndefinedVariablesRule: () => NoUndefinedVariablesRule,
NoUnusedFragmentsRule: () => NoUnusedFragmentsRule,
NoUnusedVariablesRule: () => NoUnusedVariablesRule,
OperationTypeNode: () => OperationTypeNode,
OverlappingFieldsCanBeMergedRule: () => OverlappingFieldsCanBeMergedRule,
PossibleFragmentSpreadsRule: () => PossibleFragmentSpreadsRule,
PossibleTypeExtensionsRule: () => PossibleTypeExtensionsRule,
ProvidedRequiredArgumentsRule: () => ProvidedRequiredArgumentsRule,
SafeChangeType: () => SafeChangeType,
ScalarLeafsRule: () => ScalarLeafsRule,
SchemaMetaFieldDef: () => SchemaMetaFieldDef,
SingleFieldSubscriptionsRule: () => SingleFieldSubscriptionsRule,
Source: () => Source,
StreamDirectiveOnListFieldRule: () => StreamDirectiveOnListFieldRule,
Token: () => Token2,
TokenKind: () => TokenKind,
TypeInfo: () => TypeInfo,
TypeKind: () => TypeKind,
TypeMetaFieldDef: () => TypeMetaFieldDef,
TypeNameMetaFieldDef: () => TypeNameMetaFieldDef,
UniqueArgumentDefinitionNamesRule: () => UniqueArgumentDefinitionNamesRule,
UniqueArgumentNamesRule: () => UniqueArgumentNamesRule,
UniqueDirectiveNamesRule: () => UniqueDirectiveNamesRule,
UniqueDirectivesPerLocationRule: () => UniqueDirectivesPerLocationRule,
UniqueEnumValueNamesRule: () => UniqueEnumValueNamesRule,
UniqueFieldDefinitionNamesRule: () => UniqueFieldDefinitionNamesRule,
UniqueFragmentNamesRule: () => UniqueFragmentNamesRule,
UniqueInputFieldNamesRule: () => UniqueInputFieldNamesRule,
UniqueOperationNamesRule: () => UniqueOperationNamesRule,
UniqueOperationTypesRule: () => UniqueOperationTypesRule,
UniqueTypeNamesRule: () => UniqueTypeNamesRule,
UniqueVariableNamesRule: () => UniqueVariableNamesRule,
ValidationContext: () => ValidationContext,
ValuesOfCorrectTypeRule: () => ValuesOfCorrectTypeRule,
VariablesAreInputTypesRule: () => VariablesAreInputTypesRule,
VariablesInAllowedPositionRule: () => VariablesInAllowedPositionRule,
__Directive: () => __Directive,
__DirectiveLocation: () => __DirectiveLocation,
__EnumValue: () => __EnumValue,
__Field: () => __Field,
__InputValue: () => __InputValue,
__Schema: () => __Schema,
__Type: () => __Type,
__TypeKind: () => __TypeKind,
assertAbstractType: () => assertAbstractType,
assertArgument: () => assertArgument,
assertCompositeType: () => assertCompositeType,
assertDirective: () => assertDirective,
assertEnumType: () => assertEnumType,
assertEnumValue: () => assertEnumValue,
assertEnumValueName: () => assertEnumValueName,
assertField: () => assertField,
assertInputField: () => assertInputField,
assertInputObjectType: () => assertInputObjectType,
assertInputType: () => assertInputType,
assertInterfaceType: () => assertInterfaceType,
assertLeafType: () => assertLeafType,
assertListType: () => assertListType,
assertName: () => assertName,
assertNamedType: () => assertNamedType,
assertNonNullType: () => assertNonNullType,
assertNullableType: () => assertNullableType,
assertObjectType: () => assertObjectType,
assertOutputType: () => assertOutputType,
assertScalarType: () => assertScalarType,
assertSchema: () => assertSchema,
assertType: () => assertType,
assertUnionType: () => assertUnionType,
assertValidSchema: () => assertValidSchema,
assertWrappingType: () => assertWrappingType,
astFromValue: () => astFromValue,
buildASTSchema: () => buildASTSchema,
buildClientSchema: () => buildClientSchema,
buildSchema: () => buildSchema,
coerceInputLiteral: () => coerceInputLiteral,
coerceInputValue: () => coerceInputValue,
concatAST: () => concatAST,
createSourceEventStream: () => createSourceEventStream,
defaultFieldResolver: () => defaultFieldResolver,
defaultHarness: () => defaultHarness,
defaultTypeResolver: () => defaultTypeResolver,
doTypesOverlap: () => doTypesOverlap,
enableDevMode: () => enableDevMode,
execute: () => execute,
executeRootSelectionSet: () => executeRootSelectionSet,
executeSubscriptionEvent: () => executeSubscriptionEvent,
executeSync: () => executeSync,
experimentalExecuteIncrementally: () => experimentalExecuteIncrementally,
experimentalExecuteRootSelectionSet: () => experimentalExecuteRootSelectionSet,
extendSchema: () => extendSchema,
findBreakingChanges: () => findBreakingChanges,
findDangerousChanges: () => findDangerousChanges,
findSchemaChanges: () => findSchemaChanges,
getArgumentValues: () => getArgumentValues,
getDirectiveValues: () => getDirectiveValues,
getEnterLeaveForKind: () => getEnterLeaveForKind,
getIntrospectionQuery: () => getIntrospectionQuery,
getLocation: () => getLocation,
getNamedType: () => getNamedType,
getNullableType: () => getNullableType,
getOperationAST: () => getOperationAST,
getVariableValues: () => getVariableValues,
graphql: () => graphql,
graphqlSync: () => graphqlSync,
introspectionFromSchema: () => introspectionFromSchema,
introspectionTypes: () => introspectionTypes,
isAbstractType: () => isAbstractType,
isArgument: () => isArgument,
isCompositeType: () => isCompositeType,
isConstValueNode: () => isConstValueNode,
isDefinitionNode: () => isDefinitionNode,
isDevModeEnabled: () => isDevModeEnabled,
isDirective: () => isDirective,
isEnumType: () => isEnumType,
isEnumValue: () => isEnumValue,
isEqualType: () => isEqualType,
isExecutableDefinitionNode: () => isExecutableDefinitionNode,
isField: () => isField,
isInputField: () => isInputField,
isInputObjectType: () => isInputObjectType,
isInputType: () => isInputType,
isInterfaceType: () => isInterfaceType,
isIntrospectionType: () => isIntrospectionType,
isLeafType: () => isLeafType,
isListType: () => isListType,
isNamedType: () => isNamedType,
isNonNullType: () => isNonNullType,
isNullableType: () => isNullableType,
isObjectType: () => isObjectType,
isOutputType: () => isOutputType,
isRequiredArgument: () => isRequiredArgument,
isRequiredInputField: () => isRequiredInputField,
isScalarType: () => isScalarType,
isSchema: () => isSchema,
isSchemaCoordinateNode: () => isSchemaCoordinateNode,
isSelectionNode: () => isSelectionNode,
isSpecifiedDirective: () => isSpecifiedDirective,
isSpecifiedScalarType: () => isSpecifiedScalarType,
isSubscriptionOperationDefinitionNode: () => isSubscriptionOperationDefinitionNode,
isType: () => isType,
isTypeDefinitionNode: () => isTypeDefinitionNode,
isTypeExtensionNode: () => isTypeExtensionNode,
isTypeNode: () => isTypeNode,
isTypeSubTypeOf: () => isTypeSubTypeOf,
isTypeSystemDefinitionNode: () => isTypeSystemDefinitionNode,
isTypeSystemExtensionNode: () => isTypeSystemExtensionNode,
isUnionType: () => isUnionType,
isValueNode: () => isValueNode,
isWrappingType: () => isWrappingType,
legacyExecuteIncrementally: () => legacyExecuteIncrementally,
legacyExecuteRootSelectionSet: () => legacyExecuteRootSelectionSet,
lexicographicSortSchema: () => lexicographicSortSchema,
locatedError: () => locatedError,
mapSourceToResponseEvent: () => mapSourceToResponseEvent,
parse: () => parse,
parseConstValue: () => parseConstValue,
parseSchemaCoordinate: () => parseSchemaCoordinate,
parseType: () => parseType,
parseValue: () => parseValue,
print: () => print,
printDirective: () => printDirective,
printIntrospectionSchema: () => printIntrospectionSchema,
printLocation: () => printLocation,
printSchema: () => printSchema,
printSourceLocation: () => printSourceLocation,
printType: () => printType,
recommendedRules: () => recommendedRules,
replaceVariables: () => replaceVariables,
resolveASTSchemaCoordinate: () => resolveASTSchemaCoordinate,
resolveObjMapThunk: () => resolveObjMapThunk,
resolveReadonlyArrayThunk: () => resolveReadonlyArrayThunk,
resolveSchemaCoordinate: () => resolveSchemaCoordinate,
responsePathAsArray: () => pathToArray,
separateOperations: () => separateOperations,
specifiedDirectives: () => specifiedDirectives,
specifiedRules: () => specifiedRules,
specifiedScalarTypes: () => specifiedScalarTypes,
stripIgnoredCharacters: () => stripIgnoredCharacters,
subscribe: () => subscribe,
syntaxError: () => syntaxError,
typeFromAST: () => typeFromAST,
validate: () => validate,
validateExecutionArgs: () => validateExecutionArgs,
validateInputLiteral: () => validateInputLiteral,
validateInputValue: () => validateInputValue,
validateSchema: () => validateSchema,
validateSubscriptionArgs: () => validateSubscriptionArgs,
valueFromAST: () => valueFromAST,
valueFromASTUntyped: () => valueFromASTUntyped,
valueToLiteral: () => valueToLiteral,
version: () => version,
versionInfo: () => versionInfo,
visit: () => visit,
visitInParallel: () => visitInParallel,
visitWithTypeInfo: () => visitWithTypeInfo
});
var init_graphql2 = __esm({
"../../../node_modules/.pnpm/graphql@17.1.0/node_modules/graphql/index.mjs"() {
init_version();
init_devMode();
init_graphql();
init_harness();
init_type();
init_kinds2();
init_language();
init_execution();
init_validation();
init_error();
init_utilities();
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/autocompleteUtils.js
var require_autocompleteUtils = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/autocompleteUtils.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFieldInsertText = exports.getInputInsertText = exports.getInsertText = void 0;
exports.objectValues = objectValues;
exports.hintList = hintList;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function objectValues(object) {
const keys = Object.keys(object);
const len = keys.length;
const values = new Array(len);
for (let i = 0; i < len; ++i) {
values[i] = object[keys[i]];
}
return values;
}
function hintList(token, list) {
return filterAndSortList(list, normalizeText(token.string));
}
function filterAndSortList(list, text) {
if (!text || text.trim() === "" || text.trim() === ":" || text.trim() === "{") {
return filterNonEmpty(list, (entry) => !entry.isDeprecated);
}
const byProximity = list.map((entry) => ({
proximity: getProximity(normalizeText(entry.label), text),
entry
}));
return filterNonEmpty(filterNonEmpty(byProximity, (pair) => pair.proximity <= 2), (pair) => !pair.entry.isDeprecated).sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.label.length - b.entry.label.length).map((pair) => pair.entry);
}
function filterNonEmpty(array, predicate) {
const filtered = array.filter(predicate);
return filtered.length === 0 ? array : filtered;
}
function normalizeText(text) {
return text.toLowerCase().replaceAll(/\W/g, "");
}
function getProximity(suggestion, text) {
let proximity = lexicalDistance(text, suggestion);
if (suggestion.length > text.length) {
proximity -= suggestion.length - text.length - 1;
proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5;
}
return proximity;
}
function lexicalDistance(a, b) {
let i;
let j;
const d = [];
const aLength = a.length;
const bLength = b.length;
for (i = 0; i <= aLength; i++) {
d[i] = [i];
}
for (j = 1; j <= bLength; j++) {
d[0][j] = j;
}
for (i = 1; i <= aLength; i++) {
for (j = 1; j <= bLength; j++) {
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost);
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost);
}
}
}
return d[aLength][bLength];
}
var insertSuffix = (n) => ` {
$${n !== null && n !== void 0 ? n : 1}
}`;
var getInsertText = (prefix, type, fallback) => {
if (!type) {
return fallback !== null && fallback !== void 0 ? fallback : prefix;
}
const namedType = (0, graphql_1.getNamedType)(type);
if ((0, graphql_1.isObjectType)(namedType) || (0, graphql_1.isInputObjectType)(namedType) || (0, graphql_1.isListType)(namedType) || (0, graphql_1.isAbstractType)(namedType)) {
return prefix + insertSuffix();
}
return fallback !== null && fallback !== void 0 ? fallback : prefix;
};
exports.getInsertText = getInsertText;
var getInputInsertText = (prefix, type, fallback) => {
if ((0, graphql_1.isListType)(type)) {
const baseType = (0, graphql_1.getNamedType)(type.ofType);
return prefix + `[${(0, exports.getInsertText)("", baseType, "$1")}]`;
}
return (0, exports.getInsertText)(prefix, type, fallback);
};
exports.getInputInsertText = getInputInsertText;
var getFieldInsertText = (field) => {
const requiredArgs = field.args.filter((arg) => arg.type.toString().endsWith("!"));
if (!requiredArgs.length) {
return;
}
return field.name + `(${requiredArgs.map((arg, i) => `${arg.name}: $${i + 1}`)}) ${(0, exports.getInsertText)("", field.type, "\n")}`;
};
exports.getFieldInsertText = getFieldInsertText;
}
});
// ../../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js
var main_exports = {};
__export(main_exports, {
AnnotatedTextEdit: () => AnnotatedTextEdit,
ChangeAnnotation: () => ChangeAnnotation,
ChangeAnnotationIdentifier: () => ChangeAnnotationIdentifier,
CodeAction: () => CodeAction,
CodeActionContext: () => CodeActionContext,
CodeActionKind: () => CodeActionKind,
CodeActionTriggerKind: () => CodeActionTriggerKind,
CodeDescription: () => CodeDescription,
CodeLens: () => CodeLens,
Color: () => Color2,
ColorInformation: () => ColorInformation,
ColorPresentation: () => ColorPresentation,
Command: () => Command2,
CompletionItem: () => CompletionItem,
CompletionItemKind: () => CompletionItemKind2,
CompletionItemLabelDetails: () => CompletionItemLabelDetails,
CompletionItemTag: () => CompletionItemTag2,
CompletionList: () => CompletionList,
CreateFile: () => CreateFile,
DeleteFile: () => DeleteFile,
Diagnostic: () => Diagnostic,
DiagnosticRelatedInformation: () => DiagnosticRelatedInformation,
DiagnosticSeverity: () => DiagnosticSeverity,
DiagnosticTag: () => DiagnosticTag,
DocumentHighlight: () => DocumentHighlight,
DocumentHighlightKind: () => DocumentHighlightKind3,
DocumentLink: () => DocumentLink,
DocumentSymbol: () => DocumentSymbol,
DocumentUri: () => DocumentUri,
EOL: () => EOL,
FoldingRange: () => FoldingRange,
FoldingRangeKind: () => FoldingRangeKind2,
FormattingOptions: () => FormattingOptions,
Hover: () => Hover,
InlayHint: () => InlayHint,
InlayHintKind: () => InlayHintKind3,
InlayHintLabelPart: () => InlayHintLabelPart,
InlineCompletionContext: () => InlineCompletionContext,
InlineCompletionItem: () => InlineCompletionItem,
InlineCompletionList: () => InlineCompletionList,
InlineCompletionTriggerKind: () => InlineCompletionTriggerKind3,
InlineValueContext: () => InlineValueContext,
InlineValueEvaluatableExpression: () => InlineValueEvaluatableExpression,
InlineValueText: () => InlineValueText,
InlineValueVariableLookup: () => InlineValueVariableLookup,
InsertReplaceEdit: () => InsertReplaceEdit,
InsertTextFormat: () => InsertTextFormat,
InsertTextMode: () => InsertTextMode,
Location: () => Location2,
LocationLink: () => LocationLink,
MarkedString: () => MarkedString,
MarkupContent: () => MarkupContent,
MarkupKind: () => MarkupKind,
OptionalVersionedTextDocumentIdentifier: () => OptionalVersionedTextDocumentIdentifier,
ParameterInformation: () => ParameterInformation,
Position: () => Position2,
Range: () => Range2,
RenameFile: () => RenameFile,
SelectedCompletionInfo: () => SelectedCompletionInfo,
SelectionRange: () => SelectionRange,
SemanticTokenModifiers: () => SemanticTokenModifiers,
SemanticTokenTypes: () => SemanticTokenTypes,
SemanticTokens: () => SemanticTokens,
SignatureInformation: () => SignatureInformation,
StringValue: () => StringValue,
SymbolInformation: () => SymbolInformation,
SymbolKind: () => SymbolKind2,
SymbolTag: () => SymbolTag2,
TextDocument: () => TextDocument,
TextDocumentEdit: () => TextDocumentEdit,
TextDocumentIdentifier: () => TextDocumentIdentifier,
TextDocumentItem: () => TextDocumentItem,
TextEdit: () => TextEdit,
URI: () => URI2,
VersionedTextDocumentIdentifier: () => VersionedTextDocumentIdentifier,
WorkspaceChange: () => WorkspaceChange,
WorkspaceEdit: () => WorkspaceEdit,
WorkspaceFolder: () => WorkspaceFolder,
WorkspaceSymbol: () => WorkspaceSymbol,
integer: () => integer,
uinteger: () => uinteger
});
var DocumentUri, URI2, integer, uinteger, Position2, Range2, Location2, LocationLink, Color2, ColorInformation, ColorPresentation, FoldingRangeKind2, FoldingRange, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, CodeDescription, Diagnostic, Command2, TextEdit, ChangeAnnotation, ChangeAnnotationIdentifier, AnnotatedTextEdit, TextDocumentEdit, CreateFile, RenameFile, DeleteFile, WorkspaceEdit, TextEditChangeImpl, ChangeAnnotations, WorkspaceChange, TextDocumentIdentifier, VersionedTextDocumentIdentifier, OptionalVersionedTextDocumentIdentifier, TextDocumentItem, MarkupKind, MarkupContent, CompletionItemKind2, InsertTextFormat, CompletionItemTag2, InsertReplaceEdit, InsertTextMode, CompletionItemLabelDetails, CompletionItem, CompletionList, MarkedString, Hover, ParameterInformation, SignatureInformation, DocumentHighlightKind3, DocumentHighlight, SymbolKind2, SymbolTag2, SymbolInformation, WorkspaceSymbol, DocumentSymbol, CodeActionKind, CodeActionTriggerKind, CodeActionContext, CodeAction, CodeLens, FormattingOptions, DocumentLink, SelectionRange, SemanticTokenTypes, SemanticTokenModifiers, SemanticTokens, InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression, InlineValueContext, InlayHintKind3, InlayHintLabelPart, InlayHint, StringValue, InlineCompletionItem, InlineCompletionList, InlineCompletionTriggerKind3, SelectedCompletionInfo, InlineCompletionContext, WorkspaceFolder, EOL, TextDocument, FullTextDocument, Is;
var init_main = __esm({
"../../../node_modules/.pnpm/vscode-languageserver-types@3.17.5/node_modules/vscode-languageserver-types/lib/esm/main.js"() {
"use strict";
(function(DocumentUri2) {
function is(value) {
return typeof value === "string";
}
DocumentUri2.is = is;
})(DocumentUri || (DocumentUri = {}));
(function(URI3) {
function is(value) {
return typeof value === "string";
}
URI3.is = is;
})(URI2 || (URI2 = {}));
(function(integer2) {
integer2.MIN_VALUE = -2147483648;
integer2.MAX_VALUE = 2147483647;
function is(value) {
return typeof value === "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE;
}
integer2.is = is;
})(integer || (integer = {}));
(function(uinteger2) {
uinteger2.MIN_VALUE = 0;
uinteger2.MAX_VALUE = 2147483647;
function is(value) {
return typeof value === "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE;
}
uinteger2.is = is;
})(uinteger || (uinteger = {}));
(function(Position3) {
function create(line, character) {
if (line === Number.MAX_VALUE) {
line = uinteger.MAX_VALUE;
}
if (character === Number.MAX_VALUE) {
character = uinteger.MAX_VALUE;
}
return { line, character };
}
Position3.create = create;
function is(value) {
let candidate = value;
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
}
Position3.is = is;
})(Position2 || (Position2 = {}));
(function(Range3) {
function create(one, two, three, four) {
if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
return { start: Position2.create(one, two), end: Position2.create(three, four) };
} else if (Position2.is(one) && Position2.is(two)) {
return { start: one, end: two };
} else {
throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
}
}
Range3.create = create;
function is(value) {
let candidate = value;
return Is.objectLiteral(candidate) && Position2.is(candidate.start) && Position2.is(candidate.end);
}
Range3.is = is;
})(Range2 || (Range2 = {}));
(function(Location3) {
function create(uri, range) {
return { uri, range };
}
Location3.create = create;
function is(value) {
let candidate = value;
return Is.objectLiteral(candidate) && Range2.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
}
Location3.is = is;
})(Location2 || (Location2 = {}));
(function(LocationLink2) {
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
}
LocationLink2.create = create;
function is(value) {
let candidate = value;
return Is.objectLiteral(candidate) && Range2.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range2.is(candidate.targetSelectionRange) && (Range2.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
}
LocationLink2.is = is;
})(LocationLink || (LocationLink = {}));
(function(Color3) {
function create(red, green, blue, alpha) {
return {
red,
green,
blue,
alpha
};
}
Color3.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
}
Color3.is = is;
})(Color2 || (Color2 = {}));
(function(ColorInformation2) {
function create(range, color) {
return {
range,
color
};
}
ColorInformation2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Range2.is(candidate.range) && Color2.is(candidate.color);
}
ColorInformation2.is = is;
})(ColorInformation || (ColorInformation = {}));
(function(ColorPresentation2) {
function create(label, textEdit, additionalTextEdits) {
return {
label,
textEdit,
additionalTextEdits
};
}
ColorPresentation2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
}
ColorPresentation2.is = is;
})(ColorPresentation || (ColorPresentation = {}));
(function(FoldingRangeKind3) {
FoldingRangeKind3.Comment = "comment";
FoldingRangeKind3.Imports = "imports";
FoldingRangeKind3.Region = "region";
})(FoldingRangeKind2 || (FoldingRangeKind2 = {}));
(function(FoldingRange2) {
function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
const result = {
startLine,
endLine
};
if (Is.defined(startCharacter)) {
result.startCharacter = startCharacter;
}
if (Is.defined(endCharacter)) {
result.endCharacter = endCharacter;
}
if (Is.defined(kind)) {
result.kind = kind;
}
if (Is.defined(collapsedText)) {
result.collapsedText = collapsedText;
}
return result;
}
FoldingRange2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
}
FoldingRange2.is = is;
})(FoldingRange || (FoldingRange = {}));
(function(DiagnosticRelatedInformation2) {
function create(location, message) {
return {
location,
message
};
}
DiagnosticRelatedInformation2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Location2.is(candidate.location) && Is.string(candidate.message);
}
DiagnosticRelatedInformation2.is = is;
})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
(function(DiagnosticSeverity2) {
DiagnosticSeverity2.Error = 1;
DiagnosticSeverity2.Warning = 2;
DiagnosticSeverity2.Information = 3;
DiagnosticSeverity2.Hint = 4;
})(DiagnosticSeverity || (DiagnosticSeverity = {}));
(function(DiagnosticTag2) {
DiagnosticTag2.Unnecessary = 1;
DiagnosticTag2.Deprecated = 2;
})(DiagnosticTag || (DiagnosticTag = {}));
(function(CodeDescription2) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.string(candidate.href);
}
CodeDescription2.is = is;
})(CodeDescription || (CodeDescription = {}));
(function(Diagnostic2) {
function create(range, message, severity, code, source, relatedInformation) {
let result = { range, message };
if (Is.defined(severity)) {
result.severity = severity;
}
if (Is.defined(code)) {
result.code = code;
}
if (Is.defined(source)) {
result.source = source;
}
if (Is.defined(relatedInformation)) {
result.relatedInformation = relatedInformation;
}
return result;
}
Diagnostic2.create = create;
function is(value) {
var _a2;
let candidate = value;
return Is.defined(candidate) && Range2.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a2 = candidate.codeDescription) === null || _a2 === void 0 ? void 0 : _a2.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
}
Diagnostic2.is = is;
})(Diagnostic || (Diagnostic = {}));
(function(Command3) {
function create(title, command, ...args) {
let result = { title, command };
if (Is.defined(args) && args.length > 0) {
result.arguments = args;
}
return result;
}
Command3.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
}
Command3.is = is;
})(Command2 || (Command2 = {}));
(function(TextEdit2) {
function replace(range, newText) {
return { range, newText };
}
TextEdit2.replace = replace;
function insert(position, newText) {
return { range: { start: position, end: position }, newText };
}
TextEdit2.insert = insert;
function del(range) {
return { range, newText: "" };
}
TextEdit2.del = del;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range2.is(candidate.range);
}
TextEdit2.is = is;
})(TextEdit || (TextEdit = {}));
(function(ChangeAnnotation2) {
function create(label, needsConfirmation, description) {
const result = { label };
if (needsConfirmation !== void 0) {
result.needsConfirmation = needsConfirmation;
}
if (description !== void 0) {
result.description = description;
}
return result;
}
ChangeAnnotation2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
}
ChangeAnnotation2.is = is;
})(ChangeAnnotation || (ChangeAnnotation = {}));
(function(ChangeAnnotationIdentifier2) {
function is(value) {
const candidate = value;
return Is.string(candidate);
}
ChangeAnnotationIdentifier2.is = is;
})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
(function(AnnotatedTextEdit2) {
function replace(range, newText, annotation) {
return { range, newText, annotationId: annotation };
}
AnnotatedTextEdit2.replace = replace;
function insert(position, newText, annotation) {
return { range: { start: position, end: position }, newText, annotationId: annotation };
}
AnnotatedTextEdit2.insert = insert;
function del(range, annotation) {
return { range, newText: "", annotationId: annotation };
}
AnnotatedTextEdit2.del = del;
function is(value) {
const candidate = value;
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
}
AnnotatedTextEdit2.is = is;
})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
(function(TextDocumentEdit2) {
function create(textDocument, edits) {
return { textDocument, edits };
}
TextDocumentEdit2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
}
TextDocumentEdit2.is = is;
})(TextDocumentEdit || (TextDocumentEdit = {}));
(function(CreateFile2) {
function create(uri, options, annotation) {
let result = {
kind: "create",
uri
};
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
result.options = options;
}
if (annotation !== void 0) {
result.annotationId = annotation;
}
return result;
}
CreateFile2.create = create;
function is(value) {
let candidate = value;
return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
}
CreateFile2.is = is;
})(CreateFile || (CreateFile = {}));
(function(RenameFile2) {
function create(oldUri, newUri, options, annotation) {
let result = {
kind: "rename",
oldUri,
newUri
};
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
result.options = options;
}
if (annotation !== void 0) {
result.annotationId = annotation;
}
return result;
}
RenameFile2.create = create;
function is(value) {
let candidate = value;
return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
}
RenameFile2.is = is;
})(RenameFile || (RenameFile = {}));
(function(DeleteFile2) {
function create(uri, options, annotation) {
let result = {
kind: "delete",
uri
};
if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
result.options = options;
}
if (annotation !== void 0) {
result.annotationId = annotation;
}
return result;
}
DeleteFile2.create = create;
function is(value) {
let candidate = value;
return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
}
DeleteFile2.is = is;
})(DeleteFile || (DeleteFile = {}));
(function(WorkspaceEdit2) {
function is(value) {
let candidate = value;
return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => {
if (Is.string(change.kind)) {
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
} else {
return TextDocumentEdit.is(change);
}
}));
}
WorkspaceEdit2.is = is;
})(WorkspaceEdit || (WorkspaceEdit = {}));
TextEditChangeImpl = class {
constructor(edits, changeAnnotations) {
this.edits = edits;
this.changeAnnotations = changeAnnotations;
}
insert(position, newText, annotation) {
let edit;
let id;
if (annotation === void 0) {
edit = TextEdit.insert(position, newText);
} else if (ChangeAnnotationIdentifier.is(annotation)) {
id = annotation;
edit = AnnotatedTextEdit.insert(position, newText, annotation);
} else {
this.assertChangeAnnotations(this.changeAnnotations);
id = this.changeAnnotations.manage(annotation);
edit = AnnotatedTextEdit.insert(position, newText, id);
}
this.edits.push(edit);
if (id !== void 0) {
return id;
}
}
replace(range, newText, annotation) {
let edit;
let id;
if (annotation === void 0) {
edit = TextEdit.replace(range, newText);
} else if (ChangeAnnotationIdentifier.is(annotation)) {
id = annotation;
edit = AnnotatedTextEdit.replace(range, newText, annotation);
} else {
this.assertChangeAnnotations(this.changeAnnotations);
id = this.changeAnnotations.manage(annotation);
edit = AnnotatedTextEdit.replace(range, newText, id);
}
this.edits.push(edit);
if (id !== void 0) {
return id;
}
}
delete(range, annotation) {
let edit;
let id;
if (annotation === void 0) {
edit = TextEdit.del(range);
} else if (ChangeAnnotationIdentifier.is(annotation)) {
id = annotation;
edit = AnnotatedTextEdit.del(range, annotation);
} else {
this.assertChangeAnnotations(this.changeAnnotations);
id = this.changeAnnotations.manage(annotation);
edit = AnnotatedTextEdit.del(range, id);
}
this.edits.push(edit);
if (id !== void 0) {
return id;
}
}
add(edit) {
this.edits.push(edit);
}
all() {
return this.edits;
}
clear() {
this.edits.splice(0, this.edits.length);
}
assertChangeAnnotations(value) {
if (value === void 0) {
throw new Error(`Text edit change is not configured to manage change annotations.`);
}
}
};
ChangeAnnotations = class {
constructor(annotations) {
this._annotations = annotations === void 0 ? /* @__PURE__ */ Object.create(null) : annotations;
this._counter = 0;
this._size = 0;
}
all() {
return this._annotations;
}
get size() {
return this._size;
}
manage(idOrAnnotation, annotation) {
let id;
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
id = idOrAnnotation;
} else {
id = this.nextId();
annotation = idOrAnnotation;
}
if (this._annotations[id] !== void 0) {
throw new Error(`Id ${id} is already in use.`);
}
if (annotation === void 0) {
throw new Error(`No annotation provided for id ${id}`);
}
this._annotations[id] = annotation;
this._size++;
return id;
}
nextId() {
this._counter++;
return this._counter.toString();
}
};
WorkspaceChange = class {
constructor(workspaceEdit) {
this._textEditChanges = /* @__PURE__ */ Object.create(null);
if (workspaceEdit !== void 0) {
this._workspaceEdit = workspaceEdit;
if (workspaceEdit.documentChanges) {
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
workspaceEdit.documentChanges.forEach((change) => {
if (TextDocumentEdit.is(change)) {
const textEditChange = new TextEditChangeImpl(change.edits, this._changeAnnotations);
this._textEditChanges[change.textDocument.uri] = textEditChange;
}
});
} else if (workspaceEdit.changes) {
Object.keys(workspaceEdit.changes).forEach((key) => {
const textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
this._textEditChanges[key] = textEditChange;
});
}
} else {
this._workspaceEdit = {};
}
}
/**
* Returns the underlying {@link WorkspaceEdit} literal
* use to be returned from a workspace edit operation like rename.
*/
get edit() {
this.initDocumentChanges();
if (this._changeAnnotations !== void 0) {
if (this._changeAnnotations.size === 0) {
this._workspaceEdit.changeAnnotations = void 0;
} else {
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
}
}
return this._workspaceEdit;
}
getTextEditChange(key) {
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
this.initDocumentChanges();
if (this._workspaceEdit.documentChanges === void 0) {
throw new Error("Workspace edit is not configured for document changes.");
}
const textDocument = { uri: key.uri, version: key.version };
let result = this._textEditChanges[textDocument.uri];
if (!result) {
const edits = [];
const textDocumentEdit = {
textDocument,
edits
};
this._workspaceEdit.documentChanges.push(textDocumentEdit);
result = new TextEditChangeImpl(edits, this._changeAnnotations);
this._textEditChanges[textDocument.uri] = result;
}
return result;
} else {
this.initChanges();
if (this._workspaceEdit.changes === void 0) {
throw new Error("Workspace edit is not configured for normal text edit changes.");
}
let result = this._textEditChanges[key];
if (!result) {
let edits = [];
this._workspaceEdit.changes[key] = edits;
result = new TextEditChangeImpl(edits);
this._textEditChanges[key] = result;
}
return result;
}
}
initDocumentChanges() {
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
this._changeAnnotations = new ChangeAnnotations();
this._workspaceEdit.documentChanges = [];
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
}
}
initChanges() {
if (this._workspaceEdit.documentChanges === void 0 && this._workspaceEdit.changes === void 0) {
this._workspaceEdit.changes = /* @__PURE__ */ Object.create(null);
}
}
createFile(uri, optionsOrAnnotation, options) {
this.initDocumentChanges();
if (this._workspaceEdit.documentChanges === void 0) {
throw new Error("Workspace edit is not configured for document changes.");
}
let annotation;
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
annotation = optionsOrAnnotation;
} else {
options = optionsOrAnnotation;
}
let operation;
let id;
if (annotation === void 0) {
operation = CreateFile.create(uri, options);
} else {
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
operation = CreateFile.create(uri, options, id);
}
this._workspaceEdit.documentChanges.push(operation);
if (id !== void 0) {
return id;
}
}
renameFile(oldUri, newUri, optionsOrAnnotation, options) {
this.initDocumentChanges();
if (this._workspaceEdit.documentChanges === void 0) {
throw new Error("Workspace edit is not configured for document changes.");
}
let annotation;
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
annotation = optionsOrAnnotation;
} else {
options = optionsOrAnnotation;
}
let operation;
let id;
if (annotation === void 0) {
operation = RenameFile.create(oldUri, newUri, options);
} else {
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
operation = RenameFile.create(oldUri, newUri, options, id);
}
this._workspaceEdit.documentChanges.push(operation);
if (id !== void 0) {
return id;
}
}
deleteFile(uri, optionsOrAnnotation, options) {
this.initDocumentChanges();
if (this._workspaceEdit.documentChanges === void 0) {
throw new Error("Workspace edit is not configured for document changes.");
}
let annotation;
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
annotation = optionsOrAnnotation;
} else {
options = optionsOrAnnotation;
}
let operation;
let id;
if (annotation === void 0) {
operation = DeleteFile.create(uri, options);
} else {
id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);
operation = DeleteFile.create(uri, options, id);
}
this._workspaceEdit.documentChanges.push(operation);
if (id !== void 0) {
return id;
}
}
};
(function(TextDocumentIdentifier2) {
function create(uri) {
return { uri };
}
TextDocumentIdentifier2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri);
}
TextDocumentIdentifier2.is = is;
})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
(function(VersionedTextDocumentIdentifier2) {
function create(uri, version2) {
return { uri, version: version2 };
}
VersionedTextDocumentIdentifier2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
}
VersionedTextDocumentIdentifier2.is = is;
})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
(function(OptionalVersionedTextDocumentIdentifier2) {
function create(uri, version2) {
return { uri, version: version2 };
}
OptionalVersionedTextDocumentIdentifier2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
}
OptionalVersionedTextDocumentIdentifier2.is = is;
})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
(function(TextDocumentItem2) {
function create(uri, languageId, version2, text) {
return { uri, languageId, version: version2, text };
}
TextDocumentItem2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
}
TextDocumentItem2.is = is;
})(TextDocumentItem || (TextDocumentItem = {}));
(function(MarkupKind2) {
MarkupKind2.PlainText = "plaintext";
MarkupKind2.Markdown = "markdown";
function is(value) {
const candidate = value;
return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
}
MarkupKind2.is = is;
})(MarkupKind || (MarkupKind = {}));
(function(MarkupContent2) {
function is(value) {
const candidate = value;
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
}
MarkupContent2.is = is;
})(MarkupContent || (MarkupContent = {}));
(function(CompletionItemKind3) {
CompletionItemKind3.Text = 1;
CompletionItemKind3.Method = 2;
CompletionItemKind3.Function = 3;
CompletionItemKind3.Constructor = 4;
CompletionItemKind3.Field = 5;
CompletionItemKind3.Variable = 6;
CompletionItemKind3.Class = 7;
CompletionItemKind3.Interface = 8;
CompletionItemKind3.Module = 9;
CompletionItemKind3.Property = 10;
CompletionItemKind3.Unit = 11;
CompletionItemKind3.Value = 12;
CompletionItemKind3.Enum = 13;
CompletionItemKind3.Keyword = 14;
CompletionItemKind3.Snippet = 15;
CompletionItemKind3.Color = 16;
CompletionItemKind3.File = 17;
CompletionItemKind3.Reference = 18;
CompletionItemKind3.Folder = 19;
CompletionItemKind3.EnumMember = 20;
CompletionItemKind3.Constant = 21;
CompletionItemKind3.Struct = 22;
CompletionItemKind3.Event = 23;
CompletionItemKind3.Operator = 24;
CompletionItemKind3.TypeParameter = 25;
})(CompletionItemKind2 || (CompletionItemKind2 = {}));
(function(InsertTextFormat2) {
InsertTextFormat2.PlainText = 1;
InsertTextFormat2.Snippet = 2;
})(InsertTextFormat || (InsertTextFormat = {}));
(function(CompletionItemTag3) {
CompletionItemTag3.Deprecated = 1;
})(CompletionItemTag2 || (CompletionItemTag2 = {}));
(function(InsertReplaceEdit2) {
function create(newText, insert, replace) {
return { newText, insert, replace };
}
InsertReplaceEdit2.create = create;
function is(value) {
const candidate = value;
return candidate && Is.string(candidate.newText) && Range2.is(candidate.insert) && Range2.is(candidate.replace);
}
InsertReplaceEdit2.is = is;
})(InsertReplaceEdit || (InsertReplaceEdit = {}));
(function(InsertTextMode2) {
InsertTextMode2.asIs = 1;
InsertTextMode2.adjustIndentation = 2;
})(InsertTextMode || (InsertTextMode = {}));
(function(CompletionItemLabelDetails2) {
function is(value) {
const candidate = value;
return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
}
CompletionItemLabelDetails2.is = is;
})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
(function(CompletionItem2) {
function create(label) {
return { label };
}
CompletionItem2.create = create;
})(CompletionItem || (CompletionItem = {}));
(function(CompletionList2) {
function create(items, isIncomplete) {
return { items: items ? items : [], isIncomplete: !!isIncomplete };
}
CompletionList2.create = create;
})(CompletionList || (CompletionList = {}));
(function(MarkedString2) {
function fromPlainText(plainText) {
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
}
MarkedString2.fromPlainText = fromPlainText;
function is(value) {
const candidate = value;
return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
}
MarkedString2.is = is;
})(MarkedString || (MarkedString = {}));
(function(Hover2) {
function is(value) {
let candidate = value;
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range2.is(value.range));
}
Hover2.is = is;
})(Hover || (Hover = {}));
(function(ParameterInformation2) {
function create(label, documentation) {
return documentation ? { label, documentation } : { label };
}
ParameterInformation2.create = create;
})(ParameterInformation || (ParameterInformation = {}));
(function(SignatureInformation2) {
function create(label, documentation, ...parameters) {
let result = { label };
if (Is.defined(documentation)) {
result.documentation = documentation;
}
if (Is.defined(parameters)) {
result.parameters = parameters;
} else {
result.parameters = [];
}
return result;
}
SignatureInformation2.create = create;
})(SignatureInformation || (SignatureInformation = {}));
(function(DocumentHighlightKind4) {
DocumentHighlightKind4.Text = 1;
DocumentHighlightKind4.Read = 2;
DocumentHighlightKind4.Write = 3;
})(DocumentHighlightKind3 || (DocumentHighlightKind3 = {}));
(function(DocumentHighlight2) {
function create(range, kind) {
let result = { range };
if (Is.number(kind)) {
result.kind = kind;
}
return result;
}
DocumentHighlight2.create = create;
})(DocumentHighlight || (DocumentHighlight = {}));
(function(SymbolKind3) {
SymbolKind3.File = 1;
SymbolKind3.Module = 2;
SymbolKind3.Namespace = 3;
SymbolKind3.Package = 4;
SymbolKind3.Class = 5;
SymbolKind3.Method = 6;
SymbolKind3.Property = 7;
SymbolKind3.Field = 8;
SymbolKind3.Constructor = 9;
SymbolKind3.Enum = 10;
SymbolKind3.Interface = 11;
SymbolKind3.Function = 12;
SymbolKind3.Variable = 13;
SymbolKind3.Constant = 14;
SymbolKind3.String = 15;
SymbolKind3.Number = 16;
SymbolKind3.Boolean = 17;
SymbolKind3.Array = 18;
SymbolKind3.Object = 19;
SymbolKind3.Key = 20;
SymbolKind3.Null = 21;
SymbolKind3.EnumMember = 22;
SymbolKind3.Struct = 23;
SymbolKind3.Event = 24;
SymbolKind3.Operator = 25;
SymbolKind3.TypeParameter = 26;
})(SymbolKind2 || (SymbolKind2 = {}));
(function(SymbolTag3) {
SymbolTag3.Deprecated = 1;
})(SymbolTag2 || (SymbolTag2 = {}));
(function(SymbolInformation2) {
function create(name, kind, range, uri, containerName) {
let result = {
name,
kind,
location: { uri, range }
};
if (containerName) {
result.containerName = containerName;
}
return result;
}
SymbolInformation2.create = create;
})(SymbolInformation || (SymbolInformation = {}));
(function(WorkspaceSymbol2) {
function create(name, kind, uri, range) {
return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } };
}
WorkspaceSymbol2.create = create;
})(WorkspaceSymbol || (WorkspaceSymbol = {}));
(function(DocumentSymbol2) {
function create(name, detail, kind, range, selectionRange, children) {
let result = {
name,
detail,
kind,
range,
selectionRange
};
if (children !== void 0) {
result.children = children;
}
return result;
}
DocumentSymbol2.create = create;
function is(value) {
let candidate = value;
return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range2.is(candidate.range) && Range2.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
}
DocumentSymbol2.is = is;
})(DocumentSymbol || (DocumentSymbol = {}));
(function(CodeActionKind2) {
CodeActionKind2.Empty = "";
CodeActionKind2.QuickFix = "quickfix";
CodeActionKind2.Refactor = "refactor";
CodeActionKind2.RefactorExtract = "refactor.extract";
CodeActionKind2.RefactorInline = "refactor.inline";
CodeActionKind2.RefactorRewrite = "refactor.rewrite";
CodeActionKind2.Source = "source";
CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
CodeActionKind2.SourceFixAll = "source.fixAll";
})(CodeActionKind || (CodeActionKind = {}));
(function(CodeActionTriggerKind2) {
CodeActionTriggerKind2.Invoked = 1;
CodeActionTriggerKind2.Automatic = 2;
})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
(function(CodeActionContext2) {
function create(diagnostics, only, triggerKind) {
let result = { diagnostics };
if (only !== void 0 && only !== null) {
result.only = only;
}
if (triggerKind !== void 0 && triggerKind !== null) {
result.triggerKind = triggerKind;
}
return result;
}
CodeActionContext2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
}
CodeActionContext2.is = is;
})(CodeActionContext || (CodeActionContext = {}));
(function(CodeAction2) {
function create(title, kindOrCommandOrEdit, kind) {
let result = { title };
let checkKind = true;
if (typeof kindOrCommandOrEdit === "string") {
checkKind = false;
result.kind = kindOrCommandOrEdit;
} else if (Command2.is(kindOrCommandOrEdit)) {
result.command = kindOrCommandOrEdit;
} else {
result.edit = kindOrCommandOrEdit;
}
if (checkKind && kind !== void 0) {
result.kind = kind;
}
return result;
}
CodeAction2.create = create;
function is(value) {
let candidate = value;
return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command2.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
}
CodeAction2.is = is;
})(CodeAction || (CodeAction = {}));
(function(CodeLens2) {
function create(range, data) {
let result = { range };
if (Is.defined(data)) {
result.data = data;
}
return result;
}
CodeLens2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.command) || Command2.is(candidate.command));
}
CodeLens2.is = is;
})(CodeLens || (CodeLens = {}));
(function(FormattingOptions2) {
function create(tabSize, insertSpaces) {
return { tabSize, insertSpaces };
}
FormattingOptions2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
}
FormattingOptions2.is = is;
})(FormattingOptions || (FormattingOptions = {}));
(function(DocumentLink2) {
function create(range, target, data) {
return { range, target, data };
}
DocumentLink2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
}
DocumentLink2.is = is;
})(DocumentLink || (DocumentLink = {}));
(function(SelectionRange2) {
function create(range, parent) {
return { range, parent };
}
SelectionRange2.create = create;
function is(value) {
let candidate = value;
return Is.objectLiteral(candidate) && Range2.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
}
SelectionRange2.is = is;
})(SelectionRange || (SelectionRange = {}));
(function(SemanticTokenTypes2) {
SemanticTokenTypes2["namespace"] = "namespace";
SemanticTokenTypes2["type"] = "type";
SemanticTokenTypes2["class"] = "class";
SemanticTokenTypes2["enum"] = "enum";
SemanticTokenTypes2["interface"] = "interface";
SemanticTokenTypes2["struct"] = "struct";
SemanticTokenTypes2["typeParameter"] = "typeParameter";
SemanticTokenTypes2["parameter"] = "parameter";
SemanticTokenTypes2["variable"] = "variable";
SemanticTokenTypes2["property"] = "property";
SemanticTokenTypes2["enumMember"] = "enumMember";
SemanticTokenTypes2["event"] = "event";
SemanticTokenTypes2["function"] = "function";
SemanticTokenTypes2["method"] = "method";
SemanticTokenTypes2["macro"] = "macro";
SemanticTokenTypes2["keyword"] = "keyword";
SemanticTokenTypes2["modifier"] = "modifier";
SemanticTokenTypes2["comment"] = "comment";
SemanticTokenTypes2["string"] = "string";
SemanticTokenTypes2["number"] = "number";
SemanticTokenTypes2["regexp"] = "regexp";
SemanticTokenTypes2["operator"] = "operator";
SemanticTokenTypes2["decorator"] = "decorator";
})(SemanticTokenTypes || (SemanticTokenTypes = {}));
(function(SemanticTokenModifiers2) {
SemanticTokenModifiers2["declaration"] = "declaration";
SemanticTokenModifiers2["definition"] = "definition";
SemanticTokenModifiers2["readonly"] = "readonly";
SemanticTokenModifiers2["static"] = "static";
SemanticTokenModifiers2["deprecated"] = "deprecated";
SemanticTokenModifiers2["abstract"] = "abstract";
SemanticTokenModifiers2["async"] = "async";
SemanticTokenModifiers2["modification"] = "modification";
SemanticTokenModifiers2["documentation"] = "documentation";
SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
})(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
(function(SemanticTokens2) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number");
}
SemanticTokens2.is = is;
})(SemanticTokens || (SemanticTokens = {}));
(function(InlineValueText2) {
function create(range, text) {
return { range, text };
}
InlineValueText2.create = create;
function is(value) {
const candidate = value;
return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && Is.string(candidate.text);
}
InlineValueText2.is = is;
})(InlineValueText || (InlineValueText = {}));
(function(InlineValueVariableLookup2) {
function create(range, variableName, caseSensitiveLookup) {
return { range, variableName, caseSensitiveLookup };
}
InlineValueVariableLookup2.create = create;
function is(value) {
const candidate = value;
return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
}
InlineValueVariableLookup2.is = is;
})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
(function(InlineValueEvaluatableExpression2) {
function create(range, expression) {
return { range, expression };
}
InlineValueEvaluatableExpression2.create = create;
function is(value) {
const candidate = value;
return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
}
InlineValueEvaluatableExpression2.is = is;
})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
(function(InlineValueContext2) {
function create(frameId, stoppedLocation) {
return { frameId, stoppedLocation };
}
InlineValueContext2.create = create;
function is(value) {
const candidate = value;
return Is.defined(candidate) && Range2.is(value.stoppedLocation);
}
InlineValueContext2.is = is;
})(InlineValueContext || (InlineValueContext = {}));
(function(InlayHintKind4) {
InlayHintKind4.Type = 1;
InlayHintKind4.Parameter = 2;
function is(value) {
return value === 1 || value === 2;
}
InlayHintKind4.is = is;
})(InlayHintKind3 || (InlayHintKind3 = {}));
(function(InlayHintLabelPart2) {
function create(value) {
return { value };
}
InlayHintLabelPart2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location2.is(candidate.location)) && (candidate.command === void 0 || Command2.is(candidate.command));
}
InlayHintLabelPart2.is = is;
})(InlayHintLabelPart || (InlayHintLabelPart = {}));
(function(InlayHint2) {
function create(position, label, kind) {
const result = { position, label };
if (kind !== void 0) {
result.kind = kind;
}
return result;
}
InlayHint2.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Position2.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind3.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
}
InlayHint2.is = is;
})(InlayHint || (InlayHint = {}));
(function(StringValue2) {
function createSnippet(value) {
return { kind: "snippet", value };
}
StringValue2.createSnippet = createSnippet;
})(StringValue || (StringValue = {}));
(function(InlineCompletionItem2) {
function create(insertText, filterText, range, command) {
return { insertText, filterText, range, command };
}
InlineCompletionItem2.create = create;
})(InlineCompletionItem || (InlineCompletionItem = {}));
(function(InlineCompletionList2) {
function create(items) {
return { items };
}
InlineCompletionList2.create = create;
})(InlineCompletionList || (InlineCompletionList = {}));
(function(InlineCompletionTriggerKind4) {
InlineCompletionTriggerKind4.Invoked = 0;
InlineCompletionTriggerKind4.Automatic = 1;
})(InlineCompletionTriggerKind3 || (InlineCompletionTriggerKind3 = {}));
(function(SelectedCompletionInfo2) {
function create(range, text) {
return { range, text };
}
SelectedCompletionInfo2.create = create;
})(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
(function(InlineCompletionContext2) {
function create(triggerKind, selectedCompletionInfo) {
return { triggerKind, selectedCompletionInfo };
}
InlineCompletionContext2.create = create;
})(InlineCompletionContext || (InlineCompletionContext = {}));
(function(WorkspaceFolder2) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && URI2.is(candidate.uri) && Is.string(candidate.name);
}
WorkspaceFolder2.is = is;
})(WorkspaceFolder || (WorkspaceFolder = {}));
EOL = ["\n", "\r\n", "\r"];
(function(TextDocument2) {
function create(uri, languageId, version2, content) {
return new FullTextDocument(uri, languageId, version2, content);
}
TextDocument2.create = create;
function is(value) {
let candidate = value;
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
}
TextDocument2.is = is;
function applyEdits(document2, edits) {
let text = document2.getText();
let sortedEdits = mergeSort(edits, (a, b) => {
let diff2 = a.range.start.line - b.range.start.line;
if (diff2 === 0) {
return a.range.start.character - b.range.start.character;
}
return diff2;
});
let lastModifiedOffset = text.length;
for (let i = sortedEdits.length - 1; i >= 0; i--) {
let e = sortedEdits[i];
let startOffset = document2.offsetAt(e.range.start);
let endOffset = document2.offsetAt(e.range.end);
if (endOffset <= lastModifiedOffset) {
text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
} else {
throw new Error("Overlapping edit");
}
lastModifiedOffset = startOffset;
}
return text;
}
TextDocument2.applyEdits = applyEdits;
function mergeSort(data, compare) {
if (data.length <= 1) {
return data;
}
const p = data.length / 2 | 0;
const left = data.slice(0, p);
const right = data.slice(p);
mergeSort(left, compare);
mergeSort(right, compare);
let leftIdx = 0;
let rightIdx = 0;
let i = 0;
while (leftIdx < left.length && rightIdx < right.length) {
let ret = compare(left[leftIdx], right[rightIdx]);
if (ret <= 0) {
data[i++] = left[leftIdx++];
} else {
data[i++] = right[rightIdx++];
}
}
while (leftIdx < left.length) {
data[i++] = left[leftIdx++];
}
while (rightIdx < right.length) {
data[i++] = right[rightIdx++];
}
return data;
}
})(TextDocument || (TextDocument = {}));
FullTextDocument = class {
constructor(uri, languageId, version2, content) {
this._uri = uri;
this._languageId = languageId;
this._version = version2;
this._content = content;
this._lineOffsets = void 0;
}
get uri() {
return this._uri;
}
get languageId() {
return this._languageId;
}
get version() {
return this._version;
}
getText(range) {
if (range) {
let start = this.offsetAt(range.start);
let end = this.offsetAt(range.end);
return this._content.substring(start, end);
}
return this._content;
}
update(event, version2) {
this._content = event.text;
this._version = version2;
this._lineOffsets = void 0;
}
getLineOffsets() {
if (this._lineOffsets === void 0) {
let lineOffsets = [];
let text = this._content;
let isLineStart = true;
for (let i = 0; i < text.length; i++) {
if (isLineStart) {
lineOffsets.push(i);
isLineStart = false;
}
let ch = text.charAt(i);
isLineStart = ch === "\r" || ch === "\n";
if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
i++;
}
}
if (isLineStart && text.length > 0) {
lineOffsets.push(text.length);
}
this._lineOffsets = lineOffsets;
}
return this._lineOffsets;
}
positionAt(offset) {
offset = Math.max(Math.min(offset, this._content.length), 0);
let lineOffsets = this.getLineOffsets();
let low = 0, high = lineOffsets.length;
if (high === 0) {
return Position2.create(0, offset);
}
while (low < high) {
let mid = Math.floor((low + high) / 2);
if (lineOffsets[mid] > offset) {
high = mid;
} else {
low = mid + 1;
}
}
let line = low - 1;
return Position2.create(line, offset - lineOffsets[line]);
}
offsetAt(position) {
let lineOffsets = this.getLineOffsets();
if (position.line >= lineOffsets.length) {
return this._content.length;
} else if (position.line < 0) {
return 0;
}
let lineOffset = lineOffsets[position.line];
let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
}
get lineCount() {
return this.getLineOffsets().length;
}
};
(function(Is2) {
const toString = Object.prototype.toString;
function defined(value) {
return typeof value !== "undefined";
}
Is2.defined = defined;
function undefined2(value) {
return typeof value === "undefined";
}
Is2.undefined = undefined2;
function boolean(value) {
return value === true || value === false;
}
Is2.boolean = boolean;
function string(value) {
return toString.call(value) === "[object String]";
}
Is2.string = string;
function number(value) {
return toString.call(value) === "[object Number]";
}
Is2.number = number;
function numberRange(value, min, max) {
return toString.call(value) === "[object Number]" && min <= value && value <= max;
}
Is2.numberRange = numberRange;
function integer2(value) {
return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
}
Is2.integer = integer2;
function uinteger2(value) {
return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
}
Is2.uinteger = uinteger2;
function func(value) {
return toString.call(value) === "[object Function]";
}
Is2.func = func;
function objectLiteral(value) {
return value !== null && typeof value === "object";
}
Is2.objectLiteral = objectLiteral;
function typedArray(value, check) {
return Array.isArray(value) && value.every(check);
}
Is2.typedArray = typedArray;
})(Is || (Is = {}));
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/CharacterStream.js
var require_CharacterStream = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/CharacterStream.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var CharacterStream = class {
constructor(sourceText) {
this._start = 0;
this._pos = 0;
this.getStartOfToken = () => this._start;
this.getCurrentPosition = () => this._pos;
this.eol = () => this._sourceText.length === this._pos;
this.sol = () => this._pos === 0;
this.peek = () => {
return this._sourceText.charAt(this._pos) || null;
};
this.next = () => {
const char = this._sourceText.charAt(this._pos);
this._pos++;
return char;
};
this.eat = (pattern) => {
const isMatched = this._testNextCharacter(pattern);
if (isMatched) {
this._start = this._pos;
this._pos++;
return this._sourceText.charAt(this._pos - 1);
}
return void 0;
};
this.eatWhile = (match) => {
let isMatched = this._testNextCharacter(match);
let didEat = false;
if (isMatched) {
didEat = isMatched;
this._start = this._pos;
}
while (isMatched) {
this._pos++;
isMatched = this._testNextCharacter(match);
didEat = true;
}
return didEat;
};
this.eatSpace = () => this.eatWhile(/[\s\u00a0]/);
this.skipToEnd = () => {
this._pos = this._sourceText.length;
};
this.skipTo = (position) => {
this._pos = position;
};
this.match = (pattern, consume = true, caseFold = false) => {
let token = null;
let match = null;
if (typeof pattern === "string") {
const regex = new RegExp(pattern, caseFold ? "i" : "g");
match = regex.test(this._sourceText.slice(this._pos, this._pos + pattern.length));
token = pattern;
} else if (pattern instanceof RegExp) {
match = this._sourceText.slice(this._pos).match(pattern);
token = match === null || match === void 0 ? void 0 : match[0];
}
if (match != null && (typeof pattern === "string" || match instanceof Array && this._sourceText.startsWith(match[0], this._pos))) {
if (consume) {
this._start = this._pos;
if (token && token.length) {
this._pos += token.length;
}
}
return match;
}
return false;
};
this.backUp = (num) => {
this._pos -= num;
};
this.column = () => this._pos;
this.indentation = () => {
const match = this._sourceText.match(/\s*/);
let indent = 0;
if (match && match.length !== 0) {
const whiteSpaces = match[0];
let pos = 0;
while (whiteSpaces.length > pos) {
if (whiteSpaces.charCodeAt(pos) === 9) {
indent += 2;
} else {
indent++;
}
pos++;
}
}
return indent;
};
this.current = () => this._sourceText.slice(this._start, this._pos);
this._sourceText = sourceText;
}
_testNextCharacter(pattern) {
const character = this._sourceText.charAt(this._pos);
let isMatched = false;
if (typeof pattern === "string") {
isMatched = character === pattern;
} else {
isMatched = pattern instanceof RegExp ? pattern.test(character) : pattern(character);
}
return isMatched;
}
};
exports.default = CharacterStream;
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/RuleHelpers.js
var require_RuleHelpers = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/RuleHelpers.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.opt = opt;
exports.list = list;
exports.butNot = butNot;
exports.t = t;
exports.p = p;
function opt(ofRule) {
return { ofRule };
}
function list(ofRule, separator) {
return { ofRule, isList: true, separator };
}
function butNot(rule, exclusions) {
const ruleMatch = rule.match;
rule.match = (token) => {
let check = false;
if (ruleMatch) {
check = ruleMatch(token);
}
return check && exclusions.every((exclusion) => exclusion.match && !exclusion.match(token));
};
return rule;
}
function t(kind, style) {
return { style, match: (token) => token.kind === kind };
}
function p(value, style) {
return {
style: style || "punctuation",
match: (token) => token.kind === "Punctuation" && token.value === value
};
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/Rules.js
var require_Rules = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/Rules.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExperimentalFragmentArgumentParseRules = exports.ParseRules = exports.LexRules = exports.isIgnored = void 0;
var RuleHelpers_1 = require_RuleHelpers();
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var isIgnored = (ch) => ch === " " || ch === " " || ch === "," || ch === "\n" || ch === "\r" || ch === "\uFEFF" || ch === "\xA0";
exports.isIgnored = isIgnored;
exports.LexRules = {
Name: /^[_A-Za-z][_0-9A-Za-z]*/,
Punctuation: /^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,
Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,
String: /^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,
Comment: /^#.*/
};
exports.ParseRules = {
Document: [(0, RuleHelpers_1.list)("Definition")],
Definition(token) {
switch (token.value) {
case "{":
return "ShortQuery";
case "query":
return "Query";
case "mutation":
return "Mutation";
case "subscription":
return "Subscription";
case "fragment":
return graphql_1.Kind.FRAGMENT_DEFINITION;
case "schema":
return "SchemaDef";
case "scalar":
return "ScalarDef";
case "type":
return "ObjectTypeDef";
case "interface":
return "InterfaceDef";
case "union":
return "UnionDef";
case "enum":
return "EnumDef";
case "input":
return "InputDef";
case "extend":
return "ExtendDef";
case "directive":
return "DirectiveDef";
}
},
ShortQuery: ["SelectionSet"],
Query: [
word("query"),
(0, RuleHelpers_1.opt)(name("def")),
(0, RuleHelpers_1.opt)("VariableDefinitions"),
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
],
Mutation: [
word("mutation"),
(0, RuleHelpers_1.opt)(name("def")),
(0, RuleHelpers_1.opt)("VariableDefinitions"),
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
],
Subscription: [
word("subscription"),
(0, RuleHelpers_1.opt)(name("def")),
(0, RuleHelpers_1.opt)("VariableDefinitions"),
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
],
VariableDefinitions: [(0, RuleHelpers_1.p)("("), (0, RuleHelpers_1.list)("VariableDefinition"), (0, RuleHelpers_1.p)(")")],
VariableDefinition: ["Variable", (0, RuleHelpers_1.p)(":"), "Type", (0, RuleHelpers_1.opt)("DefaultValue")],
Variable: [(0, RuleHelpers_1.p)("$", "variable"), name("variable")],
DefaultValue: [(0, RuleHelpers_1.p)("="), "Value"],
SelectionSet: [(0, RuleHelpers_1.p)("{"), (0, RuleHelpers_1.list)("Selection"), (0, RuleHelpers_1.p)("}")],
Selection(token, stream) {
return token.value === "..." ? stream.match(/[\s\u00a0,]*(on\b|@|{)/, false) ? "InlineFragment" : "FragmentSpread" : stream.match(/[\s\u00a0,]*:/, false) ? "AliasedField" : "Field";
},
AliasedField: [
name("property"),
(0, RuleHelpers_1.p)(":"),
name("qualifier"),
(0, RuleHelpers_1.opt)("Arguments"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("SelectionSet")
],
Field: [
name("property"),
(0, RuleHelpers_1.opt)("Arguments"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("SelectionSet")
],
Arguments: [(0, RuleHelpers_1.p)("("), (0, RuleHelpers_1.list)("Argument"), (0, RuleHelpers_1.p)(")")],
Argument: [name("attribute"), (0, RuleHelpers_1.p)(":"), "Value"],
FragmentSpread: [(0, RuleHelpers_1.p)("..."), name("def"), (0, RuleHelpers_1.list)("Directive")],
InlineFragment: [
(0, RuleHelpers_1.p)("..."),
(0, RuleHelpers_1.opt)("TypeCondition"),
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
],
FragmentDefinition: [
word("fragment"),
(0, RuleHelpers_1.opt)((0, RuleHelpers_1.butNot)(name("def"), [word("on")])),
"TypeCondition",
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
],
TypeCondition: [word("on"), "NamedType"],
Value(token) {
switch (token.kind) {
case "Number":
return "NumberValue";
case "String":
return "StringValue";
case "Punctuation":
switch (token.value) {
case "[":
return "ListValue";
case "{":
return "ObjectValue";
case "$":
return "Variable";
case "&":
return "NamedType";
}
return null;
case "Name":
switch (token.value) {
case "true":
case "false":
return "BooleanValue";
}
if (token.value === "null") {
return "NullValue";
}
return "EnumValue";
}
},
NumberValue: [(0, RuleHelpers_1.t)("Number", "number")],
StringValue: [
{
style: "string",
match: (token) => token.kind === "String",
update(state, token) {
if (token.value.startsWith('"""')) {
state.inBlockstring = !token.value.slice(3).endsWith('"""');
}
}
}
],
BooleanValue: [(0, RuleHelpers_1.t)("Name", "builtin")],
NullValue: [(0, RuleHelpers_1.t)("Name", "keyword")],
EnumValue: [name("string-2")],
ListValue: [(0, RuleHelpers_1.p)("["), (0, RuleHelpers_1.list)("Value"), (0, RuleHelpers_1.p)("]")],
ObjectValue: [(0, RuleHelpers_1.p)("{"), (0, RuleHelpers_1.list)("ObjectField"), (0, RuleHelpers_1.p)("}")],
ObjectField: [name("attribute"), (0, RuleHelpers_1.p)(":"), "Value"],
Type(token) {
return token.value === "[" ? "ListType" : "NonNullType";
},
ListType: [(0, RuleHelpers_1.p)("["), "Type", (0, RuleHelpers_1.p)("]"), (0, RuleHelpers_1.opt)((0, RuleHelpers_1.p)("!"))],
NonNullType: ["NamedType", (0, RuleHelpers_1.opt)((0, RuleHelpers_1.p)("!"))],
NamedType: [type("atom")],
Directive: [(0, RuleHelpers_1.p)("@", "meta"), name("meta"), (0, RuleHelpers_1.opt)("Arguments")],
DirectiveDef: [
word("directive"),
(0, RuleHelpers_1.p)("@", "meta"),
name("meta"),
(0, RuleHelpers_1.opt)("ArgumentsDef"),
word("on"),
(0, RuleHelpers_1.list)("DirectiveLocation", (0, RuleHelpers_1.p)("|"))
],
InterfaceDef: [
word("interface"),
name("atom"),
(0, RuleHelpers_1.opt)("Implements"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("FieldsDef")
],
Implements: [word("implements"), (0, RuleHelpers_1.list)("NamedType", (0, RuleHelpers_1.p)("&"))],
DirectiveLocation: [name("string-2")],
SchemaDef: [
word("schema"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.p)("{"),
(0, RuleHelpers_1.list)("OperationTypeDef"),
(0, RuleHelpers_1.p)("}")
],
OperationTypeDef: [name("keyword"), (0, RuleHelpers_1.p)(":"), name("atom")],
ScalarDef: [word("scalar"), name("atom"), (0, RuleHelpers_1.list)("Directive")],
ObjectTypeDef: [
word("type"),
name("atom"),
(0, RuleHelpers_1.opt)("Implements"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("FieldsDef")
],
FieldsDef: [(0, RuleHelpers_1.p)("{"), (0, RuleHelpers_1.list)("FieldDef"), (0, RuleHelpers_1.p)("}")],
FieldDef: [
name("property"),
(0, RuleHelpers_1.opt)("ArgumentsDef"),
(0, RuleHelpers_1.p)(":"),
"Type",
(0, RuleHelpers_1.list)("Directive")
],
ArgumentsDef: [(0, RuleHelpers_1.p)("("), (0, RuleHelpers_1.list)("InputValueDef"), (0, RuleHelpers_1.p)(")")],
InputValueDef: [
name("attribute"),
(0, RuleHelpers_1.p)(":"),
"Type",
(0, RuleHelpers_1.opt)("DefaultValue"),
(0, RuleHelpers_1.list)("Directive")
],
UnionDef: [
word("union"),
name("atom"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.p)("="),
(0, RuleHelpers_1.list)("UnionMember", (0, RuleHelpers_1.p)("|"))
],
UnionMember: ["NamedType"],
EnumDef: [
word("enum"),
name("atom"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("EnumValuesDef")
],
EnumValuesDef: [(0, RuleHelpers_1.p)("{"), (0, RuleHelpers_1.list)("EnumValueDef"), (0, RuleHelpers_1.p)("}")],
EnumValueDef: [name("string-2"), (0, RuleHelpers_1.list)("Directive")],
InputDef: [
word("input"),
name("atom"),
(0, RuleHelpers_1.list)("Directive"),
(0, RuleHelpers_1.opt)("InputFieldsDef")
],
InputFieldsDef: [(0, RuleHelpers_1.p)("{"), (0, RuleHelpers_1.list)("InputValueDef"), (0, RuleHelpers_1.p)("}")],
ExtendDef: [word("extend"), "ExtensionDefinition"],
ExtensionDefinition(token) {
switch (token.value) {
case "schema":
return graphql_1.Kind.SCHEMA_EXTENSION;
case "scalar":
return graphql_1.Kind.SCALAR_TYPE_EXTENSION;
case "type":
return graphql_1.Kind.OBJECT_TYPE_EXTENSION;
case "interface":
return graphql_1.Kind.INTERFACE_TYPE_EXTENSION;
case "union":
return graphql_1.Kind.UNION_TYPE_EXTENSION;
case "enum":
return graphql_1.Kind.ENUM_TYPE_EXTENSION;
case "input":
return graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION;
}
},
[graphql_1.Kind.SCHEMA_EXTENSION]: ["SchemaDef"],
[graphql_1.Kind.SCALAR_TYPE_EXTENSION]: ["ScalarDef"],
[graphql_1.Kind.OBJECT_TYPE_EXTENSION]: ["ObjectTypeDef"],
[graphql_1.Kind.INTERFACE_TYPE_EXTENSION]: ["InterfaceDef"],
[graphql_1.Kind.UNION_TYPE_EXTENSION]: ["UnionDef"],
[graphql_1.Kind.ENUM_TYPE_EXTENSION]: ["EnumDef"],
[graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION]: ["InputDef"]
};
exports.ExperimentalFragmentArgumentParseRules = Object.assign(Object.assign({}, exports.ParseRules), { FragmentArguments: [(0, RuleHelpers_1.p)("("), (0, RuleHelpers_1.list)("FragmentArgument"), (0, RuleHelpers_1.p)(")")], FragmentArgument: [name("attribute"), (0, RuleHelpers_1.p)(":"), "Value"], FragmentSpread: [
(0, RuleHelpers_1.p)("..."),
name("def"),
(0, RuleHelpers_1.opt)("FragmentArguments"),
(0, RuleHelpers_1.list)("Directive")
], FragmentDefinition: [
word("fragment"),
(0, RuleHelpers_1.opt)((0, RuleHelpers_1.butNot)(name("def"), [word("on")])),
(0, RuleHelpers_1.opt)("VariableDefinitions"),
"TypeCondition",
(0, RuleHelpers_1.list)("Directive"),
"SelectionSet"
] });
function word(value) {
return {
style: "keyword",
match: (token) => token.kind === "Name" && token.value === value
};
}
function name(style) {
return {
style,
match: (token) => token.kind === "Name",
update(state, token) {
state.name = token.value;
}
};
}
function type(style) {
return {
style,
match: (token) => token.kind === "Name",
update(state, token) {
var _a2;
if ((_a2 = state.prevState) === null || _a2 === void 0 ? void 0 : _a2.prevState) {
state.name = token.value;
state.prevState.prevState.type = token.value;
}
}
};
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/onlineParser.js
var require_onlineParser = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/onlineParser.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = onlineParser;
var Rules_1 = require_Rules();
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function onlineParser(options = {}) {
const parserOptions = Object.assign({ eatWhitespace: (stream) => stream.eatWhile(Rules_1.isIgnored), lexRules: Rules_1.LexRules, parseRules: options.experimentalFragmentArguments ? Rules_1.ExperimentalFragmentArgumentParseRules : Rules_1.ParseRules, editorConfig: {} }, options);
return {
startState() {
const initialState = {
level: 0,
step: 0,
name: null,
kind: null,
type: null,
rule: null,
needsSeparator: false,
prevState: null
};
pushRule(parserOptions.parseRules, initialState, graphql_1.Kind.DOCUMENT);
return initialState;
},
token(stream, state) {
return getToken(stream, state, parserOptions);
}
};
}
function getToken(stream, state, options) {
var _a2;
if (state.inBlockstring) {
if (stream.match(/.*"""/)) {
state.inBlockstring = false;
return "string";
}
stream.skipToEnd();
return "string";
}
const { lexRules, parseRules, eatWhitespace, editorConfig } = options;
if (state.rule && state.rule.length === 0) {
popRule(state);
} else if (state.needsAdvance) {
state.needsAdvance = false;
advanceRule(state, true);
}
if (stream.sol()) {
const tabSize = (editorConfig === null || editorConfig === void 0 ? void 0 : editorConfig.tabSize) || 2;
state.indentLevel = Math.floor(stream.indentation() / tabSize);
}
if (eatWhitespace(stream)) {
return "ws";
}
const token = lex(lexRules, stream);
if (!token) {
const matchedSomething = stream.match(/\S+/);
if (!matchedSomething) {
stream.match(/\s/);
}
pushRule(SpecialParseRules, state, "Invalid");
return "invalidchar";
}
if (token.kind === "Comment") {
pushRule(SpecialParseRules, state, "Comment");
return "comment";
}
const backupState = assign({}, state);
if (token.kind === "Punctuation") {
if (/^[{([]/.test(token.value)) {
if (state.indentLevel !== void 0) {
state.levels = (state.levels || []).concat(state.indentLevel + 1);
}
} else if (/^[})\]]/.test(token.value)) {
const levels = state.levels = (state.levels || []).slice(0, -1);
if (state.indentLevel && levels.length > 0 && levels.at(-1) < state.indentLevel) {
state.indentLevel = levels.at(-1);
}
}
}
while (state.rule) {
let expected = typeof state.rule === "function" ? state.step === 0 ? state.rule(token, stream) : null : state.rule[state.step];
if (state.needsSeparator) {
expected = expected === null || expected === void 0 ? void 0 : expected.separator;
}
if (expected) {
if (expected.ofRule) {
expected = expected.ofRule;
}
if (typeof expected === "string") {
pushRule(parseRules, state, expected);
continue;
}
if ((_a2 = expected.match) === null || _a2 === void 0 ? void 0 : _a2.call(expected, token)) {
if (expected.update) {
expected.update(state, token);
}
if (token.kind === "Punctuation") {
advanceRule(state, true);
} else {
state.needsAdvance = true;
}
return expected.style;
}
}
unsuccessful(state);
}
assign(state, backupState);
pushRule(SpecialParseRules, state, "Invalid");
return "invalidchar";
}
function assign(to2, from) {
const keys = Object.keys(from);
for (let i = 0; i < keys.length; i++) {
to2[keys[i]] = from[keys[i]];
}
return to2;
}
var SpecialParseRules = {
Invalid: [],
Comment: []
};
function pushRule(rules, state, ruleKind) {
if (!rules[ruleKind]) {
throw new TypeError("Unknown rule: " + ruleKind);
}
state.prevState = Object.assign({}, state);
state.kind = ruleKind;
state.name = null;
state.type = null;
state.rule = rules[ruleKind];
state.step = 0;
state.needsSeparator = false;
}
function popRule(state) {
if (!state.prevState) {
return;
}
state.kind = state.prevState.kind;
state.name = state.prevState.name;
state.type = state.prevState.type;
state.rule = state.prevState.rule;
state.step = state.prevState.step;
state.needsSeparator = state.prevState.needsSeparator;
state.prevState = state.prevState.prevState;
}
function advanceRule(state, successful) {
var _a2;
if (isList(state) && state.rule) {
const step = state.rule[state.step];
if (step.separator) {
const { separator } = step;
state.needsSeparator = !state.needsSeparator;
if (!state.needsSeparator && separator.ofRule) {
return;
}
}
if (successful) {
return;
}
}
state.needsSeparator = false;
state.step++;
while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) {
popRule(state);
if (state.rule) {
if (isList(state)) {
if ((_a2 = state.rule) === null || _a2 === void 0 ? void 0 : _a2[state.step].separator) {
state.needsSeparator = !state.needsSeparator;
}
} else {
state.needsSeparator = false;
state.step++;
}
}
}
}
function isList(state) {
const step = Array.isArray(state.rule) && typeof state.rule[state.step] !== "string" && state.rule[state.step];
return step && step.isList;
}
function unsuccessful(state) {
while (state.rule && !(Array.isArray(state.rule) && state.rule[state.step].ofRule)) {
popRule(state);
}
if (state.rule) {
advanceRule(state, false);
}
}
function lex(lexRules, stream) {
const kinds = Object.keys(lexRules);
for (let i = 0; i < kinds.length; i++) {
const match = stream.match(lexRules[kinds[i]]);
if (match && match instanceof Array) {
return { kind: kinds[i], value: match[0] };
}
}
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/api.js
var require_api = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/api.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TYPE_SYSTEM_KINDS = exports.GraphQLDocumentMode = void 0;
exports.runOnlineParser = runOnlineParser;
exports.getDocumentMode = getDocumentMode;
exports.getTokenAtPosition = getTokenAtPosition;
exports.getContextAtPosition = getContextAtPosition;
var _1 = require_parser();
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function runOnlineParser(queryText, callback, options) {
const lines = queryText.split("\n");
const parser = (0, _1.onlineParser)(options);
let state = parser.startState();
let style = "";
let stream = new _1.CharacterStream("");
for (let i = 0; i < lines.length; i++) {
stream = new _1.CharacterStream(lines[i]);
while (!stream.eol()) {
style = parser.token(stream, state);
const code = callback(stream, state, style, i);
if (code === "BREAK") {
break;
}
}
callback(stream, state, style, i);
if (!state.kind) {
state = parser.startState();
}
}
return {
start: stream.getStartOfToken(),
end: stream.getCurrentPosition(),
string: stream.current(),
state,
style
};
}
var GraphQLDocumentMode;
(function(GraphQLDocumentMode2) {
GraphQLDocumentMode2["TYPE_SYSTEM"] = "TYPE_SYSTEM";
GraphQLDocumentMode2["EXECUTABLE"] = "EXECUTABLE";
GraphQLDocumentMode2["UNKNOWN"] = "UNKNOWN";
})(GraphQLDocumentMode || (exports.GraphQLDocumentMode = GraphQLDocumentMode = {}));
exports.TYPE_SYSTEM_KINDS = [
graphql_1.Kind.SCHEMA_DEFINITION,
graphql_1.Kind.OPERATION_TYPE_DEFINITION,
graphql_1.Kind.SCALAR_TYPE_DEFINITION,
graphql_1.Kind.OBJECT_TYPE_DEFINITION,
graphql_1.Kind.INTERFACE_TYPE_DEFINITION,
graphql_1.Kind.UNION_TYPE_DEFINITION,
graphql_1.Kind.ENUM_TYPE_DEFINITION,
graphql_1.Kind.INPUT_OBJECT_TYPE_DEFINITION,
graphql_1.Kind.DIRECTIVE_DEFINITION,
graphql_1.Kind.SCHEMA_EXTENSION,
graphql_1.Kind.SCALAR_TYPE_EXTENSION,
graphql_1.Kind.OBJECT_TYPE_EXTENSION,
graphql_1.Kind.INTERFACE_TYPE_EXTENSION,
graphql_1.Kind.UNION_TYPE_EXTENSION,
graphql_1.Kind.ENUM_TYPE_EXTENSION,
graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION
];
var getParsedMode = (sdl, options) => {
let mode = GraphQLDocumentMode.UNKNOWN;
if (sdl) {
try {
(0, graphql_1.visit)((0, _1.parseDocument)(sdl, options), {
enter(node) {
if (node.kind === "Document") {
mode = GraphQLDocumentMode.EXECUTABLE;
return;
}
if (exports.TYPE_SYSTEM_KINDS.includes(node.kind)) {
mode = GraphQLDocumentMode.TYPE_SYSTEM;
return graphql_1.BREAK;
}
return false;
}
});
} catch (_a2) {
return mode;
}
}
return mode;
};
function getDocumentMode(documentText, uri, options) {
if (uri === null || uri === void 0 ? void 0 : uri.endsWith(".graphqls")) {
return GraphQLDocumentMode.TYPE_SYSTEM;
}
return getParsedMode(documentText, options);
}
function getTokenAtPosition(queryText, cursor, offset = 0, options) {
let styleAtCursor = null;
let stateAtCursor = null;
let stringAtCursor = null;
const token = runOnlineParser(queryText, (stream, state, style, index) => {
if (index !== cursor.line || stream.getCurrentPosition() + offset < cursor.character + 1) {
return;
}
styleAtCursor = style;
stateAtCursor = Object.assign({}, state);
stringAtCursor = stream.current();
return "BREAK";
}, options);
return {
start: token.start,
end: token.end,
string: stringAtCursor || token.string,
state: stateAtCursor || token.state,
style: styleAtCursor || token.style
};
}
function getContextAtPosition(queryText, cursor, schema, contextToken, options, offset = 0) {
const token = contextToken || getTokenAtPosition(queryText, cursor, offset, options);
if (!token) {
return null;
}
const state = token.state.kind === "Invalid" ? token.state.prevState : token.state;
if (!state) {
return null;
}
const typeInfo = (0, _1.getTypeInfo)(schema, token.state, options === null || options === void 0 ? void 0 : options.fragmentDefinitions);
const mode = (options === null || options === void 0 ? void 0 : options.mode) || getDocumentMode(queryText, options === null || options === void 0 ? void 0 : options.uri, options);
return {
token,
state,
typeInfo,
mode
};
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/getTypeInfo.js
var require_getTypeInfo = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/getTypeInfo.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFieldDef = getFieldDef;
exports.forEachState = forEachState;
exports.getDefinitionState = getDefinitionState;
exports.getTypeInfo = getTypeInfo;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var _1 = require_parser();
function getFieldDef(schema, type, fieldName) {
if (fieldName === graphql_1.SchemaMetaFieldDef.name && schema.getQueryType() === type) {
return graphql_1.SchemaMetaFieldDef;
}
if (fieldName === graphql_1.TypeMetaFieldDef.name && schema.getQueryType() === type) {
return graphql_1.TypeMetaFieldDef;
}
if (fieldName === graphql_1.TypeNameMetaFieldDef.name && (0, graphql_1.isCompositeType)(type)) {
return graphql_1.TypeNameMetaFieldDef;
}
if ("getFields" in type) {
return type.getFields()[fieldName];
}
return null;
}
function forEachState(stack, fn2) {
const reverseStateStack = [];
let state = stack;
while (state === null || state === void 0 ? void 0 : state.kind) {
reverseStateStack.push(state);
state = state.prevState;
}
for (let i = reverseStateStack.length - 1; i >= 0; i--) {
fn2(reverseStateStack[i]);
}
}
function getDefinitionState(tokenState) {
let definitionState;
forEachState(tokenState, (state) => {
switch (state.kind) {
case "Query":
case "ShortQuery":
case "Mutation":
case "Subscription":
case "FragmentDefinition":
definitionState = state;
break;
}
});
return definitionState;
}
function getFragmentArguments(schema, fragmentDefinitions, fragmentName) {
var _a2;
var _b2;
if (!fragmentName) {
return null;
}
const fragment = fragmentDefinitions.find((definition) => definition.name.value === fragmentName);
return (_b2 = (_a2 = fragment === null || fragment === void 0 ? void 0 : fragment.variableDefinitions) === null || _a2 === void 0 ? void 0 : _a2.flatMap((definition) => {
const argumentType = (0, graphql_1.typeFromAST)(schema, definition.type);
return argumentType ? [
{
name: definition.variable.name.value,
type: argumentType,
description: void 0
}
] : [];
})) !== null && _b2 !== void 0 ? _b2 : null;
}
function getTypeInfo(schema, tokenState, fragmentDefinitions = []) {
let argDef;
let argDefs;
let directiveDef;
let enumValue;
let fieldDef;
let inputType;
let inputObjectType;
let objectTypeDef;
let objectFieldDefs;
let parentType;
let type;
let interfaceDef;
forEachState(tokenState, (state) => {
var _a2;
var _b2;
switch (state.kind) {
case _1.RuleKinds.QUERY:
case "ShortQuery":
type = schema.getQueryType();
break;
case _1.RuleKinds.MUTATION:
type = schema.getMutationType();
break;
case _1.RuleKinds.SUBSCRIPTION:
type = schema.getSubscriptionType();
break;
case _1.RuleKinds.INLINE_FRAGMENT:
case _1.RuleKinds.FRAGMENT_DEFINITION:
if (state.type) {
type = schema.getType(state.type);
}
break;
case _1.RuleKinds.FIELD:
case _1.RuleKinds.ALIASED_FIELD: {
if (!type || !state.name) {
fieldDef = null;
} else {
fieldDef = parentType ? getFieldDef(schema, parentType, state.name) : null;
type = fieldDef ? fieldDef.type : null;
}
break;
}
case _1.RuleKinds.SELECTION_SET:
parentType = (0, graphql_1.getNamedType)(type);
break;
case _1.RuleKinds.DIRECTIVE:
directiveDef = state.name ? schema.getDirective(state.name) : null;
break;
case _1.RuleKinds.INTERFACE_DEF:
if (state.name) {
objectTypeDef = null;
interfaceDef = new graphql_1.GraphQLInterfaceType({
name: state.name,
interfaces: [],
fields: {}
});
}
break;
case _1.RuleKinds.OBJECT_TYPE_DEF:
if (state.name) {
interfaceDef = null;
objectTypeDef = new graphql_1.GraphQLObjectType({
name: state.name,
interfaces: [],
fields: {}
});
}
break;
case _1.RuleKinds.ARGUMENTS:
case _1.RuleKinds.FRAGMENT_ARGUMENTS: {
if (state.prevState) {
switch (state.prevState.kind) {
case _1.RuleKinds.FIELD:
argDefs = fieldDef && fieldDef.args;
break;
case _1.RuleKinds.DIRECTIVE:
argDefs = directiveDef && directiveDef.args;
break;
case _1.RuleKinds.FRAGMENT_SPREAD:
argDefs = getFragmentArguments(schema, fragmentDefinitions, state.prevState.name);
break;
case _1.RuleKinds.ALIASED_FIELD: {
const name = (_a2 = state.prevState) === null || _a2 === void 0 ? void 0 : _a2.name;
if (!name) {
argDefs = null;
break;
}
const field = parentType ? getFieldDef(schema, parentType, name) : null;
if (!field) {
argDefs = null;
break;
}
argDefs = field.args;
break;
}
default:
argDefs = null;
break;
}
} else {
argDefs = null;
}
break;
}
case _1.RuleKinds.ARGUMENT:
case _1.RuleKinds.FRAGMENT_ARGUMENT:
if (argDefs) {
for (let i = 0; i < argDefs.length; i++) {
if (argDefs[i].name === state.name) {
argDef = argDefs[i];
break;
}
}
}
inputType = argDef === null || argDef === void 0 ? void 0 : argDef.type;
break;
case _1.RuleKinds.VARIABLE_DEFINITION:
case _1.RuleKinds.VARIABLE:
type = inputType;
break;
case _1.RuleKinds.ENUM_VALUE:
const enumType = (0, graphql_1.getNamedType)(inputType);
enumValue = enumType instanceof graphql_1.GraphQLEnumType ? enumType.getValues().find((val) => val.value === state.name) : null;
break;
case _1.RuleKinds.LIST_VALUE:
const nullableType = (0, graphql_1.getNullableType)(inputType);
inputType = nullableType instanceof graphql_1.GraphQLList ? nullableType.ofType : null;
break;
case _1.RuleKinds.OBJECT_VALUE:
const objectType = (0, graphql_1.getNamedType)(inputType);
inputObjectType = objectType instanceof graphql_1.GraphQLInputObjectType ? objectType : null;
objectFieldDefs = (_b2 = inputObjectType === null || inputObjectType === void 0 ? void 0 : inputObjectType.getFields()) !== null && _b2 !== void 0 ? _b2 : null;
break;
case _1.RuleKinds.OBJECT_FIELD:
const objectField = state.name && objectFieldDefs ? objectFieldDefs[state.name] : null;
inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type;
fieldDef = objectField;
type = fieldDef ? fieldDef.type : null;
break;
case _1.RuleKinds.NAMED_TYPE:
if (state.name) {
type = schema.getType(state.name);
}
break;
}
});
return {
argDef,
argDefs,
directiveDef,
enumValue,
fieldDef,
inputObjectType,
inputType,
objectFieldDefs,
parentType,
type,
interfaceDef,
objectTypeDef
};
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/parseDocument.js
var require_parseDocument = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/parseDocument.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDocument = parseDocument;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function parseDocument(source, options) {
return (0, graphql_1.parse)(source, options);
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/types.js
var require_types = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/types.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RuleKinds = exports.AdditionalRuleKinds = void 0;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
exports.AdditionalRuleKinds = {
ALIASED_FIELD: "AliasedField",
ARGUMENTS: "Arguments",
FRAGMENT_ARGUMENTS: "FragmentArguments",
FRAGMENT_ARGUMENT: "FragmentArgument",
SHORT_QUERY: "ShortQuery",
QUERY: "Query",
MUTATION: "Mutation",
SUBSCRIPTION: "Subscription",
TYPE_CONDITION: "TypeCondition",
INVALID: "Invalid",
COMMENT: "Comment",
SCHEMA_DEF: "SchemaDef",
SCALAR_DEF: "ScalarDef",
OBJECT_TYPE_DEF: "ObjectTypeDef",
OBJECT_VALUE: "ObjectValue",
LIST_VALUE: "ListValue",
INTERFACE_DEF: "InterfaceDef",
UNION_DEF: "UnionDef",
ENUM_DEF: "EnumDef",
ENUM_VALUE: "EnumValue",
FIELD_DEF: "FieldDef",
INPUT_DEF: "InputDef",
INPUT_VALUE_DEF: "InputValueDef",
ARGUMENTS_DEF: "ArgumentsDef",
EXTEND_DEF: "ExtendDef",
EXTENSION_DEFINITION: "ExtensionDefinition",
DIRECTIVE_DEF: "DirectiveDef",
IMPLEMENTS: "Implements",
VARIABLE_DEFINITIONS: "VariableDefinitions",
TYPE: "Type",
VARIABLE: "Variable"
};
exports.RuleKinds = Object.assign(Object.assign({}, graphql_1.Kind), exports.AdditionalRuleKinds);
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/index.js
var require_parser = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/parser/index.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
if (k22 === void 0) k22 = k2;
var desc = Object.getOwnPropertyDescriptor(m, k2);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k2];
} };
}
Object.defineProperty(o, k22, desc);
}) : (function(o, m, k2, k22) {
if (k22 === void 0) k22 = k2;
o[k22] = m[k2];
}));
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
};
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDocument = exports.getFieldDef = exports.getDefinitionState = exports.getTypeInfo = exports.getDocumentMode = exports.GraphQLDocumentMode = exports.getContextAtPosition = exports.getTokenAtPosition = exports.runOnlineParser = exports.onlineParser = exports.t = exports.p = exports.opt = exports.list = exports.butNot = exports.isIgnored = exports.ParseRules = exports.LexRules = exports.CharacterStream = void 0;
var CharacterStream_1 = require_CharacterStream();
Object.defineProperty(exports, "CharacterStream", { enumerable: true, get: function() {
return __importDefault(CharacterStream_1).default;
} });
var Rules_1 = require_Rules();
Object.defineProperty(exports, "LexRules", { enumerable: true, get: function() {
return Rules_1.LexRules;
} });
Object.defineProperty(exports, "ParseRules", { enumerable: true, get: function() {
return Rules_1.ParseRules;
} });
Object.defineProperty(exports, "isIgnored", { enumerable: true, get: function() {
return Rules_1.isIgnored;
} });
var RuleHelpers_1 = require_RuleHelpers();
Object.defineProperty(exports, "butNot", { enumerable: true, get: function() {
return RuleHelpers_1.butNot;
} });
Object.defineProperty(exports, "list", { enumerable: true, get: function() {
return RuleHelpers_1.list;
} });
Object.defineProperty(exports, "opt", { enumerable: true, get: function() {
return RuleHelpers_1.opt;
} });
Object.defineProperty(exports, "p", { enumerable: true, get: function() {
return RuleHelpers_1.p;
} });
Object.defineProperty(exports, "t", { enumerable: true, get: function() {
return RuleHelpers_1.t;
} });
var onlineParser_1 = require_onlineParser();
Object.defineProperty(exports, "onlineParser", { enumerable: true, get: function() {
return __importDefault(onlineParser_1).default;
} });
var api_1 = require_api();
Object.defineProperty(exports, "runOnlineParser", { enumerable: true, get: function() {
return api_1.runOnlineParser;
} });
Object.defineProperty(exports, "getTokenAtPosition", { enumerable: true, get: function() {
return api_1.getTokenAtPosition;
} });
Object.defineProperty(exports, "getContextAtPosition", { enumerable: true, get: function() {
return api_1.getContextAtPosition;
} });
Object.defineProperty(exports, "GraphQLDocumentMode", { enumerable: true, get: function() {
return api_1.GraphQLDocumentMode;
} });
Object.defineProperty(exports, "getDocumentMode", { enumerable: true, get: function() {
return api_1.getDocumentMode;
} });
var getTypeInfo_1 = require_getTypeInfo();
Object.defineProperty(exports, "getTypeInfo", { enumerable: true, get: function() {
return getTypeInfo_1.getTypeInfo;
} });
Object.defineProperty(exports, "getDefinitionState", { enumerable: true, get: function() {
return getTypeInfo_1.getDefinitionState;
} });
Object.defineProperty(exports, "getFieldDef", { enumerable: true, get: function() {
return getTypeInfo_1.getFieldDef;
} });
var parseDocument_1 = require_parseDocument();
Object.defineProperty(exports, "parseDocument", { enumerable: true, get: function() {
return parseDocument_1.parseDocument;
} });
__exportStar(require_types(), exports);
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/types.js
var require_types2 = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/types.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CompletionItemKind = exports.FileChangeTypeKind = exports.GraphQLDocumentMode = exports.InsertTextFormat = void 0;
var vscode_languageserver_types_1 = (init_main(), __toCommonJS(main_exports));
Object.defineProperty(exports, "InsertTextFormat", { enumerable: true, get: function() {
return vscode_languageserver_types_1.InsertTextFormat;
} });
var parser_1 = require_parser();
Object.defineProperty(exports, "GraphQLDocumentMode", { enumerable: true, get: function() {
return parser_1.GraphQLDocumentMode;
} });
exports.FileChangeTypeKind = {
Created: 1,
Changed: 2,
Deleted: 3
};
var CompletionItemKind3;
(function(CompletionItemKind4) {
CompletionItemKind4.Text = 1;
CompletionItemKind4.Method = 2;
CompletionItemKind4.Function = 3;
CompletionItemKind4.Constructor = 4;
CompletionItemKind4.Field = 5;
CompletionItemKind4.Variable = 6;
CompletionItemKind4.Class = 7;
CompletionItemKind4.Interface = 8;
CompletionItemKind4.Module = 9;
CompletionItemKind4.Property = 10;
CompletionItemKind4.Unit = 11;
CompletionItemKind4.Value = 12;
CompletionItemKind4.Enum = 13;
CompletionItemKind4.Keyword = 14;
CompletionItemKind4.Snippet = 15;
CompletionItemKind4.Color = 16;
CompletionItemKind4.File = 17;
CompletionItemKind4.Reference = 18;
CompletionItemKind4.Folder = 19;
CompletionItemKind4.EnumMember = 20;
CompletionItemKind4.Constant = 21;
CompletionItemKind4.Struct = 22;
CompletionItemKind4.Event = 23;
CompletionItemKind4.Operator = 24;
CompletionItemKind4.TypeParameter = 25;
})(CompletionItemKind3 || (exports.CompletionItemKind = CompletionItemKind3 = {}));
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getFragmentDefinitions.js
var require_getFragmentDefinitions = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getFragmentDefinitions.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFragmentDefinitions = getFragmentDefinitions;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var parser_1 = require_parser();
function findState(state, kind) {
let current = state;
while (current === null || current === void 0 ? void 0 : current.kind) {
if (current.kind === kind) {
return current;
}
current = current.prevState;
}
}
function getFragmentDefinitions(queryText, options) {
try {
return (0, parser_1.parseDocument)(queryText, options).definitions.filter((definition) => definition.kind === graphql_1.Kind.FRAGMENT_DEFINITION);
} catch (_a2) {
}
const fragments = /* @__PURE__ */ new Map();
const variables = /* @__PURE__ */ new Map();
let activeVariables;
let previousPosition = "";
(0, parser_1.runOnlineParser)(queryText, (stream, state, _style, line) => {
var _a2;
const position = `${line}:${stream.getCurrentPosition()}`;
if (position === previousPosition) {
return;
}
previousPosition = position;
const token = stream.current();
const definitionState = (0, parser_1.getDefinitionState)(state);
const fragmentState = (definitionState === null || definitionState === void 0 ? void 0 : definitionState.kind) === parser_1.RuleKinds.FRAGMENT_DEFINITION ? definitionState : void 0;
const variableDefinitionsState = findState(state, parser_1.RuleKinds.VARIABLE_DEFINITIONS);
if (!activeVariables && (fragmentState === null || fragmentState === void 0 ? void 0 : fragmentState.name) && variableDefinitionsState && token.trim() === "(") {
activeVariables = {
fragmentName: fragmentState.name,
source: token,
line
};
} else if (activeVariables) {
if (line !== activeVariables.line) {
activeVariables.source += "\n";
activeVariables.line = line;
}
if (variableDefinitionsState || (fragmentState === null || fragmentState === void 0 ? void 0 : fragmentState.name) === activeVariables.fragmentName && token.trim() === ")") {
activeVariables.source += token;
}
if (!variableDefinitionsState && token.trim() === ")") {
try {
const operation = (0, parser_1.parseDocument)(`query${activeVariables.source} { __typename }`).definitions[0];
if (operation.kind === graphql_1.Kind.OPERATION_DEFINITION) {
variables.set(activeVariables.fragmentName, (_a2 = operation.variableDefinitions) !== null && _a2 !== void 0 ? _a2 : []);
}
} catch (_b2) {
}
activeVariables = void 0;
}
}
if ((fragmentState === null || fragmentState === void 0 ? void 0 : fragmentState.name) && fragmentState.type) {
fragments.set(fragmentState.name, {
kind: parser_1.RuleKinds.FRAGMENT_DEFINITION,
name: {
kind: graphql_1.Kind.NAME,
value: fragmentState.name
},
variableDefinitions: variables.get(fragmentState.name),
selectionSet: {
kind: parser_1.RuleKinds.SELECTION_SET,
selections: []
},
typeCondition: {
kind: parser_1.RuleKinds.NAMED_TYPE,
name: {
kind: graphql_1.Kind.NAME,
value: fragmentState.type
}
}
});
}
}, options);
return [...fragments.values()];
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getAutocompleteSuggestions.js
var require_getAutocompleteSuggestions = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getAutocompleteSuggestions.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SuggestionCommand = exports.getTypeInfo = exports.runOnlineParser = void 0;
exports.getAutocompleteSuggestions = getAutocompleteSuggestions;
exports.getVariableCompletions = getVariableCompletions;
exports.canUseDirective = canUseDirective;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var types_1 = require_types2();
var parser_1 = require_parser();
Object.defineProperty(exports, "getTypeInfo", { enumerable: true, get: function() {
return parser_1.getTypeInfo;
} });
Object.defineProperty(exports, "runOnlineParser", { enumerable: true, get: function() {
return parser_1.runOnlineParser;
} });
var autocompleteUtils_1 = require_autocompleteUtils();
var vscode_languageserver_types_1 = (init_main(), __toCommonJS(main_exports));
var getFragmentDefinitions_1 = require_getFragmentDefinitions();
exports.SuggestionCommand = {
command: "editor.action.triggerSuggest",
title: "Suggestions"
};
var collectFragmentDefs = (op, options) => {
const externalFragments = [];
if (op) {
try {
(0, graphql_1.visit)((0, parser_1.parseDocument)(op, options), {
FragmentDefinition(def) {
externalFragments.push(def);
}
});
} catch (_a2) {
return [];
}
}
return externalFragments;
};
function getAutocompleteSuggestions(schema, queryText, cursor, contextToken, fragmentDefs, options) {
var _a2;
const opts = Object.assign(Object.assign({}, options), { schema });
const fragmentDefinitions = (0, getFragmentDefinitions_1.getFragmentDefinitions)(queryText, options);
const providedFragmentDefinitions = Array.isArray(fragmentDefs) ? fragmentDefs : collectFragmentDefs(fragmentDefs, options);
for (const definition of providedFragmentDefinitions) {
if (!fragmentDefinitions.some((existing) => existing.name.value === definition.name.value)) {
fragmentDefinitions.push(definition);
}
}
const context = (0, parser_1.getContextAtPosition)(queryText, cursor, schema, contextToken, Object.assign(Object.assign({}, options), { fragmentDefinitions }), 1);
if (!context) {
return [];
}
const { state, typeInfo, mode, token } = context;
const { kind, step, prevState } = state;
if (kind === parser_1.RuleKinds.DOCUMENT) {
if (mode === parser_1.GraphQLDocumentMode.TYPE_SYSTEM) {
return getSuggestionsForTypeSystemDefinitions(token);
}
if (mode === parser_1.GraphQLDocumentMode.EXECUTABLE) {
return getSuggestionsForExecutableDefinitions(token);
}
return getSuggestionsForUnknownDocumentMode(token);
}
if (kind === parser_1.RuleKinds.EXTEND_DEF) {
return getSuggestionsForExtensionDefinitions(token);
}
if (((_a2 = prevState === null || prevState === void 0 ? void 0 : prevState.prevState) === null || _a2 === void 0 ? void 0 : _a2.kind) === parser_1.RuleKinds.EXTENSION_DEFINITION && state.name) {
return (0, autocompleteUtils_1.hintList)(token, []);
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.SCALAR_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter(graphql_1.isScalarType).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.OBJECT_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter((type) => (0, graphql_1.isObjectType)(type) && !type.name.startsWith("__")).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.INTERFACE_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter(graphql_1.isInterfaceType).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.UNION_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter(graphql_1.isUnionType).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.ENUM_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter((type) => (0, graphql_1.isEnumType)(type) && !type.name.startsWith("__")).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === graphql_1.Kind.INPUT_OBJECT_TYPE_EXTENSION) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter(graphql_1.isInputObjectType).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function
})));
}
if (kind === parser_1.RuleKinds.IMPLEMENTS || kind === parser_1.RuleKinds.NAMED_TYPE && (prevState === null || prevState === void 0 ? void 0 : prevState.kind) === parser_1.RuleKinds.IMPLEMENTS) {
return getSuggestionsForImplements(token, state, schema, queryText, typeInfo);
}
if (kind === parser_1.RuleKinds.SELECTION_SET || kind === parser_1.RuleKinds.FIELD || kind === parser_1.RuleKinds.ALIASED_FIELD) {
return getSuggestionsForFieldNames(token, typeInfo, opts);
}
if (kind === parser_1.RuleKinds.ARGUMENTS || kind === parser_1.RuleKinds.FRAGMENT_ARGUMENTS || (kind === parser_1.RuleKinds.ARGUMENT || kind === parser_1.RuleKinds.FRAGMENT_ARGUMENT) && step === 0) {
const { argDefs } = typeInfo;
if (argDefs) {
return (0, autocompleteUtils_1.hintList)(token, argDefs.map((argDef) => {
var _a3;
return {
label: argDef.name,
insertText: (0, autocompleteUtils_1.getInputInsertText)(argDef.name + ": ", argDef.type),
insertTextMode: vscode_languageserver_types_1.InsertTextMode.adjustIndentation,
insertTextFormat: types_1.InsertTextFormat.Snippet,
command: exports.SuggestionCommand,
labelDetails: {
detail: " " + String(argDef.type)
},
documentation: (_a3 = argDef.description) !== null && _a3 !== void 0 ? _a3 : void 0,
kind: types_1.CompletionItemKind.Variable,
type: argDef.type
};
}));
}
}
if ((kind === parser_1.RuleKinds.OBJECT_VALUE || kind === parser_1.RuleKinds.OBJECT_FIELD && step === 0) && typeInfo.objectFieldDefs) {
const objectFields = (0, autocompleteUtils_1.objectValues)(typeInfo.objectFieldDefs);
const completionKind = kind === parser_1.RuleKinds.OBJECT_VALUE ? types_1.CompletionItemKind.Value : types_1.CompletionItemKind.Field;
return (0, autocompleteUtils_1.hintList)(token, objectFields.map((field) => {
var _a3;
return {
label: field.name,
detail: String(field.type),
documentation: (_a3 = field === null || field === void 0 ? void 0 : field.description) !== null && _a3 !== void 0 ? _a3 : void 0,
kind: completionKind,
type: field.type,
insertText: (0, autocompleteUtils_1.getInputInsertText)(field.name + ": ", field.type),
insertTextMode: vscode_languageserver_types_1.InsertTextMode.adjustIndentation,
insertTextFormat: types_1.InsertTextFormat.Snippet,
command: exports.SuggestionCommand
};
}));
}
if (kind === parser_1.RuleKinds.ENUM_VALUE || kind === parser_1.RuleKinds.LIST_VALUE && step === 1 || kind === parser_1.RuleKinds.OBJECT_FIELD && step === 2 || (kind === parser_1.RuleKinds.ARGUMENT || kind === parser_1.RuleKinds.FRAGMENT_ARGUMENT) && step === 2) {
return getSuggestionsForInputValues(token, typeInfo, queryText, schema);
}
if (kind === parser_1.RuleKinds.VARIABLE && step === 1) {
const namedInputType = (0, graphql_1.getNamedType)(typeInfo.inputType);
const variableDefinitions = getVariableCompletions(queryText, schema, token, options);
return (0, autocompleteUtils_1.hintList)(token, variableDefinitions.filter((v) => v.detail === (namedInputType === null || namedInputType === void 0 ? void 0 : namedInputType.name)));
}
if (kind === parser_1.RuleKinds.TYPE_CONDITION && step === 1 || kind === parser_1.RuleKinds.NAMED_TYPE && prevState != null && prevState.kind === parser_1.RuleKinds.TYPE_CONDITION) {
return getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, kind);
}
if (kind === parser_1.RuleKinds.FRAGMENT_SPREAD && step === 1) {
return getSuggestionsForFragmentSpread(token, typeInfo, schema, fragmentDefinitions);
}
const unwrappedState = unwrapType(state);
if (unwrappedState.kind === parser_1.RuleKinds.FIELD_DEF) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter((type) => (0, graphql_1.isOutputType)(type) && !type.name.startsWith("__")).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function,
insertText: (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) ? type.name + "\n" : type.name,
insertTextMode: vscode_languageserver_types_1.InsertTextMode.adjustIndentation
})));
}
if (unwrappedState.kind === parser_1.RuleKinds.INPUT_VALUE_DEF && step === 2) {
return (0, autocompleteUtils_1.hintList)(token, Object.values(schema.getTypeMap()).filter((type) => (0, graphql_1.isInputType)(type) && !type.name.startsWith("__")).map((type) => ({
label: type.name,
kind: types_1.CompletionItemKind.Function,
insertText: (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) ? type.name + "\n$1" : type.name,
insertTextMode: vscode_languageserver_types_1.InsertTextMode.adjustIndentation,
insertTextFormat: types_1.InsertTextFormat.Snippet
})));
}
if (kind === parser_1.RuleKinds.VARIABLE_DEFINITION && step === 2 || kind === parser_1.RuleKinds.LIST_TYPE && step === 1 || kind === parser_1.RuleKinds.NAMED_TYPE && prevState && (prevState.kind === parser_1.RuleKinds.VARIABLE_DEFINITION || prevState.kind === parser_1.RuleKinds.LIST_TYPE || prevState.kind === parser_1.RuleKinds.NON_NULL_TYPE)) {
return getSuggestionsForVariableDefinition(token, schema, kind);
}
if (kind === parser_1.RuleKinds.DIRECTIVE) {
return getSuggestionsForDirective(token, state, schema, kind);
}
if (kind === parser_1.RuleKinds.DIRECTIVE_DEF) {
return getSuggestionsForDirectiveArguments(token, state, schema, kind);
}
return [];
}
var typeSystemCompletionItems = [
{ label: "type", kind: types_1.CompletionItemKind.Function },
{ label: "interface", kind: types_1.CompletionItemKind.Function },
{ label: "union", kind: types_1.CompletionItemKind.Function },
{ label: "input", kind: types_1.CompletionItemKind.Function },
{ label: "scalar", kind: types_1.CompletionItemKind.Function },
{ label: "schema", kind: types_1.CompletionItemKind.Function }
];
var executableCompletionItems = [
{ label: "query", kind: types_1.CompletionItemKind.Function },
{ label: "mutation", kind: types_1.CompletionItemKind.Function },
{ label: "subscription", kind: types_1.CompletionItemKind.Function },
{ label: "fragment", kind: types_1.CompletionItemKind.Function },
{ label: "{", kind: types_1.CompletionItemKind.Constructor }
];
function getSuggestionsForTypeSystemDefinitions(token) {
return (0, autocompleteUtils_1.hintList)(token, [
{ label: "extend", kind: types_1.CompletionItemKind.Function },
...typeSystemCompletionItems
]);
}
function getSuggestionsForExecutableDefinitions(token) {
return (0, autocompleteUtils_1.hintList)(token, executableCompletionItems);
}
function getSuggestionsForUnknownDocumentMode(token) {
return (0, autocompleteUtils_1.hintList)(token, [
{ label: "extend", kind: types_1.CompletionItemKind.Function },
...executableCompletionItems,
...typeSystemCompletionItems
]);
}
function getSuggestionsForExtensionDefinitions(token) {
return (0, autocompleteUtils_1.hintList)(token, typeSystemCompletionItems);
}
function getSuggestionsForFieldNames(token, typeInfo, options) {
var _a2;
if (typeInfo.parentType) {
const { parentType } = typeInfo;
let fields = [];
if ("getFields" in parentType) {
fields = (0, autocompleteUtils_1.objectValues)(parentType.getFields());
}
if ((0, graphql_1.isCompositeType)(parentType)) {
fields.push(graphql_1.TypeNameMetaFieldDef);
}
if (parentType === ((_a2 = options === null || options === void 0 ? void 0 : options.schema) === null || _a2 === void 0 ? void 0 : _a2.getQueryType())) {
fields.push(graphql_1.SchemaMetaFieldDef, graphql_1.TypeMetaFieldDef);
}
return (0, autocompleteUtils_1.hintList)(token, fields.map((field, index) => {
var _a3;
const suggestion = {
sortText: String(index) + field.name,
label: field.name,
detail: String(field.type),
documentation: (_a3 = field.description) !== null && _a3 !== void 0 ? _a3 : void 0,
deprecated: Boolean(field.deprecationReason),
isDeprecated: Boolean(field.deprecationReason),
deprecationReason: field.deprecationReason,
kind: types_1.CompletionItemKind.Field,
labelDetails: {
detail: " " + field.type.toString()
},
type: field.type
};
if (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) {
suggestion.insertText = (0, autocompleteUtils_1.getFieldInsertText)(field);
if (!suggestion.insertText) {
suggestion.insertText = (0, autocompleteUtils_1.getInsertText)(field.name, field.type, field.name + (token.state.needsAdvance ? "" : "\n"));
}
if (suggestion.insertText) {
suggestion.insertTextFormat = types_1.InsertTextFormat.Snippet;
suggestion.insertTextMode = vscode_languageserver_types_1.InsertTextMode.adjustIndentation;
suggestion.command = exports.SuggestionCommand;
}
}
return suggestion;
}));
}
return [];
}
function getSuggestionsForInputValues(token, typeInfo, queryText, schema) {
const namedInputType = (0, graphql_1.getNamedType)(typeInfo.inputType);
let listDepth = 0;
let unwrapped = (0, graphql_1.getNullableType)(typeInfo.inputType);
while (unwrapped && (0, graphql_1.isListType)(unwrapped)) {
listDepth++;
unwrapped = (0, graphql_1.getNullableType)(unwrapped.ofType);
}
const wrap2 = (literal) => listDepth > 0 ? "[".repeat(listDepth) + literal + "]".repeat(listDepth) : void 0;
const queryVariables = getVariableCompletions(queryText, schema, token).filter((v) => v.detail === (namedInputType === null || namedInputType === void 0 ? void 0 : namedInputType.name));
if (namedInputType instanceof graphql_1.GraphQLEnumType) {
const values = namedInputType.getValues();
return (0, autocompleteUtils_1.hintList)(token, values.map((value) => {
var _a2;
return {
label: value.name,
insertText: wrap2(value.name),
detail: String(namedInputType),
documentation: (_a2 = value.description) !== null && _a2 !== void 0 ? _a2 : void 0,
deprecated: Boolean(value.deprecationReason),
isDeprecated: Boolean(value.deprecationReason),
deprecationReason: value.deprecationReason,
kind: types_1.CompletionItemKind.EnumMember,
type: namedInputType
};
}).concat(queryVariables));
}
if (namedInputType === graphql_1.GraphQLBoolean) {
return (0, autocompleteUtils_1.hintList)(token, queryVariables.concat([
{
label: "true",
insertText: wrap2("true"),
detail: String(graphql_1.GraphQLBoolean),
documentation: "Not false.",
kind: types_1.CompletionItemKind.Variable,
type: graphql_1.GraphQLBoolean
},
{
label: "false",
insertText: wrap2("false"),
detail: String(graphql_1.GraphQLBoolean),
documentation: "Not true.",
kind: types_1.CompletionItemKind.Variable,
type: graphql_1.GraphQLBoolean
}
]));
}
return queryVariables;
}
function getSuggestionsForImplements(token, tokenState, schema, documentText, typeInfo) {
if (tokenState.needsSeparator) {
return [];
}
const typeMap = schema.getTypeMap();
const schemaInterfaces = (0, autocompleteUtils_1.objectValues)(typeMap).filter(graphql_1.isInterfaceType);
const schemaInterfaceNames = schemaInterfaces.map(({ name }) => name);
const inlineInterfaces = /* @__PURE__ */ new Set();
(0, parser_1.runOnlineParser)(documentText, (_2, state) => {
var _a2, _b2, _c, _d, _e2;
if (state.name) {
if (state.kind === parser_1.RuleKinds.INTERFACE_DEF && !schemaInterfaceNames.includes(state.name)) {
inlineInterfaces.add(state.name);
}
if (state.kind === parser_1.RuleKinds.NAMED_TYPE && ((_a2 = state.prevState) === null || _a2 === void 0 ? void 0 : _a2.kind) === parser_1.RuleKinds.IMPLEMENTS) {
if (typeInfo.interfaceDef) {
const existingType = (_b2 = typeInfo.interfaceDef) === null || _b2 === void 0 ? void 0 : _b2.getInterfaces().find(({ name }) => name === state.name);
if (existingType) {
return;
}
const type = schema.getType(state.name);
const interfaceConfig = (_c = typeInfo.interfaceDef) === null || _c === void 0 ? void 0 : _c.toConfig();
typeInfo.interfaceDef = new graphql_1.GraphQLInterfaceType(Object.assign(Object.assign({}, interfaceConfig), { interfaces: [
...interfaceConfig.interfaces,
type || new graphql_1.GraphQLInterfaceType({ name: state.name, fields: {} })
] }));
} else if (typeInfo.objectTypeDef) {
const existingType = (_d = typeInfo.objectTypeDef) === null || _d === void 0 ? void 0 : _d.getInterfaces().find(({ name }) => name === state.name);
if (existingType) {
return;
}
const type = schema.getType(state.name);
const objectTypeConfig = (_e2 = typeInfo.objectTypeDef) === null || _e2 === void 0 ? void 0 : _e2.toConfig();
typeInfo.objectTypeDef = new graphql_1.GraphQLObjectType(Object.assign(Object.assign({}, objectTypeConfig), { interfaces: [
...objectTypeConfig.interfaces,
type || new graphql_1.GraphQLInterfaceType({ name: state.name, fields: {} })
] }));
}
}
}
});
const currentTypeToExtend = typeInfo.interfaceDef || typeInfo.objectTypeDef;
const siblingInterfaces = (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.getInterfaces()) || [];
const siblingInterfaceNames = siblingInterfaces.map(({ name }) => name);
const possibleInterfaces = schemaInterfaces.concat([...inlineInterfaces].map((name) => ({ name }))).filter(({ name }) => name !== (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.name) && !siblingInterfaceNames.includes(name));
return (0, autocompleteUtils_1.hintList)(token, possibleInterfaces.map((type) => {
const result = {
label: type.name,
kind: types_1.CompletionItemKind.Interface,
type
};
if (type === null || type === void 0 ? void 0 : type.description) {
result.documentation = type.description;
}
return result;
}));
}
function getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, _kind) {
let possibleTypes;
if (typeInfo.parentType) {
if ((0, graphql_1.isAbstractType)(typeInfo.parentType)) {
const abstractType = (0, graphql_1.assertAbstractType)(typeInfo.parentType);
const possibleObjTypes = schema.getPossibleTypes(abstractType);
const possibleIfaceMap = /* @__PURE__ */ Object.create(null);
for (const type of possibleObjTypes) {
for (const iface of type.getInterfaces()) {
possibleIfaceMap[iface.name] = iface;
}
}
possibleTypes = possibleObjTypes.concat((0, autocompleteUtils_1.objectValues)(possibleIfaceMap));
} else {
possibleTypes = [typeInfo.parentType];
}
} else {
const typeMap = schema.getTypeMap();
possibleTypes = (0, autocompleteUtils_1.objectValues)(typeMap).filter((type) => (0, graphql_1.isCompositeType)(type) && !type.name.startsWith("__"));
}
return (0, autocompleteUtils_1.hintList)(token, possibleTypes.map((type) => {
const namedType = (0, graphql_1.getNamedType)(type);
return {
label: String(type),
documentation: (namedType === null || namedType === void 0 ? void 0 : namedType.description) || "",
kind: types_1.CompletionItemKind.Field
};
}));
}
function getSuggestionsForFragmentSpread(token, typeInfo, schema, fragmentDefinitions) {
const typeMap = schema.getTypeMap();
const defState = (0, parser_1.getDefinitionState)(token.state);
const relevantFrags = fragmentDefinitions.filter((frag) => typeMap[frag.typeCondition.name.value] && !(defState && defState.kind === parser_1.RuleKinds.FRAGMENT_DEFINITION && defState.name === frag.name.value) && (0, graphql_1.isCompositeType)(typeInfo.parentType) && (0, graphql_1.isCompositeType)(typeMap[frag.typeCondition.name.value]) && (0, graphql_1.doTypesOverlap)(schema, typeInfo.parentType, typeMap[frag.typeCondition.name.value]));
return (0, autocompleteUtils_1.hintList)(token, relevantFrags.map((frag) => ({
label: frag.name.value,
detail: String(typeMap[frag.typeCondition.name.value]),
documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`,
labelDetails: {
detail: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`
},
kind: types_1.CompletionItemKind.Field,
type: typeMap[frag.typeCondition.name.value]
})));
}
var getParentDefinition = (state, kind) => {
var _a2, _b2, _c, _d, _e2, _f, _g, _h, _j, _k;
if (((_a2 = state.prevState) === null || _a2 === void 0 ? void 0 : _a2.kind) === kind) {
return state.prevState;
}
if (((_c = (_b2 = state.prevState) === null || _b2 === void 0 ? void 0 : _b2.prevState) === null || _c === void 0 ? void 0 : _c.kind) === kind) {
return state.prevState.prevState;
}
if (((_f = (_e2 = (_d = state.prevState) === null || _d === void 0 ? void 0 : _d.prevState) === null || _e2 === void 0 ? void 0 : _e2.prevState) === null || _f === void 0 ? void 0 : _f.kind) === kind) {
return state.prevState.prevState.prevState;
}
if (((_k = (_j = (_h = (_g = state.prevState) === null || _g === void 0 ? void 0 : _g.prevState) === null || _h === void 0 ? void 0 : _h.prevState) === null || _j === void 0 ? void 0 : _j.prevState) === null || _k === void 0 ? void 0 : _k.kind) === kind) {
return state.prevState.prevState.prevState.prevState;
}
};
function getDefinitionKey(state) {
var _a2;
const definition = (0, parser_1.getDefinitionState)(state);
return (definition === null || definition === void 0 ? void 0 : definition.kind) ? `${definition.kind}:${(_a2 = definition.name) !== null && _a2 !== void 0 ? _a2 : ""}` : void 0;
}
function stateContains(state, kind) {
let current = state;
while (current === null || current === void 0 ? void 0 : current.kind) {
if (current.kind === kind) {
return true;
}
current = current.prevState;
}
return false;
}
function getVariableCompletions(queryText, schema, token, options) {
var _a2, _b2;
let variableName = null;
let variableScope;
let variableType;
const definitionsByScope = /* @__PURE__ */ new Map();
const fragmentSpreadsByScope = /* @__PURE__ */ new Map();
const operationScopes = /* @__PURE__ */ new Set();
(0, parser_1.runOnlineParser)(queryText, (_2, state) => {
var _a3, _b3;
const scope = getDefinitionKey(state);
const definition = (0, parser_1.getDefinitionState)(state);
if (!scope || !definition) {
return;
}
if (definition.kind === parser_1.RuleKinds.QUERY || definition.kind === parser_1.RuleKinds.MUTATION || definition.kind === parser_1.RuleKinds.SUBSCRIPTION || definition.kind === parser_1.RuleKinds.SHORT_QUERY) {
operationScopes.add(scope);
}
if (state.kind === parser_1.RuleKinds.FRAGMENT_SPREAD && state.name) {
const spreads = (_a3 = fragmentSpreadsByScope.get(scope)) !== null && _a3 !== void 0 ? _a3 : /* @__PURE__ */ new Set();
spreads.add(state.name);
fragmentSpreadsByScope.set(scope, spreads);
}
if (state.kind === parser_1.RuleKinds.VARIABLE && state.name && stateContains(state, parser_1.RuleKinds.VARIABLE_DEFINITION)) {
variableName = state.name;
variableScope = scope;
}
if (state.kind === parser_1.RuleKinds.NAMED_TYPE && variableName && variableScope === scope) {
const parentDefinition = getParentDefinition(state, parser_1.RuleKinds.TYPE);
if (parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type) {
variableType = schema.getType(parentDefinition.type);
}
}
if (variableName && variableType && variableScope === scope) {
const definitions = (_b3 = definitionsByScope.get(scope)) !== null && _b3 !== void 0 ? _b3 : /* @__PURE__ */ new Map();
if (!definitions.has(variableName)) {
const replaceString = token.string === "$" || token.state.kind === parser_1.RuleKinds.VARIABLE ? variableName : "$" + variableName;
definitions.set(variableName, {
detail: variableType.toString(),
insertText: replaceString,
label: "$" + variableName,
rawInsert: replaceString,
type: variableType,
kind: types_1.CompletionItemKind.Variable
});
definitionsByScope.set(scope, definitions);
}
variableName = null;
variableScope = void 0;
variableType = null;
}
}, options);
const currentDefinition = (0, parser_1.getDefinitionState)(token.state);
const currentScope = getDefinitionKey(token.state);
if (!currentDefinition || !currentScope) {
return [];
}
const visibleDefinitions = new Map((_a2 = definitionsByScope.get(currentScope)) !== null && _a2 !== void 0 ? _a2 : []);
if (currentDefinition.kind === parser_1.RuleKinds.FRAGMENT_DEFINITION) {
const reachesFragment = (scope, fragmentName, visited = /* @__PURE__ */ new Set()) => {
if (visited.has(scope)) {
return false;
}
visited.add(scope);
const spreads = fragmentSpreadsByScope.get(scope);
if (spreads === null || spreads === void 0 ? void 0 : spreads.has(fragmentName)) {
return true;
}
return [...spreads !== null && spreads !== void 0 ? spreads : []].some((spreadName) => reachesFragment(`${parser_1.RuleKinds.FRAGMENT_DEFINITION}:${spreadName}`, fragmentName, visited));
};
for (const operationScope of operationScopes) {
if (currentDefinition.name && reachesFragment(operationScope, currentDefinition.name)) {
for (const [name, definition] of (_b2 = definitionsByScope.get(operationScope)) !== null && _b2 !== void 0 ? _b2 : []) {
if (!visibleDefinitions.has(name)) {
visibleDefinitions.set(name, definition);
}
}
}
}
}
return [...visibleDefinitions.values()];
}
function getSuggestionsForVariableDefinition(token, schema, _kind) {
const inputTypeMap = schema.getTypeMap();
const inputTypes = (0, autocompleteUtils_1.objectValues)(inputTypeMap).filter(graphql_1.isInputType);
return (0, autocompleteUtils_1.hintList)(token, inputTypes.map((type) => ({
label: type.name,
documentation: (type === null || type === void 0 ? void 0 : type.description) || "",
kind: types_1.CompletionItemKind.Variable
})));
}
function getSuggestionsForDirective(token, state, schema, _kind) {
var _a2;
if ((_a2 = state.prevState) === null || _a2 === void 0 ? void 0 : _a2.kind) {
const directives = schema.getDirectives().filter((directive) => canUseDirective(state.prevState, directive));
return (0, autocompleteUtils_1.hintList)(token, directives.map((directive) => ({
label: directive.name,
documentation: (directive === null || directive === void 0 ? void 0 : directive.description) || "",
kind: types_1.CompletionItemKind.Function
})));
}
return [];
}
function getSuggestionsForDirectiveArguments(token, state, schema, _kind) {
const directive = schema.getDirectives().find((d) => d.name === state.name);
return (0, autocompleteUtils_1.hintList)(token, (directive === null || directive === void 0 ? void 0 : directive.args.map((arg) => ({
label: arg.name,
documentation: arg.description || "",
kind: types_1.CompletionItemKind.Field
}))) || []);
}
function canUseDirective(state, directive) {
if (!(state === null || state === void 0 ? void 0 : state.kind)) {
return false;
}
const { kind, prevState } = state;
const { locations } = directive;
switch (kind) {
case parser_1.RuleKinds.QUERY:
return locations.includes(graphql_1.DirectiveLocation.QUERY);
case parser_1.RuleKinds.MUTATION:
return locations.includes(graphql_1.DirectiveLocation.MUTATION);
case parser_1.RuleKinds.SUBSCRIPTION:
return locations.includes(graphql_1.DirectiveLocation.SUBSCRIPTION);
case parser_1.RuleKinds.FIELD:
case parser_1.RuleKinds.ALIASED_FIELD:
return locations.includes(graphql_1.DirectiveLocation.FIELD);
case parser_1.RuleKinds.FRAGMENT_DEFINITION:
return locations.includes(graphql_1.DirectiveLocation.FRAGMENT_DEFINITION);
case parser_1.RuleKinds.FRAGMENT_SPREAD:
return locations.includes(graphql_1.DirectiveLocation.FRAGMENT_SPREAD);
case parser_1.RuleKinds.INLINE_FRAGMENT:
return locations.includes(graphql_1.DirectiveLocation.INLINE_FRAGMENT);
case parser_1.RuleKinds.SCHEMA_DEF:
return locations.includes(graphql_1.DirectiveLocation.SCHEMA);
case parser_1.RuleKinds.SCALAR_DEF:
return locations.includes(graphql_1.DirectiveLocation.SCALAR);
case parser_1.RuleKinds.OBJECT_TYPE_DEF:
return locations.includes(graphql_1.DirectiveLocation.OBJECT);
case parser_1.RuleKinds.FIELD_DEF:
return locations.includes(graphql_1.DirectiveLocation.FIELD_DEFINITION);
case parser_1.RuleKinds.INTERFACE_DEF:
return locations.includes(graphql_1.DirectiveLocation.INTERFACE);
case parser_1.RuleKinds.UNION_DEF:
return locations.includes(graphql_1.DirectiveLocation.UNION);
case parser_1.RuleKinds.ENUM_DEF:
return locations.includes(graphql_1.DirectiveLocation.ENUM);
case parser_1.RuleKinds.ENUM_VALUE:
return locations.includes(graphql_1.DirectiveLocation.ENUM_VALUE);
case parser_1.RuleKinds.INPUT_DEF:
return locations.includes(graphql_1.DirectiveLocation.INPUT_OBJECT);
case parser_1.RuleKinds.INPUT_VALUE_DEF:
const prevStateKind = prevState === null || prevState === void 0 ? void 0 : prevState.kind;
switch (prevStateKind) {
case parser_1.RuleKinds.ARGUMENTS_DEF:
return locations.includes(graphql_1.DirectiveLocation.ARGUMENT_DEFINITION);
case parser_1.RuleKinds.INPUT_DEF:
return locations.includes(graphql_1.DirectiveLocation.INPUT_FIELD_DEFINITION);
}
}
return false;
}
function unwrapType(state) {
if (state.prevState && state.kind && [
parser_1.RuleKinds.NAMED_TYPE,
parser_1.RuleKinds.LIST_TYPE,
parser_1.RuleKinds.TYPE,
parser_1.RuleKinds.NON_NULL_TYPE
].includes(state.kind)) {
return unwrapType(state.prevState);
}
return state;
}
}
});
// ../../../node_modules/.pnpm/nullthrows@1.1.1/node_modules/nullthrows/nullthrows.js
var require_nullthrows = __commonJS({
"../../../node_modules/.pnpm/nullthrows@1.1.1/node_modules/nullthrows/nullthrows.js"(exports, module) {
"use strict";
function nullthrows(x2, message) {
if (x2 != null) {
return x2;
}
var error = new Error(message !== void 0 ? message : "Got unexpected " + x2);
error.framesToPop = 1;
throw error;
}
module.exports = nullthrows;
module.exports.default = nullthrows;
Object.defineProperty(module.exports, "__esModule", { value: true });
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/fragmentDependencies.js
var require_fragmentDependencies = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/fragmentDependencies.js"(exports) {
"use strict";
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFragmentDependenciesForAST = exports.getFragmentDependencies = void 0;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var nullthrows_1 = __importDefault(require_nullthrows());
var parser_1 = require_parser();
var getFragmentDependencies = (operationString, fragmentDefinitions, options) => {
if (!fragmentDefinitions) {
return [];
}
let parsedOperation;
try {
parsedOperation = (0, parser_1.parseDocument)(operationString, options);
} catch (_a2) {
return [];
}
return (0, exports.getFragmentDependenciesForAST)(parsedOperation, fragmentDefinitions);
};
exports.getFragmentDependencies = getFragmentDependencies;
var getFragmentDependenciesForAST = (parsedOperation, fragmentDefinitions) => {
if (!fragmentDefinitions) {
return [];
}
const existingFrags = /* @__PURE__ */ new Map();
const referencedFragNames = /* @__PURE__ */ new Set();
(0, graphql_1.visit)(parsedOperation, {
FragmentDefinition(node) {
existingFrags.set(node.name.value, true);
},
FragmentSpread(node) {
if (!referencedFragNames.has(node.name.value)) {
referencedFragNames.add(node.name.value);
}
}
});
const asts = /* @__PURE__ */ new Set();
for (const name of referencedFragNames) {
if (!existingFrags.has(name) && fragmentDefinitions.has(name)) {
asts.add((0, nullthrows_1.default)(fragmentDefinitions.get(name)));
}
}
const referencedFragments = [];
for (const ast of asts) {
(0, graphql_1.visit)(ast, {
FragmentSpread(node) {
if (!referencedFragNames.has(node.name.value) && fragmentDefinitions.get(node.name.value)) {
asts.add((0, nullthrows_1.default)(fragmentDefinitions.get(node.name.value)));
referencedFragNames.add(node.name.value);
}
}
});
if (!existingFrags.has(ast.name.value)) {
referencedFragments.push(ast);
}
}
return referencedFragments;
};
exports.getFragmentDependenciesForAST = getFragmentDependenciesForAST;
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getVariablesJSONSchema.js
var require_getVariablesJSONSchema = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getVariablesJSONSchema.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultJSONSchemaOptions = void 0;
exports.getVariablesJSONSchema = getVariablesJSONSchema;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
exports.defaultJSONSchemaOptions = {
useMarkdownDescription: false
};
function text(into, newText) {
into.push(newText);
}
function renderType(into, t) {
if ((0, graphql_1.isNonNullType)(t)) {
renderType(into, t.ofType);
text(into, "!");
} else if ((0, graphql_1.isListType)(t)) {
text(into, "[");
renderType(into, t.ofType);
text(into, "]");
} else {
text(into, t.name);
}
}
function renderDefinitionDescription(t, useMarkdown, description) {
const into = [];
const type = "type" in t ? t.type : t;
if ("type" in t && t.description) {
text(into, t.description);
text(into, "\n\n");
}
text(into, renderTypeToString(type, useMarkdown));
if (description) {
text(into, "\n");
text(into, description);
} else if (!(0, graphql_1.isScalarType)(type) && "description" in type && type.description) {
text(into, "\n");
text(into, type.description);
} else if ("ofType" in type && !(0, graphql_1.isScalarType)(type.ofType) && "description" in type.ofType && type.ofType.description) {
text(into, "\n");
text(into, type.ofType.description);
}
return into.join("");
}
function renderTypeToString(t, useMarkdown) {
const into = [];
if (useMarkdown) {
text(into, "```graphql\n");
}
renderType(into, t);
if (useMarkdown) {
text(into, "\n```");
}
return into.join("");
}
var defaultScalarTypesMap = {
Int: { type: "integer" },
String: { type: "string" },
Float: { type: "number" },
ID: { type: "string" },
Boolean: { type: "boolean" },
DateTime: { type: "string" }
};
var Marker = class {
constructor() {
this.set = /* @__PURE__ */ new Set();
}
mark(name) {
if (this.set.has(name)) {
return false;
}
this.set.add(name);
return true;
}
};
function getJSONSchemaFromGraphQLType(fieldOrType, options) {
var _a2, _b2;
let definition = /* @__PURE__ */ Object.create(null);
const definitions = /* @__PURE__ */ Object.create(null);
const isField2 = "type" in fieldOrType;
const type = isField2 ? fieldOrType.type : fieldOrType;
const baseType = (0, graphql_1.isNonNullType)(type) ? type.ofType : type;
const required = (0, graphql_1.isNonNullType)(type);
if ((0, graphql_1.isScalarType)(baseType)) {
if ((_a2 = options === null || options === void 0 ? void 0 : options.scalarSchemas) === null || _a2 === void 0 ? void 0 : _a2[baseType.name]) {
definition = JSON.parse(JSON.stringify(options.scalarSchemas[baseType.name]));
} else {
definition.type = ["string", "number", "boolean", "integer"];
}
if (!required) {
if (Array.isArray(definition.type)) {
definition.type.push("null");
} else if (definition.type) {
definition.type = [definition.type, "null"];
} else if (definition.enum) {
definition.enum.push(null);
} else if (definition.oneOf) {
definition.oneOf.push({ type: "null" });
} else {
definition = {
oneOf: [definition, { type: "null" }]
};
}
}
} else if ((0, graphql_1.isEnumType)(baseType)) {
definition.enum = baseType.getValues().map((val) => val.name);
if (!required) {
definition.enum.push(null);
}
} else if ((0, graphql_1.isListType)(baseType)) {
if (required) {
definition.type = "array";
} else {
definition.type = ["array", "null"];
}
const { definition: def, definitions: defs } = getJSONSchemaFromGraphQLType(baseType.ofType, options);
definition.items = def;
if (defs) {
for (const defName of Object.keys(defs)) {
definitions[defName] = defs[defName];
}
}
} else if ((0, graphql_1.isInputObjectType)(baseType)) {
if (required) {
definition.$ref = `#/definitions/${baseType.name}`;
} else {
definition.oneOf = [
{ $ref: `#/definitions/${baseType.name}` },
{ type: "null" }
];
}
if ((_b2 = options === null || options === void 0 ? void 0 : options.definitionMarker) === null || _b2 === void 0 ? void 0 : _b2.mark(baseType.name)) {
const fields = baseType.getFields();
const fieldDef = {
type: "object",
properties: {},
required: []
};
fieldDef.description = renderDefinitionDescription(baseType);
if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {
fieldDef.markdownDescription = renderDefinitionDescription(baseType, true);
}
for (const fieldName of Object.keys(fields)) {
const field = fields[fieldName];
const { required: fieldRequired, definition: fieldDefinition, definitions: typeDefinitions } = getJSONSchemaFromGraphQLType(field, options);
fieldDef.properties[fieldName] = fieldDefinition;
if (fieldRequired) {
fieldDef.required.push(fieldName);
}
if (typeDefinitions) {
for (const [defName, value] of Object.entries(typeDefinitions)) {
definitions[defName] = value;
}
}
}
definitions[baseType.name] = fieldDef;
}
}
if ("defaultValue" in fieldOrType && fieldOrType.defaultValue !== void 0) {
definition.default = fieldOrType.defaultValue;
}
const { description } = definition;
definition.description = renderDefinitionDescription(fieldOrType, false, description);
if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) {
definition.markdownDescription = renderDefinitionDescription(fieldOrType, true, description);
}
return { required, definition, definitions };
}
function getVariablesJSONSchema(variableToType, options) {
var _a2;
const jsonSchema = {
$schema: "http://json-schema.org/draft-04/schema",
type: "object",
properties: {},
required: [],
additionalProperties: false
};
const runtimeOptions = Object.assign(Object.assign({}, options), { definitionMarker: new Marker(), scalarSchemas: Object.assign(Object.assign({}, defaultScalarTypesMap), options === null || options === void 0 ? void 0 : options.scalarSchemas) });
if (variableToType) {
for (const [variableName, type] of Object.entries(variableToType)) {
const { definition, required, definitions } = getJSONSchemaFromGraphQLType(type, runtimeOptions);
jsonSchema.properties[variableName] = definition;
if (required) {
(_a2 = jsonSchema.required) === null || _a2 === void 0 ? void 0 : _a2.push(variableName);
}
if (definitions) {
jsonSchema.definitions = Object.assign(Object.assign({}, jsonSchema === null || jsonSchema === void 0 ? void 0 : jsonSchema.definitions), definitions);
}
}
}
return jsonSchema;
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getASTNodeAtPosition.js
var require_getASTNodeAtPosition = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getASTNodeAtPosition.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getASTNodeAtPosition = getASTNodeAtPosition;
exports.pointToOffset = pointToOffset;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function getASTNodeAtPosition(query, ast, point) {
const offset = pointToOffset(query, point);
let nodeContainingPosition;
(0, graphql_1.visit)(ast, {
enter(node) {
if (node.kind !== "Name" && node.loc && node.loc.start <= offset && offset <= node.loc.end) {
nodeContainingPosition = node;
} else {
return false;
}
},
leave(node) {
if (node.loc && node.loc.start <= offset && offset <= node.loc.end) {
return false;
}
}
});
return nodeContainingPosition;
}
function pointToOffset(text, point) {
const linesUntilPosition = text.split("\n").slice(0, point.line);
return point.character + linesUntilPosition.map((line) => line.length + 1).reduce((a, b) => a + b, 0);
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/Range.js
var require_Range = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/Range.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Position = exports.Range = void 0;
exports.offsetToPosition = offsetToPosition;
exports.locToRange = locToRange;
var Range3 = class {
constructor(start, end) {
this.containsPosition = (position) => {
if (this.start.line === position.line) {
return this.start.character <= position.character;
}
if (this.end.line === position.line) {
return this.end.character >= position.character;
}
return this.start.line <= position.line && this.end.line >= position.line;
};
this.start = start;
this.end = end;
}
setStart(line, character) {
this.start = new Position3(line, character);
}
setEnd(line, character) {
this.end = new Position3(line, character);
}
};
exports.Range = Range3;
var Position3 = class {
constructor(line, character) {
this.lessThanOrEqualTo = (position) => this.line < position.line || this.line === position.line && this.character <= position.character;
this.line = line;
this.character = character;
}
setLine(line) {
this.line = line;
}
setCharacter(character) {
this.character = character;
}
};
exports.Position = Position3;
function offsetToPosition(text, loc) {
const EOL2 = "\n";
const buf = text.slice(0, loc);
const lines = buf.split(EOL2).length - 1;
const lastLineIndex = buf.lastIndexOf(EOL2);
return new Position3(lines, loc - lastLineIndex - 1);
}
function locToRange(text, loc) {
const start = offsetToPosition(text, loc.start);
const end = offsetToPosition(text, loc.end);
return new Range3(start, end);
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/validateWithCustomRules.js
var require_validateWithCustomRules = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/validateWithCustomRules.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateWithCustomRules = validateWithCustomRules;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var specifiedSDLRules2 = [
graphql_1.LoneSchemaDefinitionRule,
graphql_1.UniqueOperationTypesRule,
graphql_1.UniqueTypeNamesRule,
graphql_1.UniqueEnumValueNamesRule,
graphql_1.UniqueFieldDefinitionNamesRule,
graphql_1.UniqueDirectiveNamesRule,
graphql_1.KnownTypeNamesRule,
graphql_1.KnownDirectivesRule,
graphql_1.UniqueDirectivesPerLocationRule,
graphql_1.PossibleTypeExtensionsRule,
graphql_1.UniqueArgumentNamesRule,
graphql_1.UniqueInputFieldNamesRule,
graphql_1.UniqueVariableNamesRule,
graphql_1.FragmentsOnCompositeTypesRule,
graphql_1.ProvidedRequiredArgumentsRule
];
function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, isSchemaDocument) {
const rules = graphql_1.specifiedRules.filter((rule) => {
if (rule === graphql_1.NoUnusedFragmentsRule || rule === graphql_1.ExecutableDefinitionsRule) {
return false;
}
if (isRelayCompatMode && rule === graphql_1.KnownFragmentNamesRule) {
return false;
}
return true;
});
if (customRules) {
Array.prototype.push.apply(rules, customRules);
}
if (isSchemaDocument) {
Array.prototype.push.apply(rules, specifiedSDLRules2);
}
const errors = (0, graphql_1.validate)(schema, ast, rules);
return errors.filter((error) => {
if (error.message.includes("Unknown directive") && error.nodes) {
const node = error.nodes[0];
if (node && node.kind === graphql_1.Kind.DIRECTIVE) {
const name = node.name.value;
if (name === "arguments" || name === "argumentDefinitions") {
return false;
}
}
}
return true;
});
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/collectVariables.js
var require_collectVariables = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/collectVariables.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.collectVariables = collectVariables;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
function collectVariables(schema, documentAST) {
const variableToType = /* @__PURE__ */ Object.create(null);
for (const definition of documentAST.definitions) {
if (definition.kind === "OperationDefinition") {
const { variableDefinitions } = definition;
if (variableDefinitions) {
for (const { variable, type } of variableDefinitions) {
const inputType = (0, graphql_1.typeFromAST)(schema, type);
if (inputType) {
variableToType[variable.name.value] = inputType;
} else if (type.kind === graphql_1.Kind.NAMED_TYPE && type.name.value === "Float") {
variableToType[variable.name.value] = graphql_1.GraphQLFloat;
}
}
}
}
}
return variableToType;
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getOperationFacts.js
var require_getOperationFacts = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/getOperationFacts.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getQueryFacts = void 0;
exports.getOperationASTFacts = getOperationASTFacts;
exports.default = getOperationFacts;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var parser_1 = require_parser();
var collectVariables_1 = require_collectVariables();
function getOperationASTFacts(documentAST, schema) {
const variableToType = schema ? (0, collectVariables_1.collectVariables)(schema, documentAST) : void 0;
const operations = [];
(0, graphql_1.visit)(documentAST, {
OperationDefinition(node) {
operations.push(node);
}
});
return { variableToType, operations };
}
function getOperationFacts(schema, documentString, options) {
if (!documentString) {
return;
}
try {
const documentAST = (0, parser_1.parseDocument)(documentString, options);
return Object.assign(Object.assign({}, getOperationASTFacts(documentAST, schema)), { documentAST });
} catch (_a2) {
}
}
exports.getQueryFacts = getOperationFacts;
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/index.js
var require_utils = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/utils/index.js"(exports) {
"use strict";
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getQueryFacts = exports.getOperationASTFacts = exports.getOperationFacts = exports.collectVariables = exports.validateWithCustomRules = exports.offsetToPosition = exports.locToRange = exports.Range = exports.Position = exports.pointToOffset = exports.getASTNodeAtPosition = exports.getVariablesJSONSchema = exports.getFragmentDependenciesForAST = exports.getFragmentDependencies = void 0;
var fragmentDependencies_1 = require_fragmentDependencies();
Object.defineProperty(exports, "getFragmentDependencies", { enumerable: true, get: function() {
return fragmentDependencies_1.getFragmentDependencies;
} });
Object.defineProperty(exports, "getFragmentDependenciesForAST", { enumerable: true, get: function() {
return fragmentDependencies_1.getFragmentDependenciesForAST;
} });
var getVariablesJSONSchema_1 = require_getVariablesJSONSchema();
Object.defineProperty(exports, "getVariablesJSONSchema", { enumerable: true, get: function() {
return getVariablesJSONSchema_1.getVariablesJSONSchema;
} });
var getASTNodeAtPosition_1 = require_getASTNodeAtPosition();
Object.defineProperty(exports, "getASTNodeAtPosition", { enumerable: true, get: function() {
return getASTNodeAtPosition_1.getASTNodeAtPosition;
} });
Object.defineProperty(exports, "pointToOffset", { enumerable: true, get: function() {
return getASTNodeAtPosition_1.pointToOffset;
} });
var Range_1 = require_Range();
Object.defineProperty(exports, "Position", { enumerable: true, get: function() {
return Range_1.Position;
} });
Object.defineProperty(exports, "Range", { enumerable: true, get: function() {
return Range_1.Range;
} });
Object.defineProperty(exports, "locToRange", { enumerable: true, get: function() {
return Range_1.locToRange;
} });
Object.defineProperty(exports, "offsetToPosition", { enumerable: true, get: function() {
return Range_1.offsetToPosition;
} });
var validateWithCustomRules_1 = require_validateWithCustomRules();
Object.defineProperty(exports, "validateWithCustomRules", { enumerable: true, get: function() {
return validateWithCustomRules_1.validateWithCustomRules;
} });
var collectVariables_1 = require_collectVariables();
Object.defineProperty(exports, "collectVariables", { enumerable: true, get: function() {
return collectVariables_1.collectVariables;
} });
var getOperationFacts_1 = require_getOperationFacts();
Object.defineProperty(exports, "getOperationFacts", { enumerable: true, get: function() {
return __importDefault(getOperationFacts_1).default;
} });
Object.defineProperty(exports, "getOperationASTFacts", { enumerable: true, get: function() {
return getOperationFacts_1.getOperationASTFacts;
} });
Object.defineProperty(exports, "getQueryFacts", { enumerable: true, get: function() {
return getOperationFacts_1.getQueryFacts;
} });
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getDefinition.js
var require_getDefinition = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getDefinition.js"(exports) {
"use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve2) {
resolve2(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve2, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LANGUAGE = void 0;
exports.getDefinitionQueryResultForNamedType = getDefinitionQueryResultForNamedType;
exports.getDefinitionQueryResultForField = getDefinitionQueryResultForField;
exports.getDefinitionQueryResultForArgument = getDefinitionQueryResultForArgument;
exports.getDefinitionQueryResultForFragmentSpread = getDefinitionQueryResultForFragmentSpread;
exports.getDefinitionQueryResultForDefinitionNode = getDefinitionQueryResultForDefinitionNode;
var utils_1 = require_utils();
exports.LANGUAGE = "GraphQL";
function assert(value, message) {
if (!value) {
throw new Error(message);
}
}
function getRange(text, node) {
const location = node.loc;
assert(location, "Expected ASTNode to have a location.");
return (0, utils_1.locToRange)(text, location);
}
function getPosition(text, node) {
const location = node.loc;
assert(location, "Expected ASTNode to have a location.");
return (0, utils_1.offsetToPosition)(text, location.start);
}
function getDefinitionQueryResultForNamedType(text, node, dependencies) {
return __awaiter(this, void 0, void 0, function* () {
const name = node.name.value;
const defNodes = dependencies.filter(({ definition }) => definition.name && definition.name.value === name);
if (defNodes.length === 0) {
throw new Error(`Definition not found for GraphQL type ${name}`);
}
const definitions = defNodes.map(({ filePath, content, definition }) => getDefinitionForNodeDefinition(filePath || "", content, definition));
return {
definitions,
queryRange: definitions.map((_2) => getRange(text, node)),
printedName: name
};
});
}
function getDefinitionQueryResultForField(fieldName, typeName, dependencies) {
return __awaiter(this, void 0, void 0, function* () {
var _a2;
const defNodes = dependencies.filter(({ definition }) => definition.name && definition.name.value === typeName);
if (defNodes.length === 0) {
throw new Error(`Definition not found for GraphQL type ${typeName}`);
}
const definitions = [];
for (const { filePath, content, definition } of defNodes) {
const fieldDefinition = (_a2 = definition.fields) === null || _a2 === void 0 ? void 0 : _a2.find((item) => item.name.value === fieldName);
if (fieldDefinition == null) {
continue;
}
definitions.push(getDefinitionForFieldDefinition(filePath || "", content, fieldDefinition));
}
return {
definitions,
queryRange: [],
printedName: [typeName, fieldName].join(".")
};
});
}
function getDefinitionQueryResultForArgument(argumentName, fieldName, typeName, dependencies) {
return __awaiter(this, void 0, void 0, function* () {
var _a2, _b2, _c;
const definitions = [];
for (const { filePath, content, definition } of dependencies) {
const argDefinition = (_c = (_b2 = (_a2 = definition.fields) === null || _a2 === void 0 ? void 0 : _a2.find((item) => item.name.value === fieldName)) === null || _b2 === void 0 ? void 0 : _b2.arguments) === null || _c === void 0 ? void 0 : _c.find((item) => item.name.value === argumentName);
if (argDefinition == null) {
continue;
}
definitions.push(getDefinitionForArgumentDefinition(filePath || "", content, argDefinition));
}
return {
definitions,
queryRange: [],
printedName: `${[typeName, fieldName].join(".")}(${argumentName})`
};
});
}
function getDefinitionQueryResultForFragmentSpread(text, fragment, dependencies) {
return __awaiter(this, void 0, void 0, function* () {
const name = fragment.name.value;
const defNodes = dependencies.filter(({ definition }) => definition.name.value === name);
if (defNodes.length === 0) {
throw new Error(`Definition not found for GraphQL fragment ${name}`);
}
const definitions = defNodes.map(({ filePath, content, definition }) => getDefinitionForFragmentDefinition(filePath || "", content, definition));
return {
definitions,
queryRange: definitions.map((_2) => getRange(text, fragment)),
printedName: name
};
});
}
function getDefinitionQueryResultForDefinitionNode(path, text, definition) {
var _a2;
return {
definitions: [getDefinitionForFragmentDefinition(path, text, definition)],
queryRange: definition.name ? [getRange(text, definition.name)] : [],
printedName: (_a2 = definition.name) === null || _a2 === void 0 ? void 0 : _a2.value
};
}
function getDefinitionForFragmentDefinition(path, text, definition) {
const { name } = definition;
if (!name) {
throw new Error("Expected ASTNode to have a Name.");
}
return {
path,
position: getPosition(text, definition),
range: getRange(text, definition),
name: name.value || "",
language: exports.LANGUAGE,
projectRoot: path
};
}
function getDefinitionForNodeDefinition(path, text, definition) {
const { name } = definition;
assert(name, "Expected ASTNode to have a Name.");
return {
path,
position: getPosition(text, definition),
range: getRange(text, definition),
name: name.value || "",
language: exports.LANGUAGE,
projectRoot: path
};
}
function getDefinitionForFieldDefinition(path, text, definition) {
const { name } = definition;
assert(name, "Expected ASTNode to have a Name.");
return {
path,
position: getPosition(text, definition),
range: getRange(text, definition),
name: name.value || "",
language: exports.LANGUAGE,
projectRoot: path
};
}
function getDefinitionForArgumentDefinition(path, text, definition) {
const { name } = definition;
assert(name, "Expected ASTNode to have a Name.");
return {
path,
position: getPosition(text, definition),
range: getRange(text, definition),
name: name.value || "",
language: exports.LANGUAGE,
projectRoot: path
};
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getDiagnostics.js
var require_getDiagnostics = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getDiagnostics.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DIAGNOSTIC_SEVERITY = exports.SEVERITY = void 0;
exports.getDiagnostics = getDiagnostics;
exports.validateQuery = validateQuery;
exports.getRange = getRange;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var parser_1 = require_parser();
var utils_1 = require_utils();
exports.SEVERITY = {
Error: "Error",
Warning: "Warning",
Information: "Information",
Hint: "Hint"
};
exports.DIAGNOSTIC_SEVERITY = {
[exports.SEVERITY.Error]: 1,
[exports.SEVERITY.Warning]: 2,
[exports.SEVERITY.Information]: 3,
[exports.SEVERITY.Hint]: 4
};
var invariant2 = (condition, message) => {
if (!condition) {
throw new Error(message);
}
};
function getDiagnostics(query, schema = null, customRules, isRelayCompatMode, externalFragments, options) {
var _a2;
var _b2;
let ast = null;
let fragments = "";
if (externalFragments) {
fragments = typeof externalFragments === "string" ? externalFragments : externalFragments.reduce((acc, node) => acc + (0, graphql_1.print)(node) + "\n\n", "");
}
const enhancedQuery = fragments ? `${query}
${fragments}` : query;
try {
ast = (0, parser_1.parseDocument)(enhancedQuery, options);
} catch (error) {
if (error instanceof graphql_1.GraphQLError) {
const range = getRange((_b2 = (_a2 = error.locations) === null || _a2 === void 0 ? void 0 : _a2[0]) !== null && _b2 !== void 0 ? _b2 : { line: 0, column: 0 }, enhancedQuery);
return [
{
severity: exports.DIAGNOSTIC_SEVERITY.Error,
message: error.message,
source: "GraphQL: Syntax",
range
}
];
}
throw error;
}
return validateQuery(ast, schema, customRules, isRelayCompatMode);
}
function validateQuery(ast, schema = null, customRules, isRelayCompatMode) {
if (!schema) {
return [];
}
const validationErrorAnnotations = (0, utils_1.validateWithCustomRules)(schema, ast, customRules, isRelayCompatMode).flatMap((error) => annotations(error, exports.DIAGNOSTIC_SEVERITY.Error, "Validation"));
const deprecationWarningAnnotations = (0, graphql_1.validate)(schema, ast, [
graphql_1.NoDeprecatedCustomRule
]).flatMap((error) => annotations(error, exports.DIAGNOSTIC_SEVERITY.Warning, "Deprecation"));
return validationErrorAnnotations.concat(deprecationWarningAnnotations);
}
function annotations(error, severity, type) {
if (!error.nodes) {
return [];
}
const highlightedNodes = [];
for (const node of error.nodes) {
const highlightNode = node.kind !== "Variable" && "name" in node && node.name !== void 0 ? node.name : "variable" in node && node.variable !== void 0 ? node.variable : node;
if (highlightNode) {
const highlightLoc = getLocation2(highlightNode);
const { line, column } = highlightLoc.startToken;
const end = column + (highlightLoc.end - highlightLoc.start);
highlightedNodes.push({
source: `GraphQL: ${type}`,
message: error.message,
severity,
range: new utils_1.Range(new utils_1.Position(line - 1, column - 1), new utils_1.Position(line - 1, end))
});
}
}
return highlightedNodes;
}
function getRange(location, queryText) {
const parser = (0, parser_1.onlineParser)();
const state = parser.startState();
const lines = queryText.split("\n");
invariant2(lines.length >= location.line, "Query text must have more lines than where the error happened");
let stream = null;
for (let i = 0; i < location.line; i++) {
stream = new parser_1.CharacterStream(lines[i]);
while (!stream.eol()) {
const style = parser.token(stream, state);
if (style === "invalidchar") {
break;
}
}
}
invariant2(stream, "Expected Parser stream to be available.");
const line = location.line - 1;
const start = stream.getStartOfToken();
const end = stream.getCurrentPosition();
return new utils_1.Range(new utils_1.Position(line, start), new utils_1.Position(line, end));
}
function getLocation2(node) {
const typeCastedNode = node;
const location = typeCastedNode.loc;
invariant2(location, "Expected ASTNode to have a location.");
return location;
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getOutline.js
var require_getOutline = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getOutline.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOutline = getOutline;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var parser_1 = require_parser();
var utils_1 = require_utils();
function getOutline(documentText, options) {
let ast;
try {
ast = (0, parser_1.parseDocument)(documentText, options);
} catch (_a2) {
return null;
}
const visitorFns = outlineTreeConverter(documentText);
const outlineTrees = (0, graphql_1.visit)(ast, {
leave(node) {
if (visitorFns !== void 0 && node.kind in visitorFns) {
return visitorFns[node.kind](node);
}
return null;
}
});
return { outlineTrees };
}
function outlineTreeConverter(docText) {
const meta = (node) => {
return {
representativeName: node.name,
startPosition: (0, utils_1.offsetToPosition)(docText, node.loc.start),
endPosition: (0, utils_1.offsetToPosition)(docText, node.loc.end),
kind: node.kind,
children: node.selectionSet || node.fields || node.values || node.arguments || []
};
};
return {
Field(node) {
const tokenizedText = node.alias ? [buildToken("plain", node.alias), buildToken("plain", ": ")] : [];
tokenizedText.push(buildToken("plain", node.name));
return Object.assign({ tokenizedText }, meta(node));
},
OperationDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", node.operation),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
Document: (node) => node.definitions,
SelectionSet: (node) => concatMap(node.selections, (child) => {
return child.kind === graphql_1.Kind.INLINE_FRAGMENT ? child.selectionSet : child;
}),
Name: (node) => node.value,
FragmentDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", "fragment"),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
InterfaceTypeDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", "interface"),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
EnumTypeDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", "enum"),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
EnumValueDefinition: (node) => Object.assign({ tokenizedText: [buildToken("plain", node.name)] }, meta(node)),
ObjectTypeDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", "type"),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
InputObjectTypeDefinition: (node) => Object.assign({ tokenizedText: [
buildToken("keyword", "input"),
buildToken("whitespace", " "),
buildToken("class-name", node.name)
] }, meta(node)),
FragmentSpread: (node) => Object.assign({ tokenizedText: [
buildToken("plain", "..."),
buildToken("class-name", node.name)
] }, meta(node)),
InputValueDefinition(node) {
return Object.assign({ tokenizedText: [buildToken("plain", node.name)] }, meta(node));
},
FieldDefinition(node) {
return Object.assign({ tokenizedText: [buildToken("plain", node.name)] }, meta(node));
},
InlineFragment: (node) => node.selectionSet
};
}
function buildToken(kind, value) {
return { kind, value };
}
function concatMap(arr, fn2) {
const res = [];
for (let i = 0; i < arr.length; i++) {
const x2 = fn2(arr[i], i);
if (Array.isArray(x2)) {
res.push(...x2);
} else {
res.push(x2);
}
}
return res;
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getHoverInformation.js
var require_getHoverInformation = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/getHoverInformation.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHoverInformation = getHoverInformation;
exports.renderField = renderField;
exports.renderDirective = renderDirective;
exports.renderArg = renderArg;
exports.renderEnumValue = renderEnumValue;
exports.renderType = renderType;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var parser_1 = require_parser();
var getFragmentDefinitions_1 = require_getFragmentDefinitions();
function getHoverInformation(schema, queryText, cursor, contextToken, config) {
const options = Object.assign(Object.assign({}, config), { schema });
const context = (0, parser_1.getContextAtPosition)(queryText, cursor, schema, contextToken, {
fragmentDefinitions: (0, getFragmentDefinitions_1.getFragmentDefinitions)(queryText, config),
experimentalFragmentArguments: config === null || config === void 0 ? void 0 : config.experimentalFragmentArguments
});
if (!context) {
return "";
}
const { typeInfo, token } = context;
const { kind, step } = token.state;
if (kind === "Field" && step === 0 && typeInfo.fieldDef || kind === "AliasedField" && step === 2 && typeInfo.fieldDef || kind === "ObjectField" && step === 0 && typeInfo.fieldDef) {
const into = [];
renderMdCodeStart(into, options);
renderField(into, typeInfo, options);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.fieldDef);
return into.join("").trim();
}
if (kind === "Directive" && step === 1 && typeInfo.directiveDef) {
const into = [];
renderMdCodeStart(into, options);
renderDirective(into, typeInfo, options);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.directiveDef);
return into.join("").trim();
}
if (kind === "Variable" && typeInfo.type) {
const into = [];
renderMdCodeStart(into, options);
renderType(into, typeInfo, options, typeInfo.type);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.type);
return into.join("").trim();
}
if ((kind === parser_1.RuleKinds.ARGUMENT || kind === parser_1.RuleKinds.FRAGMENT_ARGUMENT) && step === 0 && typeInfo.argDef) {
const into = [];
renderMdCodeStart(into, options);
renderArg(into, typeInfo, options, kind === parser_1.RuleKinds.ARGUMENT);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.argDef);
return into.join("").trim();
}
if (kind === "EnumValue" && typeInfo.enumValue && "description" in typeInfo.enumValue) {
const into = [];
renderMdCodeStart(into, options);
renderEnumValue(into, typeInfo, options);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.enumValue);
return into.join("").trim();
}
if (kind === "NamedType" && typeInfo.type && "description" in typeInfo.type) {
const into = [];
renderMdCodeStart(into, options);
renderType(into, typeInfo, options, typeInfo.type);
renderMdCodeEnd(into, options);
renderDescription(into, options, typeInfo.type);
return into.join("").trim();
}
return "";
}
function renderMdCodeStart(into, options) {
if (options.useMarkdown) {
text(into, "```graphql\n");
}
}
function renderMdCodeEnd(into, options) {
if (options.useMarkdown) {
text(into, "\n```");
}
}
function renderField(into, typeInfo, options) {
renderQualifiedField(into, typeInfo, options);
renderTypeAnnotation(into, typeInfo, options, typeInfo.type);
}
function renderQualifiedField(into, typeInfo, options) {
if (!typeInfo.fieldDef) {
return;
}
const fieldName = typeInfo.fieldDef.name;
if (fieldName.slice(0, 2) !== "__") {
renderType(into, typeInfo, options, typeInfo.parentType);
text(into, ".");
}
text(into, fieldName);
}
function renderDirective(into, typeInfo, _options) {
if (!typeInfo.directiveDef) {
return;
}
const name = "@" + typeInfo.directiveDef.name;
text(into, name);
}
function renderArg(into, typeInfo, options, qualify = true) {
if (qualify && typeInfo.directiveDef) {
renderDirective(into, typeInfo, options);
} else if (qualify && typeInfo.fieldDef) {
renderQualifiedField(into, typeInfo, options);
}
if (!typeInfo.argDef) {
return;
}
const { name } = typeInfo.argDef;
text(into, "(");
text(into, name);
renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType);
text(into, ")");
}
function renderTypeAnnotation(into, typeInfo, options, t) {
text(into, ": ");
renderType(into, typeInfo, options, t);
}
function renderEnumValue(into, typeInfo, options) {
if (!typeInfo.enumValue) {
return;
}
const { name } = typeInfo.enumValue;
renderType(into, typeInfo, options, typeInfo.inputType);
text(into, ".");
text(into, name);
}
function renderType(into, typeInfo, options, t) {
if (!t) {
return;
}
if (t instanceof graphql_1.GraphQLNonNull) {
renderType(into, typeInfo, options, t.ofType);
text(into, "!");
} else if (t instanceof graphql_1.GraphQLList) {
text(into, "[");
renderType(into, typeInfo, options, t.ofType);
text(into, "]");
} else {
text(into, t.name);
}
}
function renderDescription(into, options, def) {
if (!def) {
return;
}
const description = typeof def.description === "string" ? def.description : null;
if (description) {
text(into, "\n\n");
text(into, description);
}
renderDeprecation(into, options, def);
}
function renderDeprecation(into, _options, def) {
if (!def) {
return;
}
const reason = def.deprecationReason;
if (!reason) {
return;
}
text(into, "\n\n");
text(into, "Deprecated: ");
text(into, reason);
}
function text(into, content) {
into.push(content);
}
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/index.js
var require_interface = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/interface/index.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k2, k22) {
if (k22 === void 0) k22 = k2;
var desc = Object.getOwnPropertyDescriptor(m, k2);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() {
return m[k2];
} };
}
Object.defineProperty(o, k22, desc);
}) : (function(o, m, k2, k22) {
if (k22 === void 0) k22 = k2;
o[k22] = m[k2];
}));
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHoverInformation = exports.getOutline = exports.getFragmentDefinitions = void 0;
__exportStar(require_autocompleteUtils(), exports);
__exportStar(require_getAutocompleteSuggestions(), exports);
__exportStar(require_getDefinition(), exports);
__exportStar(require_getDiagnostics(), exports);
var getFragmentDefinitions_1 = require_getFragmentDefinitions();
Object.defineProperty(exports, "getFragmentDefinitions", { enumerable: true, get: function() {
return getFragmentDefinitions_1.getFragmentDefinitions;
} });
var getOutline_1 = require_getOutline();
Object.defineProperty(exports, "getOutline", { enumerable: true, get: function() {
return getOutline_1.getOutline;
} });
var getHoverInformation_1 = require_getHoverInformation();
Object.defineProperty(exports, "getHoverInformation", { enumerable: true, get: function() {
return getHoverInformation_1.getHoverInformation;
} });
}
});
// ../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/index.js
var require_dist = __commonJS({
"../../../node_modules/.pnpm/graphql-language-service@5.7.0_graphql@17.1.0/node_modules/graphql-language-service/dist/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Range = exports.validateWithCustomRules = exports.collectVariables = exports.Position = exports.pointToOffset = exports.offsetToPosition = exports.getVariablesJSONSchema = exports.getQueryFacts = exports.getOperationFacts = exports.getOperationASTFacts = exports.getFragmentDependenciesForAST = exports.getFragmentDependencies = exports.getASTNodeAtPosition = exports.FileChangeTypeKind = exports.CompletionItemKind = exports.parseDocument = exports.getContextAtPosition = exports.getFieldDef = exports.getDefinitionState = exports.GraphQLDocumentMode = exports.getTokenAtPosition = exports.opt = exports.t = exports.list = exports.p = exports.isIgnored = exports.LexRules = exports.RuleKinds = exports.CharacterStream = exports.ParseRules = exports.onlineParser = exports.validateQuery = exports.SuggestionCommand = exports.canUseDirective = exports.DIAGNOSTIC_SEVERITY = exports.SEVERITY = exports.getVariableCompletions = exports.getTypeInfo = exports.getRange = exports.getOutline = exports.getHoverInformation = exports.getFragmentDefinitions = exports.getDiagnostics = exports.getDefinitionQueryResultForArgument = exports.getDefinitionQueryResultForField = exports.getDefinitionQueryResultForNamedType = exports.getDefinitionQueryResultForFragmentSpread = exports.getDefinitionQueryResultForDefinitionNode = exports.getAutocompleteSuggestions = void 0;
var interface_1 = require_interface();
Object.defineProperty(exports, "getAutocompleteSuggestions", { enumerable: true, get: function() {
return interface_1.getAutocompleteSuggestions;
} });
Object.defineProperty(exports, "getDefinitionQueryResultForDefinitionNode", { enumerable: true, get: function() {
return interface_1.getDefinitionQueryResultForDefinitionNode;
} });
Object.defineProperty(exports, "getDefinitionQueryResultForFragmentSpread", { enumerable: true, get: function() {
return interface_1.getDefinitionQueryResultForFragmentSpread;
} });
Object.defineProperty(exports, "getDefinitionQueryResultForNamedType", { enumerable: true, get: function() {
return interface_1.getDefinitionQueryResultForNamedType;
} });
Object.defineProperty(exports, "getDefinitionQueryResultForField", { enumerable: true, get: function() {
return interface_1.getDefinitionQueryResultForField;
} });
Object.defineProperty(exports, "getDefinitionQueryResultForArgument", { enumerable: true, get: function() {
return interface_1.getDefinitionQueryResultForArgument;
} });
Object.defineProperty(exports, "getDiagnostics", { enumerable: true, get: function() {
return interface_1.getDiagnostics;
} });
Object.defineProperty(exports, "getFragmentDefinitions", { enumerable: true, get: function() {
return interface_1.getFragmentDefinitions;
} });
Object.defineProperty(exports, "getHoverInformation", { enumerable: true, get: function() {
return interface_1.getHoverInformation;
} });
Object.defineProperty(exports, "getOutline", { enumerable: true, get: function() {
return interface_1.getOutline;
} });
Object.defineProperty(exports, "getRange", { enumerable: true, get: function() {
return interface_1.getRange;
} });
Object.defineProperty(exports, "getTypeInfo", { enumerable: true, get: function() {
return interface_1.getTypeInfo;
} });
Object.defineProperty(exports, "getVariableCompletions", { enumerable: true, get: function() {
return interface_1.getVariableCompletions;
} });
Object.defineProperty(exports, "SEVERITY", { enumerable: true, get: function() {
return interface_1.SEVERITY;
} });
Object.defineProperty(exports, "DIAGNOSTIC_SEVERITY", { enumerable: true, get: function() {
return interface_1.DIAGNOSTIC_SEVERITY;
} });
Object.defineProperty(exports, "canUseDirective", { enumerable: true, get: function() {
return interface_1.canUseDirective;
} });
Object.defineProperty(exports, "SuggestionCommand", { enumerable: true, get: function() {
return interface_1.SuggestionCommand;
} });
Object.defineProperty(exports, "validateQuery", { enumerable: true, get: function() {
return interface_1.validateQuery;
} });
var parser_1 = require_parser();
Object.defineProperty(exports, "onlineParser", { enumerable: true, get: function() {
return parser_1.onlineParser;
} });
Object.defineProperty(exports, "ParseRules", { enumerable: true, get: function() {
return parser_1.ParseRules;
} });
Object.defineProperty(exports, "CharacterStream", { enumerable: true, get: function() {
return parser_1.CharacterStream;
} });
Object.defineProperty(exports, "RuleKinds", { enumerable: true, get: function() {
return parser_1.RuleKinds;
} });
Object.defineProperty(exports, "LexRules", { enumerable: true, get: function() {
return parser_1.LexRules;
} });
Object.defineProperty(exports, "isIgnored", { enumerable: true, get: function() {
return parser_1.isIgnored;
} });
Object.defineProperty(exports, "p", { enumerable: true, get: function() {
return parser_1.p;
} });
Object.defineProperty(exports, "list", { enumerable: true, get: function() {
return parser_1.list;
} });
Object.defineProperty(exports, "t", { enumerable: true, get: function() {
return parser_1.t;
} });
Object.defineProperty(exports, "opt", { enumerable: true, get: function() {
return parser_1.opt;
} });
Object.defineProperty(exports, "getTokenAtPosition", { enumerable: true, get: function() {
return parser_1.getTokenAtPosition;
} });
Object.defineProperty(exports, "GraphQLDocumentMode", { enumerable: true, get: function() {
return parser_1.GraphQLDocumentMode;
} });
Object.defineProperty(exports, "getDefinitionState", { enumerable: true, get: function() {
return parser_1.getDefinitionState;
} });
Object.defineProperty(exports, "getFieldDef", { enumerable: true, get: function() {
return parser_1.getFieldDef;
} });
Object.defineProperty(exports, "getContextAtPosition", { enumerable: true, get: function() {
return parser_1.getContextAtPosition;
} });
Object.defineProperty(exports, "parseDocument", { enumerable: true, get: function() {
return parser_1.parseDocument;
} });
var types_1 = require_types2();
Object.defineProperty(exports, "CompletionItemKind", { enumerable: true, get: function() {
return types_1.CompletionItemKind;
} });
Object.defineProperty(exports, "FileChangeTypeKind", { enumerable: true, get: function() {
return types_1.FileChangeTypeKind;
} });
var utils_1 = require_utils();
Object.defineProperty(exports, "getASTNodeAtPosition", { enumerable: true, get: function() {
return utils_1.getASTNodeAtPosition;
} });
Object.defineProperty(exports, "getFragmentDependencies", { enumerable: true, get: function() {
return utils_1.getFragmentDependencies;
} });
Object.defineProperty(exports, "getFragmentDependenciesForAST", { enumerable: true, get: function() {
return utils_1.getFragmentDependenciesForAST;
} });
Object.defineProperty(exports, "getOperationASTFacts", { enumerable: true, get: function() {
return utils_1.getOperationASTFacts;
} });
Object.defineProperty(exports, "getOperationFacts", { enumerable: true, get: function() {
return utils_1.getOperationFacts;
} });
Object.defineProperty(exports, "getQueryFacts", { enumerable: true, get: function() {
return utils_1.getQueryFacts;
} });
Object.defineProperty(exports, "getVariablesJSONSchema", { enumerable: true, get: function() {
return utils_1.getVariablesJSONSchema;
} });
Object.defineProperty(exports, "offsetToPosition", { enumerable: true, get: function() {
return utils_1.offsetToPosition;
} });
Object.defineProperty(exports, "pointToOffset", { enumerable: true, get: function() {
return utils_1.pointToOffset;
} });
Object.defineProperty(exports, "Position", { enumerable: true, get: function() {
return utils_1.Position;
} });
Object.defineProperty(exports, "collectVariables", { enumerable: true, get: function() {
return utils_1.collectVariables;
} });
Object.defineProperty(exports, "validateWithCustomRules", { enumerable: true, get: function() {
return utils_1.validateWithCustomRules;
} });
Object.defineProperty(exports, "Range", { enumerable: true, get: function() {
return utils_1.Range;
} });
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/constants.js
var require_constants = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/constants.js"(exports, module) {
"use strict";
var WIN_SLASH = "\\\\/";
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
var DOT_LITERAL = "\\.";
var PLUS_LITERAL = "\\+";
var QMARK_LITERAL = "\\?";
var SLASH_LITERAL = "\\/";
var ONE_CHAR = "(?=.)";
var QMARK = "[^/]";
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
var NO_DOT = `(?!${DOT_LITERAL})`;
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
var STAR = `${QMARK}*?`;
var SEP = "/";
var POSIX_CHARS = {
DOT_LITERAL,
PLUS_LITERAL,
QMARK_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
QMARK,
END_ANCHOR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK_NO_DOT,
STAR,
START_ANCHOR,
SEP
};
var WINDOWS_CHARS = {
...POSIX_CHARS,
SLASH_LITERAL: `[${WIN_SLASH}]`,
QMARK: WIN_NO_SLASH,
STAR: `${WIN_NO_SLASH}*?`,
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
NO_DOT: `(?!${DOT_LITERAL})`,
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
SEP: "\\"
};
var POSIX_REGEX_SOURCE = {
alnum: "a-zA-Z0-9",
alpha: "a-zA-Z",
ascii: "\\x00-\\x7F",
blank: " \\t",
cntrl: "\\x00-\\x1F\\x7F",
digit: "0-9",
graph: "\\x21-\\x7E",
lower: "a-z",
print: "\\x20-\\x7E ",
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
space: " \\t\\r\\n\\v\\f",
upper: "A-Z",
word: "A-Za-z0-9_",
xdigit: "A-Fa-f0-9"
};
module.exports = {
MAX_LENGTH: 1024 * 64,
POSIX_REGEX_SOURCE,
// regular expressions
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
// Replace globs with equivalent patterns to reduce parsing time.
REPLACEMENTS: {
"***": "*",
"**/**": "**",
"**/**/**": "**"
},
// Digits
CHAR_0: 48,
/* 0 */
CHAR_9: 57,
/* 9 */
// Alphabet chars.
CHAR_UPPERCASE_A: 65,
/* A */
CHAR_LOWERCASE_A: 97,
/* a */
CHAR_UPPERCASE_Z: 90,
/* Z */
CHAR_LOWERCASE_Z: 122,
/* z */
CHAR_LEFT_PARENTHESES: 40,
/* ( */
CHAR_RIGHT_PARENTHESES: 41,
/* ) */
CHAR_ASTERISK: 42,
/* * */
// Non-alphabetic chars.
CHAR_AMPERSAND: 38,
/* & */
CHAR_AT: 64,
/* @ */
CHAR_BACKWARD_SLASH: 92,
/* \ */
CHAR_CARRIAGE_RETURN: 13,
/* \r */
CHAR_CIRCUMFLEX_ACCENT: 94,
/* ^ */
CHAR_COLON: 58,
/* : */
CHAR_COMMA: 44,
/* , */
CHAR_DOT: 46,
/* . */
CHAR_DOUBLE_QUOTE: 34,
/* " */
CHAR_EQUAL: 61,
/* = */
CHAR_EXCLAMATION_MARK: 33,
/* ! */
CHAR_FORM_FEED: 12,
/* \f */
CHAR_FORWARD_SLASH: 47,
/* / */
CHAR_GRAVE_ACCENT: 96,
/* ` */
CHAR_HASH: 35,
/* # */
CHAR_HYPHEN_MINUS: 45,
/* - */
CHAR_LEFT_ANGLE_BRACKET: 60,
/* < */
CHAR_LEFT_CURLY_BRACE: 123,
/* { */
CHAR_LEFT_SQUARE_BRACKET: 91,
/* [ */
CHAR_LINE_FEED: 10,
/* \n */
CHAR_NO_BREAK_SPACE: 160,
/* \u00A0 */
CHAR_PERCENT: 37,
/* % */
CHAR_PLUS: 43,
/* + */
CHAR_QUESTION_MARK: 63,
/* ? */
CHAR_RIGHT_ANGLE_BRACKET: 62,
/* > */
CHAR_RIGHT_CURLY_BRACE: 125,
/* } */
CHAR_RIGHT_SQUARE_BRACKET: 93,
/* ] */
CHAR_SEMICOLON: 59,
/* ; */
CHAR_SINGLE_QUOTE: 39,
/* ' */
CHAR_SPACE: 32,
/* */
CHAR_TAB: 9,
/* \t */
CHAR_UNDERSCORE: 95,
/* _ */
CHAR_VERTICAL_LINE: 124,
/* | */
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
/* \uFEFF */
/**
* Create EXTGLOB_CHARS
*/
extglobChars(chars) {
return {
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
"?": { type: "qmark", open: "(?:", close: ")?" },
"+": { type: "plus", open: "(?:", close: ")+" },
"*": { type: "star", open: "(?:", close: ")*" },
"@": { type: "at", open: "(?:", close: ")" }
};
},
/**
* Create GLOB_CHARS
*/
globChars(win322) {
return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
}
};
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/utils.js
var require_utils2 = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/utils.js"(exports) {
"use strict";
var {
REGEX_BACKSLASH,
REGEX_REMOVE_BACKSLASH,
REGEX_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_GLOBAL
} = require_constants();
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
exports.removeBackslashes = (str) => {
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
return match === "\\" ? "" : match;
});
};
exports.supportsLookbehinds = () => {
const segs = process.version.slice(1).split(".").map(Number);
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
return true;
}
return false;
};
exports.escapeLast = (input, char, lastIdx) => {
const idx = input.lastIndexOf(char, lastIdx);
if (idx === -1) return input;
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
};
exports.removePrefix = (input, state = {}) => {
let output = input;
if (output.startsWith("./")) {
output = output.slice(2);
state.prefix = "./";
}
return output;
};
exports.wrapOutput = (input, state = {}, options = {}) => {
const prepend = options.contains ? "" : "^";
const append = options.contains ? "" : "$";
let output = `${prepend}(?:${input})${append}`;
if (state.negated === true) {
output = `(?:^(?!${output}).*$)`;
}
return output;
};
exports.basename = (path, { windows } = {}) => {
if (windows) {
return path.replace(/[\\/]$/, "").replace(/.*[\\/]/, "");
} else {
return path.replace(/\/$/, "").replace(/.*\//, "");
}
};
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/scan.js
var require_scan = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/scan.js"(exports, module) {
"use strict";
var utils = require_utils2();
var {
CHAR_ASTERISK,
/* * */
CHAR_AT,
/* @ */
CHAR_BACKWARD_SLASH: CHAR_BACKWARD_SLASH2,
/* \ */
CHAR_COMMA,
/* , */
CHAR_DOT: CHAR_DOT2,
/* . */
CHAR_EXCLAMATION_MARK,
/* ! */
CHAR_FORWARD_SLASH: CHAR_FORWARD_SLASH2,
/* / */
CHAR_LEFT_CURLY_BRACE,
/* { */
CHAR_LEFT_PARENTHESES,
/* ( */
CHAR_LEFT_SQUARE_BRACKET,
/* [ */
CHAR_PLUS,
/* + */
CHAR_QUESTION_MARK: CHAR_QUESTION_MARK2,
/* ? */
CHAR_RIGHT_CURLY_BRACE,
/* } */
CHAR_RIGHT_PARENTHESES,
/* ) */
CHAR_RIGHT_SQUARE_BRACKET
/* ] */
} = require_constants();
var isPathSeparator2 = (code) => {
return code === CHAR_FORWARD_SLASH2 || code === CHAR_BACKWARD_SLASH2;
};
var depth = (token) => {
if (token.isPrefix !== true) {
token.depth = token.isGlobstar ? Infinity : 1;
}
};
var scan = (input, options) => {
const opts = options || {};
const length = input.length - 1;
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
const slashes = [];
const tokens = [];
const parts = [];
let str = input;
let index = -1;
let start = 0;
let lastIndex = 0;
let isBrace = false;
let isBracket = false;
let isGlob = false;
let isExtglob = false;
let isGlobstar = false;
let braceEscaped = false;
let backslashes = false;
let negated = false;
let finished = false;
let braces = 0;
let prev;
let code;
let token = { value: "", depth: 0, isGlob: false };
const eos = () => index >= length;
const peek = () => str.charCodeAt(index + 1);
const advance = () => {
prev = code;
return str.charCodeAt(++index);
};
while (index < length) {
code = advance();
let next;
if (code === CHAR_BACKWARD_SLASH2) {
backslashes = token.backslashes = true;
code = advance();
if (code === CHAR_LEFT_CURLY_BRACE) {
braceEscaped = true;
}
continue;
}
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
braces++;
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH2) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (code === CHAR_LEFT_CURLY_BRACE) {
braces++;
continue;
}
if (braceEscaped !== true && code === CHAR_DOT2 && (code = advance()) === CHAR_DOT2) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (braceEscaped !== true && code === CHAR_COMMA) {
isBrace = token.isBrace = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_RIGHT_CURLY_BRACE) {
braces--;
if (braces === 0) {
braceEscaped = false;
isBrace = token.isBrace = true;
finished = true;
break;
}
}
}
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_FORWARD_SLASH2) {
slashes.push(index);
tokens.push(token);
token = { value: "", depth: 0, isGlob: false };
if (finished === true) continue;
if (prev === CHAR_DOT2 && index === start + 1) {
start += 2;
continue;
}
lastIndex = index + 1;
continue;
}
if (opts.noext !== true) {
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK2 || code === CHAR_EXCLAMATION_MARK;
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
isExtglob = token.isExtglob = true;
finished = true;
if (scanToEnd === true) {
while (eos() !== true && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH2) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
isGlob = token.isGlob = true;
finished = true;
break;
}
}
continue;
}
break;
}
}
if (code === CHAR_ASTERISK) {
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_QUESTION_MARK2) {
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
if (code === CHAR_LEFT_SQUARE_BRACKET) {
while (eos() !== true && (next = advance())) {
if (next === CHAR_BACKWARD_SLASH2) {
backslashes = token.backslashes = true;
advance();
continue;
}
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
isBracket = token.isBracket = true;
isGlob = token.isGlob = true;
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
}
}
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
negated = token.negated = true;
start++;
continue;
}
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
isGlob = token.isGlob = true;
if (scanToEnd === true) {
while (eos() !== true && (code = advance())) {
if (code === CHAR_LEFT_PARENTHESES) {
backslashes = token.backslashes = true;
code = advance();
continue;
}
if (code === CHAR_RIGHT_PARENTHESES) {
finished = true;
break;
}
}
continue;
}
break;
}
if (isGlob === true) {
finished = true;
if (scanToEnd === true) {
continue;
}
break;
}
}
if (opts.noext === true) {
isExtglob = false;
isGlob = false;
}
let base = str;
let prefix = "";
let glob = "";
if (start > 0) {
prefix = str.slice(0, start);
str = str.slice(start);
lastIndex -= start;
}
if (base && isGlob === true && lastIndex > 0) {
base = str.slice(0, lastIndex);
glob = str.slice(lastIndex);
} else if (isGlob === true) {
base = "";
glob = str;
} else {
base = str;
}
if (base && base !== "" && base !== "/" && base !== str) {
if (isPathSeparator2(base.charCodeAt(base.length - 1))) {
base = base.slice(0, -1);
}
}
if (opts.unescape === true) {
if (glob) glob = utils.removeBackslashes(glob);
if (base && backslashes === true) {
base = utils.removeBackslashes(base);
}
}
const state = {
prefix,
input,
start,
base,
glob,
isBrace,
isBracket,
isGlob,
isExtglob,
isGlobstar,
negated
};
if (opts.tokens === true) {
state.maxDepth = 0;
if (!isPathSeparator2(code)) {
tokens.push(token);
}
state.tokens = tokens;
}
if (opts.parts === true || opts.tokens === true) {
let prevIndex;
for (let idx = 0; idx < slashes.length; idx++) {
const n = prevIndex ? prevIndex + 1 : start;
const i = slashes[idx];
const value = input.slice(n, i);
if (opts.tokens) {
if (idx === 0 && start !== 0) {
tokens[idx].isPrefix = true;
tokens[idx].value = prefix;
} else {
tokens[idx].value = value;
}
depth(tokens[idx]);
state.maxDepth += tokens[idx].depth;
}
if (idx !== 0 || value !== "") {
parts.push(value);
}
prevIndex = i;
}
if (prevIndex && prevIndex + 1 < input.length) {
const value = input.slice(prevIndex + 1);
parts.push(value);
if (opts.tokens) {
tokens[tokens.length - 1].value = value;
depth(tokens[tokens.length - 1]);
state.maxDepth += tokens[tokens.length - 1].depth;
}
}
state.slashes = slashes;
state.parts = parts;
}
return state;
};
module.exports = scan;
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/parse.js
var require_parse = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/parse.js"(exports, module) {
"use strict";
var constants = require_constants();
var utils = require_utils2();
var {
MAX_LENGTH,
POSIX_REGEX_SOURCE,
REGEX_NON_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_BACKREF,
REPLACEMENTS
} = constants;
var expandRange = (args, options) => {
if (typeof options.expandRange === "function") {
return options.expandRange(...args, options);
}
args.sort();
const value = `[${args.join("-")}]`;
try {
new RegExp(value);
} catch (ex) {
return args.map((v) => utils.escapeRegex(v)).join("..");
}
return value;
};
var syntaxError2 = (type, char) => {
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
};
var parse2 = (input, options) => {
if (typeof input !== "string") {
throw new TypeError("Expected a string");
}
input = REPLACEMENTS[input] || input;
const opts = { ...options };
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
let len = input.length;
if (len > max) {
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
}
const bos = { type: "bos", value: "", output: opts.prepend || "" };
const tokens = [bos];
const capture = opts.capture ? "" : "?:";
const PLATFORM_CHARS = constants.globChars(opts.windows);
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
const {
DOT_LITERAL,
PLUS_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
DOTS_SLASH,
NO_DOT,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK,
QMARK_NO_DOT,
STAR,
START_ANCHOR
} = PLATFORM_CHARS;
const globstar = (opts2) => {
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
};
const nodot = opts.dot ? "" : NO_DOT;
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
let star = opts.bash === true ? globstar(opts) : STAR;
if (opts.capture) {
star = `(${star})`;
}
if (typeof opts.noext === "boolean") {
opts.noextglob = opts.noext;
}
const state = {
input,
index: -1,
start: 0,
dot: opts.dot === true,
consumed: "",
output: "",
prefix: "",
backtrack: false,
negated: false,
brackets: 0,
braces: 0,
parens: 0,
quotes: 0,
globstar: false,
tokens
};
input = utils.removePrefix(input, state);
len = input.length;
const extglobs = [];
const braces = [];
const stack = [];
let prev = bos;
let value;
const eos = () => state.index === len - 1;
const peek = state.peek = (n = 1) => input[state.index + n];
const advance = state.advance = () => input[++state.index];
const remaining = () => input.slice(state.index + 1);
const consume = (value2 = "", num = 0) => {
state.consumed += value2;
state.index += num;
};
const append = (token) => {
state.output += token.output != null ? token.output : token.value;
consume(token.value);
};
const negate = () => {
let count = 1;
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
advance();
state.start++;
count++;
}
if (count % 2 === 0) {
return false;
}
state.negated = true;
state.start++;
return true;
};
const increment = (type) => {
state[type]++;
stack.push(type);
};
const decrement = (type) => {
state[type]--;
stack.pop();
};
const push = (tok) => {
if (prev.type === "globstar") {
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
state.output = state.output.slice(0, -prev.output.length);
prev.type = "star";
prev.value = "*";
prev.output = star;
state.output += prev.output;
}
}
if (extglobs.length && tok.type !== "paren" && !EXTGLOB_CHARS[tok.value]) {
extglobs[extglobs.length - 1].inner += tok.value;
}
if (tok.value || tok.output) append(tok);
if (prev && prev.type === "text" && tok.type === "text") {
prev.value += tok.value;
prev.output = (prev.output || "") + tok.value;
return;
}
tok.prev = prev;
tokens.push(tok);
prev = tok;
};
const extglobOpen = (type, value2) => {
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
token.prev = prev;
token.parens = state.parens;
token.output = state.output;
const output = (opts.capture ? "(" : "") + token.open;
increment("parens");
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
push({ type: "paren", extglob: true, value: advance(), output });
extglobs.push(token);
};
const extglobClose = (token) => {
let output = token.close + (opts.capture ? ")" : "");
if (token.type === "negate") {
let extglobStar = star;
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
extglobStar = globstar(opts);
}
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
output = token.close = `)$))${extglobStar}`;
}
if (token.prev.type === "bos" && eos()) {
state.negatedExtglob = true;
}
}
push({ type: "paren", extglob: true, value, output });
decrement("parens");
};
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
let backslashes = false;
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
if (first === "\\") {
backslashes = true;
return m;
}
if (first === "?") {
if (esc) {
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
}
if (index === 0) {
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
}
return QMARK.repeat(chars.length);
}
if (first === ".") {
return DOT_LITERAL.repeat(chars.length);
}
if (first === "*") {
if (esc) {
return esc + first + (rest ? star : "");
}
return star;
}
return esc ? m : `\\${m}`;
});
if (backslashes === true) {
if (opts.unescape === true) {
output = output.replace(/\\/g, "");
} else {
output = output.replace(/\\+/g, (m) => {
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
});
}
}
if (output === input && opts.contains === true) {
state.output = input;
return state;
}
state.output = utils.wrapOutput(output, state, options);
return state;
}
while (!eos()) {
value = advance();
if (value === "\0") {
continue;
}
if (value === "\\") {
const next = peek();
if (next === "/" && opts.bash !== true) {
continue;
}
if (next === "." || next === ";") {
continue;
}
if (!next) {
value += "\\";
push({ type: "text", value });
continue;
}
const match = /^\\+/.exec(remaining());
let slashes = 0;
if (match && match[0].length > 2) {
slashes = match[0].length;
state.index += slashes;
if (slashes % 2 !== 0) {
value += "\\";
}
}
if (opts.unescape === true) {
value = advance() || "";
} else {
value += advance() || "";
}
if (state.brackets === 0) {
push({ type: "text", value });
continue;
}
}
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
if (opts.posix !== false && value === ":") {
const inner = prev.value.slice(1);
if (inner.includes("[")) {
prev.posix = true;
if (inner.includes(":")) {
const idx = prev.value.lastIndexOf("[");
const pre = prev.value.slice(0, idx);
const rest2 = prev.value.slice(idx + 2);
const posix2 = POSIX_REGEX_SOURCE[rest2];
if (posix2) {
prev.value = pre + posix2;
state.backtrack = true;
advance();
if (!bos.output && tokens.indexOf(prev) === 1) {
bos.output = ONE_CHAR;
}
continue;
}
}
}
}
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
value = `\\${value}`;
}
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
value = `\\${value}`;
}
if (opts.posix === true && value === "!" && prev.value === "[") {
value = "^";
}
prev.value += value;
append({ value });
continue;
}
if (state.quotes === 1 && value !== '"') {
value = utils.escapeRegex(value);
prev.value += value;
append({ value });
continue;
}
if (value === '"') {
state.quotes = state.quotes === 1 ? 0 : 1;
if (opts.keepQuotes === true) {
push({ type: "text", value });
}
continue;
}
if (value === "(") {
increment("parens");
push({ type: "paren", value });
continue;
}
if (value === ")") {
if (state.parens === 0 && opts.strictBrackets === true) {
throw new SyntaxError(syntaxError2("opening", "("));
}
const extglob = extglobs[extglobs.length - 1];
if (extglob && state.parens === extglob.parens + 1) {
extglobClose(extglobs.pop());
continue;
}
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
decrement("parens");
continue;
}
if (value === "[") {
if (opts.nobracket === true || !remaining().includes("]")) {
if (opts.nobracket !== true && opts.strictBrackets === true) {
throw new SyntaxError(syntaxError2("closing", "]"));
}
value = `\\${value}`;
} else {
increment("brackets");
}
push({ type: "bracket", value });
continue;
}
if (value === "]") {
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
push({ type: "text", value, output: `\\${value}` });
continue;
}
if (state.brackets === 0) {
if (opts.strictBrackets === true) {
throw new SyntaxError(syntaxError2("opening", "["));
}
push({ type: "text", value, output: `\\${value}` });
continue;
}
decrement("brackets");
const prevValue = prev.value.slice(1);
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
value = `/${value}`;
}
prev.value += value;
append({ value });
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
continue;
}
const escaped = utils.escapeRegex(prev.value);
state.output = state.output.slice(0, -prev.value.length);
if (opts.literalBrackets === true) {
state.output += escaped;
prev.value = escaped;
continue;
}
prev.value = `(${capture}${escaped}|${prev.value})`;
state.output += prev.value;
continue;
}
if (value === "{" && opts.nobrace !== true) {
increment("braces");
const open = {
type: "brace",
value,
output: "(",
outputIndex: state.output.length,
tokensIndex: state.tokens.length
};
braces.push(open);
push(open);
continue;
}
if (value === "}") {
const brace = braces[braces.length - 1];
if (opts.nobrace === true || !brace) {
push({ type: "text", value, output: value });
continue;
}
let output = ")";
if (brace.dots === true) {
const arr = tokens.slice();
const range = [];
for (let i = arr.length - 1; i >= 0; i--) {
tokens.pop();
if (arr[i].type === "brace") {
break;
}
if (arr[i].type !== "dots") {
range.unshift(arr[i].value);
}
}
output = expandRange(range, opts);
state.backtrack = true;
}
if (brace.comma !== true && brace.dots !== true) {
const out = state.output.slice(0, brace.outputIndex);
const toks = state.tokens.slice(brace.tokensIndex);
brace.value = brace.output = "\\{";
value = output = "\\}";
state.output = out;
for (const t of toks) {
state.output += t.output || t.value;
}
}
push({ type: "brace", value, output });
decrement("braces");
braces.pop();
continue;
}
if (value === "|") {
if (extglobs.length > 0) {
extglobs[extglobs.length - 1].conditions++;
}
push({ type: "text", value });
continue;
}
if (value === ",") {
let output = value;
const brace = braces[braces.length - 1];
if (brace && stack[stack.length - 1] === "braces") {
brace.comma = true;
output = "|";
}
push({ type: "comma", value, output });
continue;
}
if (value === "/") {
if (prev.type === "dot" && state.index === state.start + 1) {
state.start = state.index + 1;
state.consumed = "";
state.output = "";
tokens.pop();
prev = bos;
continue;
}
push({ type: "slash", value, output: SLASH_LITERAL });
continue;
}
if (value === ".") {
if (state.braces > 0 && prev.type === "dot") {
if (prev.value === ".") prev.output = DOT_LITERAL;
const brace = braces[braces.length - 1];
prev.type = "dots";
prev.output += value;
prev.value += value;
brace.dots = true;
continue;
}
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
push({ type: "text", value, output: DOT_LITERAL });
continue;
}
push({ type: "dot", value, output: DOT_LITERAL });
continue;
}
if (value === "?") {
const isGroup = prev && prev.value === "(";
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
extglobOpen("qmark", value);
continue;
}
if (prev && prev.type === "paren") {
const next = peek();
let output = value;
if (next === "<" && !utils.supportsLookbehinds()) {
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
}
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
output = `\\${value}`;
}
push({ type: "text", value, output });
continue;
}
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
push({ type: "qmark", value, output: QMARK_NO_DOT });
continue;
}
push({ type: "qmark", value, output: QMARK });
continue;
}
if (value === "!") {
if (opts.noextglob !== true && peek() === "(") {
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
extglobOpen("negate", value);
continue;
}
}
if (opts.nonegate !== true && state.index === 0) {
negate();
continue;
}
}
if (value === "+") {
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
extglobOpen("plus", value);
continue;
}
if (prev && prev.value === "(" || opts.regex === false) {
push({ type: "plus", value, output: PLUS_LITERAL });
continue;
}
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
push({ type: "plus", value });
continue;
}
push({ type: "plus", value: PLUS_LITERAL });
continue;
}
if (value === "@") {
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
push({ type: "at", extglob: true, value, output: "" });
continue;
}
push({ type: "text", value });
continue;
}
if (value !== "*") {
if (value === "$" || value === "^") {
value = `\\${value}`;
}
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
if (match) {
value += match[0];
state.index += match[0].length;
}
push({ type: "text", value });
continue;
}
if (prev && (prev.type === "globstar" || prev.star === true)) {
prev.type = "star";
prev.star = true;
prev.value += value;
prev.output = star;
state.backtrack = true;
state.globstar = true;
consume(value);
continue;
}
let rest = remaining();
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
extglobOpen("star", value);
continue;
}
if (prev.type === "star") {
if (opts.noglobstar === true) {
consume(value);
continue;
}
const prior = prev.prev;
const before = prior.prev;
const isStart = prior.type === "slash" || prior.type === "bos";
const afterStar = before && (before.type === "star" || before.type === "globstar");
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
push({ type: "star", value, output: "" });
continue;
}
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
push({ type: "star", value, output: "" });
continue;
}
while (rest.slice(0, 3) === "/**") {
const after = input[state.index + 4];
if (after && after !== "/") {
break;
}
rest = rest.slice(3);
consume("/**", 3);
}
if (prior.type === "bos" && eos()) {
prev.type = "globstar";
prev.value += value;
prev.output = globstar(opts);
state.output = prev.output;
state.globstar = true;
consume(value);
continue;
}
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
state.output = state.output.slice(0, -(prior.output + prev.output).length);
prior.output = `(?:${prior.output}`;
prev.type = "globstar";
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
prev.value += value;
state.globstar = true;
state.output += prior.output + prev.output;
consume(value);
continue;
}
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
const end = rest[1] !== void 0 ? "|$" : "";
state.output = state.output.slice(0, -(prior.output + prev.output).length);
prior.output = `(?:${prior.output}`;
prev.type = "globstar";
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
prev.value += value;
state.output += prior.output + prev.output;
state.globstar = true;
consume(value + advance());
push({ type: "slash", value: "/", output: "" });
continue;
}
if (prior.type === "bos" && rest[0] === "/") {
prev.type = "globstar";
prev.value += value;
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
state.output = prev.output;
state.globstar = true;
consume(value + advance());
push({ type: "slash", value: "/", output: "" });
continue;
}
state.output = state.output.slice(0, -prev.output.length);
prev.type = "globstar";
prev.output = globstar(opts);
prev.value += value;
state.output += prev.output;
state.globstar = true;
consume(value);
continue;
}
const token = { type: "star", value, output: star };
if (opts.bash === true) {
token.output = ".*?";
if (prev.type === "bos" || prev.type === "slash") {
token.output = nodot + token.output;
}
push(token);
continue;
}
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
token.output = value;
push(token);
continue;
}
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
if (prev.type === "dot") {
state.output += NO_DOT_SLASH;
prev.output += NO_DOT_SLASH;
} else if (opts.dot === true) {
state.output += NO_DOTS_SLASH;
prev.output += NO_DOTS_SLASH;
} else {
state.output += nodot;
prev.output += nodot;
}
if (peek() !== "*") {
state.output += ONE_CHAR;
prev.output += ONE_CHAR;
}
}
push(token);
}
while (state.brackets > 0) {
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "]"));
state.output = utils.escapeLast(state.output, "[");
decrement("brackets");
}
while (state.parens > 0) {
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", ")"));
state.output = utils.escapeLast(state.output, "(");
decrement("parens");
}
while (state.braces > 0) {
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError2("closing", "}"));
state.output = utils.escapeLast(state.output, "{");
decrement("braces");
}
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
}
if (state.backtrack === true) {
state.output = "";
for (const token of state.tokens) {
state.output += token.output != null ? token.output : token.value;
if (token.suffix) {
state.output += token.suffix;
}
}
}
return state;
};
parse2.fastpaths = (input, options) => {
const opts = { ...options };
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
const len = input.length;
if (len > max) {
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
}
input = REPLACEMENTS[input] || input;
const {
DOT_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOTS_SLASH,
STAR,
START_ANCHOR
} = constants.globChars(opts.windows);
const nodot = opts.dot ? NO_DOTS : NO_DOT;
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
const capture = opts.capture ? "" : "?:";
const state = { negated: false, prefix: "" };
let star = opts.bash === true ? ".*?" : STAR;
if (opts.capture) {
star = `(${star})`;
}
const globstar = (opts2) => {
if (opts2.noglobstar === true) return star;
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
};
const create = (str) => {
switch (str) {
case "*":
return `${nodot}${ONE_CHAR}${star}`;
case ".*":
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
case "*.*":
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
case "*/*":
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
case "**":
return nodot + globstar(opts);
case "**/*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
case "**/*.*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
case "**/.*":
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
default: {
const match = /^(.*?)\.(\w+)$/.exec(str);
if (!match) return;
const source2 = create(match[1]);
if (!source2) return;
return source2 + DOT_LITERAL + match[2];
}
}
};
const output = utils.removePrefix(input, state);
let source = create(output);
if (source && opts.strictSlashes !== true) {
source += `${SLASH_LITERAL}?`;
}
return source;
};
module.exports = parse2;
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/picomatch.js
var require_picomatch = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/lib/picomatch.js"(exports, module) {
"use strict";
var scan = require_scan();
var parse2 = require_parse();
var utils = require_utils2();
var constants = require_constants();
var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
var picomatch = (glob, options, returnState = false) => {
if (Array.isArray(glob)) {
const fns = glob.map((input) => picomatch(input, options, returnState));
const arrayMatcher = (str) => {
for (const isMatch of fns) {
const state2 = isMatch(str);
if (state2) return state2;
}
return false;
};
return arrayMatcher;
}
const isState = isObject2(glob) && glob.tokens && glob.input;
if (glob === "" || typeof glob !== "string" && !isState) {
throw new TypeError("Expected pattern to be a non-empty string");
}
const opts = options || {};
const posix2 = opts.windows;
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
const state = regex.state;
delete regex.state;
let isIgnored = () => false;
if (opts.ignore) {
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
}
const matcher = (input, returnObject = false) => {
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix: posix2 });
const result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
if (typeof opts.onResult === "function") {
opts.onResult(result);
}
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === "function") {
opts.onIgnore(result);
}
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === "function") {
opts.onMatch(result);
}
return returnObject ? result : true;
};
if (returnState) {
matcher.state = state;
}
return matcher;
};
picomatch.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
if (typeof input !== "string") {
throw new TypeError("Expected input to be a string");
}
if (input === "") {
return { isMatch: false, output: "" };
}
const opts = options || {};
const format = opts.format || (posix2 ? utils.toPosixSlashes : null);
let match = input === glob;
let output = match && format ? format(input) : input;
if (match === false) {
output = format ? format(input) : input;
match = output === glob;
}
if (match === false || opts.capture === true) {
if (opts.matchBase === true || opts.basename === true) {
match = picomatch.matchBase(input, regex, options, posix2);
} else {
match = regex.exec(output);
}
}
return { isMatch: Boolean(match), match, output };
};
picomatch.matchBase = (input, glob, options) => {
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
return regex.test(utils.basename(input));
};
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
picomatch.parse = (pattern, options) => {
if (Array.isArray(pattern)) return pattern.map((p) => picomatch.parse(p, options));
return parse2(pattern, { ...options, fastpaths: false });
};
picomatch.scan = (input, options) => scan(input, options);
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
if (returnOutput === true) {
return parsed.output;
}
const opts = options || {};
const prepend = opts.contains ? "" : "^";
const append = opts.contains ? "" : "$";
let source = `${prepend}(?:${parsed.output})${append}`;
if (parsed && parsed.negated === true) {
source = `^(?!${source}).*$`;
}
const regex = picomatch.toRegex(source, options);
if (returnState === true) {
regex.state = parsed;
}
return regex;
};
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
if (!input || typeof input !== "string") {
throw new TypeError("Expected a non-empty string");
}
const opts = options || {};
let parsed = { negated: false, fastpaths: true };
let prefix = "";
let output;
if (input.startsWith("./")) {
input = input.slice(2);
prefix = parsed.prefix = "./";
}
if (opts.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
output = parse2.fastpaths(input, options);
}
if (output === void 0) {
parsed = parse2(input, options);
parsed.prefix = prefix + (parsed.prefix || "");
} else {
parsed.output = output;
}
return picomatch.compileRe(parsed, options, returnOutput, returnState);
};
picomatch.toRegex = (source, options) => {
try {
const opts = options || {};
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
} catch (err) {
if (options && options.debug === true) throw err;
return /$^/;
}
};
picomatch.constants = constants;
module.exports = picomatch;
}
});
// ../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/index.js
var require_picomatch_browser = __commonJS({
"../../../node_modules/.pnpm/picomatch-browser@2.2.6/node_modules/picomatch-browser/index.js"(exports, module) {
"use strict";
module.exports = require_picomatch();
}
});
// ../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/schemaLoader.js
var require_schemaLoader = __commonJS({
"../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/schemaLoader.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultSchemaLoader = void 0;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var defaultSchemaLoader = (schemaConfig, parser) => {
const { schema, documentAST, introspectionJSON, introspectionJSONString, buildSchemaOptions, documentString } = schemaConfig;
if (schema) {
return schema;
}
if (introspectionJSONString) {
const introspectionJSONResult = JSON.parse(introspectionJSONString);
return (0, graphql_1.buildClientSchema)(introspectionJSONResult, buildSchemaOptions);
}
if (documentString && parser) {
const docAST = parser(documentString);
return (0, graphql_1.buildASTSchema)(docAST, buildSchemaOptions);
}
if (introspectionJSON) {
return (0, graphql_1.buildClientSchema)(introspectionJSON, buildSchemaOptions);
}
if (documentAST) {
return (0, graphql_1.buildASTSchema)(documentAST, buildSchemaOptions);
}
throw new Error("No schema supplied");
};
exports.defaultSchemaLoader = defaultSchemaLoader;
}
});
// ../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/LanguageService.js
var require_LanguageService = __commonJS({
"../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/LanguageService.js"(exports) {
"use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve2) {
resolve2(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve2, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = exports && exports.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LanguageService = void 0;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var picomatch_browser_1 = __importDefault(require_picomatch_browser());
var graphql_language_service_1 = require_dist();
var schemaLoader_1 = require_schemaLoader();
var schemaCache = /* @__PURE__ */ new Map();
var LanguageService = class {
constructor({ parser, schemas, parseOptions, externalFragmentDefinitions, customValidationRules, fillLeafsOnComplete, completionSettings, experimentalFragmentArguments }) {
var _a2;
this._parser = graphql_1.parse;
this._schemas = [];
this._schemaCache = schemaCache;
this._schemaLoader = schemaLoader_1.defaultSchemaLoader;
this._externalFragmentDefinitionNodes = null;
this._externalFragmentDefinitionsString = null;
this._experimentalFragmentArguments = false;
this.getCompletion = (uri, documentText, position) => {
const schema = this.getSchemaForFile(uri);
if (!documentText || !(schema === null || schema === void 0 ? void 0 : schema.schema)) {
return [];
}
return (0, graphql_language_service_1.getAutocompleteSuggestions)(schema.schema, documentText, position, void 0, this.getExternalFragmentDefinitions(), Object.assign(Object.assign({ uri }, this._completionSettings), { experimentalFragmentArguments: this._experimentalFragmentArguments }));
};
this.getDiagnostics = (uri, documentText, customRules) => {
const schema = this.getSchemaForFile(uri);
if (!documentText || documentText.trim().length < 2 || !(schema === null || schema === void 0 ? void 0 : schema.schema)) {
return [];
}
return (0, graphql_language_service_1.getDiagnostics)(documentText, schema.schema, customRules !== null && customRules !== void 0 ? customRules : this._customValidationRules, false, this.getExternalFragmentDefinitions(), {
experimentalFragmentArguments: this._experimentalFragmentArguments
});
};
this.getHover = (uri, documentText, position, options) => {
const schema = this.getSchemaForFile(uri);
if (schema && documentText.length > 3) {
return (0, graphql_language_service_1.getHoverInformation)(schema.schema, documentText, position, void 0, Object.assign({ useMarkdown: true, experimentalFragmentArguments: this._experimentalFragmentArguments }, options));
}
};
this.getVariablesJSONSchema = (uri, documentText, options) => {
const schema = this.getSchemaForFile(uri);
if (schema && documentText.length > 3) {
try {
const documentAST = this.parse(documentText);
const { variableToType } = (0, graphql_language_service_1.getOperationASTFacts)(documentAST, schema.schema);
if (variableToType) {
return (0, graphql_language_service_1.getVariablesJSONSchema)(variableToType, Object.assign(Object.assign({}, options), { scalarSchemas: schema.customScalarSchemas }));
}
} catch (_a3) {
}
}
return null;
};
this._schemaLoader = schemaLoader_1.defaultSchemaLoader;
if (schemas) {
this._schemas = schemas;
this._cacheSchemas();
}
if (parser) {
this._parser = parser;
}
this._completionSettings = Object.assign(Object.assign({}, completionSettings), { fillLeafsOnComplete: (_a2 = completionSettings === null || completionSettings === void 0 ? void 0 : completionSettings.fillLeafsOnComplete) !== null && _a2 !== void 0 ? _a2 : fillLeafsOnComplete });
this._experimentalFragmentArguments = experimentalFragmentArguments !== null && experimentalFragmentArguments !== void 0 ? experimentalFragmentArguments : false;
if (parseOptions) {
this._parseOptions = parseOptions;
}
if (customValidationRules) {
this._customValidationRules = customValidationRules;
}
if (externalFragmentDefinitions) {
if (Array.isArray(externalFragmentDefinitions)) {
this._externalFragmentDefinitionNodes = externalFragmentDefinitions;
} else {
this._externalFragmentDefinitionsString = externalFragmentDefinitions;
}
}
}
_cacheSchemas() {
for (const schema of this._schemas) {
this._cacheSchema(schema);
}
}
_cacheSchema(schemaConfig) {
const schema = this._schemaLoader(schemaConfig, this.parse.bind(this));
return this._schemaCache.set(schemaConfig.uri, Object.assign(Object.assign({}, schemaConfig), { schema }));
}
getSchemaForFile(uri) {
if (!this._schemas.length) {
return;
}
if (this._schemas.length === 1) {
return this._schemaCache.get(this._schemas[0].uri);
}
const schema = this._schemas.find((schemaConfig) => {
if (!schemaConfig.fileMatch) {
return false;
}
return schemaConfig.fileMatch.some((glob) => {
const isMatch = (0, picomatch_browser_1.default)(glob);
return isMatch(uri);
});
});
if (schema) {
const cacheEntry = this._schemaCache.get(schema.uri);
if (cacheEntry) {
return cacheEntry;
}
const cache = this._cacheSchema(schema);
return cache.get(schema.uri);
}
}
getExternalFragmentDefinitions() {
if (!this._externalFragmentDefinitionNodes && this._externalFragmentDefinitionsString) {
const definitionNodes = [];
try {
(0, graphql_1.visit)(this.parse(this._externalFragmentDefinitionsString), {
FragmentDefinition(node) {
definitionNodes.push(node);
}
});
} catch (_a2) {
throw new Error(`Failed parsing externalFragmentDefinitions string:
${this._externalFragmentDefinitionsString}`);
}
this._externalFragmentDefinitionNodes = definitionNodes;
}
return this._externalFragmentDefinitionNodes;
}
updateSchemas(schemas) {
return __awaiter(this, void 0, void 0, function* () {
this._schemas = schemas;
this._cacheSchemas();
});
}
updateSchema(schema) {
const schemaIndex = this._schemas.findIndex((c) => c.uri === schema.uri);
if (schemaIndex < 0) {
console.warn("updateSchema could not find a schema in your config by that URI", schema.uri);
return;
}
this._schemas[schemaIndex] = schema;
this._cacheSchema(schema);
}
addSchema(schema) {
this._schemas.push(schema);
this._cacheSchema(schema);
}
parse(text, options) {
return this._parser(text, Object.assign(Object.assign(Object.assign({}, this._parseOptions), options), { experimentalFragmentArguments: this._experimentalFragmentArguments }));
}
};
exports.LanguageService = LanguageService;
}
});
// ../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/utils.js
var require_utils3 = __commonJS({
"../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/utils.js"(exports) {
"use strict";
var __rest = exports && exports.__rest || function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStringSchema = exports.getModelLanguageId = void 0;
exports.toMonacoRange = toMonacoRange;
exports.toGraphQLPosition = toGraphQLPosition;
exports.toCompletion = toCompletion;
exports.toMonacoSeverity = toMonacoSeverity;
exports.toMarkerData = toMarkerData;
var graphql_1 = (init_graphql2(), __toCommonJS(graphql_exports));
var graphql_language_service_1 = require_dist();
var standaloneEnums_js_1 = (init_standaloneEnums(), __toCommonJS(standaloneEnums_exports));
var getModelLanguageId = (model) => {
if ("getModeId" in model) {
return model.getModeId();
}
return model.getLanguageId();
};
exports.getModelLanguageId = getModelLanguageId;
function toMonacoRange(range) {
return {
startLineNumber: range.start.line + 1,
startColumn: range.start.character + 1,
endLineNumber: range.end.line + 1,
endColumn: range.end.character + 1
};
}
function toGraphQLPosition(position) {
return new graphql_language_service_1.Position(position.lineNumber - 1, position.column - 1);
}
function toCompletion(entry, range) {
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ label: entry.label, insertText: entry.insertText, sortText: entry.sortText, filterText: entry.filterText }, entry.documentation && {
documentation: {
value: entry.documentation
}
}), { detail: entry.detail }), range && { range: toMonacoRange(range) }), { kind: entry.kind }), entry.insertTextFormat && { insertTextFormat: entry.insertTextFormat }), entry.insertTextMode && { insertTextMode: entry.insertTextMode }), entry.command && {
command: Object.assign(Object.assign({}, entry.command), { id: entry.command.command })
}), entry.labelDetails && { labelDetails: entry.labelDetails });
}
function toMonacoSeverity(severity) {
const severityMap = {
1: standaloneEnums_js_1.MarkerSeverity.Error,
2: standaloneEnums_js_1.MarkerSeverity.Warning,
3: standaloneEnums_js_1.MarkerSeverity.Info,
4: standaloneEnums_js_1.MarkerSeverity.Hint
};
return severity ? severityMap[severity] : severityMap[2];
}
function toMarkerData(diagnostic) {
return {
startLineNumber: diagnostic.range.start.line + 1,
endLineNumber: diagnostic.range.end.line + 1,
startColumn: diagnostic.range.start.character + 1,
endColumn: diagnostic.range.end.character,
message: diagnostic.message,
severity: toMonacoSeverity(diagnostic.severity),
code: diagnostic.code || void 0
};
}
var getStringSchema = (schemaConfig) => {
const { schema: graphQLSchema, documentAST, introspectionJSON, introspectionJSONString, documentString } = schemaConfig, rest = __rest(schemaConfig, ["schema", "documentAST", "introspectionJSON", "introspectionJSONString", "documentString"]);
if (graphQLSchema) {
return Object.assign(Object.assign({}, rest), { documentString: (0, graphql_1.printSchema)(graphQLSchema) });
}
if (introspectionJSONString) {
return Object.assign(Object.assign({}, rest), { introspectionJSONString });
}
if (documentString) {
return Object.assign(Object.assign({}, rest), { documentString });
}
if (introspectionJSON) {
return Object.assign(Object.assign({}, rest), { introspectionJSONString: JSON.stringify(introspectionJSON) });
}
if (documentAST) {
const schema = (0, graphql_1.buildASTSchema)(documentAST, rest.buildSchemaOptions);
return Object.assign(Object.assign({}, rest), { documentString: (0, graphql_1.printSchema)(schema) });
}
throw new Error("No schema supplied");
};
exports.getStringSchema = getStringSchema;
}
});
// ../../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/standalone.mjs
var standalone_exports = {};
__export(standalone_exports, {
__debug: () => Do,
check: () => so,
default: () => lc,
doc: () => ar,
format: () => gu,
formatWithCursor: () => Cu,
getSupportInfo: () => ao,
util: () => lr,
version: () => lu
});
function M() {
}
function Fr(e, t, r, n, u) {
for (var i = [], o; t; ) i.push(t), o = t.previousComponent, delete t.previousComponent, t = o;
i.reverse();
for (var s = 0, a = i.length, D = 0, l = 0; s < a; s++) {
var p = i[s];
if (p.removed) p.value = e.join(n.slice(l, l + p.count)), l += p.count;
else {
if (!p.added && u) {
var f = r.slice(D, D + p.count);
f = f.map(function(d, c) {
var F = n[l + c];
return F.length > d.length ? F : d;
}), p.value = e.join(f);
} else p.value = e.join(r.slice(D, D + p.count));
D += p.count, p.added || (l += p.count);
}
}
return i;
}
function mr(e, t) {
var r;
for (r = 0; r < e.length && r < t.length; r++) if (e[r] != t[r]) return e.slice(0, r);
return e.slice(0, r);
}
function hr(e, t) {
var r;
if (!e || !t || e[e.length - 1] != t[t.length - 1]) return "";
for (r = 0; r < e.length && r < t.length; r++) if (e[e.length - (r + 1)] != t[t.length - (r + 1)]) return e.slice(-r);
return e.slice(-r);
}
function wt(e, t, r) {
if (e.slice(0, t.length) != t) throw Error("string ".concat(JSON.stringify(e), " doesn't start with prefix ").concat(JSON.stringify(t), "; this is a bug"));
return r + e.slice(t.length);
}
function _t(e, t, r) {
if (!t) return e + r;
if (e.slice(-t.length) != t) throw Error("string ".concat(JSON.stringify(e), " doesn't end with suffix ").concat(JSON.stringify(t), "; this is a bug"));
return e.slice(0, -t.length) + r;
}
function we(e, t) {
return wt(e, t, "");
}
function Ue(e, t) {
return _t(e, t, "");
}
function Er(e, t) {
return t.slice(0, Nu(e, t));
}
function Nu(e, t) {
var r = 0;
e.length > t.length && (r = e.length - t.length);
var n = t.length;
e.length < t.length && (n = e.length);
var u = Array(n), i = 0;
u[0] = 0;
for (var o = 1; o < n; o++) {
for (t[o] == t[i] ? u[o] = u[i] : u[o] = i; i > 0 && t[o] != t[i]; ) i = u[i];
t[o] == t[i] && i++;
}
i = 0;
for (var s = r; s < e.length; s++) {
for (; i > 0 && e[s] != t[i]; ) i = u[i];
e[s] == t[i] && i++;
}
return i;
}
function Cr(e, t, r, n) {
if (t && r) {
var u = t.value.match(/^\s*/)[0], i = t.value.match(/\s*$/)[0], o = r.value.match(/^\s*/)[0], s = r.value.match(/\s*$/)[0];
if (e) {
var a = mr(u, o);
e.value = _t(e.value, o, a), t.value = we(t.value, a), r.value = we(r.value, a);
}
if (n) {
var D = hr(i, s);
n.value = wt(n.value, s, D), t.value = Ue(t.value, D), r.value = Ue(r.value, D);
}
} else if (r) e && (r.value = r.value.replace(/^\s*/, "")), n && (n.value = n.value.replace(/^\s*/, ""));
else if (e && n) {
var l = n.value.match(/^\s*/)[0], p = t.value.match(/^\s*/)[0], f = t.value.match(/\s*$/)[0], d = mr(l, p);
t.value = we(t.value, d);
var c = hr(we(l, d), f);
t.value = Ue(t.value, c), n.value = wt(n.value, l, c), e.value = _t(e.value, l, l.slice(0, l.length - c.length));
} else if (n) {
var F = n.value.match(/^\s*/)[0], m = t.value.match(/\s*$/)[0], h = Er(m, F);
t.value = Ue(t.value, h);
} else if (e) {
var C = e.value.match(/\s*$/)[0], v = t.value.match(/^\s*/)[0], E = Er(C, v);
t.value = we(t.value, E);
}
}
function xt(e) {
"@babel/helpers - typeof";
return xt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, xt(e);
}
function bt(e, t, r, n, u) {
t = t || [], r = r || [], n && (e = n(u, e));
var i;
for (i = 0; i < t.length; i += 1) if (t[i] === e) return r[i];
var o;
if (Object.prototype.toString.call(e) === "[object Array]") {
for (t.push(e), o = new Array(e.length), r.push(o), i = 0; i < e.length; i += 1) o[i] = bt(e[i], t, r, n, u);
return t.pop(), r.pop(), o;
}
if (e && e.toJSON && (e = e.toJSON()), xt(e) === "object" && e !== null) {
t.push(e), o = {}, r.push(o);
var s = [], a;
for (a in e) Object.prototype.hasOwnProperty.call(e, a) && s.push(a);
for (s.sort(), i = 0; i < s.length; i += 1) a = s[i], o[a] = bt(e[a], t, r, n, a);
t.pop(), r.pop();
} else o = e;
return o;
}
function gr(e, t, r) {
return ze.diff(e, t, r);
}
function yr(e) {
let t = e.indexOf("\r");
return t !== -1 ? e.charAt(t + 1) === `
` ? "crlf" : "cr" : "lf";
}
function xe(e) {
switch (e) {
case "cr":
return "\r";
case "crlf":
return `\r
`;
default:
return `
`;
}
}
function Ot(e, t) {
let r;
switch (t) {
case `
`:
r = /\n/gu;
break;
case "\r":
r = /\r/gu;
break;
case `\r
`:
r = /\r\n/gu;
break;
default:
throw new Error(`Unexpected "eol" ${JSON.stringify(t)}.`);
}
let n = e.match(r);
return n ? n.length : 0;
}
function Ar(e) {
return ne(false, e, /\r\n?/gu, `
`);
}
function Lu(e) {
if (typeof e == "string") return U;
if (Array.isArray(e)) return H;
if (!e) return;
let { type: t } = e;
if (Ke.has(t)) return t;
}
function Iu(e) {
let t = e === null ? "null" : typeof e;
if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
Expected it to be 'string' or 'object'.`;
if (z(e)) throw new Error("doc is valid.");
let r = Object.prototype.toString.call(e);
if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
let n = Pu([...Ke].map((u) => `'${u}'`));
return `Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`;
}
function Ru(e, t, r, n) {
let u = [e];
for (; u.length > 0; ) {
let i = u.pop();
if (i === vr) {
r(u.pop());
continue;
}
r && u.push(i, vr);
let o = z(i);
if (!o) throw new Q(i);
if ((t == null ? void 0 : t(i)) !== false) switch (o) {
case H:
case N: {
let s = o === H ? i : i.parts;
for (let a = s.length, D = a - 1; D >= 0; --D) u.push(s[D]);
break;
}
case w:
u.push(i.flatContents, i.breakContents);
break;
case B:
if (n && i.expandedStates) for (let s = i.expandedStates.length, a = s - 1; a >= 0; --a) u.push(i.expandedStates[a]);
else u.push(i.contents);
break;
case k:
case T:
case P:
case O:
case I:
u.push(i.contents);
break;
case U:
case V:
case L:
case R:
case A:
case _:
break;
default:
throw new Q(i);
}
}
}
function le(e) {
return G(e), { type: T, contents: e };
}
function De(e, t) {
return G(t), { type: k, contents: t, n: e };
}
function Tt(e, t = {}) {
return G(e), Je(t.expandedStates, true), { type: B, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
}
function wr(e) {
return De(Number.NEGATIVE_INFINITY, e);
}
function _r(e) {
return De({ type: "root" }, e);
}
function xr(e) {
return De(-1, e);
}
function br(e, t) {
return Tt(e[0], { ...t, expandedStates: e });
}
function Nr(e) {
return Je(e), { type: N, parts: e };
}
function Or(e, t = "", r = {}) {
return G(e), t !== "" && G(t), { type: w, breakContents: e, flatContents: t, groupId: r.groupId };
}
function Sr(e, t) {
return G(e), { type: P, contents: e, groupId: t.groupId, negate: t.negate };
}
function Ne(e) {
return G(e), { type: I, contents: e };
}
function Se(e, t) {
G(e), Je(t);
let r = [];
for (let n = 0; n < t.length; n++) n !== 0 && r.push(e), r.push(t[n]);
return r;
}
function Qe(e, t, r) {
G(e);
let n = e;
if (t > 0) {
for (let u = 0; u < Math.floor(t / r); ++u) n = le(n);
n = De(t % r, n), n = De(Number.NEGATIVE_INFINITY, n);
}
return n;
}
function Pr(e, t) {
return G(t), e ? { type: O, label: e, contents: t } : t;
}
function ee(e) {
var t;
if (!e) return "";
if (Array.isArray(e)) {
let r = [];
for (let n of e) if (Array.isArray(n)) r.push(...ee(n));
else {
let u = ee(n);
u !== "" && r.push(u);
}
return r;
}
return e.type === w ? { ...e, breakContents: ee(e.breakContents), flatContents: ee(e.flatContents) } : e.type === B ? { ...e, contents: ee(e.contents), expandedStates: (t = e.expandedStates) == null ? void 0 : t.map(ee) } : e.type === N ? { type: "fill", parts: e.parts.map(ee) } : e.contents ? { ...e, contents: ee(e.contents) } : e;
}
function Ir(e) {
let t = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ new Set();
return n(ee(e));
function n(i, o, s) {
var a, D;
if (typeof i == "string") return JSON.stringify(i);
if (Array.isArray(i)) {
let l = i.map(n).filter(Boolean);
return l.length === 1 ? l[0] : `[${l.join(", ")}]`;
}
if (i.type === A) {
let l = ((a = s == null ? void 0 : s[o + 1]) == null ? void 0 : a.type) === _;
return i.literal ? l ? "literalline" : "literallineWithoutBreakParent" : i.hard ? l ? "hardline" : "hardlineWithoutBreakParent" : i.soft ? "softline" : "line";
}
if (i.type === _) return ((D = s == null ? void 0 : s[o - 1]) == null ? void 0 : D.type) === A && s[o - 1].hard ? void 0 : "breakParent";
if (i.type === L) return "trim";
if (i.type === T) return "indent(" + n(i.contents) + ")";
if (i.type === k) return i.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + n(i.contents) + ")" : i.n < 0 ? "dedent(" + n(i.contents) + ")" : i.n.type === "root" ? "markAsRoot(" + n(i.contents) + ")" : "align(" + JSON.stringify(i.n) + ", " + n(i.contents) + ")";
if (i.type === w) return "ifBreak(" + n(i.breakContents) + (i.flatContents ? ", " + n(i.flatContents) : "") + (i.groupId ? (i.flatContents ? "" : ', ""') + `, { groupId: ${u(i.groupId)} }` : "") + ")";
if (i.type === P) {
let l = [];
i.negate && l.push("negate: true"), i.groupId && l.push(`groupId: ${u(i.groupId)}`);
let p = l.length > 0 ? `, { ${l.join(", ")} }` : "";
return `indentIfBreak(${n(i.contents)}${p})`;
}
if (i.type === B) {
let l = [];
i.break && i.break !== "propagated" && l.push("shouldBreak: true"), i.id && l.push(`id: ${u(i.id)}`);
let p = l.length > 0 ? `, { ${l.join(", ")} }` : "";
return i.expandedStates ? `conditionalGroup([${i.expandedStates.map((f) => n(f)).join(",")}]${p})` : `group(${n(i.contents)}${p})`;
}
if (i.type === N) return `fill([${i.parts.map((l) => n(l)).join(", ")}])`;
if (i.type === I) return "lineSuffix(" + n(i.contents) + ")";
if (i.type === R) return "lineSuffixBoundary";
if (i.type === O) return `label(${JSON.stringify(i.label)}, ${n(i.contents)})`;
throw new Error("Unknown doc type " + i.type);
}
function u(i) {
if (typeof i != "symbol") return JSON.stringify(String(i));
if (i in t) return t[i];
let o = i.description || "symbol";
for (let s = 0; ; s++) {
let a = o + (s > 0 ? ` #${s}` : "");
if (!r.has(a)) return r.add(a), t[i] = `Symbol.for(${JSON.stringify(a)})`;
}
}
}
function Yr(e) {
return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
}
function jr(e) {
return e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9776 && e <= 9783 || e >= 9800 && e <= 9811 || e === 9855 || e >= 9866 && e <= 9871 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12773 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101631 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e >= 119552 && e <= 119638 || e >= 119648 && e <= 119670 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129673 || e >= 129679 && e <= 129734 || e >= 129742 && e <= 129756 || e >= 129759 && e <= 129769 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
}
function Hu(e) {
if (!e) return 0;
if (!ju.test(e)) return e.length;
e = e.replace(Rr(), " ");
let t = 0;
for (let r of e) {
let n = r.codePointAt(0);
n <= 31 || n >= 127 && n <= 159 || n >= 768 && n <= 879 || (t += Hr(n) ? 1 : 2);
}
return t;
}
function Le(e, t) {
if (typeof e == "string") return t(e);
let r = /* @__PURE__ */ new Map();
return n(e);
function n(i) {
if (r.has(i)) return r.get(i);
let o = u(i);
return r.set(i, o), o;
}
function u(i) {
switch (z(i)) {
case H:
return t(i.map(n));
case N:
return t({ ...i, parts: i.parts.map(n) });
case w:
return t({ ...i, breakContents: n(i.breakContents), flatContents: n(i.flatContents) });
case B: {
let { expandedStates: o, contents: s } = i;
return o ? (o = o.map(n), s = o[0]) : s = n(s), t({ ...i, contents: s, expandedStates: o });
}
case k:
case T:
case P:
case O:
case I:
return t({ ...i, contents: n(i.contents) });
case U:
case V:
case L:
case R:
case A:
case _:
return t(i);
default:
throw new Q(i);
}
}
}
function Ze(e, t, r) {
let n = r, u = false;
function i(o) {
if (u) return false;
let s = t(o);
s !== void 0 && (u = true, n = s);
}
return be(e, i), n;
}
function Wu(e) {
if (e.type === B && e.break || e.type === A && e.hard || e.type === _) return true;
}
function Mr(e) {
return Ze(e, Wu, false);
}
function Wr(e) {
if (e.length > 0) {
let t = y(false, e, -1);
!t.expandedStates && !t.break && (t.break = "propagated");
}
return null;
}
function Ur(e) {
let t = /* @__PURE__ */ new Set(), r = [];
function n(i) {
if (i.type === _ && Wr(r), i.type === B) {
if (r.push(i), t.has(i)) return false;
t.add(i);
}
}
function u(i) {
i.type === B && r.pop().break && Wr(r);
}
be(e, n, u, true);
}
function $u(e) {
return e.type === A && !e.hard ? e.soft ? "" : " " : e.type === w ? e.flatContents : e;
}
function Vr(e) {
return Le(e, $u);
}
function $r(e) {
for (e = [...e]; e.length >= 2 && y(false, e, -2).type === A && y(false, e, -1).type === _; ) e.length -= 2;
if (e.length > 0) {
let t = ke(y(false, e, -1));
e[e.length - 1] = t;
}
return e;
}
function ke(e) {
switch (z(e)) {
case T:
case P:
case B:
case I:
case O: {
let t = ke(e.contents);
return { ...e, contents: t };
}
case w:
return { ...e, breakContents: ke(e.breakContents), flatContents: ke(e.flatContents) };
case N:
return { ...e, parts: $r(e.parts) };
case H:
return $r(e);
case U:
return e.replace(/[\n\r]*$/u, "");
case k:
case V:
case L:
case R:
case A:
case _:
break;
default:
throw new Q(e);
}
return e;
}
function et(e) {
return ke(Uu(e));
}
function Mu(e) {
switch (z(e)) {
case N:
if (e.parts.every((t) => t === "")) return "";
break;
case B:
if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
if (e.contents.type === B && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
break;
case k:
case T:
case P:
case I:
if (!e.contents) return "";
break;
case w:
if (!e.flatContents && !e.breakContents) return "";
break;
case H: {
let t = [];
for (let r of e) {
if (!r) continue;
let [n, ...u] = Array.isArray(r) ? r : [r];
typeof n == "string" && typeof y(false, t, -1) == "string" ? t[t.length - 1] += n : t.push(n), t.push(...u);
}
return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
}
case U:
case V:
case L:
case R:
case A:
case O:
case _:
break;
default:
throw new Q(e);
}
return e;
}
function Uu(e) {
return Le(e, (t) => Mu(t));
}
function zr(e, t = Xe) {
return Le(e, (r) => typeof r == "string" ? Se(t, r.split(`
`)) : r);
}
function Vu(e) {
if (e.type === A) return true;
}
function Gr(e) {
return Ze(e, Vu, false);
}
function me(e, t) {
return e.type === O ? { ...e, contents: t(e.contents) } : t(e);
}
function Kr() {
return { value: "", length: 0, queue: [] };
}
function zu(e, t) {
return Pt(e, { type: "indent" }, t);
}
function Gu(e, t, r) {
return t === Number.NEGATIVE_INFINITY ? e.root || Kr() : t < 0 ? Pt(e, { type: "dedent" }, r) : t ? t.type === "root" ? { ...e, root: e } : Pt(e, { type: typeof t == "string" ? "stringAlign" : "numberAlign", n: t }, r) : e;
}
function Pt(e, t, r) {
let n = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], u = "", i = 0, o = 0, s = 0;
for (let c of n) switch (c.type) {
case "indent":
l(), r.useTabs ? a(1) : D(r.tabWidth);
break;
case "stringAlign":
l(), u += c.n, i += c.n.length;
break;
case "numberAlign":
o += 1, s += c.n;
break;
default:
throw new Error(`Unexpected type '${c.type}'`);
}
return f(), { ...e, value: u, length: i, queue: n };
function a(c) {
u += " ".repeat(c), i += r.tabWidth * c;
}
function D(c) {
u += " ".repeat(c), i += c;
}
function l() {
r.useTabs ? p() : f();
}
function p() {
o > 0 && a(o), d();
}
function f() {
s > 0 && D(s), d();
}
function d() {
o = 0, s = 0;
}
}
function It(e) {
let t = 0, r = 0, n = e.length;
e: for (; n--; ) {
let u = e[n];
if (u === he) {
r++;
continue;
}
for (let i = u.length - 1; i >= 0; i--) {
let o = u[i];
if (o === " " || o === " ") t++;
else {
e[n] = u.slice(0, i + 1);
break e;
}
}
}
if (t > 0 || r > 0) for (e.length = n + 1; r-- > 0; ) e.push(he);
return t;
}
function tt(e, t, r, n, u, i) {
if (r === Number.POSITIVE_INFINITY) return true;
let o = t.length, s = [e], a = [];
for (; r >= 0; ) {
if (s.length === 0) {
if (o === 0) return true;
s.push(t[--o]);
continue;
}
let { mode: D, doc: l } = s.pop(), p = z(l);
switch (p) {
case U:
a.push(l), r -= Te(l);
break;
case H:
case N: {
let f = p === H ? l : l.parts, d = l[Lt] ?? 0;
for (let c = f.length - 1; c >= d; c--) s.push({ mode: D, doc: f[c] });
break;
}
case T:
case k:
case P:
case O:
s.push({ mode: D, doc: l.contents });
break;
case L:
r += It(a);
break;
case B: {
if (i && l.break) return false;
let f = l.break ? Y : D, d = l.expandedStates && f === Y ? y(false, l.expandedStates, -1) : l.contents;
s.push({ mode: f, doc: d });
break;
}
case w: {
let d = (l.groupId ? u[l.groupId] || J : D) === Y ? l.breakContents : l.flatContents;
d && s.push({ mode: D, doc: d });
break;
}
case A:
if (D === Y || l.hard) return true;
l.soft || (a.push(" "), r--);
break;
case I:
n = true;
break;
case R:
if (n) return false;
break;
}
}
return false;
}
function Ee(e, t) {
let r = {}, n = t.printWidth, u = xe(t.endOfLine), i = 0, o = [{ ind: Kr(), mode: Y, doc: e }], s = [], a = false, D = [], l = 0;
for (Ur(e); o.length > 0; ) {
let { ind: f, mode: d, doc: c } = o.pop();
switch (z(c)) {
case U: {
let F = u !== `
` ? ne(false, c, `
`, u) : c;
s.push(F), o.length > 0 && (i += Te(F));
break;
}
case H:
for (let F = c.length - 1; F >= 0; F--) o.push({ ind: f, mode: d, doc: c[F] });
break;
case V:
if (l >= 2) throw new Error("There are too many 'cursor' in doc.");
s.push(he), l++;
break;
case T:
o.push({ ind: zu(f, t), mode: d, doc: c.contents });
break;
case k:
o.push({ ind: Gu(f, c.n, t), mode: d, doc: c.contents });
break;
case L:
i -= It(s);
break;
case B:
switch (d) {
case J:
if (!a) {
o.push({ ind: f, mode: c.break ? Y : J, doc: c.contents });
break;
}
case Y: {
a = false;
let F = { ind: f, mode: J, doc: c.contents }, m = n - i, h = D.length > 0;
if (!c.break && tt(F, o, m, h, r)) o.push(F);
else if (c.expandedStates) {
let C = y(false, c.expandedStates, -1);
if (c.break) {
o.push({ ind: f, mode: Y, doc: C });
break;
} else for (let v = 1; v < c.expandedStates.length + 1; v++) if (v >= c.expandedStates.length) {
o.push({ ind: f, mode: Y, doc: C });
break;
} else {
let E = c.expandedStates[v], g = { ind: f, mode: J, doc: E };
if (tt(g, o, m, h, r)) {
o.push(g);
break;
}
}
} else o.push({ ind: f, mode: Y, doc: c.contents });
break;
}
}
c.id && (r[c.id] = y(false, o, -1).mode);
break;
case N: {
let F = n - i, m = c[Lt] ?? 0, { parts: h } = c, C = h.length - m;
if (C === 0) break;
let v = h[m + 0], E = h[m + 1], g = { ind: f, mode: J, doc: v }, j = { ind: f, mode: Y, doc: v }, b = tt(g, [], F, D.length > 0, r, true);
if (C === 1) {
b ? o.push(g) : o.push(j);
break;
}
let X = { ind: f, mode: J, doc: E }, ae = { ind: f, mode: Y, doc: E };
if (C === 2) {
b ? o.push(X, g) : o.push(ae, j);
break;
}
let $e = h[m + 2], At = { ind: f, mode: d, doc: { ...c, [Lt]: m + 2 } };
tt({ ind: f, mode: J, doc: [v, E, $e] }, [], F, D.length > 0, r, true) ? o.push(At, X, g) : b ? o.push(At, ae, g) : o.push(At, ae, j);
break;
}
case w:
case P: {
let F = c.groupId ? r[c.groupId] : d;
if (F === Y) {
let m = c.type === w ? c.breakContents : c.negate ? c.contents : le(c.contents);
m && o.push({ ind: f, mode: d, doc: m });
}
if (F === J) {
let m = c.type === w ? c.flatContents : c.negate ? le(c.contents) : c.contents;
m && o.push({ ind: f, mode: d, doc: m });
}
break;
}
case I:
D.push({ ind: f, mode: d, doc: c.contents });
break;
case R:
D.length > 0 && o.push({ ind: f, mode: d, doc: Oe });
break;
case A:
switch (d) {
case J:
if (c.hard) a = true;
else {
c.soft || (s.push(" "), i += 1);
break;
}
case Y:
if (D.length > 0) {
o.push({ ind: f, mode: d, doc: c }, ...D.reverse()), D.length = 0;
break;
}
c.literal ? f.root ? (s.push(u, f.root.value), i = f.root.length) : (s.push(u), i = 0) : (i -= It(s), s.push(u + f.value), i = f.length);
break;
}
break;
case O:
o.push({ ind: f, mode: d, doc: c.contents });
break;
case _:
break;
default:
throw new Q(c);
}
o.length === 0 && D.length > 0 && (o.push(...D.reverse()), D.length = 0);
}
let p = s.indexOf(he);
if (p !== -1) {
let f = s.indexOf(he, p + 1);
if (f === -1) return { formatted: s.filter((m) => m !== he).join("") };
let d = s.slice(0, p).join(""), c = s.slice(p + 1, f).join(""), F = s.slice(f + 1).join("");
return { formatted: d + c + F, cursorNodeStart: d.length, cursorNodeText: c };
}
return { formatted: s.join("") };
}
function Ku(e, t, r = 0) {
let n = 0;
for (let u = r; u < e.length; ++u) e[u] === " " ? n = n + t - n % t : n++;
return n;
}
function Ju(e) {
return e !== null && typeof e == "object";
}
function* ge(e, t) {
let { getVisitorKeys: r, filter: n = () => true } = t, u = (i) => Xr(i) && n(i);
for (let i of r(e)) {
let o = e[i];
if (Array.isArray(o)) for (let s of o) u(s) && (yield s);
else u(o) && (yield o);
}
}
function* Qr(e, t) {
let r = [e];
for (let n = 0; n < r.length; n++) {
let u = r[n];
for (let i of ge(u, t)) yield i, r.push(i);
}
}
function Zr(e, t) {
return ge(e, t).next().done;
}
function ye(e) {
return (t, r, n) => {
let u = !!(n != null && n.backwards);
if (r === false) return false;
let { length: i } = t, o = r;
for (; o >= 0 && o < i; ) {
let s = t.charAt(o);
if (e instanceof RegExp) {
if (!e.test(s)) return o;
} else if (!e.includes(s)) return o;
u ? o-- : o++;
}
return o === -1 || o === i ? o : false;
};
}
function qu(e, t, r) {
let n = !!(r != null && r.backwards);
if (t === false) return false;
let u = e.charAt(t);
if (n) {
if (e.charAt(t - 1) === "\r" && u === `
`) return t - 2;
if (u === `
` || u === "\r" || u === "\u2028" || u === "\u2029") return t - 1;
} else {
if (u === "\r" && e.charAt(t + 1) === `
`) return t + 2;
if (u === `
` || u === "\r" || u === "\u2028" || u === "\u2029") return t + 1;
}
return t;
}
function Xu(e, t, r = {}) {
let n = S(e, r.backwards ? t - 1 : t, r), u = W(e, n, r);
return n !== u;
}
function Qu(e) {
return Array.isArray(e) && e.length > 0;
}
function ei(e) {
return e ? (t) => e(t, tn) : Zu;
}
function ti(e) {
let t = e.type || e.kind || "(unknown type)", r = String(e.name || e.id && (typeof e.id == "object" ? e.id.name : e.id) || e.key && (typeof e.key == "object" ? e.key.name : e.key) || e.value && (typeof e.value == "object" ? "" : String(e.value)) || e.operator || "");
return r.length > 20 && (r = r.slice(0, 19) + "\u2026"), t + (r ? " " + r : "");
}
function Ht(e, t) {
(e.comments ?? (e.comments = [])).push(t), t.printed = false, t.nodeDescription = ti(e);
}
function ue(e, t) {
t.leading = true, t.trailing = false, Ht(e, t);
}
function re(e, t, r) {
t.leading = false, t.trailing = false, r && (t.marker = r), Ht(e, t);
}
function ie(e, t) {
t.leading = false, t.trailing = true, Ht(e, t);
}
function it(e, t) {
if (Wt.has(e)) return Wt.get(e);
let { printer: { getCommentChildNodes: r, canAttachComment: n, getVisitorKeys: u }, locStart: i, locEnd: o } = t;
if (!n) return [];
let s = ((r == null ? void 0 : r(e, t)) ?? [...ge(e, { getVisitorKeys: q(u) })]).flatMap((a) => n(a) ? [a] : it(a, t));
return s.sort((a, D) => i(a) - i(D) || o(a) - o(D)), Wt.set(e, s), s;
}
function nn(e, t, r, n) {
let { locStart: u, locEnd: i } = r, o = u(t), s = i(t), a = it(e, r), D, l, p = 0, f = a.length;
for (; p < f; ) {
let d = p + f >> 1, c = a[d], F = u(c), m = i(c);
if (F <= o && s <= m) return nn(c, t, r, c);
if (m <= o) {
D = c, p = d + 1;
continue;
}
if (s <= F) {
l = c, f = d;
continue;
}
throw new Error("Comment location overlaps with node location");
}
if ((n == null ? void 0 : n.type) === "TemplateLiteral") {
let { quasis: d } = n, c = Mt(d, t, r);
D && Mt(d, D, r) !== c && (D = null), l && Mt(d, l, r) !== c && (l = null);
}
return { enclosingNode: n, precedingNode: D, followingNode: l };
}
function un(e, t) {
let { comments: r } = e;
if (delete e.comments, !jt(r) || !t.printer.canAttachComment) return;
let n = [], { locStart: u, locEnd: i, printer: { experimentalFeatures: { avoidAstMutation: o = false } = {}, handleComments: s = {} }, originalText: a } = t, { ownLine: D = $t, endOfLine: l = $t, remaining: p = $t } = s, f = r.map((d, c) => ({ ...nn(e, d, t), comment: d, text: a, options: t, ast: e, isLastComment: r.length - 1 === c }));
for (let [d, c] of f.entries()) {
let { comment: F, precedingNode: m, enclosingNode: h, followingNode: C, text: v, options: E, ast: g, isLastComment: j } = c;
if (E.parser === "json" || E.parser === "json5" || E.parser === "jsonc" || E.parser === "__js_expression" || E.parser === "__ts_expression" || E.parser === "__vue_expression" || E.parser === "__vue_ts_expression") {
if (u(F) - u(g) <= 0) {
ue(g, F);
continue;
}
if (i(F) - i(g) >= 0) {
ie(g, F);
continue;
}
}
let b;
if (o ? b = [c] : (F.enclosingNode = h, F.precedingNode = m, F.followingNode = C, b = [F, v, E, g, j]), ri(v, E, f, d)) F.placement = "ownLine", D(...b) || (C ? ue(C, F) : m ? ie(m, F) : h ? re(h, F) : re(g, F));
else if (ni(v, E, f, d)) F.placement = "endOfLine", l(...b) || (m ? ie(m, F) : C ? ue(C, F) : h ? re(h, F) : re(g, F));
else if (F.placement = "remaining", !p(...b)) if (m && C) {
let X = n.length;
X > 0 && n[X - 1].followingNode !== C && rn(n, E), n.push(c);
} else m ? ie(m, F) : C ? ue(C, F) : h ? re(h, F) : re(g, F);
}
if (rn(n, t), !o) for (let d of r) delete d.precedingNode, delete d.enclosingNode, delete d.followingNode;
}
function ri(e, t, r, n) {
let { comment: u, precedingNode: i } = r[n], { locStart: o, locEnd: s } = t, a = o(u);
if (i) for (let D = n - 1; D >= 0; D--) {
let { comment: l, precedingNode: p } = r[D];
if (p !== i || !on(e.slice(s(l), a))) break;
a = o(l);
}
return $(e, a, { backwards: true });
}
function ni(e, t, r, n) {
let { comment: u, followingNode: i } = r[n], { locStart: o, locEnd: s } = t, a = s(u);
if (i) for (let D = n + 1; D < r.length; D++) {
let { comment: l, followingNode: p } = r[D];
if (p !== i || !on(e.slice(a, o(l)))) break;
a = s(l);
}
return $(e, a);
}
function rn(e, t) {
var s, a;
let r = e.length;
if (r === 0) return;
let { precedingNode: n, followingNode: u } = e[0], i = t.locStart(u), o;
for (o = r; o > 0; --o) {
let { comment: D, precedingNode: l, followingNode: p } = e[o - 1];
Pe.strictEqual(l, n), Pe.strictEqual(p, u);
let f = t.originalText.slice(t.locEnd(D), i);
if (((a = (s = t.printer).isGap) == null ? void 0 : a.call(s, f, t)) ?? /^[\s(]*$/u.test(f)) i = t.locStart(D);
else break;
}
for (let [D, { comment: l }] of e.entries()) D < o ? ie(n, l) : ue(u, l);
for (let D of [n, u]) D.comments && D.comments.length > 1 && D.comments.sort((l, p) => t.locStart(l) - t.locStart(p));
e.length = 0;
}
function Mt(e, t, r) {
let n = r.locStart(t) - 1;
for (let u = 1; u < e.length; ++u) if (n < r.locStart(e[u])) return u - 1;
return 0;
}
function ui(e, t) {
let r = t - 1;
r = S(e, r, { backwards: true }), r = W(e, r, { backwards: true }), r = S(e, r, { backwards: true });
let n = W(e, r, { backwards: true });
return r !== n;
}
function sn(e, t) {
let r = e.node;
return r.printed = true, t.printer.printComment(e, t);
}
function ii(e, t) {
var l;
let r = e.node, n = [sn(e, t)], { printer: u, originalText: i, locStart: o, locEnd: s } = t;
if ((l = u.isBlockComment) == null ? void 0 : l.call(u, r)) {
let p = $(i, s(r)) ? $(i, o(r), { backwards: true }) ? K : qe : " ";
n.push(p);
} else n.push(K);
let D = W(i, S(i, s(r)));
return D !== false && $(i, D) && n.push(K), n;
}
function oi(e, t, r) {
var D;
let n = e.node, u = sn(e, t), { printer: i, originalText: o, locStart: s } = t, a = (D = i.isBlockComment) == null ? void 0 : D.call(i, n);
if (r != null && r.hasLineSuffix && !(r != null && r.isBlock) || $(o, s(n), { backwards: true })) {
let l = Ie(o, s(n));
return { doc: Ne([K, l ? K : "", u]), isBlock: a, hasLineSuffix: true };
}
return !a || r != null && r.hasLineSuffix ? { doc: [Ne([" ", u]), Fe], isBlock: a, hasLineSuffix: true } : { doc: [" ", u], isBlock: a, hasLineSuffix: false };
}
function si(e, t) {
let r = e.node;
if (!r) return {};
let n = t[/* @__PURE__ */ Symbol.for("printedComments")];
if ((r.comments || []).filter((a) => !n.has(a)).length === 0) return { leading: "", trailing: "" };
let i = [], o = [], s;
return e.each(() => {
let a = e.node;
if (n != null && n.has(a)) return;
let { leading: D, trailing: l } = a;
D ? i.push(ii(e, t)) : l && (s = oi(e, t, s), o.push(s.doc));
}, "comments"), { leading: i, trailing: o };
}
function an(e, t, r) {
let { leading: n, trailing: u } = si(e, r);
return !n && !u ? t : me(t, (i) => [n, i, u]);
}
function Dn(e) {
let { [/* @__PURE__ */ Symbol.for("comments")]: t, [/* @__PURE__ */ Symbol.for("printedComments")]: r } = e;
for (let n of t) {
if (!n.printed && !r.has(n)) throw new Error('Comment "' + n.value.trim() + '" was not printed. Please report this error!');
delete n.printed;
}
}
function ai(e) {
return () => {
};
}
function ot({ plugins: e = [], showDeprecated: t = false } = {}) {
let r = e.flatMap((u) => u.languages ?? []), n = [];
for (let u of li(Object.assign({}, ...e.map(({ options: i }) => i), cn))) !t && u.deprecated || (Array.isArray(u.choices) && (t || (u.choices = u.choices.filter((i) => !i.deprecated)), u.name === "parser" && (u.choices = [...u.choices, ...Di(u.choices, r, e)])), u.pluginDefaults = Object.fromEntries(e.filter((i) => {
var o;
return ((o = i.defaultOptions) == null ? void 0 : o[u.name]) !== void 0;
}).map((i) => [i.name, i.defaultOptions[u.name]])), n.push(u));
return { languages: r, options: n };
}
function* Di(e, t, r) {
let n = new Set(e.map((u) => u.value));
for (let u of t) if (u.parsers) {
for (let i of u.parsers) if (!n.has(i)) {
n.add(i);
let o = r.find((a) => a.parsers && Object.prototype.hasOwnProperty.call(a.parsers, i)), s = u.name;
o != null && o.name && (s += ` (plugin: ${o.name})`), yield { value: i, description: s };
}
}
}
function li(e) {
let t = [];
for (let [r, n] of Object.entries(e)) {
let u = { name: r, ...n };
Array.isArray(u.default) && (u.default = y(false, u.default, -1).value), t.push(u);
}
return t;
}
function fn(e, t) {
if (!t) return;
let r = ci(t).toLowerCase();
return e.find(({ filenames: n }) => n == null ? void 0 : n.some((u) => u.toLowerCase() === r)) ?? e.find(({ extensions: n }) => n == null ? void 0 : n.some((u) => r.endsWith(u)));
}
function fi(e, t) {
if (t) return e.find(({ name: r }) => r.toLowerCase() === t) ?? e.find(({ aliases: r }) => r == null ? void 0 : r.includes(t)) ?? e.find(({ extensions: r }) => r == null ? void 0 : r.includes(`.${t}`));
}
function di(e, t) {
let r = e.plugins.flatMap((u) => u.languages ?? []), n = fi(r, t.language) ?? fn(r, t.physicalFile) ?? fn(r, t.file) ?? (t.physicalFile, void 0);
return n == null ? void 0 : n.parsers[0];
}
function En(e, t, r, n) {
return [`Invalid ${ce.default.red(n.key(e))} value.`, `Expected ${ce.default.blue(r)},`, `but received ${t === at ? ce.default.gray("nothing") : ce.default.red(n.value(t))}.`].join(" ");
}
function gn({ text: e, list: t }, r) {
let n = [];
return e && n.push(`- ${ce.default.blue(e)}`), t && n.push([`- ${ce.default.blue(t.title)}:`].concat(t.values.map((u) => gn(u, r - hn.length).replace(/^|\n/g, `$&${hn}`))).join(`
`)), yn(n, r);
}
function yn(e, t) {
if (e.length === 1) return e[0];
let [r, n] = e, [u, i] = e.map((o) => o.split(`
`, 1)[0].length);
return u > t && u > i ? n : r;
}
function zt(e, t) {
if (e === t) return 0;
let r = e;
e.length > t.length && (e = t, t = r);
let n = e.length, u = t.length;
for (; n > 0 && e.charCodeAt(~-n) === t.charCodeAt(~-u); ) n--, u--;
let i = 0;
for (; i < n && e.charCodeAt(i) === t.charCodeAt(i); ) i++;
if (n -= i, u -= i, n === 0) return u;
let o, s, a, D, l = 0, p = 0;
for (; l < n; ) An[l] = e.charCodeAt(i + l), Vt[l] = ++l;
for (; p < u; ) for (o = t.charCodeAt(i + p), a = p++, s = p, l = 0; l < n; l++) D = o === An[l] ? a : a + 1, a = Vt[l], s = Vt[l] = a > s ? D > s ? s + 1 : D : D > a ? a + 1 : D;
return s;
}
function Fi(e, t) {
let r = new e(t), n = Object.create(r);
for (let u of pi) u in t && (n[u] = mi(t[u], r, x.prototype[u].length));
return n;
}
function mi(e, t, r) {
return typeof e == "function" ? (...n) => e(...n.slice(0, r - 1), t, ...n.slice(r - 1)) : () => e;
}
function vn({ from: e, to: t }) {
return { from: [e], to: t };
}
function wn(e, t) {
let r = /* @__PURE__ */ Object.create(null);
for (let n of e) {
let u = n[t];
if (r[u]) throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);
r[u] = n;
}
return r;
}
function _n(e, t) {
let r = /* @__PURE__ */ new Map();
for (let n of e) {
let u = n[t];
if (r.has(u)) throw new Error(`Duplicate ${t} ${JSON.stringify(u)}`);
r.set(u, n);
}
return r;
}
function xn() {
let e = /* @__PURE__ */ Object.create(null);
return (t) => {
let r = JSON.stringify(t);
return e[r] ? true : (e[r] = true, false);
};
}
function bn(e, t) {
let r = [], n = [];
for (let u of e) t(u) ? r.push(u) : n.push(u);
return [r, n];
}
function Nn(e) {
return e === Math.floor(e);
}
function On(e, t) {
if (e === t) return 0;
let r = typeof e, n = typeof t, u = ["undefined", "object", "boolean", "number", "string"];
return r !== n ? u.indexOf(r) - u.indexOf(n) : r !== "string" ? Number(e) - Number(t) : e.localeCompare(t);
}
function Sn(e) {
return (...t) => {
let r = e(...t);
return typeof r == "string" ? new Error(r) : r;
};
}
function Kt(e) {
return e === void 0 ? {} : e;
}
function Jt(e) {
if (typeof e == "string") return { text: e };
let { text: t, list: r } = e;
return hi((t || r) !== void 0, "Unexpected `expected` result, there should be at least one field."), r ? { text: t, list: { title: r.title, values: r.values.map(Jt) } } : { text: t };
}
function qt(e, t) {
return e === true ? true : e === false ? { value: t } : e;
}
function Xt(e, t, r = false) {
return e === false ? false : e === true ? r ? true : [{ value: t }] : "value" in e ? [e] : e.length === 0 ? false : e;
}
function Bn(e, t) {
return typeof e == "string" || "key" in e ? { from: t, to: e } : "from" in e ? { from: e.from, to: e.to } : { from: t, to: e.to };
}
function pt(e, t) {
return e === void 0 ? [] : Array.isArray(e) ? e.map((r) => Bn(r, t)) : [Bn(e, t)];
}
function Qt(e, t) {
let r = pt(typeof e == "object" && "redirect" in e ? e.redirect : e, t);
return r.length === 0 ? { remain: t, redirect: r } : typeof e == "object" && "remain" in e ? { remain: e.remain, redirect: r } : { redirect: r };
}
function hi(e, t) {
if (!e) throw new Error(t);
}
function Ci(e, t, { logger: r = false, isCLI: n = false, passThrough: u = false, FlagSchema: i, descriptor: o } = {}) {
if (n) {
if (!i) throw new Error("'FlagSchema' option is required.");
if (!o) throw new Error("'descriptor' option is required.");
} else o = oe;
let s = u ? Array.isArray(u) ? (f, d) => u.includes(f) ? { [f]: d } : void 0 : (f, d) => ({ [f]: d }) : (f, d, c) => {
let { _: F, ...m } = c.schemas;
return Dt(f, d, { ...c, schemas: m });
}, a = gi(t, { isCLI: n, FlagSchema: i }), D = new Et(a, { logger: r, unknown: s, descriptor: o }), l = r !== false;
l && Zt && (D._hasDeprecationWarned = Zt);
let p = D.normalize(e);
return l && (Zt = D._hasDeprecationWarned), p;
}
function gi(e, { isCLI: t, FlagSchema: r }) {
let n = [];
t && n.push(ct.create({ name: "_" }));
for (let u of e) n.push(yi(u, { isCLI: t, optionInfos: e, FlagSchema: r })), u.alias && t && n.push(lt.create({ name: u.alias, sourceName: u.name }));
return n;
}
function yi(e, { isCLI: t, optionInfos: r, FlagSchema: n }) {
let { name: u } = e, i = { name: u }, o, s = {};
switch (e.type) {
case "int":
o = ht, t && (i.preprocess = Number);
break;
case "string":
o = je;
break;
case "choice":
o = Ft, i.choices = e.choices.map((a) => a != null && a.redirect ? { ...a, redirect: { to: { key: e.name, value: a.redirect } } } : a);
break;
case "boolean":
o = dt;
break;
case "flag":
o = n, i.flags = r.flatMap((a) => [a.alias, a.description && a.name, a.oppositeDescription && `no-${a.name}`].filter(Boolean));
break;
case "path":
o = je;
break;
default:
throw new Error(`Unexpected type ${e.type}`);
}
if (e.exception ? i.validate = (a, D, l) => e.exception(a) || D.validate(a, l) : i.validate = (a, D, l) => a === void 0 || D.validate(a, l), e.redirect && (s.redirect = (a) => a ? { to: typeof e.redirect == "string" ? e.redirect : { key: e.redirect.option, value: e.redirect.value } } : void 0), e.deprecated && (s.deprecated = true), t && !e.array) {
let a = i.preprocess || ((D) => D);
i.preprocess = (D, l, p) => l.preprocess(a(Array.isArray(D) ? y(false, D, -1) : D), p);
}
return e.array ? ft.create({ ...t ? { preprocess: (a) => Array.isArray(a) ? a : [a] } : {}, ...s, valueSchema: o.create(i) }) : o.create({ ...i, ...s });
}
function tr(e, t) {
if (!t) throw new Error("parserName is required.");
let r = er(false, e, (u) => u.parsers && Object.prototype.hasOwnProperty.call(u.parsers, t));
if (r) return r;
let n = `Couldn't resolve parser "${t}".`;
throw n += " Plugins must be explicitly added to the standalone bundle.", new Re(n);
}
function Rn(e, t) {
if (!t) throw new Error("astFormat is required.");
let r = er(false, e, (u) => u.printers && Object.prototype.hasOwnProperty.call(u.printers, t));
if (r) return r;
let n = `Couldn't find plugin for AST format "${t}".`;
throw n += " Plugins must be explicitly added to the standalone bundle.", new Re(n);
}
function Ct({ plugins: e, parser: t }) {
let r = tr(e, t);
return rr(r, t);
}
function rr(e, t) {
let r = e.parsers[t];
return typeof r == "function" ? r() : r;
}
function Yn(e, t) {
let r = e.printers[t];
return typeof r == "function" ? r() : r;
}
async function vi(e, t = {}) {
var p;
let r = { ...e };
if (!r.parser) if (r.filepath) {
if (r.parser = dn(r, { physicalFile: r.filepath }), !r.parser) throw new Ye(`No parser could be inferred for file "${r.filepath}".`);
} else throw new Ye("No parser and no file path given, couldn't infer a parser.");
let n = ot({ plugins: e.plugins, showDeprecated: true }).options, u = { ...jn, ...Object.fromEntries(n.filter((f) => f.default !== void 0).map((f) => [f.name, f.default])) }, i = tr(r.plugins, r.parser), o = await rr(i, r.parser);
r.astFormat = o.astFormat, r.locEnd = o.locEnd, r.locStart = o.locStart;
let s = (p = i.printers) != null && p[o.astFormat] ? i : Rn(r.plugins, o.astFormat), a = await Yn(s, o.astFormat);
r.printer = a;
let D = s.defaultOptions ? Object.fromEntries(Object.entries(s.defaultOptions).filter(([, f]) => f !== void 0)) : {}, l = { ...u, ...D };
for (let [f, d] of Object.entries(l)) (r[f] === null || r[f] === void 0) && (r[f] = d);
return r.parser === "json" && (r.trailingComma = "none"), In(r, n, { passThrough: Object.keys(jn), ...t });
}
async function xi(e, t) {
let r = await Ct(t), n = r.preprocess ? r.preprocess(e, t) : e;
t.originalText = n;
let u;
try {
u = await r.parse(n, t, t);
} catch (i) {
bi(i, e);
}
return { text: n, ast: u };
}
function bi(e, t) {
let { loc: r } = e;
if (r) {
let n = (0, $n.codeFrameColumns)(t, r, { highlightCode: true });
throw e.message += `
` + n, e.codeFrame = n, e;
}
throw e;
}
async function Mn(e, t, r, n, u) {
let { embeddedLanguageFormatting: i, printer: { embed: o, hasPrettierIgnore: s = () => false, getVisitorKeys: a } } = r;
if (!o || i !== "auto") return;
if (o.length > 2) throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");
let D = q(o.getVisitorKeys ?? a), l = [];
d();
let p = e.stack;
for (let { print: c, node: F, pathStack: m } of l) try {
e.stack = m;
let h = await c(f, t, e, r);
h && u.set(F, h);
} catch (h) {
if (globalThis.PRETTIER_DEBUG) throw h;
}
e.stack = p;
function f(c, F) {
return Ni(c, F, r, n);
}
function d() {
let { node: c } = e;
if (c === null || typeof c != "object" || s(e)) return;
for (let m of D(c)) Array.isArray(c[m]) ? e.each(d, m) : e.call(d, m);
let F = o(e, r);
if (F) {
if (typeof F == "function") {
l.push({ print: F, node: c, pathStack: [...e.stack] });
return;
}
u.set(c, F);
}
}
}
async function Ni(e, t, r, n) {
let u = await se({ ...r, ...t, parentParser: r.parser, originalText: e }, { passThrough: true }), { ast: i } = await fe(e, u), o = await n(i, u);
return et(o);
}
function Oi(e, t) {
let { originalText: r, [/* @__PURE__ */ Symbol.for("comments")]: n, locStart: u, locEnd: i, [/* @__PURE__ */ Symbol.for("printedComments")]: o } = t, { node: s } = e, a = u(s), D = i(s);
for (let l of n) u(l) >= a && i(l) <= D && o.add(l);
return r.slice(a, D);
}
async function He(e, t) {
({ ast: e } = await ur(e, t));
let r = /* @__PURE__ */ new Map(), n = new Jr(e), u = ln(t), i = /* @__PURE__ */ new Map();
await Mn(n, s, t, He, i);
let o = await Vn(n, t, s, void 0, i);
if (Dn(t), t.nodeAfterCursor && !t.nodeBeforeCursor) return [Z, o];
if (t.nodeBeforeCursor && !t.nodeAfterCursor) return [o, Z];
return o;
function s(D, l) {
return D === void 0 || D === n ? a(l) : Array.isArray(D) ? n.call(() => a(l), ...D) : n.call(() => a(l), D);
}
function a(D) {
u(n);
let l = n.node;
if (l == null) return "";
let p = l && typeof l == "object" && D === void 0;
if (p && r.has(l)) return r.get(l);
let f = Vn(n, t, s, D, i);
return p && r.set(l, f), f;
}
}
function Vn(e, t, r, n, u) {
var a;
let { node: i } = e, { printer: o } = t, s;
switch ((a = o.hasPrettierIgnore) != null && a.call(o, e) ? s = Un(e, t) : u.has(i) ? s = u.get(i) : s = o.print(e, t, r, n), i) {
case t.cursorNode:
s = me(s, (D) => [Z, D, Z]);
break;
case t.nodeBeforeCursor:
s = me(s, (D) => [D, Z]);
break;
case t.nodeAfterCursor:
s = me(s, (D) => [Z, D]);
break;
}
return o.printComment && (!o.willPrintOwnComments || !o.willPrintOwnComments(e, t)) && (s = an(e, s, t)), s;
}
async function ur(e, t) {
let r = e.comments ?? [];
t[/* @__PURE__ */ Symbol.for("comments")] = r, t[/* @__PURE__ */ Symbol.for("tokens")] = e.tokens ?? [], t[/* @__PURE__ */ Symbol.for("printedComments")] = /* @__PURE__ */ new Set(), un(e, t);
let { printer: { preprocess: n } } = t;
return e = n ? await n(e, t) : e, { ast: e, comments: r };
}
function Si(e, t) {
let { cursorOffset: r, locStart: n, locEnd: u } = t, i = q(t.printer.getVisitorKeys), o = (d) => n(d) <= r && u(d) >= r, s = e, a = [e];
for (let d of Qr(e, { getVisitorKeys: i, filter: o })) a.push(d), s = d;
if (Zr(s, { getVisitorKeys: i })) return { cursorNode: s };
let D, l, p = -1, f = Number.POSITIVE_INFINITY;
for (; a.length > 0 && (D === void 0 || l === void 0); ) {
s = a.pop();
let d = D !== void 0, c = l !== void 0;
for (let F of ge(s, { getVisitorKeys: i })) {
if (!d) {
let m = u(F);
m <= r && m > p && (D = F, p = m);
}
if (!c) {
let m = n(F);
m >= r && m < f && (l = F, f = m);
}
}
}
return { nodeBeforeCursor: D, nodeAfterCursor: l };
}
function Ti(e, t) {
let { printer: { massageAstNode: r, getVisitorKeys: n } } = t;
if (!r) return e;
let u = q(n), i = r.ignoredProperties ?? /* @__PURE__ */ new Set();
return o(e);
function o(s, a) {
if (!(s !== null && typeof s == "object")) return s;
if (Array.isArray(s)) return s.map((f) => o(f, a)).filter(Boolean);
let D = {}, l = new Set(u(s));
for (let f in s) !Object.prototype.hasOwnProperty.call(s, f) || i.has(f) || (l.has(f) ? D[f] = o(s[f], s) : D[f] = s[f]);
let p = r(s, D, a);
if (p !== null) return p ?? D;
}
}
function Pi(e, t) {
let r = [e.node, ...e.parentNodes], n = /* @__PURE__ */ new Set([t.node, ...t.parentNodes]);
return r.find((u) => Xn.has(u.type) && n.has(u));
}
function Jn(e) {
let t = Kn(false, e, (r) => r.type !== "Program" && r.type !== "File");
return t === -1 ? e : e.slice(0, t + 1);
}
function Ii(e, t, { locStart: r, locEnd: n }) {
let u = e.node, i = t.node;
if (u === i) return { startNode: u, endNode: i };
let o = r(e.node);
for (let a of Jn(t.parentNodes)) if (r(a) >= o) i = a;
else break;
let s = n(t.node);
for (let a of Jn(e.parentNodes)) {
if (n(a) <= s) u = a;
else break;
if (u === i) break;
}
return { startNode: u, endNode: i };
}
function ir(e, t, r, n, u = [], i) {
let { locStart: o, locEnd: s } = r, a = o(e), D = s(e);
if (!(t > D || t < a || i === "rangeEnd" && t === a || i === "rangeStart" && t === D)) {
for (let l of it(e, r)) {
let p = ir(l, t, r, n, [e, ...u], i);
if (p) return p;
}
if (!n || n(e, u[0])) return { node: e, parentNodes: u };
}
}
function Ri(e, t) {
return t !== "DeclareExportDeclaration" && e !== "TypeParameterDeclaration" && (e === "Directive" || e === "TypeAlias" || e === "TSExportAssignment" || e.startsWith("Declare") || e.startsWith("TSDeclare") || e.endsWith("Statement") || e.endsWith("Declaration"));
}
function qn(e, t, r) {
if (!t) return false;
switch (e.parser) {
case "flow":
case "babel":
case "babel-flow":
case "babel-ts":
case "typescript":
case "acorn":
case "espree":
case "meriyah":
case "__babel_estree":
return Ri(t.type, r == null ? void 0 : r.type);
case "json":
case "json5":
case "jsonc":
case "json-stringify":
return Xn.has(t.type);
case "graphql":
return Yi.has(t.kind);
case "vue":
return t.tag !== "root";
}
return false;
}
function Qn(e, t, r) {
let { rangeStart: n, rangeEnd: u, locStart: i, locEnd: o } = t;
Pe.ok(u > n);
let s = e.slice(n, u).search(/\S/u), a = s === -1;
if (!a) for (n += s; u > n && !/\S/u.test(e[u - 1]); --u) ;
let D = ir(r, n, t, (d, c) => qn(t, d, c), [], "rangeStart"), l = a ? D : ir(r, u, t, (d) => qn(t, d), [], "rangeEnd");
if (!D || !l) return { rangeStart: 0, rangeEnd: 0 };
let p, f;
if (Li(t)) {
let d = Pi(D, l);
p = d, f = d;
} else ({ startNode: p, endNode: f } = Ii(D, l, t));
return { rangeStart: Math.min(i(p), i(f)), rangeEnd: Math.max(o(p), o(f)) };
}
async function nu(e, t, r = 0) {
if (!e || e.trim().length === 0) return { formatted: "", cursorOffset: -1, comments: [] };
let { ast: n, text: u } = await fe(e, t);
t.cursorOffset >= 0 && (t = { ...t, ...zn(n, t) });
let i = await He(n, t, r);
r > 0 && (i = Qe([K, i], r, t.tabWidth));
let o = Ee(i, t);
if (r > 0) {
let a = o.formatted.trim();
o.cursorNodeStart !== void 0 && (o.cursorNodeStart -= o.formatted.indexOf(a), o.cursorNodeStart < 0 && (o.cursorNodeStart = 0, o.cursorNodeText = o.cursorNodeText.trimStart()), o.cursorNodeStart + o.cursorNodeText.length > a.length && (o.cursorNodeText = o.cursorNodeText.trimEnd())), o.formatted = a + xe(t.endOfLine);
}
let s = t[/* @__PURE__ */ Symbol.for("comments")];
if (t.cursorOffset >= 0) {
let a, D, l, p;
if ((t.cursorNode || t.nodeBeforeCursor || t.nodeAfterCursor) && o.cursorNodeText) if (l = o.cursorNodeStart, p = o.cursorNodeText, t.cursorNode) a = t.locStart(t.cursorNode), D = u.slice(a, t.locEnd(t.cursorNode));
else {
if (!t.nodeBeforeCursor && !t.nodeAfterCursor) throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");
a = t.nodeBeforeCursor ? t.locEnd(t.nodeBeforeCursor) : 0;
let h = t.nodeAfterCursor ? t.locStart(t.nodeAfterCursor) : u.length;
D = u.slice(a, h);
}
else a = 0, D = u, l = 0, p = o.formatted;
let f = t.cursorOffset - a;
if (D === p) return { formatted: o.formatted, cursorOffset: l + f, comments: s };
let d = D.split("");
d.splice(f, 0, Zn);
let c = p.split(""), F = gr(d, c), m = l;
for (let h of F) if (h.removed) {
if (h.value.includes(Zn)) break;
} else m += h.count;
return { formatted: o.formatted, cursorOffset: m, comments: s };
}
return { formatted: o.formatted, cursorOffset: -1, comments: s };
}
async function ji(e, t) {
let { ast: r, text: n } = await fe(e, t), { rangeStart: u, rangeEnd: i } = Qn(n, t, r), o = n.slice(u, i), s = Math.min(u, n.lastIndexOf(`
`, u) + 1), a = n.slice(s, u).match(/^\s*/u)[0], D = Ce(a, t.tabWidth), l = await nu(o, { ...t, rangeStart: 0, rangeEnd: Number.POSITIVE_INFINITY, cursorOffset: t.cursorOffset > u && t.cursorOffset <= i ? t.cursorOffset - u : -1, endOfLine: "lf" }, D), p = l.formatted.trimEnd(), { cursorOffset: f } = t;
f > i ? f += p.length - o.length : l.cursorOffset >= 0 && (f = l.cursorOffset + u);
let d = n.slice(0, u) + p + n.slice(i);
if (t.endOfLine !== "lf") {
let c = xe(t.endOfLine);
f >= 0 && c === `\r
` && (f += Ot(d.slice(0, f), `
`)), d = ne(false, d, `
`, c);
}
return { formatted: d, cursorOffset: f, comments: l.comments };
}
function or(e, t, r) {
return typeof t != "number" || Number.isNaN(t) || t < 0 || t > e.length ? r : t;
}
function eu(e, t) {
let { cursorOffset: r, rangeStart: n, rangeEnd: u } = t;
return r = or(e, r, -1), n = or(e, n, 0), u = or(e, u, e.length), { ...t, cursorOffset: r, rangeStart: n, rangeEnd: u };
}
function uu(e, t) {
let { cursorOffset: r, rangeStart: n, rangeEnd: u, endOfLine: i } = eu(e, t), o = e.charAt(0) === ru;
if (o && (e = e.slice(1), r--, n--, u--), i === "auto" && (i = yr(e)), e.includes("\r")) {
let s = (a) => Ot(e.slice(0, Math.max(a, 0)), `\r
`);
r -= s(r), n -= s(n), u -= s(u), e = Ar(e);
}
return { hasBOM: o, text: e, options: eu(e, { ...t, cursorOffset: r, rangeStart: n, rangeEnd: u, endOfLine: i }) };
}
async function tu(e, t) {
let r = await Ct(t);
return !r.hasPragma || r.hasPragma(e);
}
async function sr(e, t) {
let { hasBOM: r, text: n, options: u } = uu(e, await se(t));
if (u.rangeStart >= u.rangeEnd && n !== "" || u.requirePragma && !await tu(n, u)) return { formatted: e, cursorOffset: t.cursorOffset, comments: [] };
let i;
return u.rangeStart > 0 || u.rangeEnd < n.length ? i = await ji(n, u) : (!u.requirePragma && u.insertPragma && u.printer.insertPragma && !await tu(n, u) && (n = u.printer.insertPragma(n)), i = await nu(n, u)), r && (i.formatted = ru + i.formatted, i.cursorOffset >= 0 && i.cursorOffset++), i;
}
async function iu(e, t, r) {
let { text: n, options: u } = uu(e, await se(t)), i = await fe(n, u);
return r && (r.preprocessForPrint && (i.ast = await ur(i.ast, u)), r.massage && (i.ast = Gn(i.ast, u))), i;
}
async function ou(e, t) {
t = await se(t);
let r = await He(e, t);
return Ee(r, t);
}
async function su(e, t) {
let r = Ir(e), { formatted: n } = await sr(r, { ...t, parser: "__js_expression" });
return n;
}
async function au(e, t) {
t = await se(t);
let { ast: r } = await fe(e, t);
return He(r, t);
}
async function Du(e, t) {
return Ee(e, await se(t));
}
function Ui(e, t) {
if (t === false) return false;
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
for (let r = t + 2; r < e.length; ++r) if (e.charAt(r) === "*" && e.charAt(r + 1) === "/") return r + 2;
}
return t;
}
function Vi(e, t) {
return t === false ? false : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? ut(e, t) : t;
}
function zi(e, t) {
let r = null, n = t;
for (; n !== r; ) r = n, n = S(e, n), n = ve(e, n), n = Be(e, n), n = W(e, n);
return n;
}
function Gi(e, t) {
let r = null, n = t;
for (; n !== r; ) r = n, n = nt(e, n), n = ve(e, n), n = S(e, n);
return n = Be(e, n), n = W(e, n), n !== false && $(e, n);
}
function Ki(e, t) {
let r = e.lastIndexOf(`
`);
return r === -1 ? 0 : Ce(e.slice(r + 1).match(/^[\t ]*/u)[0], t);
}
function Dr(e) {
if (typeof e != "string") throw new TypeError("Expected a string");
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
}
function Ji(e, t) {
let r = e.match(new RegExp(`(${Dr(t)})+`, "gu"));
return r === null ? 0 : r.reduce((n, u) => Math.max(n, u.length / t.length), 0);
}
function qi(e, t) {
let r = We(e, t);
return r === false ? "" : e.charAt(r);
}
function Xi(e, t) {
let r = t === true || t === yt ? yt : pu, n = r === yt ? pu : yt, u = 0, i = 0;
for (let o of e) o === r ? u++ : o === n && i++;
return u > i ? n : r;
}
function Qi(e, t, r) {
for (let n = t; n < r; ++n) if (e.charAt(n) === `
`) return true;
return false;
}
function Zi(e, t, r = {}) {
return S(e, r.backwards ? t - 1 : t, r) !== t;
}
function eo(e, t, r) {
let n = t === '"' ? "'" : '"', i = ne(false, e, /\\(.)|(["'])/gsu, (o, s, a) => s === n ? s : a === t ? "\\" + a : a || (r && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s) ? s : "\\" + s));
return t + i + t;
}
function to(e, t, r) {
return We(e, r(t));
}
function ro(e, t) {
return arguments.length === 2 || typeof t == "number" ? We(e, t) : to(...arguments);
}
function no(e, t, r) {
return Ie(e, r(t));
}
function uo(e, t) {
return arguments.length === 2 || typeof t == "number" ? Ie(e, t) : no(...arguments);
}
function io(e, t, r) {
return gt(e, r(t));
}
function oo(e, t) {
return arguments.length === 2 || typeof t == "number" ? gt(e, t) : io(...arguments);
}
function de(e, t = 1) {
return async (...r) => {
let n = r[t] ?? {}, u = n.plugins ?? [];
return r[t] = { ...n, plugins: Array.isArray(u) ? u : Object.values(u) }, e(...r);
};
}
async function gu(e, t) {
let { formatted: r } = await Cu(e, { ...t, cursorOffset: -1 });
return r;
}
async function so(e, t) {
return await gu(e, t) === e;
}
var yu, vt, Au, vu, Bu, wu, fr, dr, Bt, _u, Me, xu, pr, pe, st, Wn, cr, bu, ne, Fo, Ve, Ou, Ge, Su, Nt, Tu, ku, _e, ze, U, H, V, T, k, L, B, N, w, P, I, R, A, O, _, Ke, z, Pu, St, Q, vr, be, Br, G, Je, Tr, Fe, kr, Oe, kt, qe, Lr, K, Xe, Z, Yu, y, Rr, Hr, ju, Te, Y, J, he, Lt, Ce, te, Yt, rt, Rt, Jr, qr, Pe, Xr, en, S, nt, ut, W, $, jt, tn, Zu, q, Wt, $t, on, Ie, ln, Re, Ye, cn, ci, dn, oe, Ut, mn, ce, at, Ae, hn, Cn, Gt, Vt, An, Dt, pi, x, lt, ct, ft, dt, Ft, mt, ht, je, Tn, kn, Ln, Pn, Et, Zt, In, Ai, er, jn, se, $n, fe, Un, zn, Gn, ki, Kn, Li, Xn, Yi, ru, Zn, ar, Wi, $i, Mi, lu, lr, ve, Be, We, gt, cu, fu, du, yt, pu, Fu, mu, hu, Eu, Cu, ao, Do, lc;
var init_standalone = __esm({
"../../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/standalone.mjs"() {
yu = Object.create;
vt = Object.defineProperty;
Au = Object.getOwnPropertyDescriptor;
vu = Object.getOwnPropertyNames;
Bu = Object.getPrototypeOf;
wu = Object.prototype.hasOwnProperty;
fr = (e) => {
throw TypeError(e);
};
dr = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
Bt = (e, t) => {
for (var r in t) vt(e, r, { get: t[r], enumerable: true });
};
_u = (e, t, r, n) => {
if (t && typeof t == "object" || typeof t == "function") for (let u of vu(t)) !wu.call(e, u) && u !== r && vt(e, u, { get: () => t[u], enumerable: !(n = Au(t, u)) || n.enumerable });
return e;
};
Me = (e, t, r) => (r = e != null ? yu(Bu(e)) : {}, _u(t || !e || !e.__esModule ? vt(r, "default", { value: e, enumerable: true }) : r, e));
xu = (e, t, r) => t.has(e) || fr("Cannot " + r);
pr = (e, t, r) => t.has(e) ? fr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r);
pe = (e, t, r) => (xu(e, t, "access private method"), r);
st = dr((na, Fn) => {
"use strict";
var pn = new Proxy(String, { get: () => pn });
Fn.exports = pn;
});
Wn = dr((nr) => {
"use strict";
Object.defineProperty(nr, "__esModule", { value: true });
function Bi() {
return new Proxy({}, { get: () => (e) => e });
}
var Hn = /\r\n|[\n\r\u2028\u2029]/;
function wi(e, t, r) {
let n = Object.assign({ column: 0, line: -1 }, e.start), u = Object.assign({}, n, e.end), { linesAbove: i = 2, linesBelow: o = 3 } = r || {}, s = n.line, a = n.column, D = u.line, l = u.column, p = Math.max(s - (i + 1), 0), f = Math.min(t.length, D + o);
s === -1 && (p = 0), D === -1 && (f = t.length);
let d = D - s, c = {};
if (d) for (let F = 0; F <= d; F++) {
let m = F + s;
if (!a) c[m] = true;
else if (F === 0) {
let h = t[m - 1].length;
c[m] = [a, h - a + 1];
} else if (F === d) c[m] = [0, l];
else {
let h = t[m - F].length;
c[m] = [0, h];
}
}
else a === l ? a ? c[s] = [a, 0] : c[s] = true : c[s] = [a, l - a];
return { start: p, end: f, markerLines: c };
}
function _i(e, t, r = {}) {
let u = Bi(false), i = e.split(Hn), { start: o, end: s, markerLines: a } = wi(t, i, r), D = t.start && typeof t.start.column == "number", l = String(s).length, f = e.split(Hn, s).slice(o, s).map((d, c) => {
let F = o + 1 + c, h = ` ${` ${F}`.slice(-l)} |`, C = a[F], v = !a[F + 1];
if (C) {
let E = "";
if (Array.isArray(C)) {
let g = d.slice(0, Math.max(C[0] - 1, 0)).replace(/[^\t]/g, " "), j = C[1] || 1;
E = [`
`, u.gutter(h.replace(/\d/g, " ")), " ", g, u.marker("^").repeat(j)].join(""), v && r.message && (E += " " + u.message(r.message));
}
return [u.marker(">"), u.gutter(h), d.length > 0 ? ` ${d}` : "", E].join("");
} else return ` ${u.gutter(h)}${d.length > 0 ? ` ${d}` : ""}`;
}).join(`
`);
return r.message && !D && (f = `${" ".repeat(l + 1)}${r.message}
${f}`), f;
}
nr.codeFrameColumns = _i;
});
cr = {};
Bt(cr, { __debug: () => Do, check: () => so, doc: () => ar, format: () => gu, formatWithCursor: () => Cu, getSupportInfo: () => ao, util: () => lr, version: () => lu });
bu = (e, t, r, n) => {
if (!(e && t == null)) return t.replaceAll ? t.replaceAll(r, n) : r.global ? t.replace(r, n) : t.split(r).join(n);
};
ne = bu;
M.prototype = { diff: function(t, r) {
var n, u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = u.callback;
typeof u == "function" && (i = u, u = {});
var o = this;
function s(E) {
return E = o.postProcess(E, u), i ? (setTimeout(function() {
i(E);
}, 0), true) : E;
}
t = this.castInput(t, u), r = this.castInput(r, u), t = this.removeEmpty(this.tokenize(t, u)), r = this.removeEmpty(this.tokenize(r, u));
var a = r.length, D = t.length, l = 1, p = a + D;
u.maxEditLength != null && (p = Math.min(p, u.maxEditLength));
var f = (n = u.timeout) !== null && n !== void 0 ? n : 1 / 0, d = Date.now() + f, c = [{ oldPos: -1, lastComponent: void 0 }], F = this.extractCommon(c[0], r, t, 0, u);
if (c[0].oldPos + 1 >= D && F + 1 >= a) return s(Fr(o, c[0].lastComponent, r, t, o.useLongestToken));
var m = -1 / 0, h = 1 / 0;
function C() {
for (var E = Math.max(m, -l); E <= Math.min(h, l); E += 2) {
var g = void 0, j = c[E - 1], b = c[E + 1];
j && (c[E - 1] = void 0);
var X = false;
if (b) {
var ae = b.oldPos - E;
X = b && 0 <= ae && ae < a;
}
var $e = j && j.oldPos + 1 < D;
if (!X && !$e) {
c[E] = void 0;
continue;
}
if (!$e || X && j.oldPos < b.oldPos ? g = o.addToPath(b, true, false, 0, u) : g = o.addToPath(j, false, true, 1, u), F = o.extractCommon(g, r, t, E, u), g.oldPos + 1 >= D && F + 1 >= a) return s(Fr(o, g.lastComponent, r, t, o.useLongestToken));
c[E] = g, g.oldPos + 1 >= D && (h = Math.min(h, E - 1)), F + 1 >= a && (m = Math.max(m, E + 1));
}
l++;
}
if (i) (function E() {
setTimeout(function() {
if (l > p || Date.now() > d) return i();
C() || E();
}, 0);
})();
else for (; l <= p && Date.now() <= d; ) {
var v = C();
if (v) return v;
}
}, addToPath: function(t, r, n, u, i) {
var o = t.lastComponent;
return o && !i.oneChangePerToken && o.added === r && o.removed === n ? { oldPos: t.oldPos + u, lastComponent: { count: o.count + 1, added: r, removed: n, previousComponent: o.previousComponent } } : { oldPos: t.oldPos + u, lastComponent: { count: 1, added: r, removed: n, previousComponent: o } };
}, extractCommon: function(t, r, n, u, i) {
for (var o = r.length, s = n.length, a = t.oldPos, D = a - u, l = 0; D + 1 < o && a + 1 < s && this.equals(n[a + 1], r[D + 1], i); ) D++, a++, l++, i.oneChangePerToken && (t.lastComponent = { count: 1, previousComponent: t.lastComponent, added: false, removed: false });
return l && !i.oneChangePerToken && (t.lastComponent = { count: l, previousComponent: t.lastComponent, added: false, removed: false }), t.oldPos = a, D;
}, equals: function(t, r, n) {
return n.comparator ? n.comparator(t, r) : t === r || n.ignoreCase && t.toLowerCase() === r.toLowerCase();
}, removeEmpty: function(t) {
for (var r = [], n = 0; n < t.length; n++) t[n] && r.push(t[n]);
return r;
}, castInput: function(t) {
return t;
}, tokenize: function(t) {
return Array.from(t);
}, join: function(t) {
return t.join("");
}, postProcess: function(t) {
return t;
} };
Fo = new M();
Ve = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
Ou = new RegExp("[".concat(Ve, "]+|\\s+|[^").concat(Ve, "]"), "ug");
Ge = new M();
Ge.equals = function(e, t, r) {
return r.ignoreCase && (e = e.toLowerCase(), t = t.toLowerCase()), e.trim() === t.trim();
};
Ge.tokenize = function(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r;
if (t.intlSegmenter) {
if (t.intlSegmenter.resolvedOptions().granularity != "word") throw new Error('The segmenter passed must have a granularity of "word"');
r = Array.from(t.intlSegmenter.segment(e), function(i) {
return i.segment;
});
} else r = e.match(Ou) || [];
var n = [], u = null;
return r.forEach(function(i) {
/\s/.test(i) ? u == null ? n.push(i) : n.push(n.pop() + i) : /\s/.test(u) ? n[n.length - 1] == u ? n.push(n.pop() + i) : n.push(u + i) : n.push(i), u = i;
}), n;
};
Ge.join = function(e) {
return e.map(function(t, r) {
return r == 0 ? t : t.replace(/^\s+/, "");
}).join("");
};
Ge.postProcess = function(e, t) {
if (!e || t.oneChangePerToken) return e;
var r = null, n = null, u = null;
return e.forEach(function(i) {
i.added ? n = i : i.removed ? u = i : ((n || u) && Cr(r, u, n, i), r = i, n = null, u = null);
}), (n || u) && Cr(r, u, n, null), e;
};
Su = new M();
Su.tokenize = function(e) {
var t = new RegExp("(\\r?\\n)|[".concat(Ve, "]+|[^\\S\\n\\r]+|[^").concat(Ve, "]"), "ug");
return e.match(t) || [];
};
Nt = new M();
Nt.tokenize = function(e, t) {
t.stripTrailingCr && (e = e.replace(/\r\n/g, `
`));
var r = [], n = e.split(/(\n|\r\n)/);
n[n.length - 1] || n.pop();
for (var u = 0; u < n.length; u++) {
var i = n[u];
u % 2 && !t.newlineIsToken ? r[r.length - 1] += i : r.push(i);
}
return r;
};
Nt.equals = function(e, t, r) {
return r.ignoreWhitespace ? ((!r.newlineIsToken || !e.includes(`
`)) && (e = e.trim()), (!r.newlineIsToken || !t.includes(`
`)) && (t = t.trim())) : r.ignoreNewlineAtEof && !r.newlineIsToken && (e.endsWith(`
`) && (e = e.slice(0, -1)), t.endsWith(`
`) && (t = t.slice(0, -1))), M.prototype.equals.call(this, e, t, r);
};
Tu = new M();
Tu.tokenize = function(e) {
return e.split(/(\S.+?[.!?])(?=\s+|$)/);
};
ku = new M();
ku.tokenize = function(e) {
return e.split(/([{}:;,]|\s+)/);
};
_e = new M();
_e.useLongestToken = true;
_e.tokenize = Nt.tokenize;
_e.castInput = function(e, t) {
var r = t.undefinedReplacement, n = t.stringifyReplacer, u = n === void 0 ? function(i, o) {
return typeof o > "u" ? r : o;
} : n;
return typeof e == "string" ? e : JSON.stringify(bt(e, null, null, u), u, " ");
};
_e.equals = function(e, t, r) {
return M.prototype.equals.call(_e, e.replace(/,([\r\n])/g, "$1"), t.replace(/,([\r\n])/g, "$1"), r);
};
ze = new M();
ze.tokenize = function(e) {
return e.slice();
};
ze.join = ze.removeEmpty = function(e) {
return e;
};
U = "string";
H = "array";
V = "cursor";
T = "indent";
k = "align";
L = "trim";
B = "group";
N = "fill";
w = "if-break";
P = "indent-if-break";
I = "line-suffix";
R = "line-suffix-boundary";
A = "line";
O = "label";
_ = "break-parent";
Ke = /* @__PURE__ */ new Set([V, T, k, L, B, N, w, P, I, R, A, O, _]);
z = Lu;
Pu = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
St = class extends Error {
name = "InvalidDocError";
constructor(t) {
super(Iu(t)), this.doc = t;
}
};
Q = St;
vr = {};
be = Ru;
Br = () => {
};
G = Br;
Je = Br;
Tr = { type: R };
Fe = { type: _ };
kr = { type: L };
Oe = { type: A, hard: true };
kt = { type: A, hard: true, literal: true };
qe = { type: A };
Lr = { type: A, soft: true };
K = [Oe, Fe];
Xe = [kt, Fe];
Z = { type: V };
Yu = (e, t, r) => {
if (!(e && t == null)) return Array.isArray(t) || typeof t == "string" ? t[r < 0 ? t.length + r : r] : t.at(r);
};
y = Yu;
Rr = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
Hr = (e) => !(Yr(e) || jr(e));
ju = /[^\x20-\x7F]/u;
Te = Hu;
Y = /* @__PURE__ */ Symbol("MODE_BREAK");
J = /* @__PURE__ */ Symbol("MODE_FLAT");
he = /* @__PURE__ */ Symbol("cursor");
Lt = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
Ce = Ku;
Rt = class {
constructor(t) {
pr(this, te);
this.stack = [t];
}
get key() {
let { stack: t, siblings: r } = this;
return y(false, t, r === null ? -2 : -4) ?? null;
}
get index() {
return this.siblings === null ? null : y(false, this.stack, -2);
}
get node() {
return y(false, this.stack, -1);
}
get parent() {
return this.getNode(1);
}
get grandparent() {
return this.getNode(2);
}
get isInArray() {
return this.siblings !== null;
}
get siblings() {
let { stack: t } = this, r = y(false, t, -3);
return Array.isArray(r) ? r : null;
}
get next() {
let { siblings: t } = this;
return t === null ? null : t[this.index + 1];
}
get previous() {
let { siblings: t } = this;
return t === null ? null : t[this.index - 1];
}
get isFirst() {
return this.index === 0;
}
get isLast() {
let { siblings: t, index: r } = this;
return t !== null && r === t.length - 1;
}
get isRoot() {
return this.stack.length === 1;
}
get root() {
return this.stack[0];
}
get ancestors() {
return [...pe(this, te, rt).call(this)];
}
getName() {
let { stack: t } = this, { length: r } = t;
return r > 1 ? y(false, t, -2) : null;
}
getValue() {
return y(false, this.stack, -1);
}
getNode(t = 0) {
let r = pe(this, te, Yt).call(this, t);
return r === -1 ? null : this.stack[r];
}
getParentNode(t = 0) {
return this.getNode(t + 1);
}
call(t, ...r) {
let { stack: n } = this, { length: u } = n, i = y(false, n, -1);
for (let o of r) i = i[o], n.push(o, i);
try {
return t(this);
} finally {
n.length = u;
}
}
callParent(t, r = 0) {
let n = pe(this, te, Yt).call(this, r + 1), u = this.stack.splice(n + 1);
try {
return t(this);
} finally {
this.stack.push(...u);
}
}
each(t, ...r) {
let { stack: n } = this, { length: u } = n, i = y(false, n, -1);
for (let o of r) i = i[o], n.push(o, i);
try {
for (let o = 0; o < i.length; ++o) n.push(o, i[o]), t(this, o, i), n.length -= 2;
} finally {
n.length = u;
}
}
map(t, ...r) {
let n = [];
return this.each((u, i, o) => {
n[i] = t(u, i, o);
}, ...r), n;
}
match(...t) {
let r = this.stack.length - 1, n = null, u = this.stack[r--];
for (let i of t) {
if (u === void 0) return false;
let o = null;
if (typeof n == "number" && (o = n, n = this.stack[r--], u = this.stack[r--]), i && !i(u, n, o)) return false;
n = this.stack[r--], u = this.stack[r--];
}
return true;
}
findAncestor(t) {
for (let r of pe(this, te, rt).call(this)) if (t(r)) return r;
}
hasAncestor(t) {
for (let r of pe(this, te, rt).call(this)) if (t(r)) return true;
return false;
}
};
te = /* @__PURE__ */ new WeakSet(), Yt = function(t) {
let { stack: r } = this;
for (let n = r.length - 1; n >= 0; n -= 2) if (!Array.isArray(r[n]) && --t < 0) return n;
return -1;
}, rt = function* () {
let { stack: t } = this;
for (let r = t.length - 3; r >= 0; r -= 2) {
let n = t[r];
Array.isArray(n) || (yield n);
}
};
Jr = Rt;
qr = new Proxy(() => {
}, { get: () => qr });
Pe = qr;
Xr = Ju;
en = ye(/\s/u);
S = ye(" ");
nt = ye(",; ");
ut = ye(/[^\n\r]/u);
W = qu;
$ = Xu;
jt = Qu;
tn = /* @__PURE__ */ new Set(["tokens", "comments", "parent", "enclosingNode", "precedingNode", "followingNode"]);
Zu = (e) => Object.keys(e).filter((t) => !tn.has(t));
q = ei;
Wt = /* @__PURE__ */ new WeakMap();
$t = () => false;
on = (e) => !/[\S\n\u2028\u2029]/u.test(e);
Ie = ui;
ln = ai;
Re = class extends Error {
name = "ConfigError";
};
Ye = class extends Error {
name = "UndefinedParserError";
};
cn = { cursorOffset: { category: "Special", type: "int", default: -1, range: { start: -1, end: 1 / 0, step: 1 }, description: "Print (to stderr) where a cursor at the given position would move to after formatting.", cliCategory: "Editor" }, endOfLine: { category: "Global", type: "choice", default: "lf", description: "Which end of line characters to apply.", choices: [{ value: "lf", description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos" }, { value: "crlf", description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows" }, { value: "cr", description: "Carriage Return character only (\\r), used very rarely" }, { value: "auto", description: `Maintain existing
(mixed values within one file are normalised by looking at what's used after the first line)` }] }, filepath: { category: "Special", type: "path", description: "Specify the input filepath. This will be used to do parser inference.", cliName: "stdin-filepath", cliCategory: "Other", cliDescription: "Path to the file to pretend that stdin comes from." }, insertPragma: { category: "Special", type: "boolean", default: false, description: "Insert @format pragma into file's first docblock comment.", cliCategory: "Other" }, parser: { category: "Global", type: "choice", default: void 0, description: "Which parser to use.", exception: (e) => typeof e == "string" || typeof e == "function", choices: [{ value: "flow", description: "Flow" }, { value: "babel", description: "JavaScript" }, { value: "babel-flow", description: "Flow" }, { value: "babel-ts", description: "TypeScript" }, { value: "typescript", description: "TypeScript" }, { value: "acorn", description: "JavaScript" }, { value: "espree", description: "JavaScript" }, { value: "meriyah", description: "JavaScript" }, { value: "css", description: "CSS" }, { value: "less", description: "Less" }, { value: "scss", description: "SCSS" }, { value: "json", description: "JSON" }, { value: "json5", description: "JSON5" }, { value: "jsonc", description: "JSON with Comments" }, { value: "json-stringify", description: "JSON.stringify" }, { value: "graphql", description: "GraphQL" }, { value: "markdown", description: "Markdown" }, { value: "mdx", description: "MDX" }, { value: "vue", description: "Vue" }, { value: "yaml", description: "YAML" }, { value: "glimmer", description: "Ember / Handlebars" }, { value: "html", description: "HTML" }, { value: "angular", description: "Angular" }, { value: "lwc", description: "Lightning Web Components" }] }, plugins: { type: "path", array: true, default: [{ value: [] }], category: "Global", description: "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.", exception: (e) => typeof e == "string" || typeof e == "object", cliName: "plugin", cliCategory: "Config" }, printWidth: { category: "Global", type: "int", default: 80, description: "The line length where Prettier will try wrap.", range: { start: 0, end: 1 / 0, step: 1 } }, rangeEnd: { category: "Special", type: "int", default: 1 / 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code ending at a given character offset (exclusive).
The range will extend forwards to the end of the selected statement.`, cliCategory: "Editor" }, rangeStart: { category: "Special", type: "int", default: 0, range: { start: 0, end: 1 / 0, step: 1 }, description: `Format code starting at a given character offset.
The range will extend backwards to the start of the first line containing the selected statement.`, cliCategory: "Editor" }, requirePragma: { category: "Special", type: "boolean", default: false, description: `Require either '@prettier' or '@format' to be present in the file's first docblock comment
in order for it to be formatted.`, cliCategory: "Other" }, tabWidth: { type: "int", category: "Global", default: 2, description: "Number of spaces per indentation level.", range: { start: 0, end: 1 / 0, step: 1 } }, useTabs: { category: "Global", type: "boolean", default: false, description: "Indent with tabs instead of spaces." }, embeddedLanguageFormatting: { category: "Global", type: "choice", default: "auto", description: "Control how Prettier formats quoted code embedded in the file.", choices: [{ value: "auto", description: "Format embedded code if Prettier can automatically identify it." }, { value: "off", description: "Never automatically format embedded code." }] } };
ci = (e) => String(e).split(/[/\\]/u).pop();
dn = di;
oe = { key: (e) => /^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e) ? e : JSON.stringify(e), value(e) {
if (e === null || typeof e != "object") return JSON.stringify(e);
if (Array.isArray(e)) return `[${e.map((r) => oe.value(r)).join(", ")}]`;
let t = Object.keys(e);
return t.length === 0 ? "{}" : `{ ${t.map((r) => `${oe.key(r)}: ${oe.value(e[r])}`).join(", ")} }`;
}, pair: ({ key: e, value: t }) => oe.value({ [e]: t }) };
Ut = Me(st(), 1);
mn = (e, t, { descriptor: r }) => {
let n = [`${Ut.default.yellow(typeof e == "string" ? r.key(e) : r.pair(e))} is deprecated`];
return t && n.push(`we now treat it as ${Ut.default.blue(typeof t == "string" ? r.key(t) : r.pair(t))}`), n.join("; ") + ".";
};
ce = Me(st(), 1);
at = /* @__PURE__ */ Symbol.for("vnopts.VALUE_NOT_EXIST");
Ae = /* @__PURE__ */ Symbol.for("vnopts.VALUE_UNCHANGED");
hn = " ".repeat(2);
Cn = (e, t, r) => {
let { text: n, list: u } = r.normalizeExpectedResult(r.schemas[e].expected(r)), i = [];
return n && i.push(En(e, t, n, r.descriptor)), u && i.push([En(e, t, u.title, r.descriptor)].concat(u.values.map((o) => gn(o, r.loggerPrintWidth))).join(`
`)), yn(i, r.loggerPrintWidth);
};
Gt = Me(st(), 1);
Vt = [];
An = [];
Dt = (e, t, { descriptor: r, logger: n, schemas: u }) => {
let i = [`Ignored unknown option ${Gt.default.yellow(r.pair({ key: e, value: t }))}.`], o = Object.keys(u).sort().find((s) => zt(e, s) < 3);
o && i.push(`Did you mean ${Gt.default.blue(r.key(o))}?`), n.warn(i.join(" "));
};
pi = ["default", "expected", "validate", "deprecated", "forward", "redirect", "overlap", "preprocess", "postprocess"];
x = class {
static create(t) {
return Fi(this, t);
}
constructor(t) {
this.name = t.name;
}
default(t) {
}
expected(t) {
return "nothing";
}
validate(t, r) {
return false;
}
deprecated(t, r) {
return false;
}
forward(t, r) {
}
redirect(t, r) {
}
overlap(t, r, n) {
return t;
}
preprocess(t, r) {
return t;
}
postprocess(t, r) {
return Ae;
}
};
lt = class extends x {
constructor(t) {
super(t), this._sourceName = t.sourceName;
}
expected(t) {
return t.schemas[this._sourceName].expected(t);
}
validate(t, r) {
return r.schemas[this._sourceName].validate(t, r);
}
redirect(t, r) {
return this._sourceName;
}
};
ct = class extends x {
expected() {
return "anything";
}
validate() {
return true;
}
};
ft = class extends x {
constructor({ valueSchema: t, name: r = t.name, ...n }) {
super({ ...n, name: r }), this._valueSchema = t;
}
expected(t) {
let { text: r, list: n } = t.normalizeExpectedResult(this._valueSchema.expected(t));
return { text: r && `an array of ${r}`, list: n && { title: "an array of the following values", values: [{ list: n }] } };
}
validate(t, r) {
if (!Array.isArray(t)) return false;
let n = [];
for (let u of t) {
let i = r.normalizeValidateResult(this._valueSchema.validate(u, r), u);
i !== true && n.push(i.value);
}
return n.length === 0 ? true : { value: n };
}
deprecated(t, r) {
let n = [];
for (let u of t) {
let i = r.normalizeDeprecatedResult(this._valueSchema.deprecated(u, r), u);
i !== false && n.push(...i.map(({ value: o }) => ({ value: [o] })));
}
return n;
}
forward(t, r) {
let n = [];
for (let u of t) {
let i = r.normalizeForwardResult(this._valueSchema.forward(u, r), u);
n.push(...i.map(vn));
}
return n;
}
redirect(t, r) {
let n = [], u = [];
for (let i of t) {
let o = r.normalizeRedirectResult(this._valueSchema.redirect(i, r), i);
"remain" in o && n.push(o.remain), u.push(...o.redirect.map(vn));
}
return n.length === 0 ? { redirect: u } : { redirect: u, remain: n };
}
overlap(t, r) {
return t.concat(r);
}
};
dt = class extends x {
expected() {
return "true or false";
}
validate(t) {
return typeof t == "boolean";
}
};
Ft = class extends x {
constructor(t) {
super(t), this._choices = _n(t.choices.map((r) => r && typeof r == "object" ? r : { value: r }), "value");
}
expected({ descriptor: t }) {
let r = Array.from(this._choices.keys()).map((o) => this._choices.get(o)).filter(({ hidden: o }) => !o).map((o) => o.value).sort(On).map(t.value), n = r.slice(0, -2), u = r.slice(-2);
return { text: n.concat(u.join(" or ")).join(", "), list: { title: "one of the following values", values: r } };
}
validate(t) {
return this._choices.has(t);
}
deprecated(t) {
let r = this._choices.get(t);
return r && r.deprecated ? { value: t } : false;
}
forward(t) {
let r = this._choices.get(t);
return r ? r.forward : void 0;
}
redirect(t) {
let r = this._choices.get(t);
return r ? r.redirect : void 0;
}
};
mt = class extends x {
expected() {
return "a number";
}
validate(t, r) {
return typeof t == "number";
}
};
ht = class extends mt {
expected() {
return "an integer";
}
validate(t, r) {
return r.normalizeValidateResult(super.validate(t, r), t) === true && Nn(t);
}
};
je = class extends x {
expected() {
return "a string";
}
validate(t) {
return typeof t == "string";
}
};
Tn = oe;
kn = Dt;
Ln = Cn;
Pn = mn;
Et = class {
constructor(t, r) {
let { logger: n = console, loggerPrintWidth: u = 80, descriptor: i = Tn, unknown: o = kn, invalid: s = Ln, deprecated: a = Pn, missing: D = () => false, required: l = () => false, preprocess: p = (d) => d, postprocess: f = () => Ae } = r || {};
this._utils = { descriptor: i, logger: n || { warn: () => {
} }, loggerPrintWidth: u, schemas: wn(t, "name"), normalizeDefaultResult: Kt, normalizeExpectedResult: Jt, normalizeDeprecatedResult: Xt, normalizeForwardResult: pt, normalizeRedirectResult: Qt, normalizeValidateResult: qt }, this._unknownHandler = o, this._invalidHandler = Sn(s), this._deprecatedHandler = a, this._identifyMissing = (d, c) => !(d in c) || D(d, c), this._identifyRequired = l, this._preprocess = p, this._postprocess = f, this.cleanHistory();
}
cleanHistory() {
this._hasDeprecationWarned = xn();
}
normalize(t) {
let r = {}, u = [this._preprocess(t, this._utils)], i = () => {
for (; u.length !== 0; ) {
let o = u.shift(), s = this._applyNormalization(o, r);
u.push(...s);
}
};
i();
for (let o of Object.keys(this._utils.schemas)) {
let s = this._utils.schemas[o];
if (!(o in r)) {
let a = Kt(s.default(this._utils));
"value" in a && u.push({ [o]: a.value });
}
}
i();
for (let o of Object.keys(this._utils.schemas)) {
if (!(o in r)) continue;
let s = this._utils.schemas[o], a = r[o], D = s.postprocess(a, this._utils);
D !== Ae && (this._applyValidation(D, o, s), r[o] = D);
}
return this._applyPostprocess(r), this._applyRequiredCheck(r), r;
}
_applyNormalization(t, r) {
let n = [], { knownKeys: u, unknownKeys: i } = this._partitionOptionKeys(t);
for (let o of u) {
let s = this._utils.schemas[o], a = s.preprocess(t[o], this._utils);
this._applyValidation(a, o, s);
let D = ({ from: d, to: c }) => {
n.push(typeof c == "string" ? { [c]: d } : { [c.key]: c.value });
}, l = ({ value: d, redirectTo: c }) => {
let F = Xt(s.deprecated(d, this._utils), a, true);
if (F !== false) if (F === true) this._hasDeprecationWarned(o) || this._utils.logger.warn(this._deprecatedHandler(o, c, this._utils));
else for (let { value: m } of F) {
let h = { key: o, value: m };
if (!this._hasDeprecationWarned(h)) {
let C = typeof c == "string" ? { key: c, value: m } : c;
this._utils.logger.warn(this._deprecatedHandler(h, C, this._utils));
}
}
};
pt(s.forward(a, this._utils), a).forEach(D);
let f = Qt(s.redirect(a, this._utils), a);
if (f.redirect.forEach(D), "remain" in f) {
let d = f.remain;
r[o] = o in r ? s.overlap(r[o], d, this._utils) : d, l({ value: d });
}
for (let { from: d, to: c } of f.redirect) l({ value: d, redirectTo: c });
}
for (let o of i) {
let s = t[o];
this._applyUnknownHandler(o, s, r, (a, D) => {
n.push({ [a]: D });
});
}
return n;
}
_applyRequiredCheck(t) {
for (let r of Object.keys(this._utils.schemas)) if (this._identifyMissing(r, t) && this._identifyRequired(r)) throw this._invalidHandler(r, at, this._utils);
}
_partitionOptionKeys(t) {
let [r, n] = bn(Object.keys(t).filter((u) => !this._identifyMissing(u, t)), (u) => u in this._utils.schemas);
return { knownKeys: r, unknownKeys: n };
}
_applyValidation(t, r, n) {
let u = qt(n.validate(t, this._utils), t);
if (u !== true) throw this._invalidHandler(r, u.value, this._utils);
}
_applyUnknownHandler(t, r, n, u) {
let i = this._unknownHandler(t, r, this._utils);
if (i) for (let o of Object.keys(i)) {
if (this._identifyMissing(o, i)) continue;
let s = i[o];
o in this._utils.schemas ? u(o, s) : n[o] = s;
}
}
_applyPostprocess(t) {
let r = this._postprocess(t, this._utils);
if (r !== Ae) {
if (r.delete) for (let n of r.delete) delete t[n];
if (r.override) {
let { knownKeys: n, unknownKeys: u } = this._partitionOptionKeys(r.override);
for (let i of n) {
let o = r.override[i];
this._applyValidation(o, i, this._utils.schemas[i]), t[i] = o;
}
for (let i of u) {
let o = r.override[i];
this._applyUnknownHandler(i, o, t, (s, a) => {
let D = this._utils.schemas[s];
this._applyValidation(a, s, D), t[s] = a;
});
}
}
}
}
};
In = Ci;
Ai = (e, t, r) => {
if (!(e && t == null)) {
if (t.findLast) return t.findLast(r);
for (let n = t.length - 1; n >= 0; n--) {
let u = t[n];
if (r(u, n, t)) return u;
}
}
};
er = Ai;
jn = { astFormat: "estree", printer: {}, originalText: void 0, locStart: null, locEnd: null };
se = vi;
$n = Me(Wn(), 1);
fe = xi;
Un = Oi;
zn = Si;
Gn = Ti;
ki = (e, t, r) => {
if (!(e && t == null)) {
if (t.findLastIndex) return t.findLastIndex(r);
for (let n = t.length - 1; n >= 0; n--) {
let u = t[n];
if (r(u, n, t)) return n;
}
return -1;
}
};
Kn = ki;
Li = ({ parser: e }) => e === "json" || e === "json5" || e === "jsonc" || e === "json-stringify";
Xn = /* @__PURE__ */ new Set(["JsonRoot", "ObjectExpression", "ArrayExpression", "StringLiteral", "NumericLiteral", "BooleanLiteral", "NullLiteral", "UnaryExpression", "TemplateLiteral"]);
Yi = /* @__PURE__ */ new Set(["OperationDefinition", "FragmentDefinition", "VariableDefinition", "TypeExtensionDefinition", "ObjectTypeDefinition", "FieldDefinition", "DirectiveDefinition", "EnumTypeDefinition", "EnumValueDefinition", "InputValueDefinition", "InputObjectTypeDefinition", "SchemaDefinition", "OperationTypeDefinition", "InterfaceTypeDefinition", "UnionTypeDefinition", "ScalarTypeDefinition"]);
ru = "\uFEFF";
Zn = /* @__PURE__ */ Symbol("cursor");
ar = {};
Bt(ar, { builders: () => Wi, printer: () => $i, utils: () => Mi });
Wi = { join: Se, line: qe, softline: Lr, hardline: K, literalline: Xe, group: Tt, conditionalGroup: br, fill: Nr, lineSuffix: Ne, lineSuffixBoundary: Tr, cursor: Z, breakParent: Fe, ifBreak: Or, trim: kr, indent: le, indentIfBreak: Sr, align: De, addAlignmentToDoc: Qe, markAsRoot: _r, dedentToRoot: wr, dedent: xr, hardlineWithoutBreakParent: Oe, literallineWithoutBreakParent: kt, label: Pr, concat: (e) => e };
$i = { printDocToString: Ee };
Mi = { willBreak: Mr, traverseDoc: be, findInDoc: Ze, mapDoc: Le, removeLines: Vr, stripTrailingHardline: et, replaceEndOfLine: zr, canBreak: Gr };
lu = "3.4.2";
lr = {};
Bt(lr, { addDanglingComment: () => re, addLeadingComment: () => ue, addTrailingComment: () => ie, getAlignmentSize: () => Ce, getIndentSize: () => cu, getMaxContinuousCount: () => fu, getNextNonSpaceNonCommentCharacter: () => du, getNextNonSpaceNonCommentCharacterIndex: () => ro, getPreferredQuote: () => Fu, getStringWidth: () => Te, hasNewline: () => $, hasNewlineInRange: () => mu, hasSpaces: () => hu, isNextLineEmpty: () => oo, isNextLineEmptyAfterIndex: () => gt, isPreviousLineEmpty: () => uo, makeString: () => Eu, skip: () => ye, skipEverythingButNewLine: () => ut, skipInlineComment: () => ve, skipNewline: () => W, skipSpaces: () => S, skipToLineEnd: () => nt, skipTrailingComment: () => Be, skipWhitespace: () => en });
ve = Ui;
Be = Vi;
We = zi;
gt = Gi;
cu = Ki;
fu = Ji;
du = qi;
yt = "'";
pu = '"';
Fu = Xi;
mu = Qi;
hu = Zi;
Eu = eo;
Cu = de(sr);
ao = de(ot, 0);
Do = { parse: de(iu), formatAST: de(ou), formatDoc: de(su), printToDoc: de(au), printDocToString: de(Du) };
lc = cr;
}
});
// ../../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/plugins/graphql.js
var require_graphql = __commonJS({
"../../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/plugins/graphql.js"(exports, module) {
(function(f) {
function e() {
var i = f();
return i.default || i;
}
if (typeof exports == "object" && typeof module == "object") module.exports = e();
else if (typeof define == "function" && define.amd) define(e);
else {
var t = typeof globalThis < "u" ? globalThis : typeof global < "u" ? global : typeof self < "u" ? self : this || {};
t.prettierPlugins = t.prettierPlugins || {}, t.prettierPlugins.graphql = e();
}
})(function() {
"use strict";
var re2 = Object.defineProperty;
var tt2 = Object.getOwnPropertyDescriptor;
var nt2 = Object.getOwnPropertyNames;
var it2 = Object.prototype.hasOwnProperty;
var Ne2 = (e, t) => {
for (var n in t) re2(e, n, { get: t[n], enumerable: true });
}, rt2 = (e, t, n, r) => {
if (t && typeof t == "object" || typeof t == "function") for (let i of nt2(t)) !it2.call(e, i) && i !== n && re2(e, i, { get: () => t[i], enumerable: !(r = tt2(t, i)) || r.enumerable });
return e;
};
var st2 = (e) => rt2(re2({}, "__esModule", { value: true }), e);
var ln2 = {};
Ne2(ln2, { languages: () => Pe2, options: () => we2, parsers: () => Te2, printers: () => un2 });
var ot2 = (e, t, n, r) => {
if (!(e && t == null)) return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
}, Y2 = ot2;
var se2 = "indent";
var oe2 = "group";
var ae = "if-break";
var P2 = "line";
var ce2 = "break-parent";
var xe2 = () => {
}, b = xe2, ue2 = xe2;
function x2(e) {
return b(e), { type: se2, contents: e };
}
function y2(e, t = {}) {
return b(e), ue2(t.expandedStates, true), { type: oe2, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
}
function O2(e, t = "", n = {}) {
return b(e), t !== "" && b(t), { type: ae, breakContents: e, flatContents: t, groupId: n.groupId };
}
var xt2 = { type: ce2 };
var _t2 = { type: P2, hard: true };
var k2 = { type: P2 }, p = { type: P2, soft: true }, f = [_t2, xt2];
function E(e, t) {
b(e), ue2(t);
let n = [];
for (let r = 0; r < t.length; r++) r !== 0 && n.push(e), n.push(t[r]);
return n;
}
function j(e) {
return (t, n, r) => {
let i = !!(r != null && r.backwards);
if (n === false) return false;
let { length: s } = t, a = n;
for (; a >= 0 && a < s; ) {
let u = t.charAt(a);
if (e instanceof RegExp) {
if (!e.test(u)) return a;
} else if (!e.includes(u)) return a;
i ? a-- : a++;
}
return a === -1 || a === s ? a : false;
};
}
var vn2 = j(/\s/u), G2 = j(" "), _e2 = j(",; "), ye2 = j(/[^\n\r]/u);
function yt2(e, t, n) {
let r = !!(n != null && n.backwards);
if (t === false) return false;
let i = e.charAt(t);
if (r) {
if (e.charAt(t - 1) === "\r" && i === `
`) return t - 2;
if (i === `
` || i === "\r" || i === "\u2028" || i === "\u2029") return t - 1;
} else {
if (i === "\r" && e.charAt(t + 1) === `
`) return t + 2;
if (i === `
` || i === "\r" || i === "\u2028" || i === "\u2029") return t + 1;
}
return t;
}
var $2 = yt2;
function It2(e, t, n = {}) {
let r = G2(e, n.backwards ? t - 1 : t, n), i = $2(e, r, n);
return r !== i;
}
var Ie2 = It2;
function Ot2(e, t) {
if (t === false) return false;
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
}
return t;
}
var Oe2 = Ot2;
function Dt2(e, t) {
return t === false ? false : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? ye2(e, t) : t;
}
var De2 = Dt2;
function At(e, t) {
let n = null, r = t;
for (; r !== n; ) n = r, r = _e2(e, r), r = Oe2(e, r), r = G2(e, r);
return r = De2(e, r), r = $2(e, r), r !== false && Ie2(e, r);
}
var Ae2 = At;
function gt2(e) {
return Array.isArray(e) && e.length > 0;
}
var le2 = gt2;
var pe2 = class extends Error {
name = "UnexpectedNodeError";
constructor(t, n, r = "type") {
super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`), this.node = t;
}
}, ge2 = pe2;
var F = null;
function w2(e) {
if (F !== null && typeof F.property) {
let t = F;
return F = w2.prototype = null, t;
}
return F = w2.prototype = e ?? /* @__PURE__ */ Object.create(null), new w2();
}
var kt2 = 10;
for (let e = 0; e <= kt2; e++) w2();
function fe2(e) {
return w2(e);
}
function St2(e, t = "type") {
fe2(e);
function n(r) {
let i = r[t], s = e[i];
if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${i}'.`), { node: r });
return s;
}
return n;
}
var ke2 = St2;
var J2 = class {
constructor(t, n, r) {
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
}
get [Symbol.toStringTag]() {
return "Location";
}
toJSON() {
return { start: this.start, end: this.end };
}
}, V2 = class {
constructor(t, n, r, i, s, a) {
this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
}
get [Symbol.toStringTag]() {
return "Token";
}
toJSON() {
return { kind: this.kind, value: this.value, line: this.line, column: this.column };
}
}, X = { 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"] }, Hn = new Set(Object.keys(X));
var S2;
(function(e) {
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
})(S2 || (S2 = {}));
var Ct2 = ke2(X, "kind"), Se2 = Ct2;
function q2(e) {
return e.loc.start;
}
function Q2(e) {
return e.loc.end;
}
function Ce2(e) {
return /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u.test(e);
}
function ve2(e) {
return `# @format
` + e;
}
function vt2(e, t, n) {
let { node: r } = e;
if (!r.description) return "";
let i = [n("description")];
return r.kind === "InputValueDefinition" && !r.description.block ? i.push(k2) : i.push(f), i;
}
var A2 = vt2;
function bt2(e, t, n) {
let { node: r } = e;
switch (r.kind) {
case "Document":
return [...E(f, g(e, t, n, "definitions")), f];
case "OperationDefinition": {
let i = t.originalText[q2(r)] !== "{", s = !!r.name;
return [i ? r.operation : "", i && s ? [" ", n("name")] : "", i && !s && le2(r.variableDefinitions) ? " " : "", be2(e, n), _2(e, n, r), !i && !s ? "" : " ", n("selectionSet")];
}
case "FragmentDefinition":
return ["fragment ", n("name"), be2(e, n), " on ", n("typeCondition"), _2(e, n, r), " ", n("selectionSet")];
case "SelectionSet":
return ["{", x2([f, E(f, g(e, t, n, "selections"))]), f, "}"];
case "Field":
return y2([r.alias ? [n("alias"), ": "] : "", n("name"), r.arguments.length > 0 ? y2(["(", x2([p, E([O2("", ", "), p], g(e, t, n, "arguments"))]), p, ")"]) : "", _2(e, n, r), r.selectionSet ? " " : "", n("selectionSet")]);
case "Name":
return r.value;
case "StringValue":
if (r.block) {
let i = Y2(false, r.value, '"""', String.raw`\"""`).split(`
`);
return i.length === 1 && (i[0] = i[0].trim()), i.every((s) => s === "") && (i.length = 0), E(f, ['"""', ...i, '"""']);
}
return ['"', Y2(false, Y2(false, r.value, /["\\]/gu, String.raw`\$&`), `
`, String.raw`\n`), '"'];
case "IntValue":
case "FloatValue":
case "EnumValue":
return r.value;
case "BooleanValue":
return r.value ? "true" : "false";
case "NullValue":
return "null";
case "Variable":
return ["$", n("name")];
case "ListValue":
return y2(["[", x2([p, E([O2("", ", "), p], e.map(n, "values"))]), p, "]"]);
case "ObjectValue": {
let i = t.bracketSpacing && r.fields.length > 0 ? " " : "";
return y2(["{", i, x2([p, E([O2("", ", "), p], e.map(n, "fields"))]), p, O2("", i), "}"]);
}
case "ObjectField":
case "Argument":
return [n("name"), ": ", n("value")];
case "Directive":
return ["@", n("name"), r.arguments.length > 0 ? y2(["(", x2([p, E([O2("", ", "), p], g(e, t, n, "arguments"))]), p, ")"]) : ""];
case "NamedType":
return n("name");
case "VariableDefinition":
return [n("variable"), ": ", n("type"), r.defaultValue ? [" = ", n("defaultValue")] : "", _2(e, n, r)];
case "ObjectTypeExtension":
case "ObjectTypeDefinition":
case "InputObjectTypeExtension":
case "InputObjectTypeDefinition":
case "InterfaceTypeExtension":
case "InterfaceTypeDefinition": {
let { kind: i } = r, s = [];
return i.endsWith("TypeDefinition") ? s.push(A2(e, t, n)) : s.push("extend "), i.startsWith("ObjectType") ? s.push("type") : i.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !i.startsWith("InputObjectType") && r.interfaces.length > 0 && s.push(" implements ", ...Pt2(e, t, n)), s.push(_2(e, n, r)), r.fields.length > 0 && s.push([" {", x2([f, E(f, g(e, t, n, "fields"))]), f, "}"]), s;
}
case "FieldDefinition":
return [A2(e, t, n), n("name"), r.arguments.length > 0 ? y2(["(", x2([p, E([O2("", ", "), p], g(e, t, n, "arguments"))]), p, ")"]) : "", ": ", n("type"), _2(e, n, r)];
case "DirectiveDefinition":
return [A2(e, t, n), "directive ", "@", n("name"), r.arguments.length > 0 ? y2(["(", x2([p, E([O2("", ", "), p], g(e, t, n, "arguments"))]), p, ")"]) : "", r.repeatable ? " repeatable" : "", " on ", ...E(" | ", e.map(n, "locations"))];
case "EnumTypeExtension":
case "EnumTypeDefinition":
return [A2(e, t, n), r.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), _2(e, n, r), r.values.length > 0 ? [" {", x2([f, E(f, g(e, t, n, "values"))]), f, "}"] : ""];
case "EnumValueDefinition":
return [A2(e, t, n), n("name"), _2(e, n, r)];
case "InputValueDefinition":
return [A2(e, t, n), n("name"), ": ", n("type"), r.defaultValue ? [" = ", n("defaultValue")] : "", _2(e, n, r)];
case "SchemaExtension":
return ["extend schema", _2(e, n, r), ...r.operationTypes.length > 0 ? [" {", x2([f, E(f, g(e, t, n, "operationTypes"))]), f, "}"] : []];
case "SchemaDefinition":
return [A2(e, t, n), "schema", _2(e, n, r), " {", r.operationTypes.length > 0 ? x2([f, E(f, g(e, t, n, "operationTypes"))]) : "", f, "}"];
case "OperationTypeDefinition":
return [r.operation, ": ", n("type")];
case "FragmentSpread":
return ["...", n("name"), _2(e, n, r)];
case "InlineFragment":
return ["...", r.typeCondition ? [" on ", n("typeCondition")] : "", _2(e, n, r), " ", n("selectionSet")];
case "UnionTypeExtension":
case "UnionTypeDefinition":
return y2([A2(e, t, n), y2([r.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), _2(e, n, r), r.types.length > 0 ? [" =", O2("", " "), x2([O2([k2, "| "]), E([k2, "| "], e.map(n, "types"))])] : ""])]);
case "ScalarTypeExtension":
case "ScalarTypeDefinition":
return [A2(e, t, n), r.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), _2(e, n, r)];
case "NonNullType":
return [n("type"), "!"];
case "ListType":
return ["[", n("type"), "]"];
default:
throw new ge2(r, "Graphql", "kind");
}
}
function _2(e, t, n) {
if (n.directives.length === 0) return "";
let r = E(k2, e.map(t, "directives"));
return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y2([k2, r]) : [" ", y2(x2([p, r]))];
}
function g(e, t, n, r) {
return e.map(({ isLast: i, node: s }) => {
let a = n();
return !i && Ae2(t.originalText, Q2(s)) ? [a, f] : a;
}, r);
}
function Lt2(e) {
return e.kind !== "Comment";
}
function Rt2(e) {
let t = e.node;
if (t.kind === "Comment") return "#" + t.value.trimEnd();
throw new Error("Not a comment: " + JSON.stringify(t));
}
function Pt2(e, t, n) {
let { node: r } = e, i = [], { interfaces: s } = r, a = e.map(n, "interfaces");
for (let u = 0; u < s.length; u++) {
let l = s[u];
i.push(a[u]);
let T2 = s[u + 1];
if (T2) {
let D = t.originalText.slice(l.loc.end, T2.loc.start).includes("#");
i.push(" &", D ? k2 : " ");
}
}
return i;
}
function be2(e, t) {
let { node: n } = e;
return le2(n.variableDefinitions) ? y2(["(", x2([p, E([O2("", ", "), p], e.map(t, "variableDefinitions"))]), p, ")"]) : "";
}
function Le2(e, t) {
e.kind === "StringValue" && e.block && !e.value.includes(`
`) && (t.value = e.value.trim());
}
Le2.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
function Ft2(e) {
var n;
let { node: t } = e;
return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((r) => r.value.trim() === "prettier-ignore");
}
var wt2 = { print: bt2, massageAstNode: Le2, hasPrettierIgnore: Ft2, insertPragma: ve2, printComment: Rt2, canAttachComment: Lt2, getVisitorKeys: Se2 }, Re2 = wt2;
var Pe2 = [{ linguistLanguageId: 139, name: "GraphQL", type: "data", color: "#e10098", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", aceMode: "text", parsers: ["graphql"], vscodeLanguageIds: ["graphql"] }];
var Fe2 = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
var Vt2 = { bracketSpacing: Fe2.bracketSpacing }, we2 = Vt2;
var Te2 = {};
Ne2(Te2, { graphql: () => cn2 });
function Ve2(e) {
return typeof e == "object" && e !== null;
}
function Be2(e, t) {
if (!!!e) throw new Error(t ?? "Unexpected invariant triggered.");
}
var Bt2 = /\r\n|[\n\r]/g;
function B2(e, t) {
let n = 0, r = 1;
for (let i of e.body.matchAll(Bt2)) {
if (typeof i.index == "number" || Be2(false), i.index >= t) break;
n = i.index + i[0].length, r += 1;
}
return { line: r, column: t + 1 - n };
}
function Me2(e) {
return he2(e.source, B2(e.source, e.start));
}
function he2(e, t) {
let n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, l = t.column + u, T2 = `${e.name}:${a}:${l}
`, h = r.split(/\r\n|[\n\r]/g), D = h[i];
if (D.length > 120) {
let I2 = Math.floor(l / 80), ie2 = l % 80, N2 = [];
for (let v = 0; v < D.length; v += 80) N2.push(D.slice(v, v + 80));
return T2 + Ue2([[`${a} |`, N2[0]], ...N2.slice(1, I2 + 1).map((v) => ["|", v]), ["|", "^".padStart(ie2)], ["|", N2[I2 + 1]]]);
}
return T2 + Ue2([[`${a - 1} |`, h[i - 1]], [`${a} |`, D], ["|", "^".padStart(l)], [`${a + 1} |`, h[i + 1]]]);
}
function Ue2(e) {
let t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
`);
}
function Ut2(e) {
let t = e[0];
return t == null || "kind" in t || "length" in t ? { nodes: t, source: e[1], positions: e[2], path: e[3], originalError: e[4], extensions: e[5] } : t;
}
var W2 = class e extends Error {
constructor(t, ...n) {
var r, i, s;
let { nodes: a, source: u, positions: l, path: T2, originalError: h, extensions: D } = Ut2(n);
super(t), this.name = "GraphQLError", this.path = T2 ?? void 0, this.originalError = h ?? void 0, this.nodes = Ye2(Array.isArray(a) ? a : a ? [a] : void 0);
let I2 = Ye2((r = this.nodes) === null || r === void 0 ? void 0 : r.map((N2) => N2.loc).filter((N2) => N2 != null));
this.source = u ?? (I2 == null || (i = I2[0]) === null || i === void 0 ? void 0 : i.source), this.positions = l ?? (I2 == null ? void 0 : I2.map((N2) => N2.start)), this.locations = l && u ? l.map((N2) => B2(u, N2)) : I2 == null ? void 0 : I2.map((N2) => B2(N2.source, N2.start));
let ie2 = Ve2(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
this.extensions = (s = D ?? ie2) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: true, enumerable: true }, name: { enumerable: false }, nodes: { enumerable: false }, source: { enumerable: false }, positions: { enumerable: false }, originalError: { enumerable: false } }), h != null && h.stack ? Object.defineProperty(this, "stack", { value: h.stack, writable: true, configurable: true }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: true, configurable: true });
}
get [Symbol.toStringTag]() {
return "GraphQLError";
}
toString() {
let t = this.message;
if (this.nodes) for (let n of this.nodes) n.loc && (t += `
` + Me2(n.loc));
else if (this.source && this.locations) for (let n of this.locations) t += `
` + he2(this.source, n);
return t;
}
toJSON() {
let t = { message: this.message };
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
}
};
function Ye2(e) {
return e === void 0 || e.length === 0 ? void 0 : e;
}
function d(e, t, n) {
return new W2(`Syntax Error: ${n}`, { source: e, positions: [t] });
}
var H2;
(function(e) {
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
})(H2 || (H2 = {}));
var c;
(function(e) {
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
})(c || (c = {}));
function je2(e) {
return e === 9 || e === 32;
}
function L2(e) {
return e >= 48 && e <= 57;
}
function Ge2(e) {
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
}
function de2(e) {
return Ge2(e) || e === 95;
}
function $e(e) {
return Ge2(e) || L2(e) || e === 95;
}
function Je2(e) {
var t;
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
for (let a = 0; a < e.length; ++a) {
var s;
let u = e[a], l = Mt2(u);
l !== u.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && l < n && (n = l));
}
return e.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = r) !== null && t !== void 0 ? t : 0, i + 1);
}
function Mt2(e) {
let t = 0;
for (; t < e.length && je2(e.charCodeAt(t)); ) ++t;
return t;
}
var o;
(function(e) {
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
})(o || (o = {}));
var z2 = class {
constructor(t) {
let n = new V2(o.SOF, 0, 0, 0, 0);
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
}
get [Symbol.toStringTag]() {
return "Lexer";
}
advance() {
return this.lastToken = this.token, this.token = this.lookahead();
}
lookahead() {
let t = this.token;
if (t.kind !== o.EOF) do
if (t.next) t = t.next;
else {
let n = Yt2(this, t.end);
t.next = n, n.prev = t, t = n;
}
while (t.kind === o.COMMENT);
return t;
}
};
function qe2(e) {
return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
}
function R2(e) {
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
}
function K2(e, t) {
return Qe2(e.charCodeAt(t)) && We2(e.charCodeAt(t + 1));
}
function Qe2(e) {
return e >= 55296 && e <= 56319;
}
function We2(e) {
return e >= 56320 && e <= 57343;
}
function C(e, t) {
let n = e.source.body.codePointAt(t);
if (n === void 0) return o.EOF;
if (n >= 32 && n <= 126) {
let r = String.fromCodePoint(n);
return r === '"' ? `'"'` : `"${r}"`;
}
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
}
function m(e, t, n, r, i) {
let s = e.line, a = 1 + n - e.lineStart;
return new V2(t, n, r, s, a, i);
}
function Yt2(e, t) {
let n = e.source.body, r = n.length, i = t;
for (; i < r; ) {
let s = n.charCodeAt(i);
switch (s) {
case 65279:
case 9:
case 32:
case 44:
++i;
continue;
case 10:
++i, ++e.line, e.lineStart = i;
continue;
case 13:
n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
continue;
case 35:
return jt2(e, i);
case 33:
return m(e, o.BANG, i, i + 1);
case 36:
return m(e, o.DOLLAR, i, i + 1);
case 38:
return m(e, o.AMP, i, i + 1);
case 40:
return m(e, o.PAREN_L, i, i + 1);
case 41:
return m(e, o.PAREN_R, i, i + 1);
case 46:
if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46) return m(e, o.SPREAD, i, i + 3);
break;
case 58:
return m(e, o.COLON, i, i + 1);
case 61:
return m(e, o.EQUALS, i, i + 1);
case 64:
return m(e, o.AT, i, i + 1);
case 91:
return m(e, o.BRACKET_L, i, i + 1);
case 93:
return m(e, o.BRACKET_R, i, i + 1);
case 123:
return m(e, o.BRACE_L, i, i + 1);
case 124:
return m(e, o.PIPE, i, i + 1);
case 125:
return m(e, o.BRACE_R, i, i + 1);
case 34:
return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Qt2(e, i) : $t2(e, i);
}
if (L2(s) || s === 45) return Gt2(e, i, s);
if (de2(s)) return Wt2(e, i);
throw d(e.source, i, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : R2(s) || K2(n, i) ? `Unexpected character: ${C(e, i)}.` : `Invalid character: ${C(e, i)}.`);
}
return m(e, o.EOF, r, r);
}
function jt2(e, t) {
let n = e.source.body, r = n.length, i = t + 1;
for (; i < r; ) {
let s = n.charCodeAt(i);
if (s === 10 || s === 13) break;
if (R2(s)) ++i;
else if (K2(n, i)) i += 2;
else break;
}
return m(e, o.COMMENT, t, i, n.slice(t + 1, i));
}
function Gt2(e, t, n) {
let r = e.source.body, i = t, s = n, a = false;
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
if (s = r.charCodeAt(++i), L2(s)) throw d(e.source, i, `Invalid number, unexpected digit after 0: ${C(e, i)}.`);
} else i = me2(e, i, s), s = r.charCodeAt(i);
if (s === 46 && (a = true, s = r.charCodeAt(++i), i = me2(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = true, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = me2(e, i, s), s = r.charCodeAt(i)), s === 46 || de2(s)) throw d(e.source, i, `Invalid number, expected digit but got: ${C(e, i)}.`);
return m(e, a ? o.FLOAT : o.INT, t, i, r.slice(t, i));
}
function me2(e, t, n) {
if (!L2(n)) throw d(e.source, t, `Invalid number, expected digit but got: ${C(e, t)}.`);
let r = e.source.body, i = t + 1;
for (; L2(r.charCodeAt(i)); ) ++i;
return i;
}
function $t2(e, t) {
let n = e.source.body, r = n.length, i = t + 1, s = i, a = "";
for (; i < r; ) {
let u = n.charCodeAt(i);
if (u === 34) return a += n.slice(s, i), m(e, o.STRING, t, i + 1, a);
if (u === 92) {
a += n.slice(s, i);
let l = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Jt2(e, i) : Xt2(e, i) : qt2(e, i);
a += l.value, i += l.size, s = i;
continue;
}
if (u === 10 || u === 13) break;
if (R2(u)) ++i;
else if (K2(n, i)) i += 2;
else throw d(e.source, i, `Invalid character within String: ${C(e, i)}.`);
}
throw d(e.source, i, "Unterminated string.");
}
function Jt2(e, t) {
let n = e.source.body, r = 0, i = 3;
for (; i < 12; ) {
let s = n.charCodeAt(t + i++);
if (s === 125) {
if (i < 5 || !R2(r)) break;
return { value: String.fromCodePoint(r), size: i };
}
if (r = r << 4 | U2(s), r < 0) break;
}
throw d(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + i)}".`);
}
function Xt2(e, t) {
let n = e.source.body, r = Xe2(n, t + 2);
if (R2(r)) return { value: String.fromCodePoint(r), size: 6 };
if (Qe2(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
let i = Xe2(n, t + 8);
if (We2(i)) return { value: String.fromCodePoint(r, i), size: 12 };
}
throw d(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
}
function Xe2(e, t) {
return U2(e.charCodeAt(t)) << 12 | U2(e.charCodeAt(t + 1)) << 8 | U2(e.charCodeAt(t + 2)) << 4 | U2(e.charCodeAt(t + 3));
}
function U2(e) {
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
}
function qt2(e, t) {
let n = e.source.body;
switch (n.charCodeAt(t + 1)) {
case 34:
return { value: '"', size: 2 };
case 92:
return { value: "\\", size: 2 };
case 47:
return { value: "/", size: 2 };
case 98:
return { value: "\b", size: 2 };
case 102:
return { value: "\f", size: 2 };
case 110:
return { value: `
`, size: 2 };
case 114:
return { value: "\r", size: 2 };
case 116:
return { value: " ", size: 2 };
}
throw d(e.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
}
function Qt2(e, t) {
let n = e.source.body, r = n.length, i = e.lineStart, s = t + 3, a = s, u = "", l = [];
for (; s < r; ) {
let T2 = n.charCodeAt(s);
if (T2 === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
u += n.slice(a, s), l.push(u);
let h = m(e, o.BLOCK_STRING, t, s + 3, Je2(l).join(`
`));
return e.line += l.length - 1, e.lineStart = i, h;
}
if (T2 === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
u += n.slice(a, s), a = s + 1, s += 4;
continue;
}
if (T2 === 10 || T2 === 13) {
u += n.slice(a, s), l.push(u), T2 === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, i = s;
continue;
}
if (R2(T2)) ++s;
else if (K2(n, s)) s += 2;
else throw d(e.source, s, `Invalid character within String: ${C(e, s)}.`);
}
throw d(e.source, s, "Unterminated string.");
}
function Wt2(e, t) {
let n = e.source.body, r = n.length, i = t + 1;
for (; i < r; ) {
let s = n.charCodeAt(i);
if ($e(s)) ++i;
else break;
}
return m(e, o.NAME, t, i, n.slice(t, i));
}
function Z2(e, t) {
if (!!!e) throw new Error(t);
}
function ee2(e) {
return te2(e, []);
}
function te2(e, t) {
switch (typeof e) {
case "string":
return JSON.stringify(e);
case "function":
return e.name ? `[function ${e.name}]` : "[function]";
case "object":
return Ht2(e, t);
default:
return String(e);
}
}
function Ht2(e, t) {
if (e === null) return "null";
if (t.includes(e)) return "[Circular]";
let n = [...t, e];
if (zt2(e)) {
let r = e.toJSON();
if (r !== e) return typeof r == "string" ? r : te2(r, n);
} else if (Array.isArray(e)) return Zt2(e, n);
return Kt2(e, n);
}
function zt2(e) {
return typeof e.toJSON == "function";
}
function Kt2(e, t) {
let n = Object.entries(e);
return n.length === 0 ? "{}" : t.length > 2 ? "[" + en2(e) + "]" : "{ " + n.map(([i, s]) => i + ": " + te2(s, t)).join(", ") + " }";
}
function Zt2(e, t) {
if (e.length === 0) return "[]";
if (t.length > 2) return "[Array]";
let n = Math.min(10, e.length), r = e.length - n, i = [];
for (let s = 0; s < n; ++s) i.push(te2(e[s], t));
return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
}
function en2(e) {
let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
if (t === "Object" && typeof e.constructor == "function") {
let n = e.constructor.name;
if (typeof n == "string" && n !== "") return n;
}
return t;
}
var tn2 = globalThis.process && true, He2 = tn2 ? function(t, n) {
return t instanceof n;
} : function(t, n) {
if (t instanceof n) return true;
if (typeof t == "object" && t !== null) {
var r;
let i = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name;
if (i === s) {
let a = ee2(t);
throw new Error(`Cannot use ${i} "${a}" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
https://yarnpkg.com/en/docs/selective-version-resolutions
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.`);
}
}
return false;
};
var M2 = class {
constructor(t, n = "GraphQL request", r = { line: 1, column: 1 }) {
typeof t == "string" || Z2(false, `Body must be a string. Received: ${ee2(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Z2(false, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || Z2(false, "column in locationOffset is 1-indexed and must be positive.");
}
get [Symbol.toStringTag]() {
return "Source";
}
};
function ze2(e) {
return He2(e, M2);
}
function Ke2(e, t) {
return new Ee2(e, t).parseDocument();
}
var Ee2 = class {
constructor(t, n = {}) {
let r = ze2(t) ? t : new M2(t);
this._lexer = new z2(r), this._options = n, this._tokenCounter = 0;
}
parseName() {
let t = this.expectToken(o.NAME);
return this.node(t, { kind: c.NAME, value: t.value });
}
parseDocument() {
return this.node(this._lexer.token, { kind: c.DOCUMENT, definitions: this.many(o.SOF, this.parseDefinition, o.EOF) });
}
parseDefinition() {
if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
if (n.kind === o.NAME) {
switch (n.value) {
case "schema":
return this.parseSchemaDefinition();
case "scalar":
return this.parseScalarTypeDefinition();
case "type":
return this.parseObjectTypeDefinition();
case "interface":
return this.parseInterfaceTypeDefinition();
case "union":
return this.parseUnionTypeDefinition();
case "enum":
return this.parseEnumTypeDefinition();
case "input":
return this.parseInputObjectTypeDefinition();
case "directive":
return this.parseDirectiveDefinition();
}
if (t) throw d(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions.");
switch (n.value) {
case "query":
case "mutation":
case "subscription":
return this.parseOperationDefinition();
case "fragment":
return this.parseFragmentDefinition();
case "extend":
return this.parseTypeSystemExtension();
}
}
throw this.unexpected(n);
}
parseOperationDefinition() {
let t = this._lexer.token;
if (this.peek(o.BRACE_L)) return this.node(t, { kind: c.OPERATION_DEFINITION, operation: S2.QUERY, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
let n = this.parseOperationType(), r;
return this.peek(o.NAME) && (r = this.parseName()), this.node(t, { kind: c.OPERATION_DEFINITION, operation: n, name: r, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
}
parseOperationType() {
let t = this.expectToken(o.NAME);
switch (t.value) {
case "query":
return S2.QUERY;
case "mutation":
return S2.MUTATION;
case "subscription":
return S2.SUBSCRIPTION;
}
throw this.unexpected(t);
}
parseVariableDefinitions() {
return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
}
parseVariableDefinition() {
return this.node(this._lexer.token, { kind: c.VARIABLE_DEFINITION, variable: this.parseVariable(), type: (this.expectToken(o.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() });
}
parseVariable() {
let t = this._lexer.token;
return this.expectToken(o.DOLLAR), this.node(t, { kind: c.VARIABLE, name: this.parseName() });
}
parseSelectionSet() {
return this.node(this._lexer.token, { kind: c.SELECTION_SET, selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R) });
}
parseSelection() {
return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
}
parseField() {
let t = this._lexer.token, n = this.parseName(), r, i;
return this.expectOptionalToken(o.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, { kind: c.FIELD, alias: r, name: i, arguments: this.parseArguments(false), directives: this.parseDirectives(false), selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0 });
}
parseArguments(t) {
let n = t ? this.parseConstArgument : this.parseArgument;
return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
}
parseArgument(t = false) {
let n = this._lexer.token, r = this.parseName();
return this.expectToken(o.COLON), this.node(n, { kind: c.ARGUMENT, name: r, value: this.parseValueLiteral(t) });
}
parseConstArgument() {
return this.parseArgument(true);
}
parseFragment() {
let t = this._lexer.token;
this.expectToken(o.SPREAD);
let n = this.expectOptionalKeyword("on");
return !n && this.peek(o.NAME) ? this.node(t, { kind: c.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(false) }) : this.node(t, { kind: c.INLINE_FRAGMENT, typeCondition: n ? this.parseNamedType() : void 0, directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
}
parseFragmentDefinition() {
let t = this._lexer.token;
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === true ? this.node(t, { kind: c.FRAGMENT_DEFINITION, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() }) : this.node(t, { kind: c.FRAGMENT_DEFINITION, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
}
parseFragmentName() {
if (this._lexer.token.value === "on") throw this.unexpected();
return this.parseName();
}
parseValueLiteral(t) {
let n = this._lexer.token;
switch (n.kind) {
case o.BRACKET_L:
return this.parseList(t);
case o.BRACE_L:
return this.parseObject(t);
case o.INT:
return this.advanceLexer(), this.node(n, { kind: c.INT, value: n.value });
case o.FLOAT:
return this.advanceLexer(), this.node(n, { kind: c.FLOAT, value: n.value });
case o.STRING:
case o.BLOCK_STRING:
return this.parseStringLiteral();
case o.NAME:
switch (this.advanceLexer(), n.value) {
case "true":
return this.node(n, { kind: c.BOOLEAN, value: true });
case "false":
return this.node(n, { kind: c.BOOLEAN, value: false });
case "null":
return this.node(n, { kind: c.NULL });
default:
return this.node(n, { kind: c.ENUM, value: n.value });
}
case o.DOLLAR:
if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
let r = this._lexer.token.value;
throw d(this._lexer.source, n.start, `Unexpected variable "$${r}" in constant value.`);
} else throw this.unexpected(n);
return this.parseVariable();
default:
throw this.unexpected();
}
}
parseConstValueLiteral() {
return this.parseValueLiteral(true);
}
parseStringLiteral() {
let t = this._lexer.token;
return this.advanceLexer(), this.node(t, { kind: c.STRING, value: t.value, block: t.kind === o.BLOCK_STRING });
}
parseList(t) {
let n = () => this.parseValueLiteral(t);
return this.node(this._lexer.token, { kind: c.LIST, values: this.any(o.BRACKET_L, n, o.BRACKET_R) });
}
parseObject(t) {
let n = () => this.parseObjectField(t);
return this.node(this._lexer.token, { kind: c.OBJECT, fields: this.any(o.BRACE_L, n, o.BRACE_R) });
}
parseObjectField(t) {
let n = this._lexer.token, r = this.parseName();
return this.expectToken(o.COLON), this.node(n, { kind: c.OBJECT_FIELD, name: r, value: this.parseValueLiteral(t) });
}
parseDirectives(t) {
let n = [];
for (; this.peek(o.AT); ) n.push(this.parseDirective(t));
return n;
}
parseConstDirectives() {
return this.parseDirectives(true);
}
parseDirective(t) {
let n = this._lexer.token;
return this.expectToken(o.AT), this.node(n, { kind: c.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(t) });
}
parseTypeReference() {
let t = this._lexer.token, n;
if (this.expectOptionalToken(o.BRACKET_L)) {
let r = this.parseTypeReference();
this.expectToken(o.BRACKET_R), n = this.node(t, { kind: c.LIST_TYPE, type: r });
} else n = this.parseNamedType();
return this.expectOptionalToken(o.BANG) ? this.node(t, { kind: c.NON_NULL_TYPE, type: n }) : n;
}
parseNamedType() {
return this.node(this._lexer.token, { kind: c.NAMED_TYPE, name: this.parseName() });
}
peekDescription() {
return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
}
parseDescription() {
if (this.peekDescription()) return this.parseStringLiteral();
}
parseSchemaDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("schema");
let r = this.parseConstDirectives(), i = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
return this.node(t, { kind: c.SCHEMA_DEFINITION, description: n, directives: r, operationTypes: i });
}
parseOperationTypeDefinition() {
let t = this._lexer.token, n = this.parseOperationType();
this.expectToken(o.COLON);
let r = this.parseNamedType();
return this.node(t, { kind: c.OPERATION_TYPE_DEFINITION, operation: n, type: r });
}
parseScalarTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("scalar");
let r = this.parseName(), i = this.parseConstDirectives();
return this.node(t, { kind: c.SCALAR_TYPE_DEFINITION, description: n, name: r, directives: i });
}
parseObjectTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("type");
let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
return this.node(t, { kind: c.OBJECT_TYPE_DEFINITION, description: n, name: r, interfaces: i, directives: s, fields: a });
}
parseImplementsInterfaces() {
return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
}
parseFieldsDefinition() {
return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
}
parseFieldDefinition() {
let t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
this.expectToken(o.COLON);
let s = this.parseTypeReference(), a = this.parseConstDirectives();
return this.node(t, { kind: c.FIELD_DEFINITION, description: n, name: r, arguments: i, type: s, directives: a });
}
parseArgumentDefs() {
return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
}
parseInputValueDef() {
let t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
this.expectToken(o.COLON);
let i = this.parseTypeReference(), s;
this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
let a = this.parseConstDirectives();
return this.node(t, { kind: c.INPUT_VALUE_DEFINITION, description: n, name: r, type: i, defaultValue: s, directives: a });
}
parseInterfaceTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("interface");
let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
return this.node(t, { kind: c.INTERFACE_TYPE_DEFINITION, description: n, name: r, interfaces: i, directives: s, fields: a });
}
parseUnionTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("union");
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
return this.node(t, { kind: c.UNION_TYPE_DEFINITION, description: n, name: r, directives: i, types: s });
}
parseUnionMemberTypes() {
return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
}
parseEnumTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("enum");
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
return this.node(t, { kind: c.ENUM_TYPE_DEFINITION, description: n, name: r, directives: i, values: s });
}
parseEnumValuesDefinition() {
return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
}
parseEnumValueDefinition() {
let t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
return this.node(t, { kind: c.ENUM_VALUE_DEFINITION, description: n, name: r, directives: i });
}
parseEnumValueName() {
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw d(this._lexer.source, this._lexer.token.start, `${ne2(this._lexer.token)} is reserved and cannot be used for an enum value.`);
return this.parseName();
}
parseInputObjectTypeDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("input");
let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
return this.node(t, { kind: c.INPUT_OBJECT_TYPE_DEFINITION, description: n, name: r, directives: i, fields: s });
}
parseInputFieldsDefinition() {
return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
}
parseTypeSystemExtension() {
let t = this._lexer.lookahead();
if (t.kind === o.NAME) switch (t.value) {
case "schema":
return this.parseSchemaExtension();
case "scalar":
return this.parseScalarTypeExtension();
case "type":
return this.parseObjectTypeExtension();
case "interface":
return this.parseInterfaceTypeExtension();
case "union":
return this.parseUnionTypeExtension();
case "enum":
return this.parseEnumTypeExtension();
case "input":
return this.parseInputObjectTypeExtension();
}
throw this.unexpected(t);
}
parseSchemaExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("schema");
let n = this.parseConstDirectives(), r = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
if (n.length === 0 && r.length === 0) throw this.unexpected();
return this.node(t, { kind: c.SCHEMA_EXTENSION, directives: n, operationTypes: r });
}
parseScalarTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("scalar");
let n = this.parseName(), r = this.parseConstDirectives();
if (r.length === 0) throw this.unexpected();
return this.node(t, { kind: c.SCALAR_TYPE_EXTENSION, name: n, directives: r });
}
parseObjectTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("type");
let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
if (r.length === 0 && i.length === 0 && s.length === 0) throw this.unexpected();
return this.node(t, { kind: c.OBJECT_TYPE_EXTENSION, name: n, interfaces: r, directives: i, fields: s });
}
parseInterfaceTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("interface");
let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
if (r.length === 0 && i.length === 0 && s.length === 0) throw this.unexpected();
return this.node(t, { kind: c.INTERFACE_TYPE_EXTENSION, name: n, interfaces: r, directives: i, fields: s });
}
parseUnionTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("union");
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
if (r.length === 0 && i.length === 0) throw this.unexpected();
return this.node(t, { kind: c.UNION_TYPE_EXTENSION, name: n, directives: r, types: i });
}
parseEnumTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("enum");
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
if (r.length === 0 && i.length === 0) throw this.unexpected();
return this.node(t, { kind: c.ENUM_TYPE_EXTENSION, name: n, directives: r, values: i });
}
parseInputObjectTypeExtension() {
let t = this._lexer.token;
this.expectKeyword("extend"), this.expectKeyword("input");
let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
if (r.length === 0 && i.length === 0) throw this.unexpected();
return this.node(t, { kind: c.INPUT_OBJECT_TYPE_EXTENSION, name: n, directives: r, fields: i });
}
parseDirectiveDefinition() {
let t = this._lexer.token, n = this.parseDescription();
this.expectKeyword("directive"), this.expectToken(o.AT);
let r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
this.expectKeyword("on");
let a = this.parseDirectiveLocations();
return this.node(t, { kind: c.DIRECTIVE_DEFINITION, description: n, name: r, arguments: i, repeatable: s, locations: a });
}
parseDirectiveLocations() {
return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
}
parseDirectiveLocation() {
let t = this._lexer.token, n = this.parseName();
if (Object.prototype.hasOwnProperty.call(H2, n.value)) return n;
throw this.unexpected(t);
}
node(t, n) {
return this._options.noLocation !== true && (n.loc = new J2(t, this._lexer.lastToken, this._lexer.source)), n;
}
peek(t) {
return this._lexer.token.kind === t;
}
expectToken(t) {
let n = this._lexer.token;
if (n.kind === t) return this.advanceLexer(), n;
throw d(this._lexer.source, n.start, `Expected ${Ze2(t)}, found ${ne2(n)}.`);
}
expectOptionalToken(t) {
return this._lexer.token.kind === t ? (this.advanceLexer(), true) : false;
}
expectKeyword(t) {
let n = this._lexer.token;
if (n.kind === o.NAME && n.value === t) this.advanceLexer();
else throw d(this._lexer.source, n.start, `Expected "${t}", found ${ne2(n)}.`);
}
expectOptionalKeyword(t) {
let n = this._lexer.token;
return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), true) : false;
}
unexpected(t) {
let n = t ?? this._lexer.token;
return d(this._lexer.source, n.start, `Unexpected ${ne2(n)}.`);
}
any(t, n, r) {
this.expectToken(t);
let i = [];
for (; !this.expectOptionalToken(r); ) i.push(n.call(this));
return i;
}
optionalMany(t, n, r) {
if (this.expectOptionalToken(t)) {
let i = [];
do
i.push(n.call(this));
while (!this.expectOptionalToken(r));
return i;
}
return [];
}
many(t, n, r) {
this.expectToken(t);
let i = [];
do
i.push(n.call(this));
while (!this.expectOptionalToken(r));
return i;
}
delimitedMany(t, n) {
this.expectOptionalToken(t);
let r = [];
do
r.push(n.call(this));
while (this.expectOptionalToken(t));
return r;
}
advanceLexer() {
let { maxTokens: t } = this._options, n = this._lexer.advance();
if (t !== void 0 && n.kind !== o.EOF && (++this._tokenCounter, this._tokenCounter > t)) throw d(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
}
};
function ne2(e) {
let t = e.value;
return Ze2(e.kind) + (t != null ? ` "${t}"` : "");
}
function Ze2(e) {
return qe2(e) ? `"${e}"` : e;
}
function nn2(e, t) {
let n = new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
return Object.assign(n, t);
}
var et2 = nn2;
function rn2(e) {
let t = [], { startToken: n, endToken: r } = e.loc;
for (let i = n; i !== r; i = i.next) i.kind === "Comment" && t.push({ ...i, loc: { start: i.start, end: i.end } });
return t;
}
var sn2 = { allowLegacyFragmentVariables: true };
function on2(e) {
if ((e == null ? void 0 : e.name) === "GraphQLError") {
let { message: t, locations: [n] } = e;
return et2(t, { loc: { start: n }, cause: e });
}
return e;
}
function an2(e) {
let t;
try {
t = Ke2(e, sn2);
} catch (n) {
throw on2(n);
}
return t.comments = rn2(t), t;
}
var cn2 = { parse: an2, astFormat: "graphql", hasPragma: Ce2, locStart: q2, locEnd: Q2 };
var un2 = { graphql: Re2 };
return st2(ln2);
});
}
});
// ../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/GraphQLWorker.js
var require_GraphQLWorker = __commonJS({
"../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/GraphQLWorker.js"(exports) {
"use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P2, generator) {
function adopt(value) {
return value instanceof P2 ? value : new P2(function(resolve2) {
resolve2(value);
});
}
return new (P2 || (P2 = Promise))(function(resolve2, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLWorker = void 0;
exports.create = create;
var graphql_language_service_1 = require_dist();
var LanguageService_1 = require_LanguageService();
var utils_1 = require_utils3();
var GraphQLWorker = class {
constructor(ctx, createData) {
this._ctx = ctx;
this._languageService = new LanguageService_1.LanguageService(createData.languageConfig);
this._formattingOptions = createData.formattingOptions;
}
doValidation(uri) {
return __awaiter(this, void 0, void 0, function* () {
try {
const documentModel = this._getTextModel(uri);
const document2 = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getValue();
if (!document2) {
return [];
}
const graphqlDiagnostics = this._languageService.getDiagnostics(uri, document2);
return graphqlDiagnostics.map(utils_1.toMarkerData);
} catch (err) {
console.error(err);
return [];
}
});
}
doComplete(uri, position) {
return __awaiter(this, void 0, void 0, function* () {
try {
const documentModel = this._getTextModel(uri);
const document2 = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getValue();
if (!document2) {
return [];
}
const graphQLPosition = (0, utils_1.toGraphQLPosition)(position);
const suggestions = this._languageService.getCompletion(uri, document2, graphQLPosition);
return suggestions.map((suggestion) => (0, utils_1.toCompletion)(suggestion));
} catch (err) {
console.error(err);
return [];
}
});
}
doHover(uri, position) {
return __awaiter(this, void 0, void 0, function* () {
try {
const documentModel = this._getTextModel(uri);
const document2 = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getValue();
if (!document2) {
return null;
}
const graphQLPosition = (0, utils_1.toGraphQLPosition)(position);
const hover = this._languageService.getHover(uri, document2, graphQLPosition);
const token = (0, graphql_language_service_1.getTokenAtPosition)(document2, graphQLPosition);
return {
content: hover,
range: (0, utils_1.toMonacoRange)(new graphql_language_service_1.Range(new graphql_language_service_1.Position(graphQLPosition.line, token.start), new graphql_language_service_1.Position(graphQLPosition.line, token.end)))
};
} catch (err) {
console.error(err);
return null;
}
});
}
doGetVariablesJSONSchema(uri) {
return __awaiter(this, void 0, void 0, function* () {
const documentModel = this._getTextModel(uri);
const document2 = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getValue();
if (!documentModel || !document2) {
return null;
}
const jsonSchema = this._languageService.getVariablesJSONSchema(uri, document2, { useMarkdownDescription: true });
if (jsonSchema) {
return Object.assign(Object.assign({}, jsonSchema), { $id: "monaco://variables-schema.json", title: "GraphQL Variables" });
}
return null;
});
}
doFormat(uri) {
return __awaiter(this, void 0, void 0, function* () {
var _a2;
const documentModel = this._getTextModel(uri);
const document2 = documentModel === null || documentModel === void 0 ? void 0 : documentModel.getValue();
if (!documentModel || !document2) {
return null;
}
const prettierStandalone = yield Promise.resolve().then(() => (init_standalone(), standalone_exports));
const prettierGraphqlParser = yield Promise.resolve().then(() => __toESM(require_graphql()));
return prettierStandalone.format(document2, Object.assign({ parser: "graphql", plugins: [prettierGraphqlParser] }, (_a2 = this._formattingOptions) === null || _a2 === void 0 ? void 0 : _a2.prettierConfig));
});
}
_getTextModel(uri) {
const models = this._ctx.getMirrorModels();
for (const model of models) {
if (model.uri.toString() === uri) {
return model;
}
}
return null;
}
doUpdateSchema(schema) {
return this._languageService.updateSchema(schema);
}
doUpdateSchemas(schemas) {
return this._languageService.updateSchemas(schemas);
}
};
exports.GraphQLWorker = GraphQLWorker;
exports.default = {
GraphQLWorker
};
function create(ctx, createData) {
return new GraphQLWorker(ctx, createData);
}
}
});
// ../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/graphql.worker.js
var require_graphql_worker = __commonJS({
"../../../node_modules/.pnpm/monaco-graphql@1.9.0_graphql@17.1.0_monaco-editor@0.52.2_prettier@3.4.2/node_modules/monaco-graphql/dist/graphql.worker.js"(exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var editor_worker_1 = (init_editor_worker(), __toCommonJS(editor_worker_exports));
var GraphQLWorker_1 = require_GraphQLWorker();
globalThis.onmessage = () => {
(0, editor_worker_1.initialize)((ctx, createData) => new GraphQLWorker_1.GraphQLWorker(ctx, createData));
};
}
});
require_graphql_worker();
})();