function _assert_this_initialized(self) {
    if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
    return self;
}
function _call_super(_this, derived, args) {
    derived = _get_prototype_of(derived);
    return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
}
function _class_call_check(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
    }
}
function _construct(Parent, args, Class) {
    if (_is_native_reflect_construct()) {
        _construct = Reflect.construct;
    } else {
        _construct = function construct(Parent, args, Class) {
            var a = [
                null
            ];
            a.push.apply(a, args);
            var Constructor = Function.bind.apply(Parent, a);
            var instance = new Constructor();
            if (Class) _set_prototype_of(instance, Class.prototype);
            return instance;
        };
    }
    return _construct.apply(null, arguments);
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _get_prototype_of(o) {
    _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _get_prototype_of(o);
}
function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function");
    }
    subClass.prototype = Object.create(superClass && superClass.prototype, {
        constructor: {
            value: subClass,
            writable: true,
            configurable: true
        }
    });
    if (superClass) _set_prototype_of(subClass, superClass);
}
function _is_native_function(fn) {
    return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _possible_constructor_return(self, call) {
    if (call && (_type_of(call) === "object" || typeof call === "function")) {
        return call;
    }
    return _assert_this_initialized(self);
}
function _set_prototype_of(o, p) {
    _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
        o.__proto__ = p;
        return o;
    };
    return _set_prototype_of(o, p);
}
function _type_of(obj) {
    "@swc/helpers - typeof";
    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
function _wrap_native_super(Class) {
    var _cache = typeof Map === "function" ? new Map() : undefined;
    _wrap_native_super = function wrapNativeSuper(Class) {
        if (Class === null || !_is_native_function(Class)) return Class;
        if (typeof Class !== "function") {
            throw new TypeError("Super expression must either be null or a function");
        }
        if (typeof _cache !== "undefined") {
            if (_cache.has(Class)) return _cache.get(Class);
            _cache.set(Class, Wrapper);
        }
        function Wrapper() {
            return _construct(Class, arguments, _get_prototype_of(this).constructor);
        }
        Wrapper.prototype = Object.create(Class.prototype, {
            constructor: {
                value: Wrapper,
                enumerable: false,
                writable: true,
                configurable: true
            }
        });
        return _set_prototype_of(Wrapper, Class);
    };
    return _wrap_native_super(Class);
}
function _is_native_reflect_construct() {
    try {
        var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
    } catch (_) {}
    return (_is_native_reflect_construct = function() {
        return !!result;
    })();
}
/**
 * 沙箱模块的 TypeScript 类型定义
 *
 * 提供完整的类型定义，确保类型安全和良好的开发体验。
 *
 * @author md-editor
 * @version 1.0.0
 */ /**
 * 沙箱错误类型枚举
 */ export var SandboxErrorType = /*#__PURE__*/ function(SandboxErrorType) {
    /** 代码执行超时 */ SandboxErrorType["TIMEOUT"] = "TIMEOUT";
    /** 内存超限 */ SandboxErrorType["MEMORY_LIMIT"] = "MEMORY_LIMIT";
    /** 访问被禁止的全局对象 */ SandboxErrorType["FORBIDDEN_ACCESS"] = "FORBIDDEN_ACCESS";
    /** 语法错误 */ SandboxErrorType["SYNTAX_ERROR"] = "SYNTAX_ERROR";
    /** 运行时错误 */ SandboxErrorType["RUNTIME_ERROR"] = "RUNTIME_ERROR";
    /** 安全违规 */ SandboxErrorType["SECURITY_VIOLATION"] = "SECURITY_VIOLATION";
    /** 资源限制 */ SandboxErrorType["RESOURCE_LIMIT"] = "RESOURCE_LIMIT";
    return SandboxErrorType;
}({});
/**
 * 沙箱错误类
 */ export var SandboxError = /*#__PURE__*/ function(Error1) {
    "use strict";
    _inherits(SandboxError, Error1);
    function SandboxError(message, type, context) {
        _class_call_check(this, SandboxError);
        var _this;
        _this = _call_super(this, SandboxError, [
            message
        ]), _define_property(_this, "type", void 0), _define_property(_this, "context", void 0), _define_property(_this, "timestamp", void 0);
        _this.name = 'SandboxError';
        _this.type = type;
        _this.context = context;
        _this.timestamp = Date.now();
        return _this;
    }
    return SandboxError;
}(_wrap_native_super(Error));
/**
 * 代码执行状态枚举
 */ export var ExecutionStatus = /*#__PURE__*/ function(ExecutionStatus) {
    /** 准备中 */ ExecutionStatus["PENDING"] = "PENDING";
    /** 执行中 */ ExecutionStatus["RUNNING"] = "RUNNING";
    /** 执行成功 */ ExecutionStatus["SUCCESS"] = "SUCCESS";
    /** 执行失败 */ ExecutionStatus["FAILED"] = "FAILED";
    /** 已取消 */ ExecutionStatus["CANCELLED"] = "CANCELLED";
    /** 超时 */ ExecutionStatus["TIMEOUT"] = "TIMEOUT";
    return ExecutionStatus;
}({});
/**
 * 权限级别枚举
 */ export var PermissionLevel = /*#__PURE__*/ function(PermissionLevel) {
    /** 无权限 */ PermissionLevel["NONE"] = "NONE";
    /** 只读权限 */ PermissionLevel["READ_ONLY"] = "READ_ONLY";
    /** 受限权限 */ PermissionLevel["LIMITED"] = "LIMITED";
    /** 完全权限 */ PermissionLevel["FULL"] = "FULL";
    return PermissionLevel;
}({});
/**
 * 监控事件类型
 */ export var MonitoringEventType = /*#__PURE__*/ function(MonitoringEventType) {
    /** 执行开始 */ MonitoringEventType["EXECUTION_START"] = "EXECUTION_START";
    /** 执行结束 */ MonitoringEventType["EXECUTION_END"] = "EXECUTION_END";
    /** 内存使用变化 */ MonitoringEventType["MEMORY_USAGE"] = "MEMORY_USAGE";
    /** 性能警告 */ MonitoringEventType["PERFORMANCE_WARNING"] = "PERFORMANCE_WARNING";
    /** 安全事件 */ MonitoringEventType["SECURITY_EVENT"] = "SECURITY_EVENT";
    /** 错误事件 */ MonitoringEventType["ERROR_EVENT"] = "ERROR_EVENT";
    return MonitoringEventType;
}({});
