import { __commonJSMin } from "../../../../_virtual/rolldown_runtime.js";
import { require_is } from "./is.js";
var require_messages = /* @__PURE__ */ __commonJSMin(((e) => {
	Object.defineProperty(e, "__esModule", { value: !0 }), e.Message = e.NotificationType9 = e.NotificationType8 = e.NotificationType7 = e.NotificationType6 = e.NotificationType5 = e.NotificationType4 = e.NotificationType3 = e.NotificationType2 = e.NotificationType1 = e.NotificationType0 = e.NotificationType = e.RequestType9 = e.RequestType8 = e.RequestType7 = e.RequestType6 = e.RequestType5 = e.RequestType4 = e.RequestType3 = e.RequestType2 = e.RequestType1 = e.RequestType = e.RequestType0 = e.AbstractMessageSignature = e.ParameterStructures = e.ResponseError = e.ErrorCodes = void 0;
	var n = require_is(), r;
	(function(e) {
		e.ParseError = -32700, e.InvalidRequest = -32600, e.MethodNotFound = -32601, e.InvalidParams = -32602, e.InternalError = -32603, e.jsonrpcReservedErrorRangeStart = -32099, e.serverErrorStart = -32099, e.MessageWriteError = -32099, e.MessageReadError = -32098, e.PendingResponseRejected = -32097, e.ConnectionInactive = -32096, e.ServerNotInitialized = -32002, e.UnknownErrorCode = -32001, e.jsonrpcReservedErrorRangeEnd = -32e3, e.serverErrorEnd = -32e3;
	})(r || (e.ErrorCodes = r = {})), e.ResponseError = class e extends Error {
		constructor(t, i, a) {
			super(i), this.code = n.number(t) ? t : r.UnknownErrorCode, this.data = a, Object.setPrototypeOf(this, e.prototype);
		}
		toJson() {
			let e = {
				code: this.code,
				message: this.message
			};
			return this.data !== void 0 && (e.data = this.data), e;
		}
	};
	var i = class e {
		constructor(e) {
			this.kind = e;
		}
		static is(t) {
			return t === e.auto || t === e.byName || t === e.byPosition;
		}
		toString() {
			return this.kind;
		}
	};
	e.ParameterStructures = i, i.auto = new i("auto"), i.byPosition = new i("byPosition"), i.byName = new i("byName");
	var a = class {
		constructor(e, t) {
			this.method = e, this.numberOfParams = t;
		}
		get parameterStructures() {
			return i.auto;
		}
	};
	e.AbstractMessageSignature = a, e.RequestType0 = class extends a {
		constructor(e) {
			super(e, 0);
		}
	}, e.RequestType = class extends a {
		constructor(e, t = i.auto) {
			super(e, 1), this._parameterStructures = t;
		}
		get parameterStructures() {
			return this._parameterStructures;
		}
	}, e.RequestType1 = class extends a {
		constructor(e, t = i.auto) {
			super(e, 1), this._parameterStructures = t;
		}
		get parameterStructures() {
			return this._parameterStructures;
		}
	}, e.RequestType2 = class extends a {
		constructor(e) {
			super(e, 2);
		}
	}, e.RequestType3 = class extends a {
		constructor(e) {
			super(e, 3);
		}
	}, e.RequestType4 = class extends a {
		constructor(e) {
			super(e, 4);
		}
	}, e.RequestType5 = class extends a {
		constructor(e) {
			super(e, 5);
		}
	}, e.RequestType6 = class extends a {
		constructor(e) {
			super(e, 6);
		}
	}, e.RequestType7 = class extends a {
		constructor(e) {
			super(e, 7);
		}
	}, e.RequestType8 = class extends a {
		constructor(e) {
			super(e, 8);
		}
	}, e.RequestType9 = class extends a {
		constructor(e) {
			super(e, 9);
		}
	}, e.NotificationType = class extends a {
		constructor(e, t = i.auto) {
			super(e, 1), this._parameterStructures = t;
		}
		get parameterStructures() {
			return this._parameterStructures;
		}
	}, e.NotificationType0 = class extends a {
		constructor(e) {
			super(e, 0);
		}
	}, e.NotificationType1 = class extends a {
		constructor(e, t = i.auto) {
			super(e, 1), this._parameterStructures = t;
		}
		get parameterStructures() {
			return this._parameterStructures;
		}
	}, e.NotificationType2 = class extends a {
		constructor(e) {
			super(e, 2);
		}
	}, e.NotificationType3 = class extends a {
		constructor(e) {
			super(e, 3);
		}
	}, e.NotificationType4 = class extends a {
		constructor(e) {
			super(e, 4);
		}
	}, e.NotificationType5 = class extends a {
		constructor(e) {
			super(e, 5);
		}
	}, e.NotificationType6 = class extends a {
		constructor(e) {
			super(e, 6);
		}
	}, e.NotificationType7 = class extends a {
		constructor(e) {
			super(e, 7);
		}
	}, e.NotificationType8 = class extends a {
		constructor(e) {
			super(e, 8);
		}
	}, e.NotificationType9 = class extends a {
		constructor(e) {
			super(e, 9);
		}
	};
	var o;
	(function(e) {
		function t(e) {
			let t = e;
			return t && n.string(t.method) && (n.string(t.id) || n.number(t.id));
		}
		e.isRequest = t;
		function r(e) {
			let t = e;
			return t && n.string(t.method) && e.id === void 0;
		}
		e.isNotification = r;
		function i(e) {
			let t = e;
			return t && (t.result !== void 0 || !!t.error) && (n.string(t.id) || n.number(t.id) || t.id === null);
		}
		e.isResponse = i;
	})(o || (e.Message = o = {}));
}));
export default require_messages();
export { require_messages };
