var __bare_os_bundle_exports__ = (() => { 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__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; 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/bare-sqlite/binding.js var require_binding = __commonJS({ "../../node_modules/bare-sqlite/binding.js"(exports, module) { module.exports = __require.addon(); } }); // ../../node_modules/bare-sqlite/lib/errors.js var require_errors = __commonJS({ "../../node_modules/bare-sqlite/lib/errors.js"(exports, module) { module.exports = class SQLiteError extends Error { constructor(msg, fn = SQLiteError, code = fn.name) { super(`${code}: ${msg}`); this.code = code; if (Error.captureStackTrace) Error.captureStackTrace(this, fn); } get name() { return "SQLiteError"; } static DATABASE_ALREADY_OPEN(msg) { return new SQLiteError(msg, SQLiteError.DATABASE_ALREADY_OPEN); } static DATABASE_NOT_OPEN(msg) { return new SQLiteError(msg, SQLiteError.DATABASE_NOT_OPEN); } static INVALID_ARGUMENT(msg) { return new SQLiteError(msg, SQLiteError.INVALID_ARGUMENT); } static NOT_IMPLEMENTED(msg) { return new SQLiteError(msg, SQLiteError.NOT_IMPLEMENTED); } static LOAD_EXTENSION_DISABLED(msg) { return new SQLiteError(msg, SQLiteError.LOAD_EXTENSION_DISABLED); } static from(err) { if (err instanceof SQLiteError) return err; if (err instanceof TypeError) { return SQLiteError.INVALID_ARGUMENT(err.message); } return new SQLiteError(err.message, SQLiteError.from, err.code || "ERROR"); } }; } }); // ../../node_modules/bare-sqlite/lib/statement-sync.js var require_statement_sync = __commonJS({ "../../node_modules/bare-sqlite/lib/statement-sync.js"(exports, module) { var binding = require_binding(); var errors = require_errors(); module.exports = class SQLiteStatementSync { constructor(db, sql) { this._db = db; this._sourceSQL = sql; try { this._handle = binding.prepare(db._handle, sql); } catch (err) { throw errors.from(err); } } get sourceSQL() { return this._sourceSQL; } get expandedSQL() { return binding.expandedSQL(this._handle); } all(...params) { const [named, positional] = splitParameters(params); try { const rows = binding.all(this._handle, named, positional); for (const row of rows) wrapBlobRow(row); return rows; } catch (err) { throw errors.from(err); } } values(...params) { const [named, positional] = splitParameters(params); try { const rows = binding.values(this._handle, named, positional); for (const row of rows) wrapBlobValues(row); return rows; } catch (err) { throw errors.from(err); } } get(...params) { const [named, positional] = splitParameters(params); try { const row = binding.get(this._handle, named, positional); return row === void 0 ? void 0 : wrapBlobRow(row); } catch (err) { throw errors.from(err); } } run(...params) { const [named, positional] = splitParameters(params); try { return binding.run(this._handle, named, positional); } catch (err) { throw errors.from(err); } } *iterate(...params) { const [named, positional] = splitParameters(params); try { binding.bind(this._handle, named, positional); let row; while ((row = binding.step(this._handle)) !== void 0) { yield wrapBlobRow(row); } } catch (err) { throw errors.from(err); } finally { binding.reset(this._handle); } } columns() { return binding.columns(this._handle); } setAllowBareNamedParameters(allow) { binding.allowBareNamedParameters(this._handle, !!allow); } setAllowUnknownNamedParameters(allow) { binding.allowUnknownNamedParameters(this._handle, !!allow); } setReadBigInts(enabled) { binding.readBigInts(this._handle, !!enabled); } [Symbol.dispose]() { if (this._handle === null) return; binding.finalize(this._handle); this._handle = null; } }; function wrapBlobRow(row) { for (const key in row) { const value = row[key]; if (value instanceof ArrayBuffer) row[key] = Buffer.from(value); } return row; } function wrapBlobValues(row) { for (let i = 0; i < row.length; i++) { if (row[i] instanceof ArrayBuffer) row[i] = Buffer.from(row[i]); } return row; } function splitParameters(params) { if (params.length === 0) return [null, params]; if (!isNamedParameters(params[0])) return [null, params]; return [params[0], params.slice(1)]; } function isNamedParameters(value) { if (value === null) return false; if (typeof value !== "object") return false; if (Array.isArray(value)) return false; if (ArrayBuffer.isView(value)) return false; if (value instanceof ArrayBuffer) return false; return true; } } }); // ../../node_modules/bare-sqlite/lib/tag-store.js var require_tag_store = __commonJS({ "../../node_modules/bare-sqlite/lib/tag-store.js"(exports, module) { var errors = require_errors(); module.exports = class SQLiteTagStore { constructor(db, maxSize = 1e3) { if (typeof maxSize !== "number" || !Number.isInteger(maxSize) || maxSize <= 0) { throw errors.INVALID_ARGUMENT("maxSize must be a positive integer"); } this._db = db; this._maxSize = maxSize; this._cache = /* @__PURE__ */ new Map(); } get db() { return this._db; } get size() { return this._cache.size; } get capacity() { return this._maxSize; } clear() { this._cache.clear(); } all(strings, ...params) { return this._lookup(strings).all({}, ...params); } values(strings, ...params) { return this._lookup(strings).values({}, ...params); } get(strings, ...params) { return this._lookup(strings).get({}, ...params); } iterate(strings, ...params) { return this._lookup(strings).iterate({}, ...params); } run(strings, ...params) { return this._lookup(strings).run({}, ...params); } _lookup(strings) { const sql = strings.join("?"); let stmt = this._cache.get(sql); if (stmt !== void 0) { this._cache.delete(sql); this._cache.set(sql, stmt); return stmt; } stmt = this._db.prepare(sql); this._cache.set(sql, stmt); if (this._cache.size > this._maxSize) { const oldest = this._cache.keys().next().value; this._cache.delete(oldest); } return stmt; } }; } }); // ../../node_modules/bare-sqlite/lib/database-sync.js var require_database_sync = __commonJS({ "../../node_modules/bare-sqlite/lib/database-sync.js"(exports, module) { var binding = require_binding(); var StatementSync = require_statement_sync(); var TagStore = require_tag_store(); var errors = require_errors(); module.exports = class SQLiteDatabaseSync { constructor(location, opts = {}) { const { open = true, readOnly = false, enableForeignKeyConstraints = true, enableDoubleQuotedStringLiterals = false, allowExtension = false, timeout = 0 } = opts; this._location = location; this._readOnly = readOnly; this._enableForeignKeyConstraints = enableForeignKeyConstraints; this._enableDoubleQuotedStringLiterals = enableDoubleQuotedStringLiterals; this._allowExtension = allowExtension; this._timeout = timeout; this._handle = null; if (open) this.open(); } get isOpen() { return this._handle !== null; } get isTransaction() { throw errors.NOT_IMPLEMENTED("isTransaction is not implemented"); } open() { if (this._handle !== null) { throw errors.DATABASE_ALREADY_OPEN("Database is already open"); } try { this._handle = binding.open( this._location, this._readOnly, this._enableForeignKeyConstraints, this._enableDoubleQuotedStringLiterals, this._allowExtension, this._timeout ); } catch (err) { throw errors.from(err); } } close() { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } try { binding.close(this._handle); } catch (err) { throw errors.from(err); } this._handle = null; } [Symbol.dispose]() { if (this.isOpen) this.close(); } exec(sql) { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } try { binding.exec(this._handle, sql); } catch (err) { throw errors.from(err); } } prepare(sql) { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } return new StatementSync(this, sql); } createTagStore(maxSize) { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } return new TagStore(this, maxSize); } function(name, opts, fn) { throw errors.NOT_IMPLEMENTED("function is not implemented"); } aggregate(name, opts) { throw errors.NOT_IMPLEMENTED("aggregate is not implemented"); } createSession(opts = {}) { throw errors.NOT_IMPLEMENTED("createSession is not implemented"); } applyChangeset(changeset, opts = {}) { throw errors.NOT_IMPLEMENTED("applyChangeset is not implemented"); } enableLoadExtension(allow) { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } if (!this._allowExtension) { throw errors.LOAD_EXTENSION_DISABLED("Extension loading is disabled"); } try { binding.enableLoadExtension(this._handle, !!allow); } catch (err) { throw errors.from(err); } } loadExtension(path, entryPoint = null) { if (this._handle === null) { throw errors.DATABASE_NOT_OPEN("Database is not open"); } if (!this._allowExtension) { throw errors.LOAD_EXTENSION_DISABLED("Extension loading is disabled"); } try { binding.loadExtension(this._handle, path, entryPoint); } catch (err) { throw errors.from(err); } } backup(destination, opts = {}) { throw errors.NOT_IMPLEMENTED("backup is not implemented"); } location(dbName) { throw errors.NOT_IMPLEMENTED("location is not implemented"); } }; } }); // ../../node_modules/bare-sqlite/index.js var require_bare_sqlite = __commonJS({ "../../node_modules/bare-sqlite/index.js"(exports) { var DatabaseSync = require_database_sync(); var StatementSync = require_statement_sync(); var TagStore = require_tag_store(); var errors = require_errors(); exports.DatabaseSync = DatabaseSync; exports.StatementSync = StatementSync; exports.TagStore = TagStore; exports.errors = errors; } }); // ../../bare-lib-entry-bareSqlite.js var bare_lib_entry_bareSqlite_exports = {}; __export(bare_lib_entry_bareSqlite_exports, { default: () => bare_lib_entry_bareSqlite_default }); var import_bare_sqlite = __toESM(require_bare_sqlite()); var bare_lib_entry_bareSqlite_default = import_bare_sqlite.default; return __toCommonJS(bare_lib_entry_bareSqlite_exports); })(); ;(function(){var g=globalThis;var s="__bare_os_stdlib__";g[s]=g[s]||{};var e=typeof __bare_os_bundle_exports__!=="undefined"?__bare_os_bundle_exports__:void 0;var v=e!=null&&typeof e==="object"&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;g[s]["bareSqlite"]=v;})();