tinybase 4.8.16 → 4.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/checkpoints.js +1 -0
- package/lib/checkpoints.js.gz +0 -0
- package/lib/cjs/checkpoints.cjs +1 -0
- package/lib/cjs/checkpoints.cjs.gz +0 -0
- package/lib/cjs/common.cjs +1 -0
- package/lib/cjs/common.cjs.gz +0 -0
- package/lib/cjs/indexes.cjs +1 -0
- package/lib/cjs/indexes.cjs.gz +0 -0
- package/lib/cjs/metrics.cjs +1 -0
- package/lib/cjs/metrics.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-automerge.cjs +1 -0
- package/lib/cjs/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-browser.cjs +1 -0
- package/lib/cjs/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs +1 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-electric-sql.cjs +1 -0
- package/lib/cjs/persisters/persister-electric-sql.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-expo-sqlite-next.cjs +1 -0
- package/lib/cjs/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-expo-sqlite.cjs +1 -0
- package/lib/cjs/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-file.cjs +1 -0
- package/lib/cjs/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-indexed-db.cjs +1 -0
- package/lib/cjs/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-libsql.cjs +1 -0
- package/lib/cjs/persisters/persister-libsql.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-partykit-client.cjs +1 -0
- package/lib/cjs/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-partykit-server.cjs +1 -0
- package/lib/cjs/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-powersync.cjs +1 -0
- package/lib/cjs/persisters/persister-powersync.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-remote.cjs +1 -0
- package/lib/cjs/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs +1 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs +1 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-yjs.cjs +1 -0
- package/lib/cjs/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs/persisters.cjs +1 -0
- package/lib/cjs/persisters.cjs.gz +0 -0
- package/lib/cjs/queries.cjs +1 -0
- package/lib/cjs/queries.cjs.gz +0 -0
- package/lib/cjs/relationships.cjs +1 -0
- package/lib/cjs/relationships.cjs.gz +0 -0
- package/lib/cjs/store.cjs +1 -0
- package/lib/cjs/store.cjs.gz +0 -0
- package/lib/cjs/tinybase.cjs +1 -0
- package/lib/cjs/tinybase.cjs.gz +0 -0
- package/lib/cjs/tools.cjs +1 -0
- package/lib/cjs/tools.cjs.gz +0 -0
- package/lib/cjs/ui-react-dom-debug.cjs +1 -0
- package/lib/cjs/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/cjs/ui-react-dom.cjs +1 -0
- package/lib/cjs/ui-react-dom.cjs.gz +0 -0
- package/lib/cjs/ui-react.cjs +1 -0
- package/lib/cjs/ui-react.cjs.gz +0 -0
- package/lib/cjs-es6/checkpoints.cjs +1 -0
- package/lib/cjs-es6/checkpoints.cjs.gz +0 -0
- package/lib/cjs-es6/common.cjs +1 -0
- package/lib/cjs-es6/common.cjs.gz +0 -0
- package/lib/cjs-es6/indexes.cjs +1 -0
- package/lib/cjs-es6/indexes.cjs.gz +0 -0
- package/lib/cjs-es6/metrics.cjs +1 -0
- package/lib/cjs-es6/metrics.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-electric-sql.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-electric-sql.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-file.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-libsql.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-libsql.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-powersync.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-powersync.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs-es6/persisters.cjs +1 -0
- package/lib/cjs-es6/persisters.cjs.gz +0 -0
- package/lib/cjs-es6/queries.cjs +1 -0
- package/lib/cjs-es6/queries.cjs.gz +0 -0
- package/lib/cjs-es6/relationships.cjs +1 -0
- package/lib/cjs-es6/relationships.cjs.gz +0 -0
- package/lib/cjs-es6/store.cjs +1 -0
- package/lib/cjs-es6/store.cjs.gz +0 -0
- package/lib/cjs-es6/tinybase.cjs +1 -0
- package/lib/cjs-es6/tinybase.cjs.gz +0 -0
- package/lib/cjs-es6/tools.cjs +1 -0
- package/lib/cjs-es6/tools.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react-dom-debug.cjs +1 -0
- package/lib/cjs-es6/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react-dom.cjs +1 -0
- package/lib/cjs-es6/ui-react-dom.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react.cjs +1 -0
- package/lib/cjs-es6/ui-react.cjs.gz +0 -0
- package/lib/common.js +1 -0
- package/lib/common.js.gz +0 -0
- package/lib/debug/checkpoints.js +412 -0
- package/lib/debug/common.js +4 -0
- package/lib/debug/indexes.js +544 -0
- package/lib/debug/metrics.js +516 -0
- package/lib/debug/persisters.js +183 -0
- package/lib/debug/queries.js +807 -0
- package/lib/debug/relationships.js +526 -0
- package/lib/debug/store.js +1602 -0
- package/lib/es6/checkpoints.js +1 -0
- package/lib/es6/checkpoints.js.gz +0 -0
- package/lib/es6/common.js +1 -0
- package/lib/es6/common.js.gz +0 -0
- package/lib/es6/indexes.js +1 -0
- package/lib/es6/indexes.js.gz +0 -0
- package/lib/es6/metrics.js +1 -0
- package/lib/es6/metrics.js.gz +0 -0
- package/lib/es6/persisters/persister-automerge.js +1 -0
- package/lib/es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/es6/persisters/persister-browser.js +1 -0
- package/lib/es6/persisters/persister-browser.js.gz +0 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-electric-sql.js +1 -0
- package/lib/es6/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/es6/persisters/persister-expo-sqlite-next.js +1 -0
- package/lib/es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/es6/persisters/persister-expo-sqlite.js +1 -0
- package/lib/es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/es6/persisters/persister-file.js +1 -0
- package/lib/es6/persisters/persister-file.js.gz +0 -0
- package/lib/es6/persisters/persister-indexed-db.js +1 -0
- package/lib/es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/es6/persisters/persister-libsql.js +1 -0
- package/lib/es6/persisters/persister-libsql.js.gz +0 -0
- package/lib/es6/persisters/persister-partykit-client.js +1 -0
- package/lib/es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/es6/persisters/persister-partykit-server.js +1 -0
- package/lib/es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/es6/persisters/persister-powersync.js +1 -0
- package/lib/es6/persisters/persister-powersync.js.gz +0 -0
- package/lib/es6/persisters/persister-remote.js +1 -0
- package/lib/es6/persisters/persister-remote.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite3.js +1 -0
- package/lib/es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/es6/persisters/persister-yjs.js +1 -0
- package/lib/es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/es6/persisters.js +1 -0
- package/lib/es6/persisters.js.gz +0 -0
- package/lib/es6/queries.js +1 -0
- package/lib/es6/queries.js.gz +0 -0
- package/lib/es6/relationships.js +1 -0
- package/lib/es6/relationships.js.gz +0 -0
- package/lib/es6/store.js +1 -0
- package/lib/es6/store.js.gz +0 -0
- package/lib/es6/tinybase.js +1 -0
- package/lib/es6/tinybase.js.gz +0 -0
- package/lib/es6/tools.js +1 -0
- package/lib/es6/tools.js.gz +0 -0
- package/lib/es6/ui-react-dom-debug.js +1 -0
- package/lib/es6/ui-react-dom-debug.js.gz +0 -0
- package/lib/es6/ui-react-dom.js +1 -0
- package/lib/es6/ui-react-dom.js.gz +0 -0
- package/lib/es6/ui-react.js +1 -0
- package/lib/es6/ui-react.js.gz +0 -0
- package/lib/indexes.js +1 -0
- package/lib/indexes.js.gz +0 -0
- package/lib/metrics.js +1 -0
- package/lib/metrics.js.gz +0 -0
- package/lib/persisters/persister-automerge.js +1 -0
- package/lib/persisters/persister-automerge.js.gz +0 -0
- package/lib/persisters/persister-browser.js +1 -0
- package/lib/persisters/persister-browser.js.gz +0 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-electric-sql.js +1 -0
- package/lib/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/persisters/persister-expo-sqlite-next.js +1 -0
- package/lib/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/persisters/persister-expo-sqlite.js +1 -0
- package/lib/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/persisters/persister-file.js +1 -0
- package/lib/persisters/persister-file.js.gz +0 -0
- package/lib/persisters/persister-indexed-db.js +1 -0
- package/lib/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/persisters/persister-libsql.js +1 -0
- package/lib/persisters/persister-libsql.js.gz +0 -0
- package/lib/persisters/persister-partykit-client.js +1 -0
- package/lib/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/persisters/persister-partykit-server.js +1 -0
- package/lib/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/persisters/persister-powersync.js +1 -0
- package/lib/persisters/persister-powersync.js.gz +0 -0
- package/lib/persisters/persister-remote.js +1 -0
- package/lib/persisters/persister-remote.js.gz +0 -0
- package/lib/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-sqlite3.js +1 -0
- package/lib/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/persisters/persister-yjs.js +1 -0
- package/lib/persisters/persister-yjs.js.gz +0 -0
- package/lib/persisters.js +1 -0
- package/lib/persisters.js.gz +0 -0
- package/lib/queries.js +1 -0
- package/lib/queries.js.gz +0 -0
- package/lib/relationships.js +1 -0
- package/lib/relationships.js.gz +0 -0
- package/lib/store.js +1 -0
- package/lib/store.js.gz +0 -0
- package/lib/tinybase.js +1 -0
- package/lib/tinybase.js.gz +0 -0
- package/lib/tools.js +1 -0
- package/lib/tools.js.gz +0 -0
- package/lib/ui-react-dom.js +1 -0
- package/lib/ui-react-dom.js.gz +0 -0
- package/lib/ui-react.js +1 -0
- package/lib/ui-react.js.gz +0 -0
- package/lib/umd/checkpoints.js +1 -0
- package/lib/umd/checkpoints.js.gz +0 -0
- package/lib/umd/common.js +1 -0
- package/lib/umd/common.js.gz +0 -0
- package/lib/umd/indexes.js +1 -0
- package/lib/umd/indexes.js.gz +0 -0
- package/lib/umd/metrics.js +1 -0
- package/lib/umd/metrics.js.gz +0 -0
- package/lib/umd/persisters/persister-automerge.js +1 -0
- package/lib/umd/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd/persisters/persister-browser.js +1 -0
- package/lib/umd/persisters/persister-browser.js.gz +0 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-electric-sql.js +1 -0
- package/lib/umd/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/umd/persisters/persister-expo-sqlite-next.js +1 -0
- package/lib/umd/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/umd/persisters/persister-expo-sqlite.js +1 -0
- package/lib/umd/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd/persisters/persister-file.js +1 -0
- package/lib/umd/persisters/persister-file.js.gz +0 -0
- package/lib/umd/persisters/persister-indexed-db.js +1 -0
- package/lib/umd/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd/persisters/persister-libsql.js +1 -0
- package/lib/umd/persisters/persister-libsql.js.gz +0 -0
- package/lib/umd/persisters/persister-partykit-client.js +1 -0
- package/lib/umd/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd/persisters/persister-partykit-server.js +1 -0
- package/lib/umd/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd/persisters/persister-powersync.js +1 -0
- package/lib/umd/persisters/persister-powersync.js.gz +0 -0
- package/lib/umd/persisters/persister-remote.js +1 -0
- package/lib/umd/persisters/persister-remote.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite3.js +1 -0
- package/lib/umd/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd/persisters/persister-yjs.js +1 -0
- package/lib/umd/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd/persisters.js +1 -0
- package/lib/umd/persisters.js.gz +0 -0
- package/lib/umd/queries.js +1 -0
- package/lib/umd/queries.js.gz +0 -0
- package/lib/umd/relationships.js +1 -0
- package/lib/umd/relationships.js.gz +0 -0
- package/lib/umd/store.js +1 -0
- package/lib/umd/store.js.gz +0 -0
- package/lib/umd/tinybase.js +1 -0
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/tools.js +1 -0
- package/lib/umd/tools.js.gz +0 -0
- package/lib/umd/ui-react-dom-debug.js +1 -0
- package/lib/umd/ui-react-dom-debug.js.gz +0 -0
- package/lib/umd/ui-react-dom.js +1 -0
- package/lib/umd/ui-react-dom.js.gz +0 -0
- package/lib/umd/ui-react.js +1 -0
- package/lib/umd/ui-react.js.gz +0 -0
- package/lib/umd-es6/checkpoints.js +1 -0
- package/lib/umd-es6/checkpoints.js.gz +0 -0
- package/lib/umd-es6/common.js +1 -0
- package/lib/umd-es6/common.js.gz +0 -0
- package/lib/umd-es6/indexes.js +1 -0
- package/lib/umd-es6/indexes.js.gz +0 -0
- package/lib/umd-es6/metrics.js +1 -0
- package/lib/umd-es6/metrics.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-automerge.js +1 -0
- package/lib/umd-es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-browser.js +1 -0
- package/lib/umd-es6/persisters/persister-browser.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js +1 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-electric-sql.js +1 -0
- package/lib/umd-es6/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite-next.js +1 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite.js +1 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-file.js +1 -0
- package/lib/umd-es6/persisters/persister-file.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-indexed-db.js +1 -0
- package/lib/umd-es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-libsql.js +1 -0
- package/lib/umd-es6/persisters/persister-libsql.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-client.js +1 -0
- package/lib/umd-es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-server.js +1 -0
- package/lib/umd-es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-powersync.js +1 -0
- package/lib/umd-es6/persisters/persister-powersync.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-remote.js +1 -0
- package/lib/umd-es6/persisters/persister-remote.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js +1 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js +1 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-yjs.js +1 -0
- package/lib/umd-es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd-es6/persisters.js +1 -0
- package/lib/umd-es6/persisters.js.gz +0 -0
- package/lib/umd-es6/queries.js +1 -0
- package/lib/umd-es6/queries.js.gz +0 -0
- package/lib/umd-es6/relationships.js +1 -0
- package/lib/umd-es6/relationships.js.gz +0 -0
- package/lib/umd-es6/store.js +1 -0
- package/lib/umd-es6/store.js.gz +0 -0
- package/lib/umd-es6/tinybase.js +1 -0
- package/lib/umd-es6/tinybase.js.gz +0 -0
- package/lib/umd-es6/tools.js +1 -0
- package/lib/umd-es6/tools.js.gz +0 -0
- package/lib/umd-es6/ui-react-dom-debug.js +1 -0
- package/lib/umd-es6/ui-react-dom-debug.js.gz +0 -0
- package/lib/umd-es6/ui-react-dom.js +1 -0
- package/lib/umd-es6/ui-react-dom.js.gz +0 -0
- package/lib/umd-es6/ui-react.js +1 -0
- package/lib/umd-es6/ui-react.js.gz +0 -0
- package/package.json +1 -1
- package/readme.md +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s="",r=n(s),a=n(!0),o=n(0),i=n(n),u="type",d="default",c="Has",h="Ids",m="Table",b=m+"s",p=m+h,g="Row",v=g+"Count",f=g+h,I="Cell",y=I+h,w="Value",C=w+"s",T=w+h,k="currentTarget",S="value",x=e=>s+e,V=Math.floor,R=isFinite,O=e=>null==e,q=(e,l,t)=>O(e)?null==t?void 0:t():l(e),P=e=>e==r||e==a,N=e=>n(e)==i,E=e=>Array.isArray(e),L=(e,l,t)=>e.slice(l,t),M=e=>e.length,{PureComponent:j,Fragment:z,createElement:$,useCallback:A,useLayoutEffect:F,useRef:J,useState:D}=l,H=(e,...l)=>O(e)?{}:e(...l),B=(e,l)=>e.sort(l),Q=(e,l)=>e.forEach(l),W=(e,l)=>e.map(l),U=e=>0==M(e),G=(e,...l)=>e.push(...l),K=e=>e.shift(),X=Object,Y=e=>X.getPrototypeOf(e),Z=X.keys,_=X.isFrozen,ee=X.freeze,le=e=>!O(e)&&q(Y(e),(e=>e==X.prototype||O(Y(e))),(()=>!0)),te=(e=[])=>X.fromEntries(e),ne=(e,l)=>!O(((e,l)=>q(e,(e=>e[l])))(e,l)),se=(e,l)=>(delete e[l],e),re=(e,l)=>W(X.entries(e),(([e,t])=>l(t,e))),ae=e=>le(e)&&0==(e=>M(Z(e)))(e),oe=e=>JSON.stringify(e,((e,l)=>l instanceof Map?X.fromEntries([...l]):l)),ie=JSON.parse,ue="tinybaseStoreInspector",de="TinyBase Store Inspector",ce=["left","top","bottom","right","full"],he="state",me="sort",be="open",pe="position",ge=be,ve="editable",fe=(...e)=>oe(e),Ie=(e,l)=>W(B(e),l),ye=(e,l)=>[!!t.useCell(he,e,ve,l),A((t=>{l.setCell(he,e,ve,(e=>!e)),t.preventDefault()}),[l,e])],we="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",Ce='content:url("',Te=Ce+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",ke='</svg>")',Se=Ce+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",xe=W([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,n])=>Te+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${n}' fill='white'/>`+ke)),Ve=Te+"<path d='M20 20l60 60M20 80l60-60' />"+ke,Re=Te+`<path d='${we}' />`+ke,Oe=Te+`<path d='${we}M20 20l60 60' />`+ke;var qe=Object.defineProperty,Pe=Object.defineProperties,Ne=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,je=(e,l,t)=>l in e?qe(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,ze=(e,l)=>{for(var t in l||(l={}))Le.call(l,t)&&je(e,t,l[t]);if(Ee)for(var t of Ee(l))Me.call(l,t)&&je(e,t,l[t]);return e},$e=(e,l)=>Pe(e,Ne(l));const Ae="*::-webkit-scrollbar",Fe=((e,l="")=>e.join(l))(re($e(ze($e(ze($e(ze({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[Ae]:"width:0.5rem;height:0.5rem;",[Ae+"-track"]:"background:#111",[Ae+"-thumb"]:"background:#999;border:1px solid #111",[Ae+"-thumb:hover"]:"background:#fff",[Ae+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+Se},te(W(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),te(W(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":Se,"header>img:nth-of-type(6)":Ve}),te(W(xe,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":Re,"details[open]>summary img.done":Oe,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem",[`th,#${ue} td`]:"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`#${ue} ${l}{${e}}`:""))),Je=({s:e})=>{var l;const n=null!=(l=t.useValue(pe,e))?l:1,s=t.useSetValueCallback(ge,(()=>!0),[],e);return t.useValue(ge,e)?null:$("img",{onClick:s,title:de,"data-position":n})},De=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:a})=>{const o=!!t.useCell(he,e,be,a),i=t.useSetCellCallback(he,e,be,(e=>e[k].open),[],a);return $("details",{open:o,onToggle:i},$("summary",null,l,s?$("img",{onClick:s,className:n?"done":"edit"}):null),r)},He=e=>{const l=n(e);return P(l)||l==o&&R(e)?l:void 0},Be=(e,l,t,n,s)=>O(s)?e.delCell(l,t,n,!0):e.setCell(l,t,n,s),Qe=(e,l,t)=>O(t)?e.delValue(l):e.setValue(l,t),We=(e,l,t,n)=>e==r?l:e==o?t:n;var Ue=Object.defineProperty,Ge=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,_e=(e,l,t)=>l in e?Ue(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,el=(e,l)=>{for(var t in l||(l={}))Ye.call(l,t)&&_e(e,t,l[t]);if(Xe)for(var t of Xe(l))Ze.call(l,t)&&_e(e,t,l[t]);return e},ll=(e,l)=>Ge(e,Ke(l)),tl=(e,l)=>{var t={};for(var n in e)Ye.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&Xe)for(var n of Xe(e))l.indexOf(n)<0&&Ze.call(e,n)&&(t[n]=e[n]);return t};const{useCallback:nl,useMemo:sl,useState:rl}=l,al="editable",ol=(e,l)=>W(t.useTableCellIds(e,l),(l=>e+"."+l)),il=(e,l,t)=>{const n=nl(e,l);return t?n:void 0},ul=(...e)=>sl((()=>e),e),dl=(e,l)=>sl((()=>({store:e,tableId:l})),[e,l]),cl=(e,l)=>sl((()=>({queries:e,queryId:l})),[e,l]),hl=(e,l=!1,t,n=0,s,r,a,o)=>{const[[i,u,d],c]=rl([e,l,n]),h=nl((e=>{c(e),null==o||o(e)}),[o]),m=il((e=>h([e,e==i&&!u,d])),[h,i,u,d],t),b=nl((e=>h([i,u,e])),[h,i,u]),p=!0===a?Sl:a;return[[i,u,d],m,sl((()=>!1===a?null:$(p,{offset:d,limit:s,total:r,onChange:b})),[a,p,d,s,r,b])]},ml=(e,l,t)=>sl((()=>{const s=null!=l?l:e;return te(re(E(s)?te(W(s,(e=>[e,e]))):s,((e,l)=>{return[l,el(el({},{label:l,component:t}),(s=e,n(s)==r?{label:e}:e))];var s})))}),[l,t,e]),bl=({className:e,headerRow:l,idColumn:t,params:[n,s,r,a,o,i]})=>$("table",{className:e},i?$("caption",null,i):null,!1===l?null:$("thead",null,$("tr",null,!1===t?null:$(pl,{sort:null!=a?a:[],label:"Id",onClick:o}),re(n,(({label:e},l)=>$(pl,{key:l,cellId:l,label:e,sort:null!=a?a:[],onClick:o}))))),$("tbody",null,W(r,(e=>$("tr",{key:e},!1===t?null:$("th",null,e),re(n,(({component:l,getComponentProps:t},n)=>$("td",{key:n},$(l,ll(el(el({},H(t,e,n)),s),{rowId:e,cellId:n})))))))))),pl=({cellId:e,sort:[l,t],label:n=(null!=e?e:s),onClick:r})=>$("th",{onClick:il((()=>null==r?void 0:r(e)),[r,e],r),className:O(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},O(t)||l!=e?null:(t?"↓":"↑")+" ",n),gl=({localRowId:e,params:[n,s,r,a,o,i,u]})=>{const d=t.useRemoteRowId(o,e,i);return $("tr",null,!1===n?null:$(l.Fragment,null,$("th",null,e),$("th",null,d)),re(s,(({component:l,getComponentProps:t},n)=>{const[s,o]=n.split(".",2),i=s===r?e:s===a?d:null;return O(i)?null:$("td",{key:n},$(l,ll(el({},H(t,i,o)),{store:u,tableId:s,rowId:i,cellId:o})))})))},vl=({thing:e,onThingChange:l,className:t,hasSchema:n,showType:s=!0})=>{const[i,u]=rl(),[d,c]=rl(),[h,m]=rl(),[b,p]=rl(),[g,v]=rl();d!==e&&(u(He(e)),c(e),m(e+""),p(Number(e)||0),v(!!e));const f=nl(((e,t)=>{t(e),c(e),l(e)}),[l]),I=nl((()=>{if(!(null==n?void 0:n())){const e=We(i,o,a,r),t=We(e,h,b,g);u(e),c(t),l(t)}}),[n,l,h,b,g,i]);return $("div",{className:t},s?$("button",{className:i,onClick:I},i):null,We(i,$("input",{key:i,value:h,onChange:nl((e=>f(e[k][S]+"",m)),[f])}),$("input",{key:i,type:"number",value:b,onChange:nl((e=>f(Number(e[k][S]||0),p)),[f])}),$("input",{key:i,type:"checkbox",checked:g,onChange:nl((e=>f(!!e[k].checked,v)),[f])})))},fl=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:a,limit:o,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,b=tl(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[p,g,v]=hl(s,r,d,a,o,t.useRowCount(n,i),c,h);return $(bl,ll(el({},b),{params:ul(ml(t.useTableCellIds(n,i),m,u?Tl:t.CellView),dl(i,n),t.useSortedRowIds(n,...p,o,i),p,g,v)}))},Il=({store:e,editable:l=!1,valueComponent:n=(l?kl:t.ValueView),getValueComponentProps:s,className:r,headerRow:a,idColumn:o})=>$("table",{className:r},!1===a?null:$("thead",null,$("tr",null,!1===o?null:$("th",null,"Id"),$("th",null,w))),$("tbody",null,W(t.useValueIds(e),(l=>$("tr",{key:l},!1===o?null:$("th",null,l),$("td",null,$(n,ll(el({},H(s,l)),{valueId:l,store:e})))))))),yl=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:a,customCells:o}=l,i=tl(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(r),n);return $(bl,ll(el({},i),{params:ul(ml(t.useTableCellIds(c,d),o,a?Tl:t.CellView),dl(d,c),t.useSliceRowIds(n,s,u))}))},wl=({relationshipId:e,relationships:n,editable:s,customCells:r,className:a,headerRow:o,idColumn:i=!0})=>{const[u,d,c,h]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(n),e),m=ml([...ol(c,d),...ol(h,d)],r,s?Tl:t.CellView),b=ul(i,m,c,h,e,u,d);return $("table",{className:a},!1===o?null:$("thead",null,$("tr",null,!1===i?null:$(l.Fragment,null,$("th",null,c,".Id"),$("th",null,h,".Id")),re(m,(({label:e},l)=>$("th",{key:l},e))))),$("tbody",null,W(t.useRowIds(c,d),(e=>$(gl,{key:e,localRowId:e,params:b})))))},Cl=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:a,limit:o,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=tl(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[b,p,g]=hl(s,r,u,a,o,t.useResultRowCount(n,i),d,h);return $(bl,ll(el({},m),{params:ul(ml(t.useResultTableCellIds(n,i),c,t.ResultCellView),cl(i,n),t.useResultSortedRowIds(n,...b,o,i),b,p,g)}))},Tl=({tableId:e,rowId:l,cellId:n,store:s,className:r,showType:a})=>{var o;return $(vl,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:al+I,showType:a,hasSchema:null==(o=t.useStoreOrStoreById(s))?void 0:o.hasTablesSchema})},kl=({valueId:e,store:l,className:n,showType:s})=>{var r;return $(vl,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:al+w,showType:s,hasSchema:null==(r=t.useStoreOrStoreById(l))?void 0:r.hasValuesSchema})},Sl=({onChange:e,total:t,offset:n=0,limit:s=t,singular:r="row",plural:a=r+"s"})=>{(n>t||n<0)&&(n=0,e(0));const o=il((()=>e(n-s)),[e,n,s],n>0),i=il((()=>e(n+s)),[e,n,s],n+s<t);return $(l.Fragment,null,t>s&&$(l.Fragment,null,$("button",{className:"previous",disabled:0==n,onClick:o},"←"),$("button",{className:"next",disabled:n+s>=t,onClick:i},"→"),n+1," to ",Math.min(t,n+s)," of "),t," ",1!=t?a:r)},xl=({indexes:e,indexesId:l,indexId:n,s:s})=>$(De,{uniqueId:fe("i",l,n),summary:"Index: "+n,s:s},W(t.useSliceIds(n,e),(t=>$(Vl,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Vl=({indexes:e,indexesId:l,indexId:t,sliceId:n,s:s})=>{const r=fe("i",l,t,n),[a,o]=ye(r,s);return $(De,{uniqueId:r,summary:"Slice: "+n,editable:a,handleEditable:o,s:s},$(yl,{sliceId:n,indexId:t,indexes:e,editable:a}))},Rl=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return O(n)?null:$(De,{uniqueId:fe("i",e),summary:"Indexes: "+(null!=e?e:d),s:l},U(s)?"No indexes defined":Ie(s,(t=>$(xl,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Ol=({metrics:e,metricId:l})=>$("tr",null,$("th",null,l),$("td",null,null==e?void 0:e.getTableId(l)),$("td",null,t.useMetric(l,e))),ql=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return O(n)?null:$(De,{uniqueId:fe("m",e),summary:"Metrics: "+(null!=e?e:d),s:l},U(s)?"No metrics defined":$("table",null,$("thead",null,$("th",null,"Metric Id"),$("th",null,"Table Id"),$("th",null,"Metric")),$("tbody",null,W(s,(e=>$(Ol,{metrics:n,metricId:e,key:e}))))))},Pl=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const a=fe("q",l,n),[o,i,u]=ie(null!=(r=t.useCell(he,a,me,s))?r:"[]"),d=t.useSetCellCallback(he,a,me,oe,[],s);return $(De,{uniqueId:a,summary:"Query: "+n,s:s},$(Cl,{queryId:n,queries:e,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},Nl=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return O(n)?null:$(De,{uniqueId:fe("q",e),summary:"Queries: "+(null!=e?e:d),s:l},U(s)?"No queries defined":Ie(s,(t=>$(Pl,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},El=({relationships:e,relationshipsId:l,relationshipId:t,s:n})=>{const s=fe("r",l,t),[r,a]=ye(s,n);return $(De,{uniqueId:s,summary:"Relationship: "+t,editable:r,handleEditable:a,s:n},$(wl,{relationshipId:t,relationships:e,editable:r}))},Ll=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return O(n)?null:$(De,{uniqueId:fe("r",e),summary:"Relationships: "+(null!=e?e:d),s:l},U(s)?"No relationships defined":Ie(s,(t=>$(El,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},Ml=({tableId:e,store:l,storeId:n,s:s})=>{var r;const a=fe("t",n,e),[o,i,u]=ie(null!=(r=t.useCell(he,a,me,s))?r:"[]"),d=t.useSetCellCallback(he,a,me,oe,[],s),[c,h]=ye(a,s);return $(De,{uniqueId:a,summary:m+": "+e,editable:c,handleEditable:h,s:s},$(fl,{tableId:e,store:l,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},jl=({store:e,storeId:l,s:n})=>{const s=fe("v",l),[r,a]=ye(s,n);return U(t.useValueIds(e))?null:$(De,{uniqueId:s,summary:C,editable:r,handleEditable:a,s:n},$(Il,{store:e,editable:r}))},zl=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return O(n)?null:$(De,{uniqueId:fe("s",e),summary:"Store: "+(null!=e?e:d),s:l},$(jl,{storeId:e,store:n,s:l}),Ie(s,(t=>$(Ml,{store:n,storeId:e,tableId:t,s:l,key:t}))))},$l=({s:e})=>{const l=J(null),n=J(0),[s,r]=D(!1),{scrollLeft:a,scrollTop:o}=t.useValues(e);F((()=>{const e=l.current;if(e&&!s){const l=new MutationObserver((()=>{e.scrollWidth>=V(a)+e.clientWidth&&e.scrollHeight>=V(o)+e.clientHeight&&e.scrollTo(a,o)}));return l.observe(e,{childList:!0,subtree:!0}),()=>l.disconnect()}}),[s,a,o]);const i=A((l=>{const{scrollLeft:t,scrollTop:s}=l[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:t,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),b=t.useIndexesIds(),p=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return O(u)&&U(d)&&O(c)&&U(h)&&O(m)&&U(b)&&O(p)&&U(g)&&O(v)&&U(f)?$("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the StoreInspector inside a Provider component."):$("article",{ref:l,onScroll:i},$(zl,{s:e}),W(d,(l=>$(zl,{storeId:l,s:e,key:l}))),$(ql,{s:e}),W(h,(l=>$(ql,{metricsId:l,s:e,key:l}))),$(Rl,{s:e}),W(b,(l=>$(Rl,{indexesId:l,s:e,key:l}))),$(Ll,{s:e}),W(g,(l=>$(Ll,{relationshipsId:l,s:e,key:l}))),$(Nl,{s:e}),W(f,(l=>$(Nl,{queriesId:l,s:e,key:l}))))};class Al extends j{constructor(e){super(e),this.componentDidCatch=(e,l)=>console.error(e,l.componentStack),this.state={e:0}}static getDerivedStateFromError(){return{e:1}}render(){return this.state.e?$("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const Fl=({s:e})=>{var l;const n=null!=(l=t.useValue(pe,e))?l:1,s=t.useSetValueCallback(ge,(()=>!1),[],e),r=t.useSetValueCallback(pe,(e=>Number(e[k].dataset.id)),[],e);return $("header",null,$("img",{title:de}),$("span",null,de),W(ce,((e,l)=>l==n?null:$("img",{onClick:r,"data-id":l,title:"Dock to "+e,key:l}))),$("img",{onClick:s,title:"Close"}))},Jl=({s:e})=>{var l;const n=null!=(l=t.useValue(pe,e))?l:1;return t.useValue(ge,e)?$("main",{"data-position":n},$(Fl,{s:e}),$(Al,null,$($l,{s:e}))):null},Dl=e=>l=>{return t=(l,t)=>l+e(t),Kl(l).reduce(t,0);var t},Hl=e=>{var l;return null!=(l=null==e?void 0:e.size)?l:0},Bl=Dl(Hl),Ql=Dl(Bl),Wl=Dl(Ql),Ul=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},Gl=e=>O(e)||0==Hl(e),Kl=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},Xl=e=>e.clear(),Yl=(e,l)=>null==e?void 0:e.forEach(l),Zl=(e,l)=>null==e?void 0:e.delete(l),_l=e=>new Map(e),et=e=>{var l;return[...null!=(l=null==e?void 0:e.keys())?l:[]]},lt=(e,l)=>null==e?void 0:e.get(l),tt=(e,l)=>Yl(e,((e,t)=>l(t,e))),nt=(e,l,t)=>O(t)?(Zl(e,l),e):null==e?void 0:e.set(l,t),st=(e,l,t)=>(Ul(e,l)||nt(e,l,t()),lt(e,l)),rt=(e,l,t,n=nt)=>(re(l,((l,n)=>t(e,n,l))),tt(e,(t=>ne(l,t)?0:n(e,t))),e),at=(e,l,t)=>{const n={};return Yl(e,((e,s)=>{const r=l?l(e,s):e;!(null==t?void 0:t(r,e))&&(n[s]=r)})),n},ot=(e,l,t)=>at(e,(e=>at(e,l,t)),ae),it=(e,l,t)=>at(e,(e=>ot(e,l,t)),ae),ut=(e,l)=>{const t=_l();return Yl(e,((e,n)=>{var s;return t.set(n,null!=(s=null==l?void 0:l(e))?s:e)})),t},dt=e=>ut(e,ut),ct=e=>ut(e,dt),ht=(e,l,t,n,s=0)=>q((t?st:lt)(e,l[s],s>M(l)-2?t:_l),(r=>{if(s>M(l)-2)return(null==n?void 0:n(r))&&nt(e,l[s]),r;const a=ht(r,l,t,n,s+1);return Gl(r)&&nt(e,l[s]),a}));var mt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const bt=_l(),pt=_l();var gt=(e,l,t)=>new Promise(((n,s)=>{var r=e=>{try{o(t.next(e))}catch(e){s(e)}},a=e=>{try{o(t.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((t=t.apply(e,l)).next())}));const vt="storage",ft=globalThis.window,It=e=>new Set(E(e)||O(e)?e:[e]),yt=(e,l)=>null==e?void 0:e.add(l),wt=/^\d+$/,Ct=()=>{const e=[];let l=0;return[t=>{var n;return null!=(n=t?K(e):null)?n:s+l++},l=>{wt.test(l)&&M(e)<1e3&&G(e,l)}]},Tt=e=>[e,e],kt=(e,l=Bl)=>l(e[0])+l(e[1]),St=()=>[_l(),_l()],xt=e=>[...e],Vt=([e,l])=>e===l,Rt=(e,l,t)=>O(e)||!le(e)||ae(e)||_(e)?(null==t||t(),!1):(re(e,((t,n)=>{l(t,n)||se(e,n)})),!ae(e)),Ot=(e,l,t)=>nt(e,l,lt(e,l)==-t?void 0:t),qt=()=>{let e,l,t=!1,n=!1,r=!1,a=!1,i=0;const h=_l(),k=_l(),S=_l(),V=_l(),R=_l(),E=_l(),j=_l(),z=_l(),$=_l(),A=_l(),F=_l(),J=_l(),D=_l(),H=_l(),U=It(),K=_l(),X=_l(),Y=_l(),Z=_l(),_=St(),le=St(),te=St(),ue=St(),de=St(),ce=St(),he=St(),me=St(),be=St(),pe=St(),ge=St(),ve=St(),fe=St(),Ie=St(),ye=St(),we=St(),Ce=St(),Te=St(),ke=St(),Se=St(),xe=St(),Ve=St(),Re=_l(),Oe=St(),[qe,Pe,Ne,Ee]=(e=>{let l;const[t,n]=Ct(),r=_l();return[(e,n,a,o=[],i=(()=>[]))=>{null!=l||(l=$t);const u=t(1);return nt(r,u,[e,n,a,o,i]),yt(ht(n,null!=a?a:[s],It),u),u},(e,t,...n)=>Q(((e,l=[s])=>{const t=[],n=(e,s)=>s==M(l)?G(t,e):null===l[s]?Yl(e,(e=>n(e,s+1))):Q([l[s],null],(l=>n(lt(e,l),s+1)));return n(e,0),t})(e,t),(e=>Yl(e,(e=>lt(r,e)[0](l,...null!=t?t:[],...n))))),e=>q(lt(r,e),(([,l,t])=>(ht(l,null!=t?t:[s],void 0,(l=>(Zl(l,e),Gl(l)?1:0))),nt(r,e),n(e),t))),e=>q(lt(r,e),(([e,,t=[],n,s])=>{const r=(...a)=>{var o,i;const u=M(a);u==M(t)?e(l,...a,...s(a)):O(t[u])?Q(null!=(i=null==(o=n[u])?void 0:o.call(n,...a))?i:[],(e=>r(...a,e))):r(...a,t[u])};r()}))]})(),Le=e=>{if(!Rt(e,((e,l)=>[u,d].includes(l))))return!1;const l=e[u];return!(!P(l)&&l!=o||(He(e[d])!=l&&se(e,d),0))},Me=(l,t)=>(!e||Ul(F,t)||bl(t))&&Rt(l,((e,l)=>je(t,l,e)),(()=>bl(t))),je=(e,l,t,n)=>Rt(n?t:Fe(t,e,l),((n,s)=>q(ze(e,l,s,n),(e=>(t[s]=e,!0)),(()=>!1))),(()=>bl(e,l))),ze=(l,t,n,s)=>e?q(lt(lt(F,l),n),(e=>He(s)!=e[u]?bl(l,t,n,s,e[d]):s),(()=>bl(l,t,n,s))):O(He(s))?bl(l,t,n,s):s,$e=(e,l)=>Rt(l?e:Je(e),((l,t)=>q(Ae(t,l),(l=>(e[t]=l,!0)),(()=>!1))),(()=>pl())),Ae=(e,t)=>l?q(lt(D,e),(l=>He(t)!=l[u]?pl(e,t,l[d]):t),(()=>pl(e,t))):O(He(t))?pl(e,t):t,Fe=(e,l,t)=>(q(lt(J,l),(([n,s])=>{Yl(n,((l,t)=>{ne(e,t)||(e[t]=l)})),Yl(s,(n=>{ne(e,n)||bl(l,t,n)}))})),e),Je=e=>(l&&(Yl(H,((l,t)=>{ne(e,t)||(e[t]=l)})),Yl(U,(l=>{ne(e,l)||pl(l)}))),e),De=e=>rt(F,e,((e,l,t)=>{const n=_l(),s=It();rt(st(F,l,_l),t,((e,l,t)=>{nt(e,l,t),q(t[d],(e=>nt(n,l,e)),(()=>yt(s,l)))})),nt(J,l,[n,s])}),((e,l)=>{nt(F,l),nt(J,l)})),We=e=>rt(D,e,((e,l,t)=>{nt(D,l,t),q(t[d],(e=>nt(H,l,e)),(()=>yt(U,l)))}),((e,l)=>{nt(D,l),nt(H,l),Zl(U,l)})),Ue=e=>ae(e)?ft():mt(e),Ge=e=>rt(Y,e,((e,l,t)=>Ke(l,t)),((e,l)=>sl(l))),Ke=(e,l)=>rt(st(Y,e,(()=>(il(e,1),nt(K,e,Ct()),nt(X,e,_l()),_l()))),l,((l,t,n)=>Xe(e,l,t,n)),((l,t)=>rl(e,l,t))),Xe=(e,l,t,n,s)=>rt(st(l,t,(()=>(ul(e,t,1),_l()))),n,((l,n,s)=>Ye(e,t,l,n,s)),((n,r)=>al(e,l,t,n,r,s))),Ye=(e,l,t,n,s)=>{Ul(t,n)||dl(e,l,n,1);const r=lt(t,n);s!==r&&(cl(e,l,n,r,s),nt(t,n,s))},Ze=(e,l,t,n,s)=>q(lt(l,t),(l=>Ye(e,t,l,n,s)),(()=>Xe(e,l,t,Fe({[n]:s},e,t)))),_e=e=>ae(e)?Nt():bt(e),el=e=>rt(Z,e,((e,l,t)=>ll(l,t)),((e,l)=>ol(l))),ll=(e,l)=>{Ul(Z,e)||hl(e,1);const t=lt(Z,e);l!==t&&(ml(e,t,l),nt(Z,e,l))},tl=(e,l)=>{const[t]=lt(K,e),n=t(l);return Ul(lt(Y,e),n)?tl(e,l):n},nl=e=>{var l;return null!=(l=lt(Y,e))?l:Ke(e,{})},sl=e=>Ke(e,{}),rl=(e,l,t)=>{const[,n]=lt(K,e);n(t),Xe(e,l,t,{},!0)},al=(e,l,t,n,s,r)=>{var a;const o=lt(null==(a=lt(J,e))?void 0:a[0],s);if(!O(o)&&!r)return Ye(e,t,n,s,o);const i=l=>{cl(e,t,l,lt(n,l)),dl(e,t,l,-1),nt(n,l)};O(o)?i(s):tt(n,i),Gl(n)&&(ul(e,t,-1),Gl(nt(l,t))&&(il(e,-1),nt(Y,e),nt(K,e),nt(X,e)))},ol=e=>{const l=lt(H,e);if(!O(l))return ll(e,l);ml(e,lt(Z,e)),hl(e,-1),nt(Z,e)},il=(e,l)=>Ot(h,e,l),ul=(e,l,t)=>Ot(st(V,e,_l),l,t)&&nt(S,e,st(S,e,(()=>0))+t),dl=(e,l,t,n)=>{var s;const r=lt(X,e),a=null!=(s=lt(r,t))?s:0;(0==a&&1==n||1==a&&-1==n)&&Ot(st(k,e,_l),t,n),nt(r,t,a!=-n?a+n:null),Ot(st(st(R,e,_l),l,_l),t,n)},cl=(e,l,t,n,s)=>st(st(st(E,e,_l),l,_l),t,(()=>[n,0]))[1]=s,hl=(e,l)=>Ot(j,e,l),ml=(e,l,t)=>st(z,e,(()=>[l,0]))[1]=t,bl=(e,l,t,n,s)=>(G(st(st(st($,e,_l),l,_l),t,(()=>[])),n),s),pl=(e,l,t)=>(G(st(A,e,(()=>[])),l),t),gl=(e,l,t)=>q(lt(lt(lt(E,e),l),t),(([e,l])=>[!0,e,l]),(()=>[!1,...Tt(El(e,l,t))])),vl=e=>q(lt(z,e),(([e,l])=>[!0,e,l]),(()=>[!1,...Tt(jl(e))])),fl=e=>Gl($)||Gl(we[e])?0:Yl(e?ct($):$,((l,t)=>Yl(l,((l,n)=>Yl(l,((l,s)=>Pe(we[e],[t,n,s],l))))))),Il=e=>Gl(A)||Gl(Ce[e])?0:Yl(e?ut(A):A,((l,t)=>Pe(Ce[e],[t],l))),yl=(e,l,t,n)=>{if(!Gl(e))return Pe(l,n,(()=>at(e))),tt(e,((e,l)=>Pe(t,[...null!=n?n:[],e],1==l))),1},wl=e=>{const l=zl();l!=r&&Pe(_[e],void 0,l);const t=Gl(pe[e]),n=Gl(fe[e])&&Gl(Ie[e])&&Gl(be[e])&&Gl(ge[e])&&Gl(ce[e])&&Gl(he[e])&&Gl(me[e])&&t&&Gl(te[e])&&Gl(ue[e]),s=Gl(ye[e])&&Gl(ve[e])&&Gl(de[e])&&Gl(le[e]);if(!n||!s){const l=e?[ut(h),dt(k),ut(S),dt(V),ct(R),ct(E)]:[h,k,S,V,R,E];if(!n){yl(l[0],te[e],ue[e]),Yl(l[1],((l,t)=>yl(l,ce[e],he[e],[t]))),Yl(l[2],((l,t)=>{0!=l&&Pe(me[e],[t],Ol(t))}));const n=It();Yl(l[3],((l,s)=>{yl(l,be[e],ge[e],[s])&&!t&&(Pe(pe[e],[s,null]),yt(n,s))})),t||Yl(l[5],((l,t)=>{if(!Ul(n,t)){const n=It();Yl(l,(e=>Yl(e,(([l,t],s)=>t!==l?yt(n,s):Zl(e,s))))),Yl(n,(l=>Pe(pe[e],[t,l])))}})),Yl(l[4],((l,t)=>Yl(l,((l,n)=>yl(l,fe[e],Ie[e],[t,n])))))}if(!s){let t;Yl(l[5],((l,n)=>{let s;Yl(l,((l,r)=>{let a;Yl(l,(([l,o],i)=>{o!==l&&(Pe(ye[e],[n,r,i],o,l,gl),t=s=a=1)})),a&&Pe(ve[e],[n,r],gl)})),s&&Pe(de[e],[n],gl)})),t&&Pe(le[e],void 0,gl)}}},Cl=e=>{const l=Dl();l!=a&&Pe(Te[e],void 0,l);const t=Gl(Se[e])&&Gl(xe[e]),n=Gl(Ve[e])&&Gl(ke[e]);if(!t||!n){const l=e?[ut(j),ut(z)]:[j,z];if(t||yl(l[0],Se[e],xe[e]),!n){let t;Yl(l[1],(([l,n],s)=>{n!==l&&(Pe(Ve[e],[s],n,l,vl),t=1)})),t&&Pe(ke[e],void 0,vl)}}},Tl=(e,...l)=>(Mt((()=>e(...W(l,x)))),$t),kl=()=>[at(E,((e,l)=>-1===lt(h,l)?null:at(e,((e,t)=>-1===lt(lt(V,l),t)?null:at(e,(([,e])=>null!=e?e:null),((e,l)=>Vt(l)))),ae)),ae),at(z,(([,e])=>null!=e?e:null),((e,l)=>Vt(l)))],Sl=()=>({cellsTouched:t,valuesTouched:n,changedCells:it(E,xt,Vt),invalidCells:it($),changedValues:at(z,xt,Vt),invalidValues:at(A),changedTableIds:at(h),changedRowIds:ot(V),changedCellIds:it(R),changedValueIds:at(j)}),xl=()=>it(Y),Vl=()=>et(Y),Rl=e=>et(lt(X,x(e))),Ol=e=>Hl(lt(Y,x(e))),ql=e=>et(lt(Y,x(e))),Pl=(e,l,t,n=0,s)=>{return W(L(B((r=lt(Y,x(e)),a=(e,t)=>[O(l)?t:lt(e,x(l)),t],W([...null!=(o=null==r?void 0:r.entries())?o:[]],(([e,l])=>a(l,e)))),(([e],[l])=>{return((null!=(n=e)?n:0)<(null!=(s=l)?s:0)?-1:1)*(t?-1:1);var n,s})),n,O(s)?s:n+s),(([,e])=>e));var r,a,o},Nl=(e,l)=>et(lt(lt(Y,x(e)),x(l))),El=(e,l,t)=>lt(lt(lt(Y,x(e)),x(l)),x(t)),Ll=()=>at(Z),Ml=()=>et(Z),jl=e=>lt(Z,x(e)),zl=()=>!Gl(Y),$l=e=>Ul(Y,x(e)),Al=(e,l)=>Ul(lt(X,x(e)),x(l)),Fl=(e,l)=>Ul(lt(Y,x(e)),x(l)),Jl=(e,l,t)=>Ul(lt(lt(Y,x(e)),x(l)),x(t)),Dl=()=>!Gl(Z),Kl=e=>Ul(Z,x(e)),mt=e=>Tl((()=>(e=>Rt(e,Me,bl))(e)?Ge(e):0)),bt=e=>Tl((()=>$e(e)?el(e):0)),pt=e=>{try{Ue(ie(e))}catch(e){}return $t},gt=l=>Tl((()=>{if((e=Rt(l,(e=>Rt(e,Le))))&&(De(l),!Gl(Y))){const e=xl();ft(),mt(e)}})),vt=e=>Tl((()=>{if(l=(e=>Rt(e,Le))(e)){const t=Ll();Lt(),Nt(),l=!0,We(e),bt(t)}})),ft=()=>Tl((()=>Ge({}))),wt=e=>Tl((e=>Ul(Y,e)?sl(e):0),e),Pt=(e,l)=>Tl(((e,l)=>q(lt(Y,e),(t=>Ul(t,l)?rl(e,t,l):0))),e,l),Nt=()=>Tl((()=>el({}))),Et=()=>Tl((()=>{De({}),e=!1})),Lt=()=>Tl((()=>{We({}),l=!1})),Mt=(e,l)=>{if(-1!=i){jt();const t=e();return zt(l),t}},jt=()=>(-1!=i&&i++,1==i&&Pe(Re,void 0,kl,Sl),$t),zt=e=>(i>0&&(i--,0==i&&(t=!Gl(E),n=!Gl(z),i=1,fl(1),t&&wl(1),Il(1),n&&Cl(1),(null==e?void 0:e(kl,Sl))&&(Yl(E,((e,l)=>Yl(e,((e,t)=>Yl(e,(([e],n)=>Be($t,l,t,n,e))))))),Yl(z,(([e],l)=>Qe($t,l,e))),t=n=!1),Pe(Oe[0],void 0,kl,Sl),i=-1,fl(0),t&&wl(0),Il(0),n&&Cl(0),Pe(Oe[1],void 0,kl,Sl),i=0,t=n=!1,r=zl(),a=Dl(),Q([h,k,S,V,R,E,$,j,z,A],Xl))),$t),$t={getContent:()=>[xl(),Ll()],getTables:xl,getTableIds:Vl,getTable:e=>ot(lt(Y,x(e))),getTableCellIds:Rl,getRowCount:Ol,getRowIds:ql,getSortedRowIds:Pl,getRow:(e,l)=>at(lt(lt(Y,x(e)),x(l))),getCellIds:Nl,getCell:El,getValues:Ll,getValueIds:Ml,getValue:jl,hasTables:zl,hasTable:$l,hasTableCell:Al,hasRow:Fl,hasCell:Jl,hasValues:Dl,hasValue:Kl,getTablesJson:()=>oe(Y),getValuesJson:()=>oe(Z),getJson:()=>oe([Y,Z]),getTablesSchemaJson:()=>oe(F),getValuesSchemaJson:()=>oe(D),getSchemaJson:()=>oe([F,D]),hasTablesSchema:()=>e,hasValuesSchema:()=>l,setContent:([e,l])=>Tl((()=>{(ae(e)?ft:mt)(e),(ae(l)?Nt:bt)(l)})),setTables:mt,setTable:(e,l)=>Tl((e=>Me(l,e)?Ke(e,l):0),e),setRow:(e,l,t)=>Tl(((e,l)=>je(e,l,t)?Xe(e,nl(e),l,t):0),e,l),addRow:(e,l,t=!0)=>Mt((()=>{let n;return je(e,n,l)&&(e=x(e),Xe(e,nl(e),n=tl(e,t?1:0),l)),n})),setPartialRow:(e,l,t)=>Tl(((e,l)=>{if(je(e,l,t,1)){const n=nl(e);re(t,((t,s)=>Ze(e,n,l,s,t)))}}),e,l),setCell:(e,l,t,n)=>Tl(((e,l,t)=>q(ze(e,l,t,N(n)?n(El(e,l,t)):n),(n=>Ze(e,nl(e),l,t,n)))),e,l,t),setValues:bt,setPartialValues:e=>Tl((()=>$e(e,1)?re(e,((e,l)=>ll(l,e))):0)),setValue:(e,l)=>Tl((e=>q(Ae(e,N(l)?l(jl(e)):l),(l=>ll(e,l)))),e),setTransactionChanges:e=>Tl((()=>{re(e[0],((e,l)=>O(e)?wt(l):re(e,((e,t)=>O(e)?Pt(l,t):re(e,((e,n)=>Be($t,l,t,n,e))))))),re(e[1],((e,l)=>Qe($t,l,e)))})),setTablesJson:pt,setValuesJson:e=>{try{_e(ie(e))}catch(e){}return $t},setJson:e=>Tl((()=>{try{const[l,t]=ie(e);Ue(l),_e(t)}catch(l){pt(e)}})),setTablesSchema:gt,setValuesSchema:vt,setSchema:(e,l)=>Tl((()=>{gt(e),vt(l)})),delTables:ft,delTable:wt,delRow:Pt,delCell:(e,l,t,n)=>Tl(((e,l,t)=>q(lt(Y,e),(s=>q(lt(s,l),(r=>Ul(r,t)?al(e,s,l,r,t,n):0))))),e,l,t),delValues:Nt,delValue:e=>Tl((e=>Ul(Z,e)?ol(e):0),e),delTablesSchema:Et,delValuesSchema:Lt,delSchema:()=>Tl((()=>{Et(),Lt()})),transaction:Mt,startTransaction:jt,finishTransaction:zt,forEachTable:e=>Yl(Y,((l,t)=>e(t,(e=>Yl(l,((l,t)=>e(t,(e=>tt(l,e))))))))),forEachTableCell:(e,l)=>tt(lt(X,x(e)),l),forEachRow:(e,l)=>Yl(lt(Y,x(e)),((e,t)=>l(t,(l=>tt(e,l))))),forEachCell:(e,l,t)=>tt(lt(lt(Y,x(e)),x(l)),t),forEachValue:e=>tt(Z,e),addSortedRowIdsListener:(e,l,t,n,s,r,a)=>{let o=Pl(e,l,t,n,s);return qe((()=>{const a=Pl(e,l,t,n,s);var i,u,d;u=o,M(i=a)===M(u)&&(d=(e,l)=>u[l]===e,i.every(d))||(o=a,r($t,e,l,t,n,s,o))}),pe[a?1:0],[e,l],[Vl])},addStartTransactionListener:e=>qe(e,Re),addWillFinishTransactionListener:e=>qe(e,Oe[0]),addDidFinishTransactionListener:e=>qe(e,Oe[1]),callListener:e=>(Ee(e),$t),delListener:e=>(Ne(e),$t),getListenerStats:()=>({hasTables:kt(_),tables:kt(le),tableIds:kt(te),hasTable:kt(ue),table:kt(de),tableCellIds:kt(ce),hasTableCell:kt(he,Ql),rowCount:kt(me),rowIds:kt(be),sortedRowIds:kt(pe),hasRow:kt(ge,Ql),row:kt(ve,Ql),cellIds:kt(fe,Ql),hasCell:kt(Ie,Wl),cell:kt(ye,Wl),invalidCell:kt(we,Wl),hasValues:kt(Te),values:kt(ke),valueIds:kt(Se),hasValue:kt(xe),value:kt(Ve),invalidValue:kt(Ce),transaction:Bl(Re)+kt(Oe)}),createStore:qt,addListener:qe,callListeners:Pe};return re({[c+b]:[0,_,[],()=>[zl()]],[b]:[0,le],[p]:[0,te],[c+m]:[1,ue,[Vl],e=>[$l(...e)]],[m]:[1,de,[Vl]],[m+y]:[1,ce,[Vl]],[c+m+I]:[2,he,[Vl,Rl],e=>[Al(...e)]],[v]:[1,me,[Vl]],[f]:[1,be,[Vl]],[c+g]:[2,ge,[Vl,ql],e=>[Fl(...e)]],[g]:[2,ve,[Vl,ql]],[y]:[2,fe,[Vl,ql]],[c+I]:[3,Ie,[Vl,ql,Nl],e=>[Jl(...e)]],[I]:[3,ye,[Vl,ql,Nl],e=>Tt(El(...e))],InvalidCell:[3,we],[c+C]:[0,Te,[],()=>[Dl()]],[C]:[0,ke],[T]:[0,Se],[c+w]:[1,xe,[Ml],e=>[Kl(...e)]],[w]:[1,Ve,[Ml],e=>Tt(jl(e[0]))],InvalidValue:[1,Ce]},(([e,l,t,n],s)=>{$t["add"+s+"Listener"]=(...s)=>qe(s[e],l[s[e+1]?1:0],e>0?L(s,0,e):void 0,t,n)})),ee($t)},Pt=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(qt),s=ce.indexOf(e);return t.useCreatePersister(n,(e=>((e,l,t,n)=>((e,l,t,n,s,r,[a,o]=[],i=[])=>{let u,d,c,h=0,m=0,b=0,p=0;st(bt,i,(()=>0)),st(pt,i,(()=>[]));const g=e=>mt(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield v.schedule((()=>mt(void 0,null,(function*(){yield e(),h=0}))))),v})),v={load:(t,n)=>mt(void 0,null,(function*(){return yield g((()=>mt(void 0,null,(function*(){try{e.setContent(yield l())}catch(l){e.setContent([t,n])}}))))})),startAutoLoad:(...t)=>mt(void 0,[...t],(function*(t={},s={}){return v.stopAutoLoad(),yield v.load(t,s),p=1,c=n(((t,n)=>mt(void 0,null,(function*(){if(n){const l=n();yield g((()=>mt(void 0,null,(function*(){return e.setTransactionChanges(l)}))))}else yield g((()=>mt(void 0,null,(function*(){var n;try{e.setContent(null!=(n=null==t?void 0:t())?n:yield l())}catch(e){}}))))})))),v})),stopAutoLoad:()=>(p&&(s(c),c=void 0,p=0),v),save:l=>mt(void 0,null,(function*(){return 1!=h&&(h=2,b++,yield v.schedule((()=>mt(void 0,null,(function*(){try{yield t(e.getContent,l)}catch(e){}h=0}))))),v})),startAutoSave:()=>mt(void 0,null,(function*(){return yield v.stopAutoSave().save(),u=e.addDidFinishTransactionListener(((e,l)=>{const[t,n]=l();ae(t)&&ae(n)||v.save((()=>[t,n]))})),v})),stopAutoSave:()=>(q(u,e.delListener),u=void 0,v),schedule:(...e)=>mt(void 0,null,(function*(){return G(lt(pt,i),...e),yield mt(void 0,null,(function*(){if(!lt(bt,i)){for(nt(bt,i,1);!O(d=K(lt(pt,i)));)try{yield d()}catch(e){}nt(bt,i,0)}})),v})),getStore:()=>e,destroy:()=>v.stopAutoLoad().stopAutoSave(),getStats:()=>({loads:m,saves:b})};return a&&(v[a]=()=>o),ee(v)})(e,(()=>gt(void 0,null,(function*(){return ie(t.getItem(l))}))),(e=>gt(void 0,null,(function*(){return t.setItem(l,oe(e()))}))),(e=>{const n=n=>{n.storageArea===t&&n.key===l&&e((()=>ie(n.newValue)))};return ft.addEventListener(vt,n),n}),(e=>ft.removeEventListener(vt,e)),0,["getStorageName",l]))(e,ue,sessionStorage)),void 0,(e=>{return t=function*(){yield e.load(void 0,{position:-1==s?1:s,open:!!l}),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=l=>l.done?e(l.value):Promise.resolve(l.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),$(z,null,$("aside",{id:ue},$(Je,{s:n}),$(Jl,{s:n})),$("style",null,Fe))};var Nt=Object.defineProperty,Et=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,jt=(e,l,t)=>l in e?Nt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t;e.EditableCellView=Tl,e.EditableValueView=kl,e.RelationshipInHtmlTable=wl,e.ResultSortedTableInHtmlTable=Cl,e.ResultTableInHtmlTable=e=>{var l=e,{queryId:n,queries:s,customCells:r}=l,a=tl(l,["queryId","queries","customCells"]);return $(bl,ll(el({},a),{params:ul(ml(t.useResultTableCellIds(n,s),r,t.ResultCellView),cl(s,n),t.useResultRowIds(n,s))}))},e.SliceInHtmlTable=yl,e.SortedTableInHtmlTable=fl,e.SortedTablePaginator=Sl,e.StoreInspector=e=>$(Pt,((e,l)=>{for(var t in l||(l={}))Lt.call(l,t)&&jt(e,t,l[t]);if(Et)for(var t of Et(l))Mt.call(l,t)&&jt(e,t,l[t]);return e})({},e)),e.TableInHtmlTable=e=>{var l=e,{tableId:n,store:s,editable:r,customCells:a}=l,o=tl(l,["tableId","store","editable","customCells"]);return $(bl,ll(el({},o),{params:ul(ml(t.useTableCellIds(n,s),a,r?Tl:t.CellView),dl(s,n),t.useRowIds(n,s))}))},e.ValuesInHtmlTable=Il},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDomDebug={},e.React,e.TinyBaseUiReact);
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,l;e=this,l=function(e,l,t){"use strict";const a=e=>typeof e,n=a(""),o=a(!0),r=a(0),i="Value",s="currentTarget",d="value",u=isFinite,c=e=>null==e,{PureComponent:m,Fragment:h,createElement:b,useCallback:p,useLayoutEffect:g,useRef:f,useState:w}=l,y=(e,...l)=>c(e)?{}:e(...l),v=(e,l)=>e.map(l),I=Object,C=(e=[])=>I.fromEntries(e),k=(e,l)=>v(I.entries(e),(([e,t])=>l(t,e))),x="tinybaseStoreInspector",T="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",R='content:url("',O=R+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",S='</svg>")',N=R+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",V=v([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,l,t,a])=>O+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${l}' width='${t}' height='${a}' fill='white'/>`+S)),j=O+"<path d='M20 20l60 60M20 80l60-60' />"+S,z=O+`<path d='${T}' />`+S,P=O+`<path d='${T}M20 20l60 60' />`+S;var $=Object.defineProperty,q=Object.defineProperties,M=Object.getOwnPropertyDescriptors,B=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,F=(e,l,t)=>l in e?$(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,D=(e,l)=>{for(var t in l||(l={}))E.call(l,t)&&F(e,t,l[t]);if(B)for(var t of B(l))H.call(l,t)&&F(e,t,l[t]);return e},A=(e,l)=>q(e,M(l));const L="*::-webkit-scrollbar";((e,l="")=>{e.join(l)})(k(A(D(A(D(A(D({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[L]:"width:0.5rem;height:0.5rem;",[L+"-track"]:"background:#111",[L+"-thumb"]:"background:#999;border:1px solid #111",[L+"-thumb:hover"]:"background:#fff",[L+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+N},C(v(["bottom:0;left:0","top:0;right:0"],((e,l)=>[`>img[data-position='${l}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),C(v(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,l)=>[`main[data-position='${l}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":N,"header>img:nth-of-type(6)":j}),C(v(V,((e,l)=>[`header>img[data-id='${l}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":z,"details[open]>summary img.done":P,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem",[`th,#${x} td`]:"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,l)=>e?`#${x} ${l}{${e}}`:"")));const U=(e,l,t,a)=>e==n?l:e==r?t:a;var G=Object.defineProperty,J=Object.defineProperties,K=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,Y=(e,l,t)=>l in e?G(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Z=(e,l)=>{for(var t in l||(l={}))W.call(l,t)&&Y(e,t,l[t]);if(Q)for(var t of Q(l))X.call(l,t)&&Y(e,t,l[t]);return e},_=(e,l)=>J(e,K(l)),ee=(e,l)=>{var t={};for(var a in e)W.call(e,a)&&l.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&Q)for(var a of Q(e))l.indexOf(a)<0&&X.call(e,a)&&(t[a]=e[a]);return t};const{useCallback:le,useMemo:te,useState:ae}=l,ne="editable",oe=(e,l)=>v(t.useTableCellIds(e,l),(l=>e+"."+l)),re=(e,l,t)=>{const a=le(e,l);return t?a:void 0},ie=(...e)=>te((()=>e),e),se=(e,l)=>te((()=>({store:e,tableId:l})),[e,l]),de=(e,l)=>te((()=>({queries:e,queryId:l})),[e,l]),ue=(e,l=!1,t,a=0,n,o,r,i)=>{const[[s,d,u],c]=ae([e,l,a]),m=le((e=>{c(e),null==i||i(e)}),[i]),h=re((e=>m([e,e==s&&!d,u])),[m,s,d,u],t),p=le((e=>m([s,d,e])),[m,s,d]),g=!0===r?we:r;return[[s,d,u],h,te((()=>!1===r?null:b(g,{offset:u,limit:n,total:o,onChange:p})),[r,g,u,n,o,p])]},ce=(e,l,t)=>te((()=>{const o=null!=l?l:e;return C(k(Array.isArray(o)?C(v(o,(e=>[e,e]))):o,((e,l)=>{return[l,Z(Z({},{label:l,component:t}),(o=e,a(o)==n?{label:e}:e))];var o})))}),[l,t,e]),me=({className:e,headerRow:l,idColumn:t,params:[a,n,o,r,i,s]})=>b("table",{className:e},s?b("caption",null,s):null,!1===l?null:b("thead",null,b("tr",null,!1===t?null:b(he,{sort:null!=r?r:[],label:"Id",onClick:i}),k(a,(({label:e},l)=>b(he,{key:l,cellId:l,label:e,sort:null!=r?r:[],onClick:i}))))),b("tbody",null,v(o,(e=>b("tr",{key:e},!1===t?null:b("th",null,e),k(a,(({component:l,getComponentProps:t},a)=>b("td",{key:a},b(l,_(Z(Z({},y(t,e,a)),n),{rowId:e,cellId:a})))))))))),he=({cellId:e,sort:[l,t],label:a=(null!=e?e:""),onClick:n})=>b("th",{onClick:re((()=>null==n?void 0:n(e)),[n,e],n),className:c(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},c(t)||l!=e?null:(t?"↓":"↑")+" ",a),be=({localRowId:e,params:[a,n,o,r,i,s,d]})=>{const u=t.useRemoteRowId(i,e,s);return b("tr",null,!1===a?null:b(l.Fragment,null,b("th",null,e),b("th",null,u)),k(n,(({component:l,getComponentProps:t},a)=>{const[n,i]=a.split(".",2),s=n===o?e:n===r?u:null;return c(s)?null:b("td",{key:a},b(l,_(Z({},y(t,s,i)),{store:d,tableId:n,rowId:s,cellId:i})))})))},pe=({thing:e,onThingChange:l,className:t,hasSchema:i,showType:c=!0})=>{const[m,h]=ae(),[p,g]=ae(),[f,w]=ae(),[y,v]=ae(),[I,C]=ae();p!==e&&(h((e=>{const l=a(e);return(e=>e==n||e==o)(l)||l==r&&u(e)?l:void 0})(e)),g(e),w(e+""),v(Number(e)||0),C(!!e));const k=le(((e,t)=>{t(e),g(e),l(e)}),[l]),x=le((()=>{if(!(null==i?void 0:i())){const e=U(m,r,o,n),t=U(e,f,y,I);h(e),g(t),l(t)}}),[i,l,f,y,I,m]);return b("div",{className:t},c?b("button",{className:m,onClick:x},m):null,U(m,b("input",{key:m,value:f,onChange:le((e=>k(e[s][d]+"",w)),[k])}),b("input",{key:m,type:"number",value:y,onChange:le((e=>k(Number(e[s][d]||0),v)),[k])}),b("input",{key:m,type:"checkbox",checked:I,onChange:le((e=>k(!!e[s].checked,C)),[k])})))},ge=({tableId:e,rowId:l,cellId:a,store:n,className:o,showType:r})=>{var i;return b(pe,{thing:t.useCell(e,l,a,n),onThingChange:t.useSetCellCallback(e,l,a,(e=>e),[],n),className:null!=o?o:ne+"Cell",showType:r,hasSchema:null==(i=t.useStoreOrStoreById(n))?void 0:i.hasTablesSchema})},fe=({valueId:e,store:l,className:a,showType:n})=>{var o;return b(pe,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=a?a:ne+i,showType:n,hasSchema:null==(o=t.useStoreOrStoreById(l))?void 0:o.hasValuesSchema})},we=({onChange:e,total:t,offset:a=0,limit:n=t,singular:o="row",plural:r=o+"s"})=>{(a>t||a<0)&&(a=0,e(0));const i=re((()=>e(a-n)),[e,a,n],a>0),s=re((()=>e(a+n)),[e,a,n],a+n<t);return b(l.Fragment,null,t>n&&b(l.Fragment,null,b("button",{className:"previous",disabled:0==a,onClick:i},"←"),b("button",{className:"next",disabled:a+n>=t,onClick:s},"→"),a+1," to ",Math.min(t,a+n)," of "),t," ",1!=t?r:o)},ye=e=>new Map(e);ye(),ye(),e.EditableCellView=ge,e.EditableValueView=fe,e.RelationshipInHtmlTable=({relationshipId:e,relationships:a,editable:n,customCells:o,className:r,headerRow:i,idColumn:s=!0})=>{const[d,u,c,m]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(t.useRelationshipsOrRelationshipsById(a),e),h=ce([...oe(c,u),...oe(m,u)],o,n?ge:t.CellView),p=ie(s,h,c,m,e,d,u);return b("table",{className:r},!1===i?null:b("thead",null,b("tr",null,!1===s?null:b(l.Fragment,null,b("th",null,c,".Id"),b("th",null,m,".Id")),k(h,(({label:e},l)=>b("th",{key:l},e))))),b("tbody",null,v(t.useRowIds(c,u),(e=>b(be,{key:e,localRowId:e,params:p})))))},e.ResultSortedTableInHtmlTable=e=>{var l=e,{queryId:a,cellId:n,descending:o,offset:r,limit:i,queries:s,sortOnClick:d,paginator:u=!1,customCells:c,onChange:m}=l,h=ee(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[p,g,f]=ue(n,o,d,r,i,t.useResultRowCount(a,s),u,m);return b(me,_(Z({},h),{params:ie(ce(t.useResultTableCellIds(a,s),c,t.ResultCellView),de(s,a),t.useResultSortedRowIds(a,...p,i,s),p,g,f)}))},e.ResultTableInHtmlTable=e=>{var l=e,{queryId:a,queries:n,customCells:o}=l,r=ee(l,["queryId","queries","customCells"]);return b(me,_(Z({},r),{params:ie(ce(t.useResultTableCellIds(a,n),o,t.ResultCellView),de(n,a),t.useResultRowIds(a,n))}))},e.SliceInHtmlTable=e=>{var l=e,{indexId:a,sliceId:n,indexes:o,editable:r,customCells:i}=l,s=ee(l,["indexId","sliceId","indexes","editable","customCells"]);const[d,u,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(t.useIndexesOrIndexesById(o),a);return b(me,_(Z({},s),{params:ie(ce(t.useTableCellIds(c,u),i,r?ge:t.CellView),se(u,c),t.useSliceRowIds(a,n,d))}))},e.SortedTableInHtmlTable=e=>{var l=e,{tableId:a,cellId:n,descending:o,offset:r,limit:i,store:s,editable:d,sortOnClick:u,paginator:c=!1,onChange:m,customCells:h}=l,p=ee(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[g,f,w]=ue(n,o,u,r,i,t.useRowCount(a,s),c,m);return b(me,_(Z({},p),{params:ie(ce(t.useTableCellIds(a,s),h,d?ge:t.CellView),se(s,a),t.useSortedRowIds(a,...g,i,s),g,f,w)}))},e.SortedTablePaginator=we,e.StoreInspector=e=>null,e.TableInHtmlTable=e=>{var l=e,{tableId:a,store:n,editable:o,customCells:r}=l,i=ee(l,["tableId","store","editable","customCells"]);return b(me,_(Z({},i),{params:ie(ce(t.useTableCellIds(a,n),r,o?ge:t.CellView),se(n,a),t.useRowIds(a,n))}))},e.ValuesInHtmlTable=({store:e,editable:l=!1,valueComponent:a=(l?fe:t.ValueView),getValueComponentProps:n,className:o,headerRow:r,idColumn:s})=>b("table",{className:o},!1===r?null:b("thead",null,b("tr",null,!1===s?null:b("th",null,"Id"),b("th",null,i))),b("tbody",null,v(t.useValueIds(e),(l=>b("tr",{key:l},!1===s?null:b("th",null,l),b("td",null,b(a,_(Z({},y(n,l)),{valueId:l,store:e}))))))))},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("react"),require("./ui-react")):"function"==typeof define&&define.amd?define(["exports","react","./ui-react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.React,e.TinyBaseUiReact);
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,l="",o=t(l),r=t(t),u="Listener",n="Result",d="Has",i="has",a="Ids",c="Table",I=c+"s",C=c+a,p="Row",b=p+"Count",w=p+a,R="Sorted"+p+a,k="Cell",v=k+a,g="Value",h=g+"s",y=g+a,m=e=>null==e,L=(e,s,t)=>m(e)?null==t?void 0:t():s(e),f=e=>t(e)==o,T=e=>t(e)==r,V=()=>{},S=(e,s)=>e.map(s),P=Object.keys,x=(e,s)=>L(e,(e=>e[s])),{createContext:O,useContext:q,useEffect:B}=s,H=O([]),M=(e,s)=>{var t;const l=q(H);return m(e)?l[s]:f(e)?x(null!=(t=l[s+1])?t:{},e):e},D=(e,s)=>{const t=M(e,s);return m(e)||f(e)?t:e},j=e=>{var s;return P(null!=(s=q(H)[e])?s:{})},F=e=>D(e,0),Q=e=>D(e,2),E=e=>D(e,4),A=e=>D(e,6),G=e=>D(e,8),U=e=>D(e,10),W=e=>e.toLowerCase();W(u);const z="Transaction";W(z);const{useCallback:J,useEffect:K,useMemo:N,useLayoutEffect:X,useRef:Y,useState:Z}=s,$=[],_={},ee=[[],void 0,[]],se=(e,s,t=$)=>{const l=N((()=>s(e)),[e,...t]);return K((()=>()=>l.destroy()),[l]),l},te=(e,s,t,l=$,o,r="get",u="")=>{const[,n]=Z(),d=J((()=>{var o,u;return null!=(u=null==(o=null==s?void 0:s[r+e])?void 0:o.call(s,...l))?u:t}),[s,r,e,...l,t]),i=Y();return N((()=>i.current=d()),[d]),le(u+e,s,((...e)=>{i.current=m(o)?d():e[o],n([])}),[d,o],l),i.current},le=(e,s,t,l=$,o=$,...r)=>X((()=>{var l;const n=null==(l=null==s?void 0:s["add"+e+u])?void 0:l.call(s,...o,t,...r);return()=>null==s?void 0:s.delListener(n)}),[s,e,...o,...l,...r]),oe=(e,s,t,l=$,o=V,r=$,...u)=>{const n=F(e);return J((e=>L(n,(l=>L(t(e,l),(t=>o(l["set"+s](...S(u,(s=>T(s)?s(e,l):s)),t),t)))))),[n,s,...l,...r,...u])},re=(e,s,t=V,l=$,...o)=>{const r=F(e);return J((()=>t(null==r?void 0:r["del"+s](...o))),[r,s,...l,...o])},ue=(e,s,t)=>{const l=U(e);return J((()=>null==l?void 0:l[s](t)),[l,s,t])},ne=e=>te(C,F(e),$),de=(e,s)=>te(w,F(s),$,[e]),ie=(e,s,t,l=0,o,r)=>te(R,F(r),$,[e,s,t,l,o],6),ae=(e,s,t)=>te(v,F(t),$,[e,s]),ce=(e,s,t,l)=>te(k,F(l),void 0,[e,s,t],4),Ie=e=>te(y,F(e),$),Ce=(e,s)=>te(g,F(s),void 0,[e]),pe=(e,s)=>te("Metric",Q(s),void 0,[e]),be=(e,s)=>te("SliceIds",E(s),$,[e]),we=(e,s,t)=>te("Slice"+w,E(t),$,[e,s]),Re=(e,s,t)=>te("RemoteRowId",A(t),void 0,[e,s]),ke=(e,s,t)=>te("Local"+w,A(t),$,[e,s]),ve=(e,s,t)=>te("Linked"+w,A(t),$,[e,s]),ge=(e,s)=>te(n+w,G(s),$,[e]),he=(e,s,t,l=0,o,r)=>te(n+R,G(r),$,[e,s,t,l,o],6),ye=(e,s,t)=>te(n+v,G(t),$,[e,s]),me=(e,s,t,l)=>te(n+k,G(l),void 0,[e,s,t]),Le=e=>te("CheckpointIds",U(e),ee),fe=(e,s)=>te("Checkpoint",U(s),void 0,[e]),Te=e=>ue(e,"goBackward"),Ve=e=>ue(e,"goForward"),{PureComponent:Se,Fragment:Pe,createElement:xe,useCallback:Oe,useLayoutEffect:qe,useRef:Be,useState:He}=s,Me=(e,...s)=>m(e)?{}:e(...s),De=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var je=Object.defineProperty,Fe=Object.defineProperties,Qe=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,Ue=(e,s,t)=>s in e?je(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,We=(e,s)=>{for(var t in s||(s={}))Ae.call(s,t)&&Ue(e,t,s[t]);if(Ee)for(var t of Ee(s))Ge.call(s,t)&&Ue(e,t,s[t]);return e},ze=(e,s)=>Fe(e,Qe(s)),Je=(e,s)=>{var t={};for(var l in e)Ae.call(e,l)&&s.indexOf(l)<0&&(t[l]=e[l]);if(null!=e&&Ee)for(var l of Ee(e))s.indexOf(l)<0&&Ge.call(e,l)&&(t[l]=e[l]);return t};const{useCallback:Ke,useContext:Ne,useMemo:Xe,useState:Ye}=s,Ze=({tableId:e,store:s,rowComponent:t=ls,getRowComponentProps:l,customCellIds:o,separator:r,debugIds:u},n)=>ss(S(n,(r=>xe(t,ze(We({},Me(l,r)),{key:r,tableId:e,rowId:r,customCellIds:o,store:s,debugIds:u})))),r,u,e),$e=({queryId:e,queries:s,resultRowComponent:t=ds,getResultRowComponentProps:l,separator:o,debugIds:r},u)=>ss(S(u,(o=>xe(t,ze(We({},Me(l,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:r})))),o,r,e),_e=({relationshipId:e,relationships:s,rowComponent:t=ls,getRowComponentProps:l,separator:o,debugIds:r},u,n)=>{const[d,i,a]=De(A(s),e),c=u(e,n,d);return ss(S(c,(e=>xe(t,ze(We({},Me(l,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:r})))),o,r,n)},es=e=>({checkpoints:s,checkpointComponent:t=is,getCheckpointComponentProps:l,separator:o,debugIds:r})=>{const u=U(s);return ss(S(e(Le(u)),(e=>xe(t,ze(We({},Me(l,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:r})))),o)},ss=(e,s,t,l)=>{const o=m(s)||!Array.isArray(e)?e:S(e,((e,t)=>t>0?[s,e]:e));return t?[l,":{",o,"}"]:o},ts=({tableId:e,rowId:s,cellId:t,store:o,debugIds:r})=>{var u;return ss(l+(null!=(u=ce(e,s,t,o))?u:l),void 0,r,t)},ls=({tableId:e,rowId:s,store:t,cellComponent:l=ts,getCellComponentProps:o,customCellIds:r,separator:u,debugIds:n})=>ss(S(((e,s,t,l)=>{const o=ae(s,t,l);return null!=e?e:o})(r,e,s,t),(r=>xe(l,ze(We({},Me(o,r)),{key:r,tableId:e,rowId:s,cellId:r,store:t,debugIds:n})))),u,n,s),os=e=>Ze(e,de(e.tableId,e.store)),rs=({valueId:e,store:s,debugIds:t})=>{var o;return ss(l+(null!=(o=Ce(e,s))?o:l),void 0,t,e)},us=({indexId:e,sliceId:s,indexes:t,rowComponent:l=ls,getRowComponentProps:o,separator:r,debugIds:u})=>{const[n,d,i]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(E(t),e),a=we(e,s,n);return ss(S(a,(e=>xe(l,ze(We({},Me(o,e)),{key:e,tableId:i,rowId:e,store:d,debugIds:u})))),r,u,s)},ns=({queryId:e,rowId:s,cellId:t,queries:o,debugIds:r})=>{var u;return ss(l+(null!=(u=me(e,s,t,o))?u:l),void 0,r,t)},ds=({queryId:e,rowId:s,queries:t,resultCellComponent:l=ns,getResultCellComponentProps:o,separator:r,debugIds:u})=>ss(S(ye(e,s,t),(r=>xe(l,ze(We({},Me(o,r)),{key:r,queryId:e,rowId:s,cellId:r,queries:t,debugIds:u})))),r,u,s),is=({checkpoints:e,checkpointId:s,debugIds:t})=>{var o;return ss(null!=(o=fe(s,e))?o:l,void 0,t,s)},as=es((e=>e[0])),cs=es((e=>m(e[1])?[]:[e[1]])),Is=es((e=>e[2]));e.BackwardCheckpointsView=as,e.CellView=ts,e.CheckpointView=is,e.CurrentCheckpointView=cs,e.ForwardCheckpointsView=Is,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=us,getSliceComponentProps:l,separator:o,debugIds:r})=>ss(S(be(e,s),(o=>xe(t,ze(We({},Me(l,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:r})))),o,r,e),e.LinkedRowsView=e=>_e(e,ve,e.firstRowId),e.LocalRowsView=e=>_e(e,ke,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var o;return ss(null!=(o=pe(e,s))?o:l,void 0,t,e)},e.Provider=({store:e,storesById:s,metrics:t,metricsById:l,indexes:o,indexesById:r,relationships:u,relationshipsById:n,queries:d,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const C=Ne(H),[p,b]=Ye({}),w=Ke(((e,s)=>b((t=>x(t,e)==s?t:ze(We({},t),{[e]:s})))),[]),R=Ke((e=>b((s=>We({},((e,s)=>(delete e[s],e))(s,e))))),[]);return xe(H.Provider,{value:Xe((()=>[null!=e?e:C[0],We(We(We({},C[1]),s),p),null!=t?t:C[2],We(We({},C[3]),l),null!=o?o:C[4],We(We({},C[5]),r),null!=u?u:C[6],We(We({},C[7]),n),null!=d?d:C[8],We(We({},C[9]),i),null!=a?a:C[10],We(We({},C[11]),c),w,R]),[e,s,p,t,l,o,r,u,n,d,i,a,c,C,w,R])},I)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:l=ls,getRowComponentProps:o,debugIds:r})=>{const[u,n,,d]=De(A(t),e),i=Re(e,s,u);return ss(m(d)||m(i)?null:xe(l,ze(We({},Me(o,i)),{key:i,tableId:d,rowId:i,store:n,debugIds:r})),void 0,r,s)},e.ResultCellView=ns,e.ResultRowView=ds,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:l,offset:o,limit:r}=s,u=Je(s,["cellId","descending","offset","limit"]);return $e(u,he(u.queryId,t,l,o,r,u.queries))},e.ResultTableView=e=>$e(e,ge(e.queryId,e.queries)),e.RowView=ls,e.SliceView=us,e.SortedTableView=e=>{var s=e,{cellId:t,descending:l,offset:o,limit:r}=s,u=Je(s,["cellId","descending","offset","limit"]);return Ze(u,ie(u.tableId,t,l,o,r,u.store))},e.TableView=os,e.TablesView=({store:e,tableComponent:s=os,getTableComponentProps:t,separator:l,debugIds:o})=>ss(S(ne(e),(l=>xe(s,ze(We({},Me(t,l)),{key:l,tableId:l,store:e,debugIds:o})))),l),e.ValueView=rs,e.ValuesView=({store:e,valueComponent:s=rs,getValueComponentProps:t,separator:l,debugIds:o})=>ss(S(Ie(e),(l=>xe(s,ze(We({},Me(t,l)),{key:l,valueId:l,store:e,debugIds:o})))),l),e.useAddRowCallback=(e,s,t=$,l,o=V,r=$,u=!0)=>{const n=F(l);return J((t=>L(n,(l=>L(s(t,l),(s=>o(l.addRow(T(e)?e(t,l):e,s,u),l,s)))))),[n,e,...t,...r,u])},e.useCell=ce,e.useCellIds=ae,e.useCellIdsListener=(e,s,t,l,o,r)=>le(v,F(r),t,l,[e,s],o),e.useCellListener=(e,s,t,l,o,r,u)=>le(k,F(u),l,o,[e,s,t],r),e.useCheckpoint=fe,e.useCheckpointIds=Le,e.useCheckpointIdsListener=(e,s,t)=>le("CheckpointIds",U(t),e,s),e.useCheckpointListener=(e,s,t,l)=>le("Checkpoint",U(l),s,t,[e]),e.useCheckpoints=e=>M(e,10),e.useCheckpointsIds=()=>j(11),e.useCheckpointsOrCheckpointsById=U,e.useCreateCheckpoints=(e,s,t)=>se(e,s,t),e.useCreateIndexes=(e,s,t)=>se(e,s,t),e.useCreateMetrics=(e,s,t)=>se(e,s,t),e.useCreatePersister=(e,s,t=$,l,o=$,r,u=$)=>{const[,n]=Z(),d=N((()=>s(e)),[e,...t]);return K((()=>{var e;return e=function*(){l&&(yield l(d),n([]))},new Promise(((s,t)=>{var l=s=>{try{r(e.next(s))}catch(e){t(e)}},o=s=>{try{r(e.throw(s))}catch(e){t(e)}},r=e=>e.done?s(e.value):Promise.resolve(e.value).then(l,o);r((e=e.apply(void 0,null)).next())})),()=>{null==d||d.destroy(),null==r||r(d)}}),[d,...o,...u]),d},e.useCreateQueries=(e,s,t)=>se(e,s,t),e.useCreateRelationships=(e,s,t)=>se(e,s,t),e.useCreateStore=(e,s=$)=>N(e,s),e.useDelCellCallback=(e,s,t,l,o,r,u)=>re(o,k,r,u,e,s,t,l),e.useDelRowCallback=(e,s,t,l,o)=>re(t,p,l,o,e,s),e.useDelTableCallback=(e,s,t,l)=>re(s,c,t,l,e),e.useDelTablesCallback=(e,s,t)=>re(e,I,s,t),e.useDelValueCallback=(e,s,t,l)=>re(s,g,t,l,e),e.useDelValuesCallback=(e,s,t)=>re(e,h,s,t),e.useDidFinishTransactionListener=(e,s,t)=>le("DidFinish"+z,F(t),e,s),e.useGoBackwardCallback=Te,e.useGoForwardCallback=Ve,e.useGoToCallback=(e,s=$,t,l=V,o=$)=>{const r=U(t);return J((s=>L(r,(t=>L(e(s),(e=>l(t.goTo(e),e)))))),[r,...s,...o])},e.useHasCell=(e,s,t,l)=>te(k,F(l),!1,[e,s,t],4,i,d),e.useHasCellListener=(e,s,t,l,o,r,u)=>le(d+k,F(u),l,o,[e,s,t],r),e.useHasRow=(e,s,t)=>te(p,F(t),!1,[e,s],3,i,d),e.useHasRowListener=(e,s,t,l,o,r)=>le(d+p,F(r),t,l,[e,s],o),e.useHasTable=(e,s)=>te(c,F(s),!1,[e],2,i,d),e.useHasTableCell=(e,s,t)=>te(c+k,F(t),!1,[e,s],3,i,d),e.useHasTableCellListener=(e,s,t,l,o,r)=>le(d+c+k,F(r),t,l,[e,s],o),e.useHasTableListener=(e,s,t,l,o)=>le(d+c,F(o),s,t,[e],l),e.useHasTables=e=>te(I,F(e),!1,[],1,i,d),e.useHasTablesListener=(e,s,t,l)=>le(d+I,F(l),e,s,[],t),e.useHasValue=(e,s)=>te(g,F(s),!1,[e],2,i,d),e.useHasValueListener=(e,s,t,l,o)=>le(d+g,F(o),s,t,[e],l),e.useHasValues=e=>te(h,F(e),!1,[],1,i,d),e.useHasValuesListener=(e,s,t,l)=>le(d+h,F(l),e,s,[],t),e.useIndexIds=e=>te("IndexIds",E(e),$),e.useIndexes=e=>M(e,4),e.useIndexesIds=()=>j(5),e.useIndexesOrIndexesById=E,e.useLinkedRowIds=ve,e.useLinkedRowIdsListener=(e,s,t,l,o)=>le("Linked"+w,A(o),t,l,[e,s]),e.useLocalRowIds=ke,e.useLocalRowIdsListener=(e,s,t,l,o)=>le("Local"+w,A(o),t,l,[e,s]),e.useMetric=pe,e.useMetricIds=e=>te("MetricIds",Q(e),$),e.useMetricListener=(e,s,t,l)=>le("Metric",Q(l),s,t,[e]),e.useMetrics=e=>M(e,2),e.useMetricsIds=()=>j(3),e.useMetricsOrMetricsById=Q,e.useProvideStore=(e,s)=>{const{12:t,13:l}=q(H);B((()=>(null==t||t(e,s),()=>null==l?void 0:l(e))),[t,e,s,l])},e.useQueries=e=>M(e,8),e.useQueriesIds=()=>j(9),e.useQueriesOrQueriesById=G,e.useQueryIds=e=>te("QueryIds",G(e),$),e.useRedoInformation=e=>{var s;const t=U(e),[,,[o]]=Le(t);return[!m(o),Ve(t),o,null!=(s=L(o,(e=>null==t?void 0:t.getCheckpoint(e))))?s:l]},e.useRelationshipIds=e=>te("RelationshipIds",A(e),$),e.useRelationships=e=>M(e,6),e.useRelationshipsIds=()=>j(7),e.useRelationshipsOrRelationshipsById=A,e.useRemoteRowId=Re,e.useRemoteRowIdListener=(e,s,t,l,o)=>le("RemoteRowId",A(o),t,l,[e,s]),e.useResultCell=me,e.useResultCellIds=ye,e.useResultCellIdsListener=(e,s,t,l,o)=>le(n+v,G(o),t,l,[e,s]),e.useResultCellListener=(e,s,t,l,o,r)=>le(n+k,G(r),l,o,[e,s,t]),e.useResultRow=(e,s,t)=>te(n+p,G(t),_,[e,s]),e.useResultRowCount=(e,s)=>te(n+b,G(s),0,[e]),e.useResultRowCountListener=(e,s,t,l)=>le(n+b,G(l),s,t,[e]),e.useResultRowIds=ge,e.useResultRowIdsListener=(e,s,t,l)=>le(n+w,G(l),s,t,[e]),e.useResultRowListener=(e,s,t,l,o)=>le(n+p,G(o),t,l,[e,s]),e.useResultSortedRowIds=he,e.useResultSortedRowIdsListener=(e,s,t,l,o,r,u,d)=>le(n+R,G(d),r,u,[e,s,t,l,o]),e.useResultTable=(e,s)=>te(n+c,G(s),_,[e]),e.useResultTableCellIds=(e,s)=>te(n+c+v,G(s),$,[e]),e.useResultTableCellIdsListener=(e,s,t,l)=>le(n+c+v,G(l),s,t,[e]),e.useResultTableListener=(e,s,t,l)=>le(n+c,G(l),s,t,[e]),e.useRow=(e,s,t)=>te(p,F(t),_,[e,s]),e.useRowCount=(e,s)=>te(b,F(s),0,[e]),e.useRowCountListener=(e,s,t,l,o)=>le(b,F(o),s,t,[e],l),e.useRowIds=de,e.useRowIdsListener=(e,s,t,l,o)=>le(w,F(o),s,t,[e],l),e.useRowListener=(e,s,t,l,o,r)=>le(p,F(r),t,l,[e,s],o),e.useSetCellCallback=(e,s,t,l,o,r,u,n)=>oe(r,k,l,o,u,n,e,s,t),e.useSetCheckpointCallback=(e=V,s=$,t,l=V,o=$)=>{const r=U(t);return J((s=>L(r,(t=>{const o=e(s);l(t.addCheckpoint(o),t,o)}))),[r,...s,...o])},e.useSetPartialRowCallback=(e,s,t,l,o,r,u)=>oe(o,"PartialRow",t,l,r,u,e,s),e.useSetPartialValuesCallback=(e,s,t,l,o)=>oe(t,"PartialValues",e,s,l,o),e.useSetRowCallback=(e,s,t,l,o,r,u)=>oe(o,p,t,l,r,u,e,s),e.useSetTableCallback=(e,s,t,l,o,r)=>oe(l,c,s,t,o,r,e),e.useSetTablesCallback=(e,s,t,l,o)=>oe(t,I,e,s,l,o),e.useSetValueCallback=(e,s,t,l,o,r)=>oe(l,g,s,t,o,r,e),e.useSetValuesCallback=(e,s,t,l,o)=>oe(t,h,e,s,l,o),e.useSliceIds=be,e.useSliceIdsListener=(e,s,t,l)=>le("SliceIds",E(l),s,t,[e]),e.useSliceRowIds=we,e.useSliceRowIdsListener=(e,s,t,l,o)=>le("Slice"+w,E(o),t,l,[e,s]),e.useSortedRowIds=ie,e.useSortedRowIdsListener=(e,s,t,l,o,r,u,n,d)=>le(R,F(d),r,u,[e,s,t,l,o],n),e.useStartTransactionListener=(e,s,t)=>le("Start"+z,F(t),e,s),e.useStore=e=>M(e,0),e.useStoreIds=()=>j(1),e.useStoreOrStoreById=F,e.useTable=(e,s)=>te(c,F(s),_,[e]),e.useTableCellIds=(e,s)=>te(c+v,F(s),$,[e]),e.useTableCellIdsListener=(e,s,t,l,o)=>le(c+v,F(o),s,t,[e],l),e.useTableIds=ne,e.useTableIdsListener=(e,s,t,l)=>le(C,F(l),e,s,$,t),e.useTableListener=(e,s,t,l,o)=>le(c,F(o),s,t,[e],l),e.useTables=e=>te(I,F(e),_),e.useTablesListener=(e,s,t,l)=>le(I,F(l),e,s,$,t),e.useUndoInformation=e=>{var s;const t=U(e),[o,r]=Le(t);return[(u=o,!(0==u.length)),Te(t),r,null!=(s=L(r,(e=>null==t?void 0:t.getCheckpoint(e))))?s:l];var u},e.useValue=Ce,e.useValueIds=Ie,e.useValueIdsListener=(e,s,t,l)=>le(y,F(l),e,s,$,t),e.useValueListener=(e,s,t,l,o)=>le(g,F(o),s,t,[e],l),e.useValues=e=>te(h,F(e),_),e.useValuesListener=(e,s,t,l)=>le(h,F(l),e,s,$,t),e.useWillFinishTransactionListener=(e,s,t)=>le("WillFinish"+z,F(t),e,s)},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
|
|
Binary file
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-8"><em>NEW!</em> v4.8 release</a> <span id="one-with">"The One With PowerSync"</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app's data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions & ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a> and <a href="https://electric-sql.com/">ElectricSQL</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">5.0kB - 9.4kB</a>, no dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</li></ul><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&logo=x&logoColor=%23fff&label=Twitter&labelColor=%23333&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.8.
|
|
1
|
+
<section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2><p id="copy">Build blisteringly fast web apps that work both online and offline. Manage your state locally, synchronize it to the cloud when you need to, or even make it collaborative. But, most importantly... have fun building stuff again!</p></section><p><a href="https://tinybase.org/guides/releases/#v4-8"><em>NEW!</em> v4.8 release</a> <span id="one-with">"The One With PowerSync"</span></p><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><ul><li>Manage <a href="#start-with-a-simple-key-value-store">key-value data</a>, <a href="#level-up-to-use-tabular-data">tabular data</a> - or both - with optional <a href="#apply-schemas-to-tables-values">schematization</a> to model your app's data structures.</li><li><a href="#register-granular-listeners">Flexibly reactive</a> to reconciled updates, so you only spend rendering cycles on things that change.</li><li><a href="#build-complex-queries-with-tinyql">Powerful query engine</a> to select, join, filter, group, sort and paginate data - reactively - and without SQL.</li><li>Built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, <a href="#model-table-relationships">tabular relationships</a> - and even an <a href="#set-checkpoints-for-an-undo-stack">undo stack</a> for your app state.</li><li>Create <a href="#type-definitions-orm-like-apis">type definitions & ORM-like APIs</a>, from schema or inference. <a href="#an-inspector-for-your-data">Inspect your data</a> (<em>new!</em>) directly in the browser.</li><li>Easily <a href="#persist-to-storage-sqlite-crdts">sync your data</a> to browser <a href="https://tinybase.org/api/persister-browser">storage</a>, <a href="https://tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://tinybase.org/api/persister-partykit-client/">PartyKit</a> and <a href="https://electric-sql.com/">ElectricSQL</a>.</li><li>Optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and (<em>new!</em>) <a href="#pre-built-reactive-components">pre-built components</a> that let you easily build fully reactive user interfaces.</li><li>Tiny by name, tiny by nature: <a href="#did-we-say-tiny">5.0kB - 9.4kB</a>, no dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</li></ul><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=GitHub&labelColor=%23d81b60&color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&logo=discord&logoColor=%23fff&label=Discord&labelColor=%233131e8&color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&logo=x&logoColor=%23fff&label=Twitter&labelColor=%23333&color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Ideas&labelColor=%23d81b60&color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&logo=GitHub&logoColor=%23fff&label=Issues&labelColor=%23d81b60&color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&logo=jest&logoColor=%23fff&color=%23333&labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/4.8.17" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&logo=npm&logoColor=%23fff&labelColor=%23bd0005&color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
|
|
2
2
|
|
|
3
3
|
```js
|
|
4
4
|
const store = createStore()
|
|
@@ -247,4 +247,4 @@ export const createShop: typeof createShopDecl = () => {
|
|
|
247
247
|
};
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>5.0kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>9.4kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>4.3kB</em>, the auxiliary <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>11.1kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>5.0kB</td><td>12.0kB</td><td>51.6kB</td><td>252.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>15.2kB</td><td>30.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.8kB</td><td>17.0kB</td><td>35.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.9kB</td><td>3.7kB</td><td>17.1kB</td><td>44.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.8kB</td><td>5.7kB</td><td>25.6kB</td><td>126.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.6kB</td><td>3.1kB</td><td>12.7kB</td><td>35.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.5kB</td><td>5.3kB</td><td>44.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>9.4kB</td><td>23.2kB</td><td>100.8kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,968</td><td>1,968</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,127</td><td>2,127</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>848</td><td>848</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>719</td><td>719</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">4,078</td></tr><tr><th class="right">Assertions</th><td colspan="3">18,366</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img title="beekeeb" src="https://github.com/beekeeb.png?size=48" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img title="cancelself" src="https://github.com/cancelself.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img title="ezra-en" src="https://github.com/ezra-en.png?size=48" width="48" height="48"></a><a href="https://github.com/fdfontes" target="_blank"><img title="fdfontes" src="https://github.com/fdfontes.png?size=48" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img title="feychenie" src="https://github.com/feychenie.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img title="itsdevcoffee" src="https://github.com/itsdevcoffee.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img title="jbolda" src="https://github.com/jbolda.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img title="Kudo" src="https://github.com/Kudo.png?size=48" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img title="learn-anything" src="https://github.com/learn-anything.png?size=48" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img title="lluc" src="https://github.com/lluc.png?size=48" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img title="marksteve" src="https://github.com/marksteve.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img title="mjamesderocher" src="https://github.com/mjamesderocher.png?size=48" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img title="nikitavoloboev" src="https://github.com/nikitavoloboev.png?size=48" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img title="palerdot" src="https://github.com/palerdot.png?size=48" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img title="PorcoRosso85" src="https://github.com/PorcoRosso85.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img title="sudo-self" src="https://github.com/sudo-self.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img title="threepointone" src="https://github.com/threepointone.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></section><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
|
|
250
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>5.0kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>9.4kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>4.3kB</em>, the auxiliary <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>11.1kB</em>, and everything is super fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>5.0kB</td><td>12.0kB</td><td>51.6kB</td><td>252.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>15.2kB</td><td>30.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.8kB</td><td>17.0kB</td><td>35.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.9kB</td><td>3.7kB</td><td>17.1kB</td><td>44.2kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.8kB</td><td>5.7kB</td><td>25.6kB</td><td>126.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.6kB</td><td>3.1kB</td><td>12.7kB</td><td>35.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.5kB</td><td>5.3kB</td><td>44.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>9.4kB</td><td>23.2kB</td><td>100.8kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible for you to get your TinyBase-powered app up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,968</td><td>1,968</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,127</td><td>2,127</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>848</td><td>848</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>719</td><td>719</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">4,078</td></tr><tr><th class="right">Assertions</th><td colspan="3">18,366</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img title="beekeeb" src="https://github.com/beekeeb.png?size=48" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img title="cancelself" src="https://github.com/cancelself.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img title="byCedric" src="https://github.com/byCedric.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img title="ezra-en" src="https://github.com/ezra-en.png?size=48" width="48" height="48"></a><a href="https://github.com/fdfontes" target="_blank"><img title="fdfontes" src="https://github.com/fdfontes.png?size=48" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img title="feychenie" src="https://github.com/feychenie.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img title="itsdevcoffee" src="https://github.com/itsdevcoffee.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img title="jbolda" src="https://github.com/jbolda.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img title="Kudo" src="https://github.com/Kudo.png?size=48" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img title="learn-anything" src="https://github.com/learn-anything.png?size=48" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img title="lluc" src="https://github.com/lluc.png?size=48" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img title="marksteve" src="https://github.com/marksteve.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img title="mjamesderocher" src="https://github.com/mjamesderocher.png?size=48" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img title="mouktardev" src="https://github.com/mouktardev.png?size=48" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img title="nickmessing" src="https://github.com/nickmessing.png?size=48" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img title="nikitavoloboev" src="https://github.com/nikitavoloboev.png?size=48" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img title="nkzw-tech" src="https://github.com/nkzw-tech.png?size=48" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img title="palerdot" src="https://github.com/palerdot.png?size=48" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img title="PorcoRosso85" src="https://github.com/PorcoRosso85.png?size=48" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img title="primodiumxyz" src="https://github.com/primodiumxyz.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img title="sudo-self" src="https://github.com/sudo-self.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img title="threepointone" src="https://github.com/threepointone.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img title="ViktorZhurbin" src="https://github.com/ViktorZhurbin.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></section><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
|