tinybase 5.0.0-beta.23 → 5.0.0-beta.25

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.
Files changed (447) hide show
  1. package/cjs/common/index.cjs +9 -1
  2. package/cjs/common/with-schemas/index.cjs +9 -1
  3. package/cjs/es6/common/index.cjs +9 -1
  4. package/cjs/es6/common/with-schemas/index.cjs +9 -1
  5. package/cjs/es6/index.cjs +12 -5
  6. package/cjs/es6/mergeable-store/index.cjs +11 -4
  7. package/cjs/es6/mergeable-store/with-schemas/index.cjs +11 -4
  8. package/cjs/es6/metrics/index.cjs +3 -2
  9. package/cjs/es6/metrics/with-schemas/index.cjs +3 -2
  10. package/cjs/es6/min/common/index.cjs +1 -1
  11. package/cjs/es6/min/common/index.cjs.gz +0 -0
  12. package/cjs/es6/min/common/with-schemas/index.cjs +1 -1
  13. package/cjs/es6/min/common/with-schemas/index.cjs.gz +0 -0
  14. package/cjs/es6/min/index.cjs +1 -1
  15. package/cjs/es6/min/index.cjs.gz +0 -0
  16. package/cjs/es6/min/mergeable-store/index.cjs +1 -1
  17. package/cjs/es6/min/mergeable-store/index.cjs.gz +0 -0
  18. package/cjs/es6/min/mergeable-store/with-schemas/index.cjs +1 -1
  19. package/cjs/es6/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
  20. package/cjs/es6/min/metrics/index.cjs +1 -1
  21. package/cjs/es6/min/metrics/index.cjs.gz +0 -0
  22. package/cjs/es6/min/metrics/with-schemas/index.cjs +1 -1
  23. package/cjs/es6/min/metrics/with-schemas/index.cjs.gz +0 -0
  24. package/cjs/es6/min/persisters/persister-browser/index.cjs +1 -1
  25. package/cjs/es6/min/persisters/persister-browser/index.cjs.gz +0 -0
  26. package/cjs/es6/min/persisters/persister-browser/with-schemas/index.cjs +1 -1
  27. package/cjs/es6/min/persisters/persister-browser/with-schemas/index.cjs.gz +0 -0
  28. package/cjs/es6/min/persisters/persister-indexed-db/index.cjs +1 -1
  29. package/cjs/es6/min/persisters/persister-indexed-db/index.cjs.gz +0 -0
  30. package/cjs/es6/min/persisters/persister-indexed-db/with-schemas/index.cjs +1 -1
  31. package/cjs/es6/min/persisters/persister-indexed-db/with-schemas/index.cjs.gz +0 -0
  32. package/cjs/es6/min/queries/index.cjs +1 -1
  33. package/cjs/es6/min/queries/index.cjs.gz +0 -0
  34. package/cjs/es6/min/queries/with-schemas/index.cjs +1 -1
  35. package/cjs/es6/min/queries/with-schemas/index.cjs.gz +0 -0
  36. package/cjs/es6/min/synchronizers/index.cjs +1 -1
  37. package/cjs/es6/min/synchronizers/index.cjs.gz +0 -0
  38. package/cjs/es6/min/synchronizers/synchronizer-local/index.cjs +1 -1
  39. package/cjs/es6/min/synchronizers/synchronizer-local/index.cjs.gz +0 -0
  40. package/cjs/es6/min/synchronizers/synchronizer-local/with-schemas/index.cjs +1 -1
  41. package/cjs/es6/min/synchronizers/synchronizer-local/with-schemas/index.cjs.gz +0 -0
  42. package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
  43. package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
  44. package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
  45. package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
  46. package/cjs/es6/min/synchronizers/with-schemas/index.cjs +1 -1
  47. package/cjs/es6/min/synchronizers/with-schemas/index.cjs.gz +0 -0
  48. package/cjs/es6/min/ui-react-dom/index.cjs +1 -1
  49. package/cjs/es6/min/ui-react-dom/index.cjs.gz +0 -0
  50. package/cjs/es6/min/ui-react-dom/with-schemas/index.cjs +1 -1
  51. package/cjs/es6/min/ui-react-dom/with-schemas/index.cjs.gz +0 -0
  52. package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
  53. package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
  54. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  55. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  56. package/cjs/es6/min/with-schemas/index.cjs +1 -1
  57. package/cjs/es6/min/with-schemas/index.cjs.gz +0 -0
  58. package/cjs/es6/persisters/persister-browser/index.cjs +2 -1
  59. package/cjs/es6/persisters/persister-browser/with-schemas/index.cjs +2 -1
  60. package/cjs/es6/persisters/persister-indexed-db/index.cjs +2 -1
  61. package/cjs/es6/persisters/persister-indexed-db/with-schemas/index.cjs +2 -1
  62. package/cjs/es6/queries/index.cjs +3 -2
  63. package/cjs/es6/queries/with-schemas/index.cjs +3 -2
  64. package/cjs/es6/synchronizers/index.cjs +9 -2
  65. package/cjs/es6/synchronizers/synchronizer-local/index.cjs +9 -2
  66. package/cjs/es6/synchronizers/synchronizer-local/with-schemas/index.cjs +9 -2
  67. package/cjs/es6/synchronizers/synchronizer-ws-client/index.cjs +9 -2
  68. package/cjs/es6/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +9 -2
  69. package/cjs/es6/synchronizers/with-schemas/index.cjs +9 -2
  70. package/cjs/es6/ui-react-dom/index.cjs +3 -1
  71. package/cjs/es6/ui-react-dom/with-schemas/index.cjs +3 -1
  72. package/cjs/es6/ui-react-inspector/index.cjs +6 -3
  73. package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +6 -3
  74. package/cjs/es6/with-schemas/index.cjs +12 -5
  75. package/cjs/index.cjs +12 -5
  76. package/cjs/mergeable-store/index.cjs +11 -4
  77. package/cjs/mergeable-store/with-schemas/index.cjs +11 -4
  78. package/cjs/metrics/index.cjs +3 -2
  79. package/cjs/metrics/with-schemas/index.cjs +3 -2
  80. package/cjs/min/common/index.cjs +1 -1
  81. package/cjs/min/common/index.cjs.gz +0 -0
  82. package/cjs/min/common/with-schemas/index.cjs +1 -1
  83. package/cjs/min/common/with-schemas/index.cjs.gz +0 -0
  84. package/cjs/min/index.cjs +1 -1
  85. package/cjs/min/index.cjs.gz +0 -0
  86. package/cjs/min/mergeable-store/index.cjs +1 -1
  87. package/cjs/min/mergeable-store/index.cjs.gz +0 -0
  88. package/cjs/min/mergeable-store/with-schemas/index.cjs +1 -1
  89. package/cjs/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
  90. package/cjs/min/metrics/index.cjs +1 -1
  91. package/cjs/min/metrics/index.cjs.gz +0 -0
  92. package/cjs/min/metrics/with-schemas/index.cjs +1 -1
  93. package/cjs/min/metrics/with-schemas/index.cjs.gz +0 -0
  94. package/cjs/min/persisters/persister-browser/index.cjs +1 -1
  95. package/cjs/min/persisters/persister-browser/index.cjs.gz +0 -0
  96. package/cjs/min/persisters/persister-browser/with-schemas/index.cjs +1 -1
  97. package/cjs/min/persisters/persister-browser/with-schemas/index.cjs.gz +0 -0
  98. package/cjs/min/persisters/persister-indexed-db/index.cjs +1 -1
  99. package/cjs/min/persisters/persister-indexed-db/index.cjs.gz +0 -0
  100. package/cjs/min/persisters/persister-indexed-db/with-schemas/index.cjs +1 -1
  101. package/cjs/min/persisters/persister-indexed-db/with-schemas/index.cjs.gz +0 -0
  102. package/cjs/min/queries/index.cjs +1 -1
  103. package/cjs/min/queries/index.cjs.gz +0 -0
  104. package/cjs/min/queries/with-schemas/index.cjs +1 -1
  105. package/cjs/min/queries/with-schemas/index.cjs.gz +0 -0
  106. package/cjs/min/synchronizers/index.cjs +1 -1
  107. package/cjs/min/synchronizers/index.cjs.gz +0 -0
  108. package/cjs/min/synchronizers/synchronizer-local/index.cjs +1 -1
  109. package/cjs/min/synchronizers/synchronizer-local/index.cjs.gz +0 -0
  110. package/cjs/min/synchronizers/synchronizer-local/with-schemas/index.cjs +1 -1
  111. package/cjs/min/synchronizers/synchronizer-local/with-schemas/index.cjs.gz +0 -0
  112. package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
  113. package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
  114. package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
  115. package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
  116. package/cjs/min/synchronizers/with-schemas/index.cjs +1 -1
  117. package/cjs/min/synchronizers/with-schemas/index.cjs.gz +0 -0
  118. package/cjs/min/ui-react-dom/index.cjs +1 -1
  119. package/cjs/min/ui-react-dom/index.cjs.gz +0 -0
  120. package/cjs/min/ui-react-dom/with-schemas/index.cjs +1 -1
  121. package/cjs/min/ui-react-dom/with-schemas/index.cjs.gz +0 -0
  122. package/cjs/min/ui-react-inspector/index.cjs +1 -1
  123. package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
  124. package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  125. package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  126. package/cjs/min/with-schemas/index.cjs +1 -1
  127. package/cjs/min/with-schemas/index.cjs.gz +0 -0
  128. package/cjs/persisters/persister-browser/index.cjs +2 -1
  129. package/cjs/persisters/persister-browser/with-schemas/index.cjs +2 -1
  130. package/cjs/persisters/persister-indexed-db/index.cjs +2 -1
  131. package/cjs/persisters/persister-indexed-db/with-schemas/index.cjs +2 -1
  132. package/cjs/queries/index.cjs +3 -2
  133. package/cjs/queries/with-schemas/index.cjs +3 -2
  134. package/cjs/synchronizers/index.cjs +9 -2
  135. package/cjs/synchronizers/synchronizer-local/index.cjs +9 -2
  136. package/cjs/synchronizers/synchronizer-local/with-schemas/index.cjs +9 -2
  137. package/cjs/synchronizers/synchronizer-ws-client/index.cjs +9 -2
  138. package/cjs/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +9 -2
  139. package/cjs/synchronizers/with-schemas/index.cjs +9 -2
  140. package/cjs/ui-react-dom/index.cjs +3 -1
  141. package/cjs/ui-react-dom/with-schemas/index.cjs +3 -1
  142. package/cjs/ui-react-inspector/index.cjs +6 -3
  143. package/cjs/ui-react-inspector/with-schemas/index.cjs +6 -3
  144. package/cjs/with-schemas/index.cjs +12 -5
  145. package/common/index.js +9 -1
  146. package/common/with-schemas/index.js +9 -1
  147. package/es6/common/index.js +9 -1
  148. package/es6/common/with-schemas/index.js +9 -1
  149. package/es6/index.js +12 -5
  150. package/es6/mergeable-store/index.js +11 -4
  151. package/es6/mergeable-store/with-schemas/index.js +11 -4
  152. package/es6/metrics/index.js +3 -2
  153. package/es6/metrics/with-schemas/index.js +3 -2
  154. package/es6/min/common/index.js +1 -1
  155. package/es6/min/common/index.js.gz +0 -0
  156. package/es6/min/common/with-schemas/index.js +1 -1
  157. package/es6/min/common/with-schemas/index.js.gz +0 -0
  158. package/es6/min/index.js +1 -1
  159. package/es6/min/index.js.gz +0 -0
  160. package/es6/min/mergeable-store/index.js +1 -1
  161. package/es6/min/mergeable-store/index.js.gz +0 -0
  162. package/es6/min/mergeable-store/with-schemas/index.js +1 -1
  163. package/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
  164. package/es6/min/metrics/index.js +1 -1
  165. package/es6/min/metrics/index.js.gz +0 -0
  166. package/es6/min/metrics/with-schemas/index.js +1 -1
  167. package/es6/min/metrics/with-schemas/index.js.gz +0 -0
  168. package/es6/min/persisters/persister-browser/index.js +1 -1
  169. package/es6/min/persisters/persister-browser/index.js.gz +0 -0
  170. package/es6/min/persisters/persister-browser/with-schemas/index.js +1 -1
  171. package/es6/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  172. package/es6/min/persisters/persister-indexed-db/index.js +1 -1
  173. package/es6/min/persisters/persister-indexed-db/index.js.gz +0 -0
  174. package/es6/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  175. package/es6/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  176. package/es6/min/queries/index.js +1 -1
  177. package/es6/min/queries/index.js.gz +0 -0
  178. package/es6/min/queries/with-schemas/index.js +1 -1
  179. package/es6/min/queries/with-schemas/index.js.gz +0 -0
  180. package/es6/min/synchronizers/index.js +1 -1
  181. package/es6/min/synchronizers/index.js.gz +0 -0
  182. package/es6/min/synchronizers/synchronizer-local/index.js +1 -1
  183. package/es6/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  184. package/es6/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  185. package/es6/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  186. package/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  187. package/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  188. package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  189. package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  190. package/es6/min/synchronizers/with-schemas/index.js +1 -1
  191. package/es6/min/synchronizers/with-schemas/index.js.gz +0 -0
  192. package/es6/min/ui-react-dom/index.js +1 -1
  193. package/es6/min/ui-react-dom/index.js.gz +0 -0
  194. package/es6/min/ui-react-dom/with-schemas/index.js +1 -1
  195. package/es6/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  196. package/es6/min/ui-react-inspector/index.js +1 -1
  197. package/es6/min/ui-react-inspector/index.js.gz +0 -0
  198. package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  199. package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  200. package/es6/min/with-schemas/index.js +1 -1
  201. package/es6/min/with-schemas/index.js.gz +0 -0
  202. package/es6/persisters/persister-browser/index.js +2 -1
  203. package/es6/persisters/persister-browser/with-schemas/index.js +2 -1
  204. package/es6/persisters/persister-indexed-db/index.js +2 -1
  205. package/es6/persisters/persister-indexed-db/with-schemas/index.js +2 -1
  206. package/es6/queries/index.js +3 -2
  207. package/es6/queries/with-schemas/index.js +3 -2
  208. package/es6/synchronizers/index.js +9 -2
  209. package/es6/synchronizers/synchronizer-local/index.js +9 -2
  210. package/es6/synchronizers/synchronizer-local/with-schemas/index.js +9 -2
  211. package/es6/synchronizers/synchronizer-ws-client/index.js +9 -2
  212. package/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +9 -2
  213. package/es6/synchronizers/with-schemas/index.js +9 -2
  214. package/es6/ui-react-dom/index.js +3 -1
  215. package/es6/ui-react-dom/with-schemas/index.js +3 -1
  216. package/es6/ui-react-inspector/index.js +6 -3
  217. package/es6/ui-react-inspector/with-schemas/index.js +6 -3
  218. package/es6/with-schemas/index.js +12 -5
  219. package/index.js +12 -5
  220. package/mergeable-store/index.js +11 -4
  221. package/mergeable-store/with-schemas/index.js +11 -4
  222. package/metrics/index.js +3 -2
  223. package/metrics/with-schemas/index.js +3 -2
  224. package/min/common/index.js +1 -1
  225. package/min/common/index.js.gz +0 -0
  226. package/min/common/with-schemas/index.js +1 -1
  227. package/min/common/with-schemas/index.js.gz +0 -0
  228. package/min/index.js +1 -1
  229. package/min/index.js.gz +0 -0
  230. package/min/mergeable-store/index.js +1 -1
  231. package/min/mergeable-store/index.js.gz +0 -0
  232. package/min/mergeable-store/with-schemas/index.js +1 -1
  233. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  234. package/min/metrics/index.js +1 -1
  235. package/min/metrics/index.js.gz +0 -0
  236. package/min/metrics/with-schemas/index.js +1 -1
  237. package/min/metrics/with-schemas/index.js.gz +0 -0
  238. package/min/persisters/persister-browser/index.js +1 -1
  239. package/min/persisters/persister-browser/index.js.gz +0 -0
  240. package/min/persisters/persister-browser/with-schemas/index.js +1 -1
  241. package/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  242. package/min/persisters/persister-indexed-db/index.js +1 -1
  243. package/min/persisters/persister-indexed-db/index.js.gz +0 -0
  244. package/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  245. package/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  246. package/min/queries/index.js +1 -1
  247. package/min/queries/index.js.gz +0 -0
  248. package/min/queries/with-schemas/index.js +1 -1
  249. package/min/queries/with-schemas/index.js.gz +0 -0
  250. package/min/synchronizers/index.js +1 -1
  251. package/min/synchronizers/index.js.gz +0 -0
  252. package/min/synchronizers/synchronizer-local/index.js +1 -1
  253. package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  254. package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  255. package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  256. package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  257. package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  258. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  259. package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  260. package/min/synchronizers/with-schemas/index.js +1 -1
  261. package/min/synchronizers/with-schemas/index.js.gz +0 -0
  262. package/min/ui-react-dom/index.js +1 -1
  263. package/min/ui-react-dom/index.js.gz +0 -0
  264. package/min/ui-react-dom/with-schemas/index.js +1 -1
  265. package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  266. package/min/ui-react-inspector/index.js +1 -1
  267. package/min/ui-react-inspector/index.js.gz +0 -0
  268. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  269. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  270. package/min/with-schemas/index.js +1 -1
  271. package/min/with-schemas/index.js.gz +0 -0
  272. package/package.json +8 -7
  273. package/persisters/persister-browser/index.js +2 -1
  274. package/persisters/persister-browser/with-schemas/index.js +2 -1
  275. package/persisters/persister-indexed-db/index.js +2 -1
  276. package/persisters/persister-indexed-db/with-schemas/index.js +2 -1
  277. package/queries/index.js +3 -2
  278. package/queries/with-schemas/index.js +3 -2
  279. package/readme.md +2 -2
  280. package/releases.md +2 -2
  281. package/synchronizers/index.js +9 -2
  282. package/synchronizers/synchronizer-local/index.js +9 -2
  283. package/synchronizers/synchronizer-local/with-schemas/index.js +9 -2
  284. package/synchronizers/synchronizer-ws-client/index.js +9 -2
  285. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +9 -2
  286. package/synchronizers/with-schemas/index.js +9 -2
  287. package/ui-react-dom/index.js +3 -1
  288. package/ui-react-dom/with-schemas/index.js +3 -1
  289. package/ui-react-inspector/index.js +6 -3
  290. package/ui-react-inspector/with-schemas/index.js +6 -3
  291. package/umd/common/index.js +9 -1
  292. package/umd/common/with-schemas/index.js +9 -1
  293. package/umd/es6/common/index.js +9 -1
  294. package/umd/es6/common/with-schemas/index.js +9 -1
  295. package/umd/es6/index.js +12 -5
  296. package/umd/es6/mergeable-store/index.js +11 -4
  297. package/umd/es6/mergeable-store/with-schemas/index.js +11 -4
  298. package/umd/es6/metrics/index.js +3 -2
  299. package/umd/es6/metrics/with-schemas/index.js +3 -2
  300. package/umd/es6/min/common/index.js +1 -1
  301. package/umd/es6/min/common/index.js.gz +0 -0
  302. package/umd/es6/min/common/with-schemas/index.js +1 -1
  303. package/umd/es6/min/common/with-schemas/index.js.gz +0 -0
  304. package/umd/es6/min/index.js +1 -1
  305. package/umd/es6/min/index.js.gz +0 -0
  306. package/umd/es6/min/mergeable-store/index.js +1 -1
  307. package/umd/es6/min/mergeable-store/index.js.gz +0 -0
  308. package/umd/es6/min/mergeable-store/with-schemas/index.js +1 -1
  309. package/umd/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
  310. package/umd/es6/min/metrics/index.js +1 -1
  311. package/umd/es6/min/metrics/index.js.gz +0 -0
  312. package/umd/es6/min/metrics/with-schemas/index.js +1 -1
  313. package/umd/es6/min/metrics/with-schemas/index.js.gz +0 -0
  314. package/umd/es6/min/persisters/persister-browser/index.js +1 -1
  315. package/umd/es6/min/persisters/persister-browser/index.js.gz +0 -0
  316. package/umd/es6/min/persisters/persister-browser/with-schemas/index.js +1 -1
  317. package/umd/es6/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  318. package/umd/es6/min/persisters/persister-expo-sqlite/index.js +1 -1
  319. package/umd/es6/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
  320. package/umd/es6/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
  321. package/umd/es6/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
  322. package/umd/es6/min/persisters/persister-indexed-db/index.js +1 -1
  323. package/umd/es6/min/persisters/persister-indexed-db/index.js.gz +0 -0
  324. package/umd/es6/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  325. package/umd/es6/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  326. package/umd/es6/min/queries/index.js +1 -1
  327. package/umd/es6/min/queries/index.js.gz +0 -0
  328. package/umd/es6/min/queries/with-schemas/index.js +1 -1
  329. package/umd/es6/min/queries/with-schemas/index.js.gz +0 -0
  330. package/umd/es6/min/synchronizers/index.js +1 -1
  331. package/umd/es6/min/synchronizers/index.js.gz +0 -0
  332. package/umd/es6/min/synchronizers/synchronizer-local/index.js +1 -1
  333. package/umd/es6/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  334. package/umd/es6/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  335. package/umd/es6/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  336. package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  337. package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  338. package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  339. package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  340. package/umd/es6/min/synchronizers/with-schemas/index.js +1 -1
  341. package/umd/es6/min/synchronizers/with-schemas/index.js.gz +0 -0
  342. package/umd/es6/min/ui-react-dom/index.js +1 -1
  343. package/umd/es6/min/ui-react-dom/index.js.gz +0 -0
  344. package/umd/es6/min/ui-react-dom/with-schemas/index.js +1 -1
  345. package/umd/es6/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  346. package/umd/es6/min/ui-react-inspector/index.js +1 -1
  347. package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
  348. package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  349. package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  350. package/umd/es6/min/with-schemas/index.js +1 -1
  351. package/umd/es6/min/with-schemas/index.js.gz +0 -0
  352. package/umd/es6/persisters/persister-browser/index.js +2 -1
  353. package/umd/es6/persisters/persister-browser/with-schemas/index.js +2 -1
  354. package/umd/es6/persisters/persister-expo-sqlite/index.js +4 -1
  355. package/umd/es6/persisters/persister-expo-sqlite/with-schemas/index.js +4 -1
  356. package/umd/es6/persisters/persister-indexed-db/index.js +2 -1
  357. package/umd/es6/persisters/persister-indexed-db/with-schemas/index.js +2 -1
  358. package/umd/es6/queries/index.js +3 -2
  359. package/umd/es6/queries/with-schemas/index.js +3 -2
  360. package/umd/es6/synchronizers/index.js +9 -2
  361. package/umd/es6/synchronizers/synchronizer-local/index.js +9 -2
  362. package/umd/es6/synchronizers/synchronizer-local/with-schemas/index.js +9 -2
  363. package/umd/es6/synchronizers/synchronizer-ws-client/index.js +9 -2
  364. package/umd/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +9 -2
  365. package/umd/es6/synchronizers/with-schemas/index.js +9 -2
  366. package/umd/es6/ui-react-dom/index.js +3 -1
  367. package/umd/es6/ui-react-dom/with-schemas/index.js +3 -1
  368. package/umd/es6/ui-react-inspector/index.js +6 -3
  369. package/umd/es6/ui-react-inspector/with-schemas/index.js +6 -3
  370. package/umd/es6/with-schemas/index.js +12 -5
  371. package/umd/index.js +12 -5
  372. package/umd/mergeable-store/index.js +11 -4
  373. package/umd/mergeable-store/with-schemas/index.js +11 -4
  374. package/umd/metrics/index.js +3 -2
  375. package/umd/metrics/with-schemas/index.js +3 -2
  376. package/umd/min/common/index.js +1 -1
  377. package/umd/min/common/index.js.gz +0 -0
  378. package/umd/min/common/with-schemas/index.js +1 -1
  379. package/umd/min/common/with-schemas/index.js.gz +0 -0
  380. package/umd/min/index.js +1 -1
  381. package/umd/min/index.js.gz +0 -0
  382. package/umd/min/mergeable-store/index.js +1 -1
  383. package/umd/min/mergeable-store/index.js.gz +0 -0
  384. package/umd/min/mergeable-store/with-schemas/index.js +1 -1
  385. package/umd/min/mergeable-store/with-schemas/index.js.gz +0 -0
  386. package/umd/min/metrics/index.js +1 -1
  387. package/umd/min/metrics/index.js.gz +0 -0
  388. package/umd/min/metrics/with-schemas/index.js +1 -1
  389. package/umd/min/metrics/with-schemas/index.js.gz +0 -0
  390. package/umd/min/persisters/persister-browser/index.js +1 -1
  391. package/umd/min/persisters/persister-browser/index.js.gz +0 -0
  392. package/umd/min/persisters/persister-browser/with-schemas/index.js +1 -1
  393. package/umd/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
  394. package/umd/min/persisters/persister-expo-sqlite/index.js +1 -1
  395. package/umd/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
  396. package/umd/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
  397. package/umd/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
  398. package/umd/min/persisters/persister-indexed-db/index.js +1 -1
  399. package/umd/min/persisters/persister-indexed-db/index.js.gz +0 -0
  400. package/umd/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
  401. package/umd/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
  402. package/umd/min/queries/index.js +1 -1
  403. package/umd/min/queries/index.js.gz +0 -0
  404. package/umd/min/queries/with-schemas/index.js +1 -1
  405. package/umd/min/queries/with-schemas/index.js.gz +0 -0
  406. package/umd/min/synchronizers/index.js +1 -1
  407. package/umd/min/synchronizers/index.js.gz +0 -0
  408. package/umd/min/synchronizers/synchronizer-local/index.js +1 -1
  409. package/umd/min/synchronizers/synchronizer-local/index.js.gz +0 -0
  410. package/umd/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
  411. package/umd/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
  412. package/umd/min/synchronizers/synchronizer-ws-client/index.js +1 -1
  413. package/umd/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
  414. package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
  415. package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
  416. package/umd/min/synchronizers/with-schemas/index.js +1 -1
  417. package/umd/min/synchronizers/with-schemas/index.js.gz +0 -0
  418. package/umd/min/ui-react-dom/index.js +1 -1
  419. package/umd/min/ui-react-dom/index.js.gz +0 -0
  420. package/umd/min/ui-react-dom/with-schemas/index.js +1 -1
  421. package/umd/min/ui-react-dom/with-schemas/index.js.gz +0 -0
  422. package/umd/min/ui-react-inspector/index.js +1 -1
  423. package/umd/min/ui-react-inspector/index.js.gz +0 -0
  424. package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
  425. package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  426. package/umd/min/with-schemas/index.js +1 -1
  427. package/umd/min/with-schemas/index.js.gz +0 -0
  428. package/umd/persisters/persister-browser/index.js +2 -1
  429. package/umd/persisters/persister-browser/with-schemas/index.js +2 -1
  430. package/umd/persisters/persister-expo-sqlite/index.js +4 -1
  431. package/umd/persisters/persister-expo-sqlite/with-schemas/index.js +4 -1
  432. package/umd/persisters/persister-indexed-db/index.js +2 -1
  433. package/umd/persisters/persister-indexed-db/with-schemas/index.js +2 -1
  434. package/umd/queries/index.js +3 -2
  435. package/umd/queries/with-schemas/index.js +3 -2
  436. package/umd/synchronizers/index.js +9 -2
  437. package/umd/synchronizers/synchronizer-local/index.js +9 -2
  438. package/umd/synchronizers/synchronizer-local/with-schemas/index.js +9 -2
  439. package/umd/synchronizers/synchronizer-ws-client/index.js +9 -2
  440. package/umd/synchronizers/synchronizer-ws-client/with-schemas/index.js +9 -2
  441. package/umd/synchronizers/with-schemas/index.js +9 -2
  442. package/umd/ui-react-dom/index.js +3 -1
  443. package/umd/ui-react-dom/with-schemas/index.js +3 -1
  444. package/umd/ui-react-inspector/index.js +6 -3
  445. package/umd/ui-react-inspector/with-schemas/index.js +6 -3
  446. package/umd/with-schemas/index.js +12 -5
  447. package/with-schemas/index.js +12 -5
@@ -1 +1 @@
1
- const e=e=>typeof e,t="",s=e(t),n=e(!0),a=e(0),o=e(e),r="type",l="default",i="Listener",c="Result",d="add",u="Has",g="Ids",h="Table",f=h+"s",b=h+g,w="Row",C=w+"Count",L=w+g,v="Sorted"+w+g,I="Cell",T=I+g,p="Value",y=p+"s",R=p+g,S=e=>t+e,M=(e,t)=>e.startsWith(t),V=(e,t)=>e.endsWith(t),m=Promise,D=Math.max,E=Math.min,H=isFinite,k=e=>null==e,A=(e,t,s)=>k(e)?s?.():t(e),J=e=>e==s||e==n,x=t=>e(t)==s,F=t=>e(t)==o,Q=e=>Array.isArray(e),z=(e,t,s)=>e.slice(t,s),N=e=>e.length,P=()=>{},O=(e,t)=>e.includes(t),W=(e,t)=>e.every(t),_=(e,t)=>N(e)===N(t)&&W(e,((e,s)=>t[s]===e)),j=(e,t)=>W(e,((s,n)=>0==n||t(e[n-1],s)<=0)),$=(e,t)=>e.sort(t),B=(e,t)=>e.forEach(t),U=(e,t)=>e.map(t),q=e=>K(e,((e,t)=>e+t),0),G=e=>0==N(e),K=(e,t,s)=>e.reduce(t,s),X=(e,...t)=>e.push(...t),Y=e=>e.pop(),Z=e=>e.shift(),ee=Object,te=e=>ee.getPrototypeOf(e),se=ee.entries,ne=ee.isFrozen,ae=e=>!k(e)&&A(te(e),(e=>e==ee.prototype||k(te(e))),(()=>!0)),oe=ee.keys,re=ee.freeze,le=(e=[])=>ee.fromEntries(e),ie=(e,t)=>t in e,ce=(e,t)=>(delete e[t],e),de=(e,t)=>B(se(e),(([e,s])=>t(s,e))),ue=(e,t)=>U(se(e),(([e,s])=>t(s,e))),ge=e=>ae(e)&&0==(e=>N(oe(e)))(e),he=(e,t,s)=>(ie(e,t)||(e[t]=s()),e[t]),fe=(e,t,s,n=0)=>k(e)||!ae(e)||!n&&ge(e)||ne(e)?(s?.(),!1):(ue(e,((s,n)=>{t(s,n)||ce(e,n)})),!!n||!ge(e)),be=e=>t=>K(pe(t),((t,s)=>t+e(s)),0),we=e=>e?.size??0,Ce=be(we),Le=be(Ce),ve=be(Le),Ie=(e,t)=>e?.has(t)??!1,Te=e=>k(e)||0==we(e),pe=e=>[...e?.values()??[]],ye=e=>e.clear(),Re=(e,t)=>e?.forEach(t),Se=(e,t)=>e?.delete(t),Me=e=>new Map(e),Ve=e=>[...e?.keys()??[]],me=(e,t)=>e?.get(t),De=(e,t)=>Re(e,((e,s)=>t(s,e))),Ee=(e,t,s)=>k(s)?(Se(e,t),e):e?.set(t,s),He=(e,t,s,n)=>(Ie(e,t)?n?.(me(e,t)):Ee(e,t,s()),me(e,t)),ke=(e,t,s,n=Ee)=>(ue(t,((t,n)=>s(e,n,t))),De(e,(s=>ie(t,s)?0:n(e,s))),e),Ae=(e,t,s,n)=>{const a={};return Re(e,((e,o)=>{if(!s?.(e,o)){const s=t?t(e,o):e;!n?.(s)&&(a[o]=s)}})),a},Je=(e,t,s)=>Ae(e,(e=>Ae(e,t,s)),Te,ge),xe=(e,t,s)=>Ae(e,(e=>Je(e,t,s)),Te,ge),Fe=(e,t)=>{const s=Me();return Re(e,((e,n)=>s.set(n,t?.(e)??e))),s},Qe=e=>Fe(e,Fe),ze=e=>Fe(e,Qe),Ne=(e,t,s,n,a=0)=>A((s?He:me)(e,t[a],a>N(t)-2?s:Me),(o=>{if(a>N(t)-2)return n?.(o)&&Ee(e,t[a]),o;const r=Ne(o,t,s,n,a+1);return Te(o)&&Ee(e,t[a]),r})),Pe=t=>{const s=e(t);return J(s)||s==a&&H(t)?s:void 0},Oe=e=>k(e)||!k(Pe(e)),We=(e,t,s,n,a)=>k(a)?e.delCell(t,s,n,!0):e.setCell(t,s,n,a),_e=(e,t,s)=>k(s)?e.delValue(t):e.setValue(t,s),je=e=>new Set(Q(e)||k(e)?e:[e]),$e=(e,t)=>e?.add(t),Be=(e,t,s,n,a)=>{const o=e.hasRow,r=Me(),l=Me(),i=Me(),c=Me(),d=Me(),u=Me(),g=(t,s,...n)=>{const a=He(u,t,je);return B(n,(t=>$e(a,t)&&s&&e.callListener(t))),n},h=(t,...s)=>A(me(u,t),(n=>{B(G(s)?pe(n):s,(t=>{e.delListener(t),Se(n,t)})),Te(n)&&Ee(u,t)})),f=(e,s)=>{Ee(r,e,s),Ie(l,e)||(Ee(l,e,t()),Ee(c,e,Me()),Ee(d,e,Me()),a(i))},b=e=>{Ee(r,e),Ee(l,e),Ee(c,e),Ee(d,e),h(e),a(i)};return[()=>e,()=>Ve(r),e=>De(l,e),e=>Ie(l,e),e=>me(r,e),e=>me(l,e),(e,t)=>Ee(l,e,t),f,(t,n,a,r,l)=>{f(t,n);const i=Me(),u=Me(),b=me(c,t),w=me(d,t),C=t=>{const a=s=>e.getCell(n,t,s),c=me(b,t),d=o(n,t)?s(r(a,t)):void 0;if(c===d||Q(c)&&Q(d)&&_(c,d)||Ee(i,t,[c,d]),!k(l)){const e=me(w,t),s=o(n,t)?l(a,t):void 0;e!=s&&Ee(u,t,s)}},L=e=>{a((()=>{Re(i,(([,e],t)=>Ee(b,t,e))),Re(u,((e,t)=>Ee(w,t,e)))}),i,u,b,w,e),ye(i),ye(u)};De(b,C),e.hasTable(n)&&B(e.getRowIds(n),(e=>{Ie(b,e)||C(e)})),L(!0),h(t),g(t,0,e.addRowListener(n,null,((e,t,s)=>C(s))),e.addTableListener(n,(()=>L())))},b,e=>n(e,i),()=>De(u,b),g,h]},Ue=(e,s)=>x(e)?t=>t(e):e??(()=>s??t),qe=(e,t)=>{const s=new WeakMap;return n=>{s.has(n)||s.set(n,e(n));const a=s.get(n);return t?.(a),a}},Ge=/^\d+$/,Ke=()=>{const e=[];let s=0;return[n=>(n?Z(e):null)??t+s++,t=>{Ge.test(t)&&N(e)<1e3&&X(e,t)}]},Xe=e=>{let s;const[n,a]=Ke(),o=Me();return[(a,r,l,i=[],c=(()=>[]))=>{s??=e();const d=n(1);return Ee(o,d,[a,r,l,i,c]),$e(Ne(r,l??[t],je),d),d},(e,n,...a)=>B(((e,s=[t])=>{const n=[],a=(e,t)=>t==N(s)?X(n,e):null===s[t]?Re(e,(e=>a(e,t+1))):B([s[t],null],(s=>a(me(e,s),t+1)));return a(e,0),n})(e,n),(e=>Re(e,(e=>me(o,e)[0](s,...n??[],...a))))),e=>A(me(o,e),(([,s,n])=>(Ne(s,n??[t],void 0,(t=>(Se(t,e),Te(t)?1:0))),Ee(o,e),a(e),n))),e=>A(me(o,e),(([e,,t=[],n,a])=>{const o=(...r)=>{const l=N(r);l==N(t)?e(s,...r,...a(r)):k(t[l])?B(n[l]?.(...r)??[],(e=>o(...r,e))):o(...r,t[l])};o()}))]},Ye=qe((e=>{let s,n,a,o=100,r=Me(),l=Me(),i=1;const c=Me(),d=Me(),[u,g,h]=Xe((()=>x)),f=Me(),b=Me(),w=[],C=[],L=(t,s)=>{i=0,e.transaction((()=>{const[n,a]=me(f,s);Re(n,((s,n)=>Re(s,((s,a)=>Re(s,((s,o)=>We(e,n,a,o,s[t]))))))),Re(a,((s,n)=>_e(e,n,s[t])))})),i=1},v=e=>{Ee(f,e),Ee(b,e),g(d,[e])},I=(e,t)=>B(((e,t)=>e.splice(0,t))(e,t??N(e)),v),T=()=>I(w,N(w)-o),p=()=>A(s,(()=>{X(w,s),T(),I(C),s=void 0,a=1})),y=()=>{s=Y(w),a=1};let R,S;const M=(e=t)=>(k(s)&&(s=t+n++,Ee(f,s,[r,l]),H(s,e),r=Me(),l=Me(),a=1),s),V=()=>{G(w)||(((e,...t)=>{e.unshift(...t)})(C,M()),L(0,s),s=Y(w),a=1)},m=()=>{G(C)||(X(w,s),s=Z(C),L(1,s),a=1)},D=()=>{a&&(g(c),a=0)},E=e=>{const t=M(e);return D(),t},H=(e,t)=>(J(e)&&me(b,e)!==t&&(Ee(b,e,t),g(d,[e])),x),J=e=>Ie(f,e),x={setSize:e=>(o=e,T(),x),addCheckpoint:E,setCheckpoint:H,getStore:()=>e,getCheckpointIds:()=>[[...w],s,[...C]],forEachCheckpoint:e=>De(b,e),hasCheckpoint:J,getCheckpoint:e=>me(b,e),goBackward:()=>(V(),D(),x),goForward:()=>(m(),D(),x),goTo:e=>{const t=O(w,e)?V:O(C,e)?m:null;for(;!k(t)&&e!=s;)t();return D(),x},addCheckpointIdsListener:e=>u(e,c),addCheckpointListener:(e,t)=>u(t,d,[e]),delListener:e=>(h(e),x),clear:()=>(I(w),I(C),k(s)||v(s),s=void 0,n=0,E(),x),clearForward:()=>(G(C)||(I(C),g(c)),x),destroy:()=>{e.delListener(R),e.delListener(S)},getListenerStats:()=>({checkpointIds:Ce(c),checkpoint:Ce(d)}),_registerListeners:()=>{R=e.addCellListener(null,null,null,((e,t,s,n,a,o)=>{if(i){p();const e=He(r,t,Me),l=He(e,s,Me),i=He(l,n,(()=>[o,void 0]));i[1]=a,i[0]===a&&Te(Ee(l,n))&&Te(Ee(e,s))&&Te(Ee(r,t))&&y(),D()}})),S=e.addValueListener(null,((e,t,s,n)=>{if(i){p();const e=He(l,t,(()=>[n,void 0]));e[1]=s,e[0]===s&&Te(Ee(l,t))&&y(),D()}}))}};return re(x.clear())}),(e=>e._registerListeners())),Ze="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(t),et=Me(U(Ze,((e,t)=>[e,t]))),tt=e=>Ze[63&e],st=(e,t)=>me(et,e[t])??0,nt=(e,t)=>(e??0)<(t??0)?-1:1,at=(e=16)=>K(crypto.getRandomValues(new Uint8Array(e)),((e,t)=>e+tt(t)),""),ot=qe((e=>{const s=Me(),n=Me(),[a,o,r]=Xe((()=>v)),[l,i,c,d,u,g,h,,f,b,w,C]=Be(e,Me,(e=>k(e)?t:Q(e)?U(e,S):S(e)),a,o),L=(t,s,n)=>{const a=u(t);Re(n,((t,n)=>s(n,(s=>Re(t,(t=>s(t,(s=>e.forEachCell(a,t,s)))))))))},v={setIndexDefinition:(e,t,a,r,l,i=nt)=>{const c=k(l)?void 0:([e],[t])=>l(e,t);return f(e,t,((t,a,l,d,u,f)=>{let b=0;const w=je(),C=je(),L=g(e);if(Re(a,(([e,t],s)=>{const n=je(e),a=je(t);Re(n,(e=>Se(a,e)?Se(n,e):0)),Re(n,(e=>{$e(w,e),A(me(L,e),(t=>{Se(t,s),Te(t)&&(Ee(L,e),b=1)}))})),Re(a,(e=>{$e(w,e),Ie(L,e)||(Ee(L,e,je()),b=1),$e(me(L,e),s),k(r)||$e(C,e)}))})),t(),Te(u)||(f?De(L,(e=>$e(C,e))):De(l,(e=>A(me(d,e),(e=>$e(C,e))))),Re(C,(e=>{const t=(t,s)=>i(me(u,t),me(u,s),e),s=[...me(L,e)];j(s,t)||(Ee(L,e,je($(s,t))),$e(w,e))}))),(b||f)&&!k(c)){const t=[...L];j(t,c)||(h(e,Me($(t,c))),b=1)}b&&o(s,[e]),Re(w,(t=>o(n,[e,t])))}),Ue(a),A(r,Ue)),v},delIndexDefinition:e=>(b(e),v),getStore:l,getIndexIds:i,forEachIndex:e=>c(((t,s)=>e(t,(e=>L(t,e,s))))),forEachSlice:(e,t)=>L(e,t,g(e)),hasIndex:d,hasSlice:(e,t)=>Ie(g(e),t),getTableId:u,getSliceIds:e=>Ve(g(e)),getSliceRowIds:(e,t)=>pe(me(g(e),t)),addIndexIdsListener:w,addSliceIdsListener:(e,t)=>a(t,s,[e]),addSliceRowIdsListener:(e,t,s)=>a(s,n,[e,t]),delListener:e=>(r(e),v),destroy:C,getListenerStats:()=>({sliceIds:Ce(s),sliceRowIds:Le(n)})};return re(v)})),rt=Me([["avg",[(e,t)=>q(e)/t,(e,t,s)=>e+(t-e)/(s+1),(e,t,s)=>e+(e-t)/(s-1),(e,t,s,n)=>e+(t-s)/n]],["max",[e=>D(...e),(e,t)=>D(t,e),(e,t)=>t==e?void 0:e,(e,t,s)=>s==e?void 0:D(t,e)]],["min",[e=>E(...e),(e,t)=>E(t,e),(e,t)=>t==e?void 0:e,(e,t,s)=>s==e?void 0:E(t,e)]],["sum",[e=>q(e),(e,t)=>e+t,(e,t)=>e-t,(e,t,s)=>e-s+t]]]),lt=(e,t,s,n,a,o=!1)=>{if(Te(s))return;const[r,l,i,c]=a;return o||=k(e),Re(n,(([s,n])=>{o||(e=k(s)?l?.(e,n,t++):k(n)?i?.(e,s,t--):c?.(e,n,s,t),o||=k(e))})),o?r(pe(s),we(s)):e},it=qe((e=>{const s=Me(),[n,a,o]=Xe((()=>C)),[r,l,i,c,d,u,g,,h,f,b,w]=Be(e,P,(e=>isNaN(e)||k(e)||!0===e||!1===e||e===t?void 0:1*e),n,a),C={setMetricDefinition:(e,t,n,o,r,l,i)=>{const c=F(n)?[n,r,l,i]:me(rt,n)??me(rt,"sum");return h(e,t,((t,n,o,r,l,i)=>{const d=u(e),h=we(r);i||=k(d),t();let f=lt(d,h,r,n,c,i);H(f)||(f=void 0),f!=d&&(g(e,f),a(s,[e],f,d))}),Ue(o,1)),C},delMetricDefinition:e=>(f(e),C),getStore:r,getMetricIds:l,forEachMetric:i,hasMetric:c,getTableId:d,getMetric:u,addMetricIdsListener:b,addMetricListener:(e,t)=>n(t,s,[e]),delListener:e=>(o(e),C),destroy:w,getListenerStats:()=>({metric:Ce(s)})};return re(C)})),ct=Me(),dt=Me(),ut=(e,t,s,n,a,o,r,l={},i=[])=>{let c,d,u,g=0,h=0,f=0;He(ct,i,(()=>0)),He(dt,i,(()=>[]));const[b,w,C,L,v]=((e=1,t)=>e>1&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!ge(e)||!ge(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!ge(e)||!ge(t),t.setContent]:(e=>{throw Error("Store type not supported by this Persister")})())(r,e),I=t=>{(b&&Q(t?.[0])?1===t?.[2]?e.applyMergeableChanges:e.setMergeableContent:1===t?.[2]?e.applyChanges:e.setContent)(t)},T=async e=>(2!=g&&(g=1,h++,await S((async()=>{try{I(await t())}catch(t){o?.(t),e&&v(e)}g=0}))),M),p=()=>(d&&(a(d),d=void 0),M),y=async e=>(1!=g&&(g=2,f++,await S((async()=>{try{await s(w,e)}catch(e){o?.(e)}g=0}))),M),R=()=>(A(u,e.delListener),u=void 0,M),S=async(...e)=>(X(me(dt,i),...e),await(async()=>{if(!me(ct,i)){for(Ee(ct,i,1);!k(c=Z(me(dt,i)));)try{await c()}catch(e){o?.(e)}Ee(ct,i,0)}})(),M),M={load:T,startAutoLoad:async e=>(await p().load(e),d=n((async(e,t)=>{t||e?2!=g&&(g=1,h++,I(t??e),g=0):await T()})),M),stopAutoLoad:p,isAutoLoading:()=>!k(d),save:y,startAutoSave:async()=>(await R().save(),u=e.addDidFinishTransactionListener((()=>{const e=C();L(e)&&y(e)})),M),stopAutoSave:R,isAutoSaving:()=>!k(u),schedule:S,getStore:()=>e,destroy:()=>p().stopAutoSave(),getStats:()=>({loads:h,saves:f}),...l};return re(M)},gt=new globalThis.TextEncoder,ht=e=>{let t=2166136261;return B(gt.encode(e),(e=>{t^=e,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)})),t>>>0},ft=([e,t,s])=>[e,t,s],bt=([e,t])=>wt(e,t),wt=(e,t)=>t?[e,t]:[e],Ct=e=>e[2],Lt=(e,t)=>ht(e+":"+t),vt=(e,t)=>t>e?(e?ht(e):0)^ht(t):0,It=(e,t)=>((e??"")>(t??"")?e:t)??"",Tt=(e,t,s)=>{e[2]=t>>>0,s>e[1]&&(e[1]=s)},pt=(e=t)=>wt(le(),e),yt=(e=t)=>[Me(),e,0],Rt=([e,t,s],n=ft)=>[Ae(e,n),t,s],St=([e,t],s=bt)=>wt(Ae(e,s),t),Mt=(t,s)=>Q(t)&&3==N(t)&&x(t[1])&&e(t[2])==a&&H(t[2])&&s(t[0]),Vt=(e,s,n,a,o,r,l={})=>{let i,c=0,d=0;const u=Me();n(((t,n,a,o)=>{d++,0==a?A(me(u,n),(([e,s])=>k(e)||e==t?s(o,t):0)):2==a&&b.isAutoLoading()?f(t,o).then((e=>{i?.(void 0,e)})):3==a&&b.isAutoLoading()?i?.(void 0,o):A(1==a&&b.isAutoSaving()?e.getMergeableContentHashes():4==a?e.getMergeableTableDiff(o):5==a?e.getMergeableRowDiff(o):6==a?e.getMergeableCellDiff(o):7==a?e.getMergeableValueDiff(o):void 0,(e=>{c++,s(t,n,0,e)}))}));const g=async(e,n,a=t)=>new m(((t,r)=>{const l=at(),i=setTimeout((()=>{Se(u,l),r(`No response from ${e??"anyone"} to '${n}'`)}),1e3*o);Ee(u,l,[e,(e,s)=>{clearTimeout(i),Se(u,l),t([e,s])}]),c++,s(e,l,n,a)})),h=(e,[t,s])=>{de(t,(([t,s],n)=>{const a=he(e[0],n,pt);de(t,(([e,t],s)=>{const n=he(a[0],s,pt);de(e,(([e,t],s)=>n[0][s]=wt(e,t))),n[1]=It(n[1],t)})),a[1]=It(a[1],s)})),e[1]=It(e[1],s)},f=async(t=null,s)=>{k(s)&&([s,t]=await g(t,1));const[n,a]=s,[o,r]=e.getMergeableContentHashes();let l=pt();if(o!=n){const[s,n]=(await g(t,4,e.getMergeableTableHashes()))[0];if(l=s,!ge(n)){const[s,a]=(await g(t,5,e.getMergeableRowHashes(n)))[0];if(h(l,s),!ge(a)){const s=(await g(t,6,e.getMergeableCellHashes(a)))[0];h(l,s)}}}return[l,r==a?pt():(await g(t,7,e.getMergeableValueHashes()))[0],1]},b=ut(e,(async()=>{const e=await f();return ge(e[0][0])&&ge(e[1][0])?void 0:e}),(async(t,n)=>{c++,n?s(null,null,3,n):s(null,null,2,e.getMergeableContentHashes())}),(e=>i=e),(()=>i=void 0),r,2,{startSync:async e=>await(await b.startAutoLoad(e)).startAutoSave(),stopSync:()=>b.stopAutoLoad().stopAutoSave(),destroy:()=>(a(),b.stopSync()),getSynchronizerStats:()=>({sends:c,receives:d}),...l});return b},mt=qe((e=>{const s=e.createStore,n=s(),a=s(),o=Me(),{addListener:r,callListeners:l,delListener:u}=a,[g,f,b,p,y,,,R,,S,M,V,m,D]=Be(e,(()=>!0),P,r,l),E=(e,t,...s)=>B(s,(s=>$e(He(He(o,t,Me),e,je),s))),H=e=>{A(me(o,e),(e=>{De(e,((e,t)=>Re(t,(t=>e.delListener(t))))),ye(e)})),B([a,n],(t=>t.delTable(e)))},J=(e,t,s)=>E(t,e,t.addStartTransactionListener(s.startTransaction),t.addDidFinishTransactionListener((()=>s.finishTransaction()))),x={setQueryDefinition:(s,o,r)=>{R(s,o),H(s);const l=[],i=[[null,[o,null,null,[],Me()]]],c=[],d=[],u=[];r({select:(e,s)=>{const n=F(e)?[N(l)+t,e]:[k(s)?e:s,t=>t(e,s)];return X(l,n),{as:e=>n[0]=e}},join:(e,t,s)=>{const n=k(s)||F(t)?null:t,a=k(n)?t:s,o=[e,[e,n,F(a)?a:e=>e(a),[],Me()]];return X(i,o),{as:e=>o[0]=e}},where:(e,t,s)=>X(c,F(e)?e:k(s)?s=>s(e)===t:n=>n(e,t)===s),group:(e,t,s,n,a)=>{const o=[e,[e,F(t)?[t,s,n,a]:me(rt,t)??[(e,t)=>t]]];return X(d,o),{as:e=>o[0]=e}},having:(e,t)=>X(u,F(e)?e:s=>s(e)===t)});const g=Me(l);if(Te(g))return x;const h=Me(i);De(h,((e,[,t])=>A(me(h,t),(({3:t})=>k(e)?0:X(t,e)))));const f=Me(d);let b=n;if(Te(f)&&G(u))b=a;else{J(s,b,a);const e=Me();De(f,((t,[s,n])=>$e(He(e,s,je),[t,n])));const t=je();De(g,(s=>Ie(e,s)?0:$e(t,s)));const n=Me(),o=(t,n,o,r)=>A(t,(([l,i,c,d])=>{De(n,((t,[s])=>{const n=He(l,t,Me),a=me(n,o),i=r?void 0:s;if(a!==i){const s=je([[a,i]]),r=we(n);Ee(n,o,i),Re(me(e,t),(([e,t])=>{const a=lt(d[e],r,n,s,t);d[e]=k(Pe(a))?null:a}))}})),Te(i)||!W(u,(e=>e((e=>d[e]))))?a.delRow(s,c):k(c)?t[2]=a.addRow(s,d):a.setRow(s,c,d)}));E(b,s,b.addRowListener(s,null,((a,r,l,i)=>{const c=[],d=[],u=Me(),g=b.hasRow(s,l);let h=!g;Re(t,(e=>{const[t,n,a]=i(s,l,e);X(c,n),X(d,a),h||=t})),De(e,(e=>{const[t,,n]=i(s,l,e);(h||t)&&Ee(u,e,[n])})),h&&o(Ne(n,c,void 0,(([,e])=>(Se(e,l),Te(e)))),u,l,1),g&&o(Ne(n,d,(()=>{const e={};return Re(t,(t=>e[t]=b.getCell(s,l,t))),[Me(),je(),void 0,e]}),(([,e])=>{$e(e,l)})),u,l)})))}J(s,e,b);const w=(t,n,a,r)=>{const l=t=>e.getCell(n,a,t);B(r,(n=>{const[a,,o,r,i]=me(h,n),c=o?.(l,t),[d,u]=me(i,t)??[];c!=d&&(k(u)||D(s,u),Ee(i,t,k(c)?null:[c,...m(s,1,e.addRowListener(a,c,(()=>w(t,a,c,r))))]))})),(t=>{const n=(s,n)=>e.getCell(...k(n)?[o,t,s]:s===o?[o,t,n]:[me(h,s)?.[0],me(me(h,s)?.[4],t)?.[0],n]);b.transaction((()=>W(c,(e=>e(n)))?De(g,((e,a)=>We(b,s,t,e,a(n,t)))):b.delRow(s,t)))})(t)},{3:C}=me(h,null);return b.transaction((()=>m(s,1,e.addRowListener(o,null,((t,n,a)=>{e.hasRow(o,a)?w(a,o,a,C):(b.delRow(s,a),Re(h,(({4:e})=>A(me(e,a),(([,t])=>{D(s,t),Ee(e,a)})))))}))))),x},delQueryDefinition:e=>(H(e),S(e),x),getStore:g,getQueryIds:f,forEachQuery:b,hasQuery:p,getTableId:y,addQueryIdsListener:e=>M((()=>e(x))),delListener:e=>(u(e),x),destroy:V,getListenerStats:()=>{const{tables:e,tableIds:t,transaction:s,...n}=a.getListenerStats();return n}};return ue({[h]:[1,1],[h+T]:[0,1],[C]:[0,1],[L]:[0,1],[v]:[0,5],[w]:[1,2],[T]:[0,2],[I]:[1,3]},(([e,t],s)=>{B(e?["get","has","forEach"]:["get"],(e=>x[e+c+s]=(...t)=>a[e+s](...t))),x[d+c+s+i]=(...e)=>a[d+s+i](...z(e,0,t),((s,...n)=>e[t](x,...n)),!0)})),re(x)})),Dt=qe((e=>{const s=Me(),n=Me(),a=Me(),o=Me(),[r,l,i]=Xe((()=>p)),[c,d,u,g,h,f,,,b,w,C,L]=Be(e,(()=>[Me(),Me(),Me(),Me()]),(e=>k(e)?void 0:e+t),r,l),v=(e,t,s)=>A(f(e),(([n,,a])=>{if(!Ie(a,t)){const o=je();if(h(e)!=T(e))$e(o,t);else{let e=t;for(;!k(e)&&!Ie(o,e);)$e(o,e),e=me(n,e)}if(s)return o;Ee(a,t,o)}return me(a,t)})),I=(e,t)=>A(f(e),(([,,e])=>Ee(e,t))),T=e=>me(s,e),p={setRelationshipDefinition:(e,t,r,i)=>(Ee(s,e,r),b(e,t,((t,s)=>{const r=je(),i=je(),c=je(),[d,u]=f(e);Re(s,(([t,s],n)=>{k(t)||($e(i,t),A(me(u,t),(e=>{Se(e,n),Te(e)&&Ee(u,t)}))),k(s)||($e(i,s),Ie(u,s)||Ee(u,s,je()),$e(me(u,s),n)),$e(r,n),Ee(d,n,s),De(me(o,e),(t=>{Ie(v(e,t),n)&&$e(c,t)}))})),t(),Re(r,(t=>l(n,[e,t]))),Re(i,(t=>l(a,[e,t]))),Re(c,(t=>{I(e,t),l(o,[e,t])}))}),Ue(i)),p),delRelationshipDefinition:e=>(Ee(s,e),w(e),p),getStore:c,getRelationshipIds:d,forEachRelationship:t=>u((s=>t(s,(t=>e.forEachRow(h(s),t))))),hasRelationship:g,getLocalTableId:h,getRemoteTableId:T,getRemoteRowId:(e,t)=>me(f(e)?.[0],t),getLocalRowIds:(e,t)=>pe(me(f(e)?.[1],t)),getLinkedRowIds:(e,t)=>k(f(e))?[t]:pe(v(e,t,!0)),addRelationshipIdsListener:C,addRemoteRowIdListener:(e,t,s)=>r(s,n,[e,t]),addLocalRowIdsListener:(e,t,s)=>r(s,a,[e,t]),addLinkedRowIdsListener:(e,t,s)=>(v(e,t),r(s,o,[e,t])),delListener:e=>(I(...i(e)??[]),p),destroy:L,getListenerStats:()=>({remoteRowId:Le(n),localRowIds:Le(a),linkedRowIds:Le(o)})};return re(p)})),Et=e=>[e,e],Ht=(e,t=Ce)=>t(e[0])+t(e[1]),kt=()=>[Me(),Me()],At=e=>[...e],Jt=([e,t])=>e===t,xt=e=>JSON.stringify(e,((e,t)=>t instanceof Map?ee.fromEntries([...t]):t)),Ft=JSON.parse,Qt=(e,t,s)=>Ee(e,t,me(e,t)==-s?void 0:s),zt=()=>{let e,t,s=!1,n=!1,o=0,c=[];const g=Me(),v=Me(),M=Me(),V=Me(),m=Me(),D=Me(),E=Me(),H=Me(),x=Me(),Q=Me(),N=Me(),P=Me(),W=Me(),j=Me(),q=je(),G=Me(),K=Me(),Y=Me(),Z=Me(),ee=kt(),te=kt(),se=kt(),ne=kt(),ae=kt(),oe=kt(),le=kt(),de=kt(),he=kt(),be=kt(),pe=kt(),Ne=kt(),Oe=kt(),Be=kt(),Ue=kt(),qe=kt(),Ge=kt(),Ye=kt(),Ze=kt(),et=kt(),tt=kt(),st=kt(),at=Me(),ot=kt(),[rt,lt,it,ct]=Xe((()=>zs)),dt=e=>{if(!fe(e,((e,t)=>O([r,l],t))))return!1;const t=e[r];return!(!J(t)&&t!=a||(Pe(e[l])!=t&&ce(e,l),0))},ut=(t,s)=>(!e||Ie(N,s)||Kt(s))&&fe(t,((e,t)=>gt(s,t,e)),(()=>Kt(s))),gt=(e,t,s,n)=>fe(n?s:wt(s,e,t),((n,a)=>A(ht(e,t,a,n),(e=>(s[a]=e,!0)),(()=>!1))),(()=>Kt(e,t))),ht=(t,s,n,a)=>e?A(me(me(N,t),n),(e=>Pe(a)!=e[r]?Kt(t,s,n,a,e[l]):a),(()=>Kt(t,s,n,a))):k(Pe(a))?Kt(t,s,n,a):a,ft=(e,t)=>fe(t?e:Ct(e),((t,s)=>A(bt(s,t),(t=>(e[s]=t,!0)),(()=>!1))),(()=>Xt())),bt=(e,s)=>t?A(me(W,e),(t=>Pe(s)!=t[r]?Xt(e,s,t[l]):s),(()=>Xt(e,s))):k(Pe(s))?Xt(e,s):s,wt=(e,t,s)=>(A(me(P,t),(([n,a])=>{Re(n,((t,s)=>{ie(e,s)||(e[s]=t)})),Re(a,(n=>{ie(e,n)||Kt(t,s,n)}))})),e),Ct=e=>(t&&(Re(j,((t,s)=>{ie(e,s)||(e[s]=t)})),Re(q,(t=>{ie(e,t)||Xt(t)}))),e),Lt=e=>ke(N,e,((e,t,s)=>{const n=Me(),a=je();ke(He(N,t,Me),s,((e,t,s)=>{Ee(e,t,s),A(s[l],(e=>Ee(n,t,e)),(()=>$e(a,t)))})),Ee(P,t,[n,a])}),((e,t)=>{Ee(N,t),Ee(P,t)})),vt=e=>ke(W,e,((e,t,s)=>{Ee(W,t,s),A(s[l],(e=>Ee(j,t,e)),(()=>$e(q,t)))}),((e,t)=>{Ee(W,t),Ee(j,t),Se(q,t)})),It=e=>ge(e)?Ds():Rs(e),Tt=e=>ke(Y,e,((e,t,s)=>pt(t,s)),((e,t)=>Pt(t))),pt=(e,t)=>ke(He(Y,e,(()=>(jt(e,1),Ee(G,e,Ke()),Ee(K,e,Me()),Me()))),t,((t,s,n)=>yt(e,t,s,n)),((t,s)=>Ot(e,t,s))),yt=(e,t,s,n,a)=>ke(He(t,s,(()=>($t(e,s,1),Me()))),n,((t,n,a)=>Rt(e,s,t,n,a)),((n,o)=>Wt(e,t,s,n,o,a))),Rt=(e,t,s,n,a)=>{Ie(s,n)||Bt(e,t,n,1);const o=me(s,n);a!==o&&(Ut(e,t,n,o,a),Ee(s,n,a))},St=(e,t,s,n,a)=>A(me(t,s),(t=>Rt(e,s,t,n,a)),(()=>yt(e,t,s,wt({[n]:a},e,s)))),Mt=e=>ge(e)?ks():Ss(e),Vt=e=>ke(Z,e,((e,t,s)=>mt(t,s)),((e,t)=>_t(t))),mt=(e,t)=>{Ie(Z,e)||qt(e,1);const s=me(Z,e);t!==s&&(Gt(e,s,t),Ee(Z,e,t))},Dt=(e,t)=>{const[s]=me(G,e),n=s(t);return Ie(me(Y,e),n)?Dt(e,t):n},Nt=e=>me(Y,e)??pt(e,{}),Pt=e=>pt(e,{}),Ot=(e,t,s)=>{const[,n]=me(G,e);n(s),yt(e,t,s,{},!0)},Wt=(e,t,s,n,a,o)=>{const r=me(me(P,e)?.[0],a);if(!k(r)&&!o)return Rt(e,s,n,a,r);const l=t=>{Ut(e,s,t,me(n,t)),Bt(e,s,t,-1),Ee(n,t)};k(r)?l(a):De(n,l),Te(n)&&($t(e,s,-1),Te(Ee(t,s))&&(jt(e,-1),Ee(Y,e),Ee(G,e),Ee(K,e)))},_t=e=>{const t=me(j,e);if(!k(t))return mt(e,t);Gt(e,me(Z,e)),qt(e,-1),Ee(Z,e)},jt=(e,t)=>Qt(g,e,t),$t=(e,t,s)=>Qt(He(V,e,Me),t,s)&&Ee(M,e,He(M,e,(()=>0))+s),Bt=(e,t,s,n)=>{const a=me(K,e),o=me(a,s)??0;(0==o&&1==n||1==o&&-1==n)&&Qt(He(v,e,Me),s,n),Ee(a,s,o!=-n?o+n:null),Qt(He(He(m,e,Me),t,Me),s,n)},Ut=(e,t,s,n,a)=>{He(He(He(D,e,Me),t,Me),s,(()=>[n,0]))[1]=a,c[3]?.(e,t,s,a)},qt=(e,t)=>Qt(E,e,t),Gt=(e,t,s)=>{He(H,e,(()=>[t,0]))[1]=s,c[4]?.(e,s)},Kt=(e,t,s,n,a)=>(X(He(He(He(x,e,Me),t,Me),s,(()=>[])),n),a),Xt=(e,t,s)=>(X(He(Q,e,(()=>[])),t),s),Yt=(e,t,s)=>A(me(me(me(D,e),t),s),(([e,t])=>[!0,e,t]),(()=>[!1,...Et(hs(e,t,s))])),Zt=e=>A(me(H,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Et(ws(e))])),es=e=>Te(x)||Te(qe[e])?0:Re(e?ze(x):x,((t,s)=>Re(t,((t,n)=>Re(t,((t,a)=>lt(qe[e],[s,n,a],t))))))),ts=e=>Te(Q)||Te(Ge[e])?0:Re(e?Fe(Q):Q,((t,s)=>lt(Ge[e],[s],t))),ss=(e,t,s,n)=>{if(!Te(e))return lt(t,n,(()=>Ae(e))),De(e,((e,t)=>lt(s,[...n??[],e],1==t))),1},ns=e=>{const t=Cs();t!=s&&lt(ee[e],void 0,t);const n=Te(be[e]),a=Te(Oe[e])&&Te(Be[e])&&Te(he[e])&&Te(pe[e])&&Te(oe[e])&&Te(le[e])&&Te(de[e])&&n&&Te(se[e])&&Te(ne[e]),o=Te(Ue[e])&&Te(Ne[e])&&Te(ae[e])&&Te(te[e]);if(!a||!o){const t=e?[Fe(g),Qe(v),Fe(M),Qe(V),ze(m),ze(D)]:[g,v,M,V,m,D];if(!a){ss(t[0],se[e],ne[e]),Re(t[1],((t,s)=>ss(t,oe[e],le[e],[s]))),Re(t[2],((t,s)=>{0!=t&&lt(de[e],[s],cs(s))}));const s=je();Re(t[3],((t,a)=>{ss(t,he[e],pe[e],[a])&&!n&&(lt(be[e],[a,null]),$e(s,a))})),n||Re(t[5],((t,n)=>{if(!Ie(s,n)){const s=je();Re(t,(e=>Re(e,(([t,n],a)=>n!==t?$e(s,a):Se(e,a))))),Re(s,(t=>lt(be[e],[n,t])))}})),Re(t[4],((t,s)=>Re(t,((t,n)=>ss(t,Oe[e],Be[e],[s,n])))))}if(!o){let s;Re(t[5],((t,n)=>{let a;Re(t,((t,o)=>{let r;Re(t,(([t,l],i)=>{l!==t&&(lt(Ue[e],[n,o,i],l,t,Yt),s=a=r=1)})),r&&lt(Ne[e],[n,o],Yt)})),a&&lt(ae[e],[n],Yt)})),s&&lt(te[e],void 0,Yt)}}},as=e=>{const t=ps();t!=n&&lt(Ye[e],void 0,t);const s=Te(et[e])&&Te(tt[e]),a=Te(st[e])&&Te(Ze[e]);if(!s||!a){const t=e?[Fe(E),Fe(H)]:[E,H];if(s||ss(t[0],et[e],tt[e]),!a){let s;Re(t[1],(([t,n],a)=>{n!==t&&(lt(st[e],[a],n,t,Zt),s=1)})),s&&lt(Ze[e],void 0,Zt)}}},os=(e,...t)=>(xs((()=>e(...U(t,S)))),zs),rs=()=>xe(Y),ls=()=>Ve(Y),is=e=>Ve(me(K,S(e))),cs=e=>we(me(Y,S(e))),ds=e=>Ve(me(Y,S(e))),us=(e,t,s,n=0,a)=>{return U(z($((o=me(Y,S(e)),r=(e,s)=>[k(t)?s:me(e,S(t)),s],U([...o?.entries()??[]],(([e,t])=>r(t,e)))),(([e],[t])=>nt(e,t)*(s?-1:1))),n,k(a)?a:n+a),(([,e])=>e));var o,r},gs=(e,t)=>Ve(me(me(Y,S(e)),S(t))),hs=(e,t,s)=>me(me(me(Y,S(e)),S(t)),S(s)),fs=()=>Ae(Z),bs=()=>Ve(Z),ws=e=>me(Z,S(e)),Cs=()=>!Te(Y),Ls=e=>Ie(Y,S(e)),vs=(e,t)=>Ie(me(K,S(e)),S(t)),Is=(e,t)=>Ie(me(Y,S(e)),S(t)),Ts=(e,t,s)=>Ie(me(me(Y,S(e)),S(t)),S(s)),ps=()=>!Te(Z),ys=e=>Ie(Z,S(e)),Rs=e=>os((()=>(e=>fe(e,ut,Kt))(e)?Tt(e):0)),Ss=e=>os((()=>ft(e)?Vt(e):0)),Ms=e=>{try{It(Ft(e))}catch{}return zs},Vs=t=>os((()=>{if((e=fe(t,(e=>fe(e,dt))))&&(Lt(t),!Te(Y))){const e=rs();Ds(),Rs(e)}})),ms=e=>os((()=>{if(t=(e=>fe(e,dt))(e)){const s=fs();Js(),ks(),t=!0,vt(e),Ss(s)}})),Ds=()=>os((()=>Tt({}))),Es=e=>os((e=>Ie(Y,e)?Pt(e):0),e),Hs=(e,t)=>os(((e,t)=>A(me(Y,e),(s=>Ie(s,t)?Ot(e,s,t):0))),e,t),ks=()=>os((()=>Vt({}))),As=()=>os((()=>{Lt({}),e=!1})),Js=()=>os((()=>{vt({}),t=!1})),xs=(e,t)=>{if(-1!=o){Fs();const s=e();return Qs(t),s}},Fs=()=>(-1!=o&&o++,1==o&&(c[0]?.(),lt(at)),zs),Qs=e=>(o>0&&(o--,0==o&&(o=1,es(1),Te(D)||ns(1),ts(1),Te(H)||as(1),e?.(zs)&&(Re(D,((e,t)=>Re(e,((e,s)=>Re(e,(([e],n)=>We(zs,t,s,n,e))))))),ye(D),Re(H,(([e],t)=>_e(zs,t,e))),ye(H)),lt(ot[0],void 0),o=-1,es(0),Te(D)||ns(0),ts(0),Te(H)||as(0),c[1]?.(),lt(ot[1],void 0),c[2]?.(),o=0,s=Cs(),n=ps(),B([g,v,M,V,m,D,x,E,H,Q],ye))),zs),zs={getContent:()=>[rs(),fs()],getTables:rs,getTableIds:ls,getTable:e=>Je(me(Y,S(e))),getTableCellIds:is,getRowCount:cs,getRowIds:ds,getSortedRowIds:us,getRow:(e,t)=>Ae(me(me(Y,S(e)),S(t))),getCellIds:gs,getCell:hs,getValues:fs,getValueIds:bs,getValue:ws,hasTables:Cs,hasTable:Ls,hasTableCell:vs,hasRow:Is,hasCell:Ts,hasValues:ps,hasValue:ys,getTablesJson:()=>xt(Y),getValuesJson:()=>xt(Z),getJson:()=>xt([Y,Z]),getTablesSchemaJson:()=>xt(N),getValuesSchemaJson:()=>xt(W),getSchemaJson:()=>xt([N,W]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:([e,t])=>os((()=>{(ge(e)?Ds:Rs)(e),(ge(t)?ks:Ss)(t)})),setTables:Rs,setTable:(e,t)=>os((e=>ut(t,e)?pt(e,t):0),e),setRow:(e,t,s)=>os(((e,t)=>gt(e,t,s)?yt(e,Nt(e),t,s):0),e,t),addRow:(e,t,s=!0)=>xs((()=>{let n;return gt(e,n,t)&&(e=S(e),yt(e,Nt(e),n=Dt(e,s?1:0),t)),n})),setPartialRow:(e,t,s)=>os(((e,t)=>{if(gt(e,t,s,1)){const n=Nt(e);ue(s,((s,a)=>St(e,n,t,a,s)))}}),e,t),setCell:(e,t,s,n)=>os(((e,t,s)=>A(ht(e,t,s,F(n)?n(hs(e,t,s)):n),(n=>St(e,Nt(e),t,s,n)))),e,t,s),setValues:Ss,setPartialValues:e=>os((()=>ft(e,1)?ue(e,((e,t)=>mt(t,e))):0)),setValue:(e,t)=>os((e=>A(bt(e,F(t)?t(ws(e)):t),(t=>mt(e,t)))),e),applyChanges:e=>os((()=>{ue(e[0],((e,t)=>k(e)?Es(t):ue(e,((e,s)=>k(e)?Hs(t,s):ue(e,((e,n)=>We(zs,t,s,n,e))))))),ue(e[1],((e,t)=>_e(zs,t,e)))})),setTablesJson:Ms,setValuesJson:e=>{try{Mt(Ft(e))}catch{}return zs},setJson:e=>os((()=>{try{const[t,s]=Ft(e);It(t),Mt(s)}catch{Ms(e)}})),setTablesSchema:Vs,setValuesSchema:ms,setSchema:(e,t)=>os((()=>{Vs(e),ms(t)})),delTables:Ds,delTable:Es,delRow:Hs,delCell:(e,t,s,n)=>os(((e,t,s)=>A(me(Y,e),(a=>A(me(a,t),(o=>Ie(o,s)?Wt(e,a,t,o,s,n):0))))),e,t,s),delValues:ks,delValue:e=>os((e=>Ie(Z,e)?_t(e):0),e),delTablesSchema:As,delValuesSchema:Js,delSchema:()=>os((()=>{As(),Js()})),transaction:xs,startTransaction:Fs,getTransactionChanges:()=>[Ae(D,((e,t)=>-1===me(g,t)?void 0:Ae(e,((e,s)=>-1===me(me(V,t),s)?void 0:Ae(e,(([,e])=>e),(e=>Jt(e)))),Te,ge)),Te,ge),Ae(H,(([,e])=>e),(e=>Jt(e))),1],getTransactionLog:()=>[!Te(D),!Te(H),xe(D,At,Jt),xe(x),Ae(H,At,Jt),Ae(Q),Ae(g),Je(V),xe(m),Ae(E)],finishTransaction:Qs,forEachTable:e=>Re(Y,((t,s)=>e(s,(e=>Re(t,((t,s)=>e(s,(e=>De(t,e))))))))),forEachTableCell:(e,t)=>De(me(K,S(e)),t),forEachRow:(e,t)=>Re(me(Y,S(e)),((e,s)=>t(s,(t=>De(e,t))))),forEachCell:(e,t,s)=>De(me(me(Y,S(e)),S(t)),s),forEachValue:e=>De(Z,e),addSortedRowIdsListener:(e,t,s,n,a,o,r)=>{let l=us(e,t,s,n,a);return rt((()=>{const r=us(e,t,s,n,a);_(r,l)||(l=r,o(zs,e,t,s,n,a,l))}),be[r?1:0],[e,t],[ls])},addStartTransactionListener:e=>rt(e,at),addWillFinishTransactionListener:e=>rt(e,ot[0]),addDidFinishTransactionListener:e=>rt(e,ot[1]),callListener:e=>(ct(e),zs),delListener:e=>(it(e),zs),getListenerStats:()=>({hasTables:Ht(ee),tables:Ht(te),tableIds:Ht(se),hasTable:Ht(ne),table:Ht(ae),tableCellIds:Ht(oe),hasTableCell:Ht(le,Le),rowCount:Ht(de),rowIds:Ht(he),sortedRowIds:Ht(be),hasRow:Ht(pe,Le),row:Ht(Ne,Le),cellIds:Ht(Oe,Le),hasCell:Ht(Be,ve),cell:Ht(Ue,ve),invalidCell:Ht(qe,ve),hasValues:Ht(Ye),values:Ht(Ze),valueIds:Ht(et),hasValue:Ht(tt),value:Ht(st),invalidValue:Ht(Ge),transaction:Ce(at)+Ht(ot)}),isMergeable:()=>!1,createStore:zt,addListener:rt,callListeners:lt,setInternalListeners:(e,t,s,n,a)=>c=[e,t,s,n,a]};return ue({[u+f]:[0,ee,[],()=>[Cs()]],[f]:[0,te],[b]:[0,se],[u+h]:[1,ne,[ls],e=>[Ls(...e)]],[h]:[1,ae,[ls]],[h+T]:[1,oe,[ls]],[u+h+I]:[2,le,[ls,is],e=>[vs(...e)]],[C]:[1,de,[ls]],[L]:[1,he,[ls]],[u+w]:[2,pe,[ls,ds],e=>[Is(...e)]],[w]:[2,Ne,[ls,ds]],[T]:[2,Oe,[ls,ds]],[u+I]:[3,Be,[ls,ds,gs],e=>[Ts(...e)]],[I]:[3,Ue,[ls,ds,gs],e=>Et(hs(...e))],InvalidCell:[3,qe],[u+y]:[0,Ye,[],()=>[ps()]],[y]:[0,Ze],[R]:[0,et],[u+p]:[1,tt,[bs],e=>[ys(...e)]],[p]:[1,st,[bs],e=>Et(ws(e[0]))],InvalidValue:[1,Ge]},(([e,t,s,n],a)=>{zs[d+a+i]=(...a)=>rt(a[e],t[a[e+1]?1:0],e>0?z(a,0,e):void 0,s,n)})),re(zs)},Nt=2**36,Pt=2**30,Ot=2**24,Wt=2**18,_t=4096,jt={HasTable:1,Table:1,TableCellIds:1,HasTableCell:2,RowCount:1,RowIds:1,SortedRowIds:5,HasRow:2,Row:2,CellIds:2,HasCell:3,Cell:3,HasValue:1,Value:1,InvalidCell:3,InvalidValue:1},$t=(e=t)=>[yt(e),yt(e)],Bt=e=>{let s=1,n=$t(),a=0;const o=Me(),r=je(),[l,i]=(e=>{let t=0,s=-1;const n=A(e,(e=>{const t=ht(e);return tt(t/Ot)+tt(t/Wt)+tt(t/_t)+tt(t/64)+tt(t)}),(()=>at(5))),a=e=>{const n=t,[a,o]=k(e)||""==e?[0,0]:[st(r=e,0)*Nt+st(r,1)*Pt+st(r,2)*Ot+st(r,3)*Wt+st(r,4)*_t+64*st(r,5)+st(r,6),st(r,7)*Wt+st(r,8)*_t+64*st(r,9)+st(r,10)];var r;t=D(n,a,globalThis.HLC_TIME??Date.now()),s=t==n?t==a?D(s,o):s:t==a?o:-1};return[()=>{return a(),o=++s,tt((e=t)/Nt)+tt(e/Pt)+tt(e/Ot)+tt(e/Wt)+tt(e/_t)+tt(e/64)+tt(e)+tt(o/Wt)+tt(o/_t)+tt(o/64)+tt(o)+n;var e,o},a]})(e),c=zt(),d=e=>{const t=s;return s=0,e(),s=t,b},u=(e,s=0)=>{const a={},o={},[[r,l=t,c=0],d]=e,[u,h]=n,[f,b,w]=u;let C=s?c:w,L=l;de(r,(([e,n=t,o=0],r)=>{const l=He(f,r,yt),[i,c,d]=l;let u=s?o:d,h=n;de(e,((e,t)=>{const[n,o,l]=g(e,He(i,t,yt),he(he(a,r,le),t,le),s);u^=s?0:(o?Lt(t,o):0)^Lt(t,l),h=It(h,n)})),u^=s?0:vt(c,n),Tt(l,u,n),C^=s?0:(d?Lt(r,d):0)^Lt(r,l[2]),L=It(L,h)})),C^=s?0:vt(b,l),Tt(u,C,l);const[v]=g(d,h,o,s);return i(It(L,v)),[a,o,1]},g=(e,s,n,a)=>{const[o,r=t,l=0]=e,[i,c,d]=s;let u=r,g=a?l:d;return de(o,(([e,s,o=0],r)=>{const l=He(i,r,(()=>[void 0,t,0])),[,c,d]=l;(!c||s>c)&&(Tt(l,a?o:ht(xt(e??null)+":"+s),s),l[0]=e,n[r]=e,g^=a?0:Lt(r,d)^Lt(r,l[2]),u=It(u,s))})),g^=a?0:vt(c,r),Tt(s,g,r),[u,d,s[2]]},h=()=>[Rt(n[0],(e=>Rt(e,(e=>Rt(e))))),Rt(n[1])],f=e=>d((()=>c.applyChanges(u(e)))),b={getMergeableContent:h,getMergeableContentHashes:()=>[n[0][2],n[1][2]],getMergeableTableHashes:()=>Ae(n[0][0],Ct),getMergeableTableDiff:e=>{const t=pt(n[0][1]),s={};return De(n[0][0],((n,[a,o,r])=>ie(e,n)?r!=e[n]?s[n]=r:0:t[0][n]=St([a,o],(e=>St(e))))),[t,s]},getMergeableRowHashes:e=>{const t={};return de(e,((e,s)=>A(me(n[0][0],s),(([n,,a])=>a!=e?De(n,((e,[,,n])=>he(t,s,le)[e]=n)):0)))),t},getMergeableRowDiff:e=>{const t=pt(n[0][1]),s={};return de(e,((e,a)=>De(me(n[0][0],a)?.[0],((n,[o,r,l])=>ie(e,n)?l!==e[n]?he(s,a,le)[n]=l:0:he(t[0],a,pt)[0][n]=St([o,r]))))),[t,s]},getMergeableCellHashes:e=>{const t={};return de(e,((e,s)=>A(me(n[0][0],s),(([n])=>de(e,((e,a)=>A(me(n,a),(([n,,o])=>o!==e?De(n,((e,[,,n])=>he(he(t,s,le),a,le)[e]=n)):0)))))))),t},getMergeableCellDiff:e=>{const[[t,s]]=n,a={};return de(e,((e,s)=>de(e,((e,n)=>A(me(t,s),(([t,o])=>A(me(t,n),(([t,r])=>De(t,((t,[l,i,c])=>c!==e[t]?he(he(a,s,(()=>pt(o)))[0],n,(()=>pt(r)))[0][t]=[l,i]:0)))))))))),wt(a,s)},getMergeableValueHashes:()=>Ae(n[1][0],Ct),getMergeableValueDiff:e=>{const[,[t,s]]=n,a=Ae(t,bt,(([,,t],s)=>t==e?.[s]));return wt(a,s)},setMergeableContent:e=>d((()=>(e=>Q(e)&&2==N(e)&&Mt(e[0],(e=>fe(e,(e=>Mt(e,(e=>fe(e,(e=>Mt(e,(e=>fe(e,(e=>Mt(e,Oe)),void 0,1)))),void 0,1)))),void 0,1)))&&Mt(e[1],(e=>fe(e,(e=>Mt(e,Oe)),void 0,1))))(e)?c.transaction((()=>{c.delTables().delValues(),n=$t(),c.applyChanges(u(e,1))})):0)),setDefaultContent:e=>(c.transaction((()=>{a=1,c.setContent(e),a=0})),b),getTransactionMergeableChanges:()=>{const[[e,t],[s,a]]=n,l={};Re(o,((t,s)=>A(me(e,s),(([e,n])=>{const a={};Re(t,((t,s)=>A(me(e,s),(([e,n])=>{const o={};Re(t,(t=>{A(me(e,t),(([e,s])=>o[t]=wt(e,s)))})),a[s]=wt(o,n)})))),l[s]=wt(a,n)}))));const i={};return Re(r,(e=>A(me(s,e),(([t,s])=>i[e]=wt(t,s))))),[wt(l,t),wt(i,a),1]},applyMergeableChanges:f,merge:e=>{const t=h(),s=e.getMergeableContent();return e.applyMergeableChanges(t),f(s)}};return c.setInternalListeners((()=>{}),(()=>{}),(()=>{ye(o),ye(r)}),((e,n,r,i)=>{$e(He(He(o,e,Me),n,je),r),s&&u([[{[e]:[{[n]:[{[r]:[i,a?t:l()]}]}]}],[{}],1])}),((e,n)=>{$e(r,e),s&&u([[{}],[{[e]:[n,a?t:l()]}],1])})),ue(c,((e,t)=>b[t]=M(t,"set")||M(t,"del")||M(t,"apply")||V(t,"Transaction")||"callListener"==t?(...t)=>(e(...t),b):M(t,"add")&&V(t,"Listener")?(...s)=>{const n=jt[z(t,3,-8)]??0,a=s[n];return s[n]=(e,...t)=>a(b,...t),e(...s)}:"isMergeable"==t?()=>!0:e)),re(b)};export{Ye as createCheckpoints,ut as createCustomPersister,Vt as createCustomSynchronizer,ot as createIndexes,Bt as createMergeableStore,it as createMetrics,mt as createQueries,Dt as createRelationships,zt as createStore,nt as defaultSorter,at as getUniqueId};
1
+ const e=e=>typeof e,t="",s=e(t),n=e(!0),a=e(0),o=e(e),r="type",l="default",i="Listener",c="Result",d="add",u="Has",g="Ids",h="Table",f=h+"s",b=h+g,w="Row",C=w+"Count",L=w+g,v="Sorted"+w+g,I="Cell",p=I+g,T="Value",y=T+"s",R=T+g,S=e=>t+e,M=(e,t)=>e.startsWith(t),V=(e,t)=>e.endsWith(t),m=Promise,D=globalThis,E=Math,H=E.max,k=E.min,A=E.floor,J=isFinite,x=e=>null==e,F=(e,t,s)=>x(e)?s?.():t(e),Q=e=>e==s||e==n,z=t=>e(t)==s,N=t=>e(t)==o,P=e=>Array.isArray(e),O=(e,t,s)=>e.slice(t,s),W=e=>e.length,_=()=>{},j=(e,t)=>e.includes(t),$=(e,t)=>e.every(t),B=(e,t)=>W(e)===W(t)&&$(e,((e,s)=>t[s]===e)),U=(e,t)=>$(e,((s,n)=>0==n||t(e[n-1],s)<=0)),q=(e,t)=>e.sort(t),G=(e,t)=>e.forEach(t),K=(e,t)=>e.map(t),X=e=>Z(e,((e,t)=>e+t),0),Y=e=>0==W(e),Z=(e,t,s)=>e.reduce(t,s),ee=(e,...t)=>e.push(...t),te=e=>e.pop(),se=e=>e.shift(),ne=Object,ae=e=>ne.getPrototypeOf(e),oe=ne.entries,re=ne.isFrozen,le=e=>!x(e)&&F(ae(e),(e=>e==ne.prototype||x(ae(e))),(()=>!0)),ie=ne.keys,ce=ne.freeze,de=(e=[])=>ne.fromEntries(e),ue=(e,t)=>t in e,ge=(e,t)=>(delete e[t],e),he=(e,t)=>G(oe(e),(([e,s])=>t(s,e))),fe=(e,t)=>K(oe(e),(([e,s])=>t(s,e))),be=e=>le(e)&&0==(e=>W(ie(e)))(e),we=(e,t,s)=>(ue(e,t)||(e[t]=s()),e[t]),Ce=(e,t,s,n=0)=>x(e)||!le(e)||!n&&be(e)||re(e)?(s?.(),!1):(fe(e,((s,n)=>{t(s,n)||ge(e,n)})),!!n||!be(e)),Le=e=>t=>Z(Se(t),((t,s)=>t+e(s)),0),ve=e=>e?.size??0,Ie=Le(ve),pe=Le(Ie),Te=Le(pe),ye=(e,t)=>e?.has(t)??!1,Re=e=>x(e)||0==ve(e),Se=e=>[...e?.values()??[]],Me=e=>e.clear(),Ve=(e,t)=>e?.forEach(t),me=(e,t)=>e?.delete(t),De=e=>new Map(e),Ee=e=>[...e?.keys()??[]],He=(e,t)=>e?.get(t),ke=(e,t)=>Ve(e,((e,s)=>t(s,e))),Ae=(e,t,s)=>x(s)?(me(e,t),e):e?.set(t,s),Je=(e,t,s,n)=>(ye(e,t)?n?.(He(e,t)):Ae(e,t,s()),He(e,t)),xe=(e,t,s,n=Ae)=>(fe(t,((t,n)=>s(e,n,t))),ke(e,(s=>ue(t,s)?0:n(e,s))),e),Fe=(e,t,s,n)=>{const a={};return Ve(e,((e,o)=>{if(!s?.(e,o)){const s=t?t(e,o):e;!n?.(s)&&(a[o]=s)}})),a},Qe=(e,t,s)=>Fe(e,(e=>Fe(e,t,s)),Re,be),ze=(e,t,s)=>Fe(e,(e=>Qe(e,t,s)),Re,be),Ne=(e,t)=>{const s=De();return Ve(e,((e,n)=>s.set(n,t?.(e)??e))),s},Pe=e=>Ne(e,Ne),Oe=e=>Ne(e,Pe),We=(e,t,s,n,a=0)=>F((s?Je:He)(e,t[a],a>W(t)-2?s:De),(o=>{if(a>W(t)-2)return n?.(o)&&Ae(e,t[a]),o;const r=We(o,t,s,n,a+1);return Re(o)&&Ae(e,t[a]),r})),_e=t=>{const s=e(t);return Q(s)||s==a&&J(t)?s:void 0},je=e=>x(e)||!x(_e(e)),$e=(e,t,s,n,a)=>x(a)?e.delCell(t,s,n,!0):e.setCell(t,s,n,a),Be=(e,t,s)=>x(s)?e.delValue(t):e.setValue(t,s),Ue=e=>new Set(P(e)||x(e)?e:[e]),qe=(e,t)=>e?.add(t),Ge=(e,t,s,n,a)=>{const o=e.hasRow,r=De(),l=De(),i=De(),c=De(),d=De(),u=De(),g=(t,s,...n)=>{const a=Je(u,t,Ue);return G(n,(t=>qe(a,t)&&s&&e.callListener(t))),n},h=(t,...s)=>F(He(u,t),(n=>{G(Y(s)?Se(n):s,(t=>{e.delListener(t),me(n,t)})),Re(n)&&Ae(u,t)})),f=(e,s)=>{Ae(r,e,s),ye(l,e)||(Ae(l,e,t()),Ae(c,e,De()),Ae(d,e,De()),a(i))},b=e=>{Ae(r,e),Ae(l,e),Ae(c,e),Ae(d,e),h(e),a(i)};return[()=>e,()=>Ee(r),e=>ke(l,e),e=>ye(l,e),e=>He(r,e),e=>He(l,e),(e,t)=>Ae(l,e,t),f,(t,n,a,r,l)=>{f(t,n);const i=De(),u=De(),b=He(c,t),w=He(d,t),C=t=>{const a=s=>e.getCell(n,t,s),c=He(b,t),d=o(n,t)?s(r(a,t)):void 0;if(c===d||P(c)&&P(d)&&B(c,d)||Ae(i,t,[c,d]),!x(l)){const e=He(w,t),s=o(n,t)?l(a,t):void 0;e!=s&&Ae(u,t,s)}},L=e=>{a((()=>{Ve(i,(([,e],t)=>Ae(b,t,e))),Ve(u,((e,t)=>Ae(w,t,e)))}),i,u,b,w,e),Me(i),Me(u)};ke(b,C),e.hasTable(n)&&G(e.getRowIds(n),(e=>{ye(b,e)||C(e)})),L(!0),h(t),g(t,0,e.addRowListener(n,null,((e,t,s)=>C(s))),e.addTableListener(n,(()=>L())))},b,e=>n(e,i),()=>ke(u,b),g,h]},Ke=(e,s)=>z(e)?t=>t(e):e??(()=>s??t),Xe=(e,t)=>{const s=new WeakMap;return n=>{s.has(n)||s.set(n,e(n));const a=s.get(n);return t?.(a),a}},Ye=/^\d+$/,Ze=()=>{const e=[];let s=0;return[n=>(n?se(e):null)??t+s++,t=>{Ye.test(t)&&W(e)<1e3&&ee(e,t)}]},et=e=>{let s;const[n,a]=Ze(),o=De();return[(a,r,l,i=[],c=(()=>[]))=>{s??=e();const d=n(1);return Ae(o,d,[a,r,l,i,c]),qe(We(r,l??[t],Ue),d),d},(e,n,...a)=>G(((e,s=[t])=>{const n=[],a=(e,t)=>t==W(s)?ee(n,e):null===s[t]?Ve(e,(e=>a(e,t+1))):G([s[t],null],(s=>a(He(e,s),t+1)));return a(e,0),n})(e,n),(e=>Ve(e,(e=>He(o,e)[0](s,...n??[],...a))))),e=>F(He(o,e),(([,s,n])=>(We(s,n??[t],void 0,(t=>(me(t,e),Re(t)?1:0))),Ae(o,e),a(e),n))),e=>F(He(o,e),(([e,,t=[],n,a])=>{const o=(...r)=>{const l=W(r);l==W(t)?e(s,...r,...a(r)):x(t[l])?G(n[l]?.(...r)??[],(e=>o(...r,e))):o(...r,t[l])};o()}))]},tt=Xe((e=>{let s,n,a,o=100,r=De(),l=De(),i=1;const c=De(),d=De(),[u,g,h]=et((()=>A)),f=De(),b=De(),w=[],C=[],L=(t,s)=>{i=0,e.transaction((()=>{const[n,a]=He(f,s);Ve(n,((s,n)=>Ve(s,((s,a)=>Ve(s,((s,o)=>$e(e,n,a,o,s[t]))))))),Ve(a,((s,n)=>Be(e,n,s[t])))})),i=1},v=e=>{Ae(f,e),Ae(b,e),g(d,[e])},I=(e,t)=>G(((e,t)=>e.splice(0,t))(e,t??W(e)),v),p=()=>I(w,W(w)-o),T=()=>F(s,(()=>{ee(w,s),p(),I(C),s=void 0,a=1})),y=()=>{s=te(w),a=1};let R,S;const M=(e=t)=>(x(s)&&(s=t+n++,Ae(f,s,[r,l]),H(s,e),r=De(),l=De(),a=1),s),V=()=>{Y(w)||(((e,...t)=>{e.unshift(...t)})(C,M()),L(0,s),s=te(w),a=1)},m=()=>{Y(C)||(ee(w,s),s=se(C),L(1,s),a=1)},D=()=>{a&&(g(c),a=0)},E=e=>{const t=M(e);return D(),t},H=(e,t)=>(k(e)&&He(b,e)!==t&&(Ae(b,e,t),g(d,[e])),A),k=e=>ye(f,e),A={setSize:e=>(o=e,p(),A),addCheckpoint:E,setCheckpoint:H,getStore:()=>e,getCheckpointIds:()=>[[...w],s,[...C]],forEachCheckpoint:e=>ke(b,e),hasCheckpoint:k,getCheckpoint:e=>He(b,e),goBackward:()=>(V(),D(),A),goForward:()=>(m(),D(),A),goTo:e=>{const t=j(w,e)?V:j(C,e)?m:null;for(;!x(t)&&e!=s;)t();return D(),A},addCheckpointIdsListener:e=>u(e,c),addCheckpointListener:(e,t)=>u(t,d,[e]),delListener:e=>(h(e),A),clear:()=>(I(w),I(C),x(s)||v(s),s=void 0,n=0,E(),A),clearForward:()=>(Y(C)||(I(C),g(c)),A),destroy:()=>{e.delListener(R),e.delListener(S)},getListenerStats:()=>({checkpointIds:Ie(c),checkpoint:Ie(d)}),_registerListeners:()=>{R=e.addCellListener(null,null,null,((e,t,s,n,a,o)=>{if(i){T();const e=Je(r,t,De),l=Je(e,s,De),i=Je(l,n,(()=>[o,void 0]));i[1]=a,i[0]===a&&Re(Ae(l,n))&&Re(Ae(e,s))&&Re(Ae(r,t))&&y(),D()}})),S=e.addValueListener(null,((e,t,s,n)=>{if(i){T();const e=Je(l,t,(()=>[n,void 0]));e[1]=s,e[0]===s&&Re(Ae(l,t))&&y(),D()}}))}};return ce(A.clear())}),(e=>e._registerListeners())),st="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(t),nt=De(K(st,((e,t)=>[e,t]))),at=e=>st[63&e],ot=(e,t)=>He(nt,e[t])??0,rt=D.crypto?e=>D.crypto.getRandomValues(e):e=>K(e,(()=>A(256*E.random()))),lt=(e,t)=>(e??0)<(t??0)?-1:1,it=(e=16)=>Z(rt(new Uint8Array(e)),((e,t)=>e+at(t)),""),ct=Xe((e=>{const s=De(),n=De(),[a,o,r]=et((()=>v)),[l,i,c,d,u,g,h,,f,b,w,C]=Ge(e,De,(e=>x(e)?t:P(e)?K(e,S):S(e)),a,o),L=(t,s,n)=>{const a=u(t);Ve(n,((t,n)=>s(n,(s=>Ve(t,(t=>s(t,(s=>e.forEachCell(a,t,s)))))))))},v={setIndexDefinition:(e,t,a,r,l,i=lt)=>{const c=x(l)?void 0:([e],[t])=>l(e,t);return f(e,t,((t,a,l,d,u,f)=>{let b=0;const w=Ue(),C=Ue(),L=g(e);if(Ve(a,(([e,t],s)=>{const n=Ue(e),a=Ue(t);Ve(n,(e=>me(a,e)?me(n,e):0)),Ve(n,(e=>{qe(w,e),F(He(L,e),(t=>{me(t,s),Re(t)&&(Ae(L,e),b=1)}))})),Ve(a,(e=>{qe(w,e),ye(L,e)||(Ae(L,e,Ue()),b=1),qe(He(L,e),s),x(r)||qe(C,e)}))})),t(),Re(u)||(f?ke(L,(e=>qe(C,e))):ke(l,(e=>F(He(d,e),(e=>qe(C,e))))),Ve(C,(e=>{const t=(t,s)=>i(He(u,t),He(u,s),e),s=[...He(L,e)];U(s,t)||(Ae(L,e,Ue(q(s,t))),qe(w,e))}))),(b||f)&&!x(c)){const t=[...L];U(t,c)||(h(e,De(q(t,c))),b=1)}b&&o(s,[e]),Ve(w,(t=>o(n,[e,t])))}),Ke(a),F(r,Ke)),v},delIndexDefinition:e=>(b(e),v),getStore:l,getIndexIds:i,forEachIndex:e=>c(((t,s)=>e(t,(e=>L(t,e,s))))),forEachSlice:(e,t)=>L(e,t,g(e)),hasIndex:d,hasSlice:(e,t)=>ye(g(e),t),getTableId:u,getSliceIds:e=>Ee(g(e)),getSliceRowIds:(e,t)=>Se(He(g(e),t)),addIndexIdsListener:w,addSliceIdsListener:(e,t)=>a(t,s,[e]),addSliceRowIdsListener:(e,t,s)=>a(s,n,[e,t]),delListener:e=>(r(e),v),destroy:C,getListenerStats:()=>({sliceIds:Ie(s),sliceRowIds:pe(n)})};return ce(v)})),dt=De([["avg",[(e,t)=>X(e)/t,(e,t,s)=>e+(t-e)/(s+1),(e,t,s)=>e+(e-t)/(s-1),(e,t,s,n)=>e+(t-s)/n]],["max",[e=>H(...e),(e,t)=>H(t,e),(e,t)=>t==e?void 0:e,(e,t,s)=>s==e?void 0:H(t,e)]],["min",[e=>k(...e),(e,t)=>k(t,e),(e,t)=>t==e?void 0:e,(e,t,s)=>s==e?void 0:k(t,e)]],["sum",[e=>X(e),(e,t)=>e+t,(e,t)=>e-t,(e,t,s)=>e-s+t]]]),ut=(e,t,s,n,a,o=!1)=>{if(Re(s))return;const[r,l,i,c]=a;return o||=x(e),Ve(n,(([s,n])=>{o||(e=x(s)?l?.(e,n,t++):x(n)?i?.(e,s,t--):c?.(e,n,s,t),o||=x(e))})),o?r(Se(s),ve(s)):e},gt=Xe((e=>{const s=De(),[n,a,o]=et((()=>C)),[r,l,i,c,d,u,g,,h,f,b,w]=Ge(e,_,(e=>isNaN(e)||x(e)||!0===e||!1===e||e===t?void 0:1*e),n,a),C={setMetricDefinition:(e,t,n,o,r,l,i)=>{const c=N(n)?[n,r,l,i]:He(dt,n)??He(dt,"sum");return h(e,t,((t,n,o,r,l,i)=>{const d=u(e),h=ve(r);i||=x(d),t();let f=ut(d,h,r,n,c,i);J(f)||(f=void 0),f!=d&&(g(e,f),a(s,[e],f,d))}),Ke(o,1)),C},delMetricDefinition:e=>(f(e),C),getStore:r,getMetricIds:l,forEachMetric:i,hasMetric:c,getTableId:d,getMetric:u,addMetricIdsListener:b,addMetricListener:(e,t)=>n(t,s,[e]),delListener:e=>(o(e),C),destroy:w,getListenerStats:()=>({metric:Ie(s)})};return ce(C)})),ht=De(),ft=De(),bt=(e,t,s,n,a,o,r,l={},i=[])=>{let c,d,u,g=0,h=0,f=0;Je(ht,i,(()=>0)),Je(ft,i,(()=>[]));const[b,w,C,L,v]=((e=1,t)=>e>1&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!be(e)||!be(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!be(e)||!be(t),t.setContent]:(e=>{throw Error("Store type not supported by this Persister")})())(r,e),I=t=>{(b&&P(t?.[0])?1===t?.[2]?e.applyMergeableChanges:e.setMergeableContent:1===t?.[2]?e.applyChanges:e.setContent)(t)},p=async e=>(2!=g&&(g=1,h++,await S((async()=>{try{I(await t())}catch(t){o?.(t),e&&v(e)}g=0}))),M),T=()=>(d&&(a(d),d=void 0),M),y=async e=>(1!=g&&(g=2,f++,await S((async()=>{try{await s(w,e)}catch(e){o?.(e)}g=0}))),M),R=()=>(F(u,e.delListener),u=void 0,M),S=async(...e)=>(ee(He(ft,i),...e),await(async()=>{if(!He(ht,i)){for(Ae(ht,i,1);!x(c=se(He(ft,i)));)try{await c()}catch(e){o?.(e)}Ae(ht,i,0)}})(),M),M={load:p,startAutoLoad:async e=>(await T().load(e),d=n((async(e,t)=>{t||e?2!=g&&(g=1,h++,I(t??e),g=0):await p()})),M),stopAutoLoad:T,isAutoLoading:()=>!x(d),save:y,startAutoSave:async()=>(await R().save(),u=e.addDidFinishTransactionListener((()=>{const e=C();L(e)&&y(e)})),M),stopAutoSave:R,isAutoSaving:()=>!x(u),schedule:S,getStore:()=>e,destroy:()=>T().stopAutoSave(),getStats:()=>({loads:h,saves:f}),...l};return ce(M)},wt=new D.TextEncoder,Ct=e=>{let t=2166136261;return G(wt.encode(e),(e=>{t^=e,t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24)})),t>>>0},Lt=([e,t,s])=>[e,t,s],vt=([e,t])=>It(e,t),It=(e,t)=>t?[e,t]:[e],pt=e=>e[2],Tt=(e,t)=>Ct(e+":"+t),yt=(e,t)=>t>e?(e?Ct(e):0)^Ct(t):0,Rt=(e,t)=>((e??"")>(t??"")?e:t)??"",St=(e,t,s)=>{e[2]=t>>>0,s>e[1]&&(e[1]=s)},Mt=(e=t)=>It(de(),e),Vt=(e=t)=>[De(),e,0],mt=([e,t,s],n=Lt)=>[Fe(e,n),t,s],Dt=([e,t],s=vt)=>It(Fe(e,s),t),Et=(t,s)=>P(t)&&3==W(t)&&z(t[1])&&e(t[2])==a&&J(t[2])&&s(t[0]),Ht=(e,s,n,a,o,r,l={})=>{let i,c=0,d=0;const u=De();n(((t,n,a,o)=>{d++,0==a?F(He(u,n),(([e,s])=>x(e)||e==t?s(o,t):0)):2==a&&b.isAutoLoading()?f(t,o).then((e=>{i?.(void 0,e)})):3==a&&b.isAutoLoading()?i?.(void 0,o):F(1==a&&b.isAutoSaving()?e.getMergeableContentHashes():4==a?e.getMergeableTableDiff(o):5==a?e.getMergeableRowDiff(o):6==a?e.getMergeableCellDiff(o):7==a?e.getMergeableValueDiff(o):void 0,(e=>{c++,s(t,n,0,e)}))}));const g=async(e,n,a=t)=>new m(((t,r)=>{const l=it(),i=setTimeout((()=>{me(u,l),r(`No response from ${e??"anyone"} to '${n}'`)}),1e3*o);Ae(u,l,[e,(e,s)=>{clearTimeout(i),me(u,l),t([e,s])}]),c++,s(e,l,n,a)})),h=(e,[t,s])=>{he(t,(([t,s],n)=>{const a=we(e[0],n,Mt);he(t,(([e,t],s)=>{const n=we(a[0],s,Mt);he(e,(([e,t],s)=>n[0][s]=It(e,t))),n[1]=Rt(n[1],t)})),a[1]=Rt(a[1],s)})),e[1]=Rt(e[1],s)},f=async(t=null,s)=>{x(s)&&([s,t]=await g(t,1));const[n,a]=s,[o,r]=e.getMergeableContentHashes();let l=Mt();if(o!=n){const[s,n]=(await g(t,4,e.getMergeableTableHashes()))[0];if(l=s,!be(n)){const[s,a]=(await g(t,5,e.getMergeableRowHashes(n)))[0];if(h(l,s),!be(a)){const s=(await g(t,6,e.getMergeableCellHashes(a)))[0];h(l,s)}}}return[l,r==a?Mt():(await g(t,7,e.getMergeableValueHashes()))[0],1]},b=bt(e,(async()=>{const e=await f();return be(e[0][0])&&be(e[1][0])?void 0:e}),(async(t,n)=>{c++,n?s(null,null,3,n):s(null,null,2,e.getMergeableContentHashes())}),(e=>i=e),(()=>i=void 0),r,2,{startSync:async e=>await(await b.startAutoLoad(e)).startAutoSave(),stopSync:()=>b.stopAutoLoad().stopAutoSave(),destroy:()=>(a(),b.stopSync()),getSynchronizerStats:()=>({sends:c,receives:d}),...l});return b},kt=Xe((e=>{const s=e.createStore,n=s(),a=s(),o=De(),{addListener:r,callListeners:l,delListener:u}=a,[g,f,b,T,y,,,R,,S,M,V,m,D]=Ge(e,(()=>!0),_,r,l),E=(e,t,...s)=>G(s,(s=>qe(Je(Je(o,t,De),e,Ue),s))),H=e=>{F(He(o,e),(e=>{ke(e,((e,t)=>Ve(t,(t=>e.delListener(t))))),Me(e)})),G([a,n],(t=>t.delTable(e)))},k=(e,t,s)=>E(t,e,t.addStartTransactionListener(s.startTransaction),t.addDidFinishTransactionListener((()=>s.finishTransaction()))),A={setQueryDefinition:(s,o,r)=>{R(s,o),H(s);const l=[],i=[[null,[o,null,null,[],De()]]],c=[],d=[],u=[];r({select:(e,s)=>{const n=N(e)?[W(l)+t,e]:[x(s)?e:s,t=>t(e,s)];return ee(l,n),{as:e=>n[0]=e}},join:(e,t,s)=>{const n=x(s)||N(t)?null:t,a=x(n)?t:s,o=[e,[e,n,N(a)?a:e=>e(a),[],De()]];return ee(i,o),{as:e=>o[0]=e}},where:(e,t,s)=>ee(c,N(e)?e:x(s)?s=>s(e)===t:n=>n(e,t)===s),group:(e,t,s,n,a)=>{const o=[e,[e,N(t)?[t,s,n,a]:He(dt,t)??[(e,t)=>t]]];return ee(d,o),{as:e=>o[0]=e}},having:(e,t)=>ee(u,N(e)?e:s=>s(e)===t)});const g=De(l);if(Re(g))return A;const h=De(i);ke(h,((e,[,t])=>F(He(h,t),(({3:t})=>x(e)?0:ee(t,e)))));const f=De(d);let b=n;if(Re(f)&&Y(u))b=a;else{k(s,b,a);const e=De();ke(f,((t,[s,n])=>qe(Je(e,s,Ue),[t,n])));const t=Ue();ke(g,(s=>ye(e,s)?0:qe(t,s)));const n=De(),o=(t,n,o,r)=>F(t,(([l,i,c,d])=>{ke(n,((t,[s])=>{const n=Je(l,t,De),a=He(n,o),i=r?void 0:s;if(a!==i){const s=Ue([[a,i]]),r=ve(n);Ae(n,o,i),Ve(He(e,t),(([e,t])=>{const a=ut(d[e],r,n,s,t);d[e]=x(_e(a))?null:a}))}})),Re(i)||!$(u,(e=>e((e=>d[e]))))?a.delRow(s,c):x(c)?t[2]=a.addRow(s,d):a.setRow(s,c,d)}));E(b,s,b.addRowListener(s,null,((a,r,l,i)=>{const c=[],d=[],u=De(),g=b.hasRow(s,l);let h=!g;Ve(t,(e=>{const[t,n,a]=i(s,l,e);ee(c,n),ee(d,a),h||=t})),ke(e,(e=>{const[t,,n]=i(s,l,e);(h||t)&&Ae(u,e,[n])})),h&&o(We(n,c,void 0,(([,e])=>(me(e,l),Re(e)))),u,l,1),g&&o(We(n,d,(()=>{const e={};return Ve(t,(t=>e[t]=b.getCell(s,l,t))),[De(),Ue(),void 0,e]}),(([,e])=>{qe(e,l)})),u,l)})))}k(s,e,b);const w=(t,n,a,r)=>{const l=t=>e.getCell(n,a,t);G(r,(n=>{const[a,,o,r,i]=He(h,n),c=o?.(l,t),[d,u]=He(i,t)??[];c!=d&&(x(u)||D(s,u),Ae(i,t,x(c)?null:[c,...m(s,1,e.addRowListener(a,c,(()=>w(t,a,c,r))))]))})),(t=>{const n=(s,n)=>e.getCell(...x(n)?[o,t,s]:s===o?[o,t,n]:[He(h,s)?.[0],He(He(h,s)?.[4],t)?.[0],n]);b.transaction((()=>$(c,(e=>e(n)))?ke(g,((e,a)=>$e(b,s,t,e,a(n,t)))):b.delRow(s,t)))})(t)},{3:C}=He(h,null);return b.transaction((()=>m(s,1,e.addRowListener(o,null,((t,n,a)=>{e.hasRow(o,a)?w(a,o,a,C):(b.delRow(s,a),Ve(h,(({4:e})=>F(He(e,a),(([,t])=>{D(s,t),Ae(e,a)})))))}))))),A},delQueryDefinition:e=>(H(e),S(e),A),getStore:g,getQueryIds:f,forEachQuery:b,hasQuery:T,getTableId:y,addQueryIdsListener:e=>M((()=>e(A))),delListener:e=>(u(e),A),destroy:V,getListenerStats:()=>{const{tables:e,tableIds:t,transaction:s,...n}=a.getListenerStats();return n}};return fe({[h]:[1,1],[h+p]:[0,1],[C]:[0,1],[L]:[0,1],[v]:[0,5],[w]:[1,2],[p]:[0,2],[I]:[1,3]},(([e,t],s)=>{G(e?["get","has","forEach"]:["get"],(e=>A[e+c+s]=(...t)=>a[e+s](...t))),A[d+c+s+i]=(...e)=>a[d+s+i](...O(e,0,t),((s,...n)=>e[t](A,...n)),!0)})),ce(A)})),At=Xe((e=>{const s=De(),n=De(),a=De(),o=De(),[r,l,i]=et((()=>T)),[c,d,u,g,h,f,,,b,w,C,L]=Ge(e,(()=>[De(),De(),De(),De()]),(e=>x(e)?void 0:e+t),r,l),v=(e,t,s)=>F(f(e),(([n,,a])=>{if(!ye(a,t)){const o=Ue();if(h(e)!=p(e))qe(o,t);else{let e=t;for(;!x(e)&&!ye(o,e);)qe(o,e),e=He(n,e)}if(s)return o;Ae(a,t,o)}return He(a,t)})),I=(e,t)=>F(f(e),(([,,e])=>Ae(e,t))),p=e=>He(s,e),T={setRelationshipDefinition:(e,t,r,i)=>(Ae(s,e,r),b(e,t,((t,s)=>{const r=Ue(),i=Ue(),c=Ue(),[d,u]=f(e);Ve(s,(([t,s],n)=>{x(t)||(qe(i,t),F(He(u,t),(e=>{me(e,n),Re(e)&&Ae(u,t)}))),x(s)||(qe(i,s),ye(u,s)||Ae(u,s,Ue()),qe(He(u,s),n)),qe(r,n),Ae(d,n,s),ke(He(o,e),(t=>{ye(v(e,t),n)&&qe(c,t)}))})),t(),Ve(r,(t=>l(n,[e,t]))),Ve(i,(t=>l(a,[e,t]))),Ve(c,(t=>{I(e,t),l(o,[e,t])}))}),Ke(i)),T),delRelationshipDefinition:e=>(Ae(s,e),w(e),T),getStore:c,getRelationshipIds:d,forEachRelationship:t=>u((s=>t(s,(t=>e.forEachRow(h(s),t))))),hasRelationship:g,getLocalTableId:h,getRemoteTableId:p,getRemoteRowId:(e,t)=>He(f(e)?.[0],t),getLocalRowIds:(e,t)=>Se(He(f(e)?.[1],t)),getLinkedRowIds:(e,t)=>x(f(e))?[t]:Se(v(e,t,!0)),addRelationshipIdsListener:C,addRemoteRowIdListener:(e,t,s)=>r(s,n,[e,t]),addLocalRowIdsListener:(e,t,s)=>r(s,a,[e,t]),addLinkedRowIdsListener:(e,t,s)=>(v(e,t),r(s,o,[e,t])),delListener:e=>(I(...i(e)??[]),T),destroy:L,getListenerStats:()=>({remoteRowId:pe(n),localRowIds:pe(a),linkedRowIds:pe(o)})};return ce(T)})),Jt=e=>[e,e],xt=(e,t=Ie)=>t(e[0])+t(e[1]),Ft=()=>[De(),De()],Qt=e=>[...e],zt=([e,t])=>e===t,Nt=e=>JSON.stringify(e,((e,t)=>t instanceof Map?ne.fromEntries([...t]):t)),Pt=JSON.parse,Ot=(e,t,s)=>Ae(e,t,He(e,t)==-s?void 0:s),Wt=()=>{let e,t,s=!1,n=!1,o=0,c=[];const g=De(),v=De(),M=De(),V=De(),m=De(),D=De(),E=De(),H=De(),k=De(),A=De(),J=De(),z=De(),P=De(),W=De(),_=Ue(),$=De(),U=De(),X=De(),Y=De(),Z=Ft(),te=Ft(),se=Ft(),ne=Ft(),ae=Ft(),oe=Ft(),re=Ft(),le=Ft(),ie=Ft(),de=Ft(),he=Ft(),we=Ft(),Le=Ft(),Se=Ft(),We=Ft(),je=Ft(),Ge=Ft(),Ke=Ft(),Xe=Ft(),Ye=Ft(),tt=Ft(),st=Ft(),nt=De(),at=Ft(),[ot,rt,it,ct]=et((()=>zs)),dt=e=>{if(!Ce(e,((e,t)=>j([r,l],t))))return!1;const t=e[r];return!(!Q(t)&&t!=a||(_e(e[l])!=t&&ge(e,l),0))},ut=(t,s)=>(!e||ye(J,s)||Kt(s))&&Ce(t,((e,t)=>gt(s,t,e)),(()=>Kt(s))),gt=(e,t,s,n)=>Ce(n?s:wt(s,e,t),((n,a)=>F(ht(e,t,a,n),(e=>(s[a]=e,!0)),(()=>!1))),(()=>Kt(e,t))),ht=(t,s,n,a)=>e?F(He(He(J,t),n),(e=>_e(a)!=e[r]?Kt(t,s,n,a,e[l]):a),(()=>Kt(t,s,n,a))):x(_e(a))?Kt(t,s,n,a):a,ft=(e,t)=>Ce(t?e:Ct(e),((t,s)=>F(bt(s,t),(t=>(e[s]=t,!0)),(()=>!1))),(()=>Xt())),bt=(e,s)=>t?F(He(P,e),(t=>_e(s)!=t[r]?Xt(e,s,t[l]):s),(()=>Xt(e,s))):x(_e(s))?Xt(e,s):s,wt=(e,t,s)=>(F(He(z,t),(([n,a])=>{Ve(n,((t,s)=>{ue(e,s)||(e[s]=t)})),Ve(a,(n=>{ue(e,n)||Kt(t,s,n)}))})),e),Ct=e=>(t&&(Ve(W,((t,s)=>{ue(e,s)||(e[s]=t)})),Ve(_,(t=>{ue(e,t)||Xt(t)}))),e),Lt=e=>xe(J,e,((e,t,s)=>{const n=De(),a=Ue();xe(Je(J,t,De),s,((e,t,s)=>{Ae(e,t,s),F(s[l],(e=>Ae(n,t,e)),(()=>qe(a,t)))})),Ae(z,t,[n,a])}),((e,t)=>{Ae(J,t),Ae(z,t)})),vt=e=>xe(P,e,((e,t,s)=>{Ae(P,t,s),F(s[l],(e=>Ae(W,t,e)),(()=>qe(_,t)))}),((e,t)=>{Ae(P,t),Ae(W,t),me(_,t)})),It=e=>be(e)?Ds():Rs(e),pt=e=>xe(X,e,((e,t,s)=>Tt(t,s)),((e,t)=>Ht(t))),Tt=(e,t)=>xe(Je(X,e,(()=>(jt(e,1),Ae($,e,Ze()),Ae(U,e,De()),De()))),t,((t,s,n)=>yt(e,t,s,n)),((t,s)=>kt(e,t,s))),yt=(e,t,s,n,a)=>xe(Je(t,s,(()=>($t(e,s,1),De()))),n,((t,n,a)=>Rt(e,s,t,n,a)),((n,o)=>At(e,t,s,n,o,a))),Rt=(e,t,s,n,a)=>{ye(s,n)||Bt(e,t,n,1);const o=He(s,n);a!==o&&(Ut(e,t,n,o,a),Ae(s,n,a))},St=(e,t,s,n,a)=>F(He(t,s),(t=>Rt(e,s,t,n,a)),(()=>yt(e,t,s,wt({[n]:a},e,s)))),Mt=e=>be(e)?ks():Ss(e),Vt=e=>xe(Y,e,((e,t,s)=>mt(t,s)),((e,t)=>_t(t))),mt=(e,t)=>{ye(Y,e)||qt(e,1);const s=He(Y,e);t!==s&&(Gt(e,s,t),Ae(Y,e,t))},Dt=(e,t)=>{const[s]=He($,e),n=s(t);return ye(He(X,e),n)?Dt(e,t):n},Et=e=>He(X,e)??Tt(e,{}),Ht=e=>Tt(e,{}),kt=(e,t,s)=>{const[,n]=He($,e);n(s),yt(e,t,s,{},!0)},At=(e,t,s,n,a,o)=>{const r=He(He(z,e)?.[0],a);if(!x(r)&&!o)return Rt(e,s,n,a,r);const l=t=>{Ut(e,s,t,He(n,t)),Bt(e,s,t,-1),Ae(n,t)};x(r)?l(a):ke(n,l),Re(n)&&($t(e,s,-1),Re(Ae(t,s))&&(jt(e,-1),Ae(X,e),Ae($,e),Ae(U,e)))},_t=e=>{const t=He(W,e);if(!x(t))return mt(e,t);Gt(e,He(Y,e)),qt(e,-1),Ae(Y,e)},jt=(e,t)=>Ot(g,e,t),$t=(e,t,s)=>Ot(Je(V,e,De),t,s)&&Ae(M,e,Je(M,e,(()=>0))+s),Bt=(e,t,s,n)=>{const a=He(U,e),o=He(a,s)??0;(0==o&&1==n||1==o&&-1==n)&&Ot(Je(v,e,De),s,n),Ae(a,s,o!=-n?o+n:null),Ot(Je(Je(m,e,De),t,De),s,n)},Ut=(e,t,s,n,a)=>{Je(Je(Je(D,e,De),t,De),s,(()=>[n,0]))[1]=a,c[3]?.(e,t,s,a)},qt=(e,t)=>Ot(E,e,t),Gt=(e,t,s)=>{Je(H,e,(()=>[t,0]))[1]=s,c[4]?.(e,s)},Kt=(e,t,s,n,a)=>(ee(Je(Je(Je(k,e,De),t,De),s,(()=>[])),n),a),Xt=(e,t,s)=>(ee(Je(A,e,(()=>[])),t),s),Yt=(e,t,s)=>F(He(He(He(D,e),t),s),(([e,t])=>[!0,e,t]),(()=>[!1,...Jt(hs(e,t,s))])),Zt=e=>F(He(H,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Jt(ws(e))])),es=e=>Re(k)||Re(je[e])?0:Ve(e?Oe(k):k,((t,s)=>Ve(t,((t,n)=>Ve(t,((t,a)=>rt(je[e],[s,n,a],t))))))),ts=e=>Re(A)||Re(Ge[e])?0:Ve(e?Ne(A):A,((t,s)=>rt(Ge[e],[s],t))),ss=(e,t,s,n)=>{if(!Re(e))return rt(t,n,(()=>Fe(e))),ke(e,((e,t)=>rt(s,[...n??[],e],1==t))),1},ns=e=>{const t=Cs();t!=s&&rt(Z[e],void 0,t);const n=Re(de[e]),a=Re(Le[e])&&Re(Se[e])&&Re(ie[e])&&Re(he[e])&&Re(oe[e])&&Re(re[e])&&Re(le[e])&&n&&Re(se[e])&&Re(ne[e]),o=Re(We[e])&&Re(we[e])&&Re(ae[e])&&Re(te[e]);if(!a||!o){const t=e?[Ne(g),Pe(v),Ne(M),Pe(V),Oe(m),Oe(D)]:[g,v,M,V,m,D];if(!a){ss(t[0],se[e],ne[e]),Ve(t[1],((t,s)=>ss(t,oe[e],re[e],[s]))),Ve(t[2],((t,s)=>{0!=t&&rt(le[e],[s],cs(s))}));const s=Ue();Ve(t[3],((t,a)=>{ss(t,ie[e],he[e],[a])&&!n&&(rt(de[e],[a,null]),qe(s,a))})),n||Ve(t[5],((t,n)=>{if(!ye(s,n)){const s=Ue();Ve(t,(e=>Ve(e,(([t,n],a)=>n!==t?qe(s,a):me(e,a))))),Ve(s,(t=>rt(de[e],[n,t])))}})),Ve(t[4],((t,s)=>Ve(t,((t,n)=>ss(t,Le[e],Se[e],[s,n])))))}if(!o){let s;Ve(t[5],((t,n)=>{let a;Ve(t,((t,o)=>{let r;Ve(t,(([t,l],i)=>{l!==t&&(rt(We[e],[n,o,i],l,t,Yt),s=a=r=1)})),r&&rt(we[e],[n,o],Yt)})),a&&rt(ae[e],[n],Yt)})),s&&rt(te[e],void 0,Yt)}}},as=e=>{const t=Ts();t!=n&&rt(Ke[e],void 0,t);const s=Re(Ye[e])&&Re(tt[e]),a=Re(st[e])&&Re(Xe[e]);if(!s||!a){const t=e?[Ne(E),Ne(H)]:[E,H];if(s||ss(t[0],Ye[e],tt[e]),!a){let s;Ve(t[1],(([t,n],a)=>{n!==t&&(rt(st[e],[a],n,t,Zt),s=1)})),s&&rt(Xe[e],void 0,Zt)}}},os=(e,...t)=>(xs((()=>e(...K(t,S)))),zs),rs=()=>ze(X),ls=()=>Ee(X),is=e=>Ee(He(U,S(e))),cs=e=>ve(He(X,S(e))),ds=e=>Ee(He(X,S(e))),us=(e,t,s,n=0,a)=>{return K(O(q((o=He(X,S(e)),r=(e,s)=>[x(t)?s:He(e,S(t)),s],K([...o?.entries()??[]],(([e,t])=>r(t,e)))),(([e],[t])=>lt(e,t)*(s?-1:1))),n,x(a)?a:n+a),(([,e])=>e));var o,r},gs=(e,t)=>Ee(He(He(X,S(e)),S(t))),hs=(e,t,s)=>He(He(He(X,S(e)),S(t)),S(s)),fs=()=>Fe(Y),bs=()=>Ee(Y),ws=e=>He(Y,S(e)),Cs=()=>!Re(X),Ls=e=>ye(X,S(e)),vs=(e,t)=>ye(He(U,S(e)),S(t)),Is=(e,t)=>ye(He(X,S(e)),S(t)),ps=(e,t,s)=>ye(He(He(X,S(e)),S(t)),S(s)),Ts=()=>!Re(Y),ys=e=>ye(Y,S(e)),Rs=e=>os((()=>(e=>Ce(e,ut,Kt))(e)?pt(e):0)),Ss=e=>os((()=>ft(e)?Vt(e):0)),Ms=e=>{try{It(Pt(e))}catch{}return zs},Vs=t=>os((()=>{if((e=Ce(t,(e=>Ce(e,dt))))&&(Lt(t),!Re(X))){const e=rs();Ds(),Rs(e)}})),ms=e=>os((()=>{if(t=(e=>Ce(e,dt))(e)){const s=fs();Js(),ks(),t=!0,vt(e),Ss(s)}})),Ds=()=>os((()=>pt({}))),Es=e=>os((e=>ye(X,e)?Ht(e):0),e),Hs=(e,t)=>os(((e,t)=>F(He(X,e),(s=>ye(s,t)?kt(e,s,t):0))),e,t),ks=()=>os((()=>Vt({}))),As=()=>os((()=>{Lt({}),e=!1})),Js=()=>os((()=>{vt({}),t=!1})),xs=(e,t)=>{if(-1!=o){Fs();const s=e();return Qs(t),s}},Fs=()=>(-1!=o&&o++,1==o&&(c[0]?.(),rt(nt)),zs),Qs=e=>(o>0&&(o--,0==o&&(o=1,es(1),Re(D)||ns(1),ts(1),Re(H)||as(1),e?.(zs)&&(Ve(D,((e,t)=>Ve(e,((e,s)=>Ve(e,(([e],n)=>$e(zs,t,s,n,e))))))),Me(D),Ve(H,(([e],t)=>Be(zs,t,e))),Me(H)),rt(at[0],void 0),o=-1,es(0),Re(D)||ns(0),ts(0),Re(H)||as(0),c[1]?.(),rt(at[1],void 0),c[2]?.(),o=0,s=Cs(),n=Ts(),G([g,v,M,V,m,D,k,E,H,A],Me))),zs),zs={getContent:()=>[rs(),fs()],getTables:rs,getTableIds:ls,getTable:e=>Qe(He(X,S(e))),getTableCellIds:is,getRowCount:cs,getRowIds:ds,getSortedRowIds:us,getRow:(e,t)=>Fe(He(He(X,S(e)),S(t))),getCellIds:gs,getCell:hs,getValues:fs,getValueIds:bs,getValue:ws,hasTables:Cs,hasTable:Ls,hasTableCell:vs,hasRow:Is,hasCell:ps,hasValues:Ts,hasValue:ys,getTablesJson:()=>Nt(X),getValuesJson:()=>Nt(Y),getJson:()=>Nt([X,Y]),getTablesSchemaJson:()=>Nt(J),getValuesSchemaJson:()=>Nt(P),getSchemaJson:()=>Nt([J,P]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:([e,t])=>os((()=>{(be(e)?Ds:Rs)(e),(be(t)?ks:Ss)(t)})),setTables:Rs,setTable:(e,t)=>os((e=>ut(t,e)?Tt(e,t):0),e),setRow:(e,t,s)=>os(((e,t)=>gt(e,t,s)?yt(e,Et(e),t,s):0),e,t),addRow:(e,t,s=!0)=>xs((()=>{let n;return gt(e,n,t)&&(e=S(e),yt(e,Et(e),n=Dt(e,s?1:0),t)),n})),setPartialRow:(e,t,s)=>os(((e,t)=>{if(gt(e,t,s,1)){const n=Et(e);fe(s,((s,a)=>St(e,n,t,a,s)))}}),e,t),setCell:(e,t,s,n)=>os(((e,t,s)=>F(ht(e,t,s,N(n)?n(hs(e,t,s)):n),(n=>St(e,Et(e),t,s,n)))),e,t,s),setValues:Ss,setPartialValues:e=>os((()=>ft(e,1)?fe(e,((e,t)=>mt(t,e))):0)),setValue:(e,t)=>os((e=>F(bt(e,N(t)?t(ws(e)):t),(t=>mt(e,t)))),e),applyChanges:e=>os((()=>{fe(e[0],((e,t)=>x(e)?Es(t):fe(e,((e,s)=>x(e)?Hs(t,s):fe(e,((e,n)=>$e(zs,t,s,n,e))))))),fe(e[1],((e,t)=>Be(zs,t,e)))})),setTablesJson:Ms,setValuesJson:e=>{try{Mt(Pt(e))}catch{}return zs},setJson:e=>os((()=>{try{const[t,s]=Pt(e);It(t),Mt(s)}catch{Ms(e)}})),setTablesSchema:Vs,setValuesSchema:ms,setSchema:(e,t)=>os((()=>{Vs(e),ms(t)})),delTables:Ds,delTable:Es,delRow:Hs,delCell:(e,t,s,n)=>os(((e,t,s)=>F(He(X,e),(a=>F(He(a,t),(o=>ye(o,s)?At(e,a,t,o,s,n):0))))),e,t,s),delValues:ks,delValue:e=>os((e=>ye(Y,e)?_t(e):0),e),delTablesSchema:As,delValuesSchema:Js,delSchema:()=>os((()=>{As(),Js()})),transaction:xs,startTransaction:Fs,getTransactionChanges:()=>[Fe(D,((e,t)=>-1===He(g,t)?void 0:Fe(e,((e,s)=>-1===He(He(V,t),s)?void 0:Fe(e,(([,e])=>e),(e=>zt(e)))),Re,be)),Re,be),Fe(H,(([,e])=>e),(e=>zt(e))),1],getTransactionLog:()=>[!Re(D),!Re(H),ze(D,Qt,zt),ze(k),Fe(H,Qt,zt),Fe(A),Fe(g),Qe(V),ze(m),Fe(E)],finishTransaction:Qs,forEachTable:e=>Ve(X,((t,s)=>e(s,(e=>Ve(t,((t,s)=>e(s,(e=>ke(t,e))))))))),forEachTableCell:(e,t)=>ke(He(U,S(e)),t),forEachRow:(e,t)=>Ve(He(X,S(e)),((e,s)=>t(s,(t=>ke(e,t))))),forEachCell:(e,t,s)=>ke(He(He(X,S(e)),S(t)),s),forEachValue:e=>ke(Y,e),addSortedRowIdsListener:(e,t,s,n,a,o,r)=>{let l=us(e,t,s,n,a);return ot((()=>{const r=us(e,t,s,n,a);B(r,l)||(l=r,o(zs,e,t,s,n,a,l))}),de[r?1:0],[e,t],[ls])},addStartTransactionListener:e=>ot(e,nt),addWillFinishTransactionListener:e=>ot(e,at[0]),addDidFinishTransactionListener:e=>ot(e,at[1]),callListener:e=>(ct(e),zs),delListener:e=>(it(e),zs),getListenerStats:()=>({hasTables:xt(Z),tables:xt(te),tableIds:xt(se),hasTable:xt(ne),table:xt(ae),tableCellIds:xt(oe),hasTableCell:xt(re,pe),rowCount:xt(le),rowIds:xt(ie),sortedRowIds:xt(de),hasRow:xt(he,pe),row:xt(we,pe),cellIds:xt(Le,pe),hasCell:xt(Se,Te),cell:xt(We,Te),invalidCell:xt(je,Te),hasValues:xt(Ke),values:xt(Xe),valueIds:xt(Ye),hasValue:xt(tt),value:xt(st),invalidValue:xt(Ge),transaction:Ie(nt)+xt(at)}),isMergeable:()=>!1,createStore:Wt,addListener:ot,callListeners:rt,setInternalListeners:(e,t,s,n,a)=>c=[e,t,s,n,a]};return fe({[u+f]:[0,Z,[],()=>[Cs()]],[f]:[0,te],[b]:[0,se],[u+h]:[1,ne,[ls],e=>[Ls(...e)]],[h]:[1,ae,[ls]],[h+p]:[1,oe,[ls]],[u+h+I]:[2,re,[ls,is],e=>[vs(...e)]],[C]:[1,le,[ls]],[L]:[1,ie,[ls]],[u+w]:[2,he,[ls,ds],e=>[Is(...e)]],[w]:[2,we,[ls,ds]],[p]:[2,Le,[ls,ds]],[u+I]:[3,Se,[ls,ds,gs],e=>[ps(...e)]],[I]:[3,We,[ls,ds,gs],e=>Jt(hs(...e))],InvalidCell:[3,je],[u+y]:[0,Ke,[],()=>[Ts()]],[y]:[0,Xe],[R]:[0,Ye],[u+T]:[1,tt,[bs],e=>[ys(...e)]],[T]:[1,st,[bs],e=>Jt(ws(e[0]))],InvalidValue:[1,Ge]},(([e,t,s,n],a)=>{zs[d+a+i]=(...a)=>ot(a[e],t[a[e+1]?1:0],e>0?O(a,0,e):void 0,s,n)})),ce(zs)},_t=2**36,jt=2**30,$t=2**24,Bt=2**18,Ut=4096,qt={HasTable:1,Table:1,TableCellIds:1,HasTableCell:2,RowCount:1,RowIds:1,SortedRowIds:5,HasRow:2,Row:2,CellIds:2,HasCell:3,Cell:3,HasValue:1,Value:1,InvalidCell:3,InvalidValue:1},Gt=(e=t)=>[Vt(e),Vt(e)],Kt=e=>{let s=1,n=Gt(),a=0;const o=De(),r=Ue(),[l,i]=(e=>{let t=0,s=-1;const n=F(e,(e=>{const t=Ct(e);return at(t/$t)+at(t/Bt)+at(t/Ut)+at(t/64)+at(t)}),(()=>it(5))),a=e=>{const n=t,[a,o]=x(e)||""==e?[0,0]:[ot(r=e,0)*_t+ot(r,1)*jt+ot(r,2)*$t+ot(r,3)*Bt+ot(r,4)*Ut+64*ot(r,5)+ot(r,6),ot(r,7)*Bt+ot(r,8)*Ut+64*ot(r,9)+ot(r,10)];var r;t=H(n,a,D.HLC_TIME??Date.now()),s=t==n?t==a?H(s,o):s:t==a?o:-1};return[()=>{return a(),o=++s,at((e=t)/_t)+at(e/jt)+at(e/$t)+at(e/Bt)+at(e/Ut)+at(e/64)+at(e)+at(o/Bt)+at(o/Ut)+at(o/64)+at(o)+n;var e,o},a]})(e),c=Wt(),d=e=>{const t=s;return s=0,e(),s=t,b},u=(e,s=0)=>{const a={},o={},[[r,l=t,c=0],d]=e,[u,h]=n,[f,b,w]=u;let C=s?c:w,L=l;he(r,(([e,n=t,o=0],r)=>{const l=Je(f,r,Vt),[i,c,d]=l;let u=s?o:d,h=n;he(e,((e,t)=>{const[n,o,l]=g(e,Je(i,t,Vt),we(we(a,r,de),t,de),s);u^=s?0:(o?Tt(t,o):0)^Tt(t,l),h=Rt(h,n)})),u^=s?0:yt(c,n),St(l,u,n),C^=s?0:(d?Tt(r,d):0)^Tt(r,l[2]),L=Rt(L,h)})),C^=s?0:yt(b,l),St(u,C,l);const[v]=g(d,h,o,s);return i(Rt(L,v)),[a,o,1]},g=(e,s,n,a)=>{const[o,r=t,l=0]=e,[i,c,d]=s;let u=r,g=a?l:d;return he(o,(([e,s,o=0],r)=>{const l=Je(i,r,(()=>[void 0,t,0])),[,c,d]=l;(!c||s>c)&&(St(l,a?o:Ct(Nt(e??null)+":"+s),s),l[0]=e,n[r]=e,g^=a?0:Tt(r,d)^Tt(r,l[2]),u=Rt(u,s))})),g^=a?0:yt(c,r),St(s,g,r),[u,d,s[2]]},h=()=>[mt(n[0],(e=>mt(e,(e=>mt(e))))),mt(n[1])],f=e=>d((()=>c.applyChanges(u(e)))),b={getMergeableContent:h,getMergeableContentHashes:()=>[n[0][2],n[1][2]],getMergeableTableHashes:()=>Fe(n[0][0],pt),getMergeableTableDiff:e=>{const t=Mt(n[0][1]),s={};return ke(n[0][0],((n,[a,o,r])=>ue(e,n)?r!=e[n]?s[n]=r:0:t[0][n]=Dt([a,o],(e=>Dt(e))))),[t,s]},getMergeableRowHashes:e=>{const t={};return he(e,((e,s)=>F(He(n[0][0],s),(([n,,a])=>a!=e?ke(n,((e,[,,n])=>we(t,s,de)[e]=n)):0)))),t},getMergeableRowDiff:e=>{const t=Mt(n[0][1]),s={};return he(e,((e,a)=>ke(He(n[0][0],a)?.[0],((n,[o,r,l])=>ue(e,n)?l!==e[n]?we(s,a,de)[n]=l:0:we(t[0],a,Mt)[0][n]=Dt([o,r]))))),[t,s]},getMergeableCellHashes:e=>{const t={};return he(e,((e,s)=>F(He(n[0][0],s),(([n])=>he(e,((e,a)=>F(He(n,a),(([n,,o])=>o!==e?ke(n,((e,[,,n])=>we(we(t,s,de),a,de)[e]=n)):0)))))))),t},getMergeableCellDiff:e=>{const[[t,s]]=n,a={};return he(e,((e,s)=>he(e,((e,n)=>F(He(t,s),(([t,o])=>F(He(t,n),(([t,r])=>ke(t,((t,[l,i,c])=>c!==e[t]?we(we(a,s,(()=>Mt(o)))[0],n,(()=>Mt(r)))[0][t]=[l,i]:0)))))))))),It(a,s)},getMergeableValueHashes:()=>Fe(n[1][0],pt),getMergeableValueDiff:e=>{const[,[t,s]]=n,a=Fe(t,vt,(([,,t],s)=>t==e?.[s]));return It(a,s)},setMergeableContent:e=>d((()=>(e=>P(e)&&2==W(e)&&Et(e[0],(e=>Ce(e,(e=>Et(e,(e=>Ce(e,(e=>Et(e,(e=>Ce(e,(e=>Et(e,je)),void 0,1)))),void 0,1)))),void 0,1)))&&Et(e[1],(e=>Ce(e,(e=>Et(e,je)),void 0,1))))(e)?c.transaction((()=>{c.delTables().delValues(),n=Gt(),c.applyChanges(u(e,1))})):0)),setDefaultContent:e=>(c.transaction((()=>{a=1,c.setContent(e),a=0})),b),getTransactionMergeableChanges:()=>{const[[e,t],[s,a]]=n,l={};Ve(o,((t,s)=>F(He(e,s),(([e,n])=>{const a={};Ve(t,((t,s)=>F(He(e,s),(([e,n])=>{const o={};Ve(t,(t=>{F(He(e,t),(([e,s])=>o[t]=It(e,s)))})),a[s]=It(o,n)})))),l[s]=It(a,n)}))));const i={};return Ve(r,(e=>F(He(s,e),(([t,s])=>i[e]=It(t,s))))),[It(l,t),It(i,a),1]},applyMergeableChanges:f,merge:e=>{const t=h(),s=e.getMergeableContent();return e.applyMergeableChanges(t),f(s)}};return c.setInternalListeners((()=>{}),(()=>{}),(()=>{Me(o),Me(r)}),((e,n,r,i)=>{qe(Je(Je(o,e,De),n,Ue),r),s&&u([[{[e]:[{[n]:[{[r]:[i,a?t:l()]}]}]}],[{}],1])}),((e,n)=>{qe(r,e),s&&u([[{}],[{[e]:[n,a?t:l()]}],1])})),fe(c,((e,t)=>b[t]=M(t,"set")||M(t,"del")||M(t,"apply")||V(t,"Transaction")||"callListener"==t?(...t)=>(e(...t),b):M(t,"add")&&V(t,"Listener")?(...s)=>{const n=qt[O(t,3,-8)]??0,a=s[n];return s[n]=(e,...t)=>a(b,...t),e(...s)}:"isMergeable"==t?()=>!0:e)),ce(b)};export{tt as createCheckpoints,bt as createCustomPersister,Ht as createCustomSynchronizer,ct as createIndexes,Kt as createMergeableStore,gt as createMetrics,kt as createQueries,At as createRelationships,Wt as createStore,lt as defaultSorter,it as getUniqueId};
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "5.0.0-beta.23",
3
+ "version": "5.0.0-beta.25",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",
@@ -15,9 +15,6 @@
15
15
  "react"
16
16
  ],
17
17
  "type": "module",
18
- "bin": {
19
- "tinybase": "./cli/index.js"
20
- },
21
18
  "browser": {
22
19
  "fs": false
23
20
  },
@@ -29,12 +26,13 @@
29
26
  "@sqlite.org/sqlite-wasm": "^3.46.0-build2",
30
27
  "@vlcn.io/crsqlite-wasm": "^0.16.0",
31
28
  "electric-sql": "^0.12.0",
32
- "expo-sqlite": "^14.0.3",
29
+ "expo": "^51.0.0",
30
+ "expo-sqlite": "^14.0.0",
33
31
  "partykit": "^0.0.105",
34
32
  "partysocket": "^1.0.1",
35
33
  "prettier": "^3.3.2",
36
- "react": "^18.3.1",
37
- "react-dom": "^18.3.1",
34
+ "react": "^18.2.0",
35
+ "react-dom": "^18.2.0",
38
36
  "sqlite3": "^5.1.7",
39
37
  "ws": "^8.17.0",
40
38
  "yjs": "^13.6.16"
@@ -86,6 +84,9 @@
86
84
  "optional": true
87
85
  }
88
86
  },
87
+ "bin": {
88
+ "tinybase": "./cli/index.js"
89
+ },
89
90
  "main": "./index.js",
90
91
  "types": "./@types/index.d.ts",
91
92
  "typesVersions": {
@@ -1,5 +1,7 @@
1
1
  const UNDEFINED = '\uFFFC';
2
2
 
3
+ const GLOBAL = globalThis;
4
+ const WINDOW = GLOBAL.window;
3
5
  const isUndefined = (thing) => thing == void 0;
4
6
  const ifNotUndefined = (value, then, otherwise) =>
5
7
  isUndefined(value) ? otherwise?.() : then(value);
@@ -228,7 +230,6 @@ const createCustomPersister = (
228
230
  };
229
231
 
230
232
  const STORAGE = 'storage';
231
- const WINDOW = globalThis.window;
232
233
  const createStoragePersister = (
233
234
  store,
234
235
  storageName,
@@ -1,5 +1,7 @@
1
1
  const UNDEFINED = '\uFFFC';
2
2
 
3
+ const GLOBAL = globalThis;
4
+ const WINDOW = GLOBAL.window;
3
5
  const isUndefined = (thing) => thing == void 0;
4
6
  const ifNotUndefined = (value, then, otherwise) =>
5
7
  isUndefined(value) ? otherwise?.() : then(value);
@@ -228,7 +230,6 @@ const createCustomPersister = (
228
230
  };
229
231
 
230
232
  const STORAGE = 'storage';
231
- const WINDOW = globalThis.window;
232
233
  const createStoragePersister = (
233
234
  store,
234
235
  storageName,
@@ -2,6 +2,8 @@ const T = 't';
2
2
  const V = 'v';
3
3
 
4
4
  const promise = Promise;
5
+ const GLOBAL = globalThis;
6
+ const WINDOW = GLOBAL.window;
5
7
  const startInterval = (callback, sec, immediate) => {
6
8
  return setInterval(callback, sec * 1e3);
7
9
  };
@@ -235,7 +237,6 @@ const createCustomPersister = (
235
237
  return objFreeze(persister);
236
238
  };
237
239
 
238
- const WINDOW = globalThis.window;
239
240
  const OBJECT_STORE_NAMES = [T, V];
240
241
  const KEY_PATH = {keyPath: 'k'};
241
242
  const objectStoreMatch = async (objectStore, obj) => {
@@ -2,6 +2,8 @@ const T = 't';
2
2
  const V = 'v';
3
3
 
4
4
  const promise = Promise;
5
+ const GLOBAL = globalThis;
6
+ const WINDOW = GLOBAL.window;
5
7
  const startInterval = (callback, sec, immediate) => {
6
8
  return setInterval(callback, sec * 1e3);
7
9
  };
@@ -235,7 +237,6 @@ const createCustomPersister = (
235
237
  return objFreeze(persister);
236
238
  };
237
239
 
238
- const WINDOW = globalThis.window;
239
240
  const OBJECT_STORE_NAMES = [T, V];
240
241
  const KEY_PATH = {keyPath: 'k'};
241
242
  const objectStoreMatch = async (objectStore, obj) => {
package/queries/index.js CHANGED
@@ -21,8 +21,9 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
21
21
  const CELL = 'Cell';
22
22
  const CELL_IDS = CELL + IDS;
23
23
 
24
- const mathMax = Math.max;
25
- const mathMin = Math.min;
24
+ const math = Math;
25
+ const mathMax = math.max;
26
+ const mathMin = math.min;
26
27
  const isFiniteNumber = isFinite;
27
28
  const isUndefined = (thing) => thing == void 0;
28
29
  const ifNotUndefined = (value, then, otherwise) =>
@@ -21,8 +21,9 @@ const SORTED_ROW_IDS = 'Sorted' + ROW + IDS;
21
21
  const CELL = 'Cell';
22
22
  const CELL_IDS = CELL + IDS;
23
23
 
24
- const mathMax = Math.max;
25
- const mathMin = Math.min;
24
+ const math = Math;
25
+ const mathMax = math.max;
26
+ const mathMin = math.min;
26
27
  const isFiniteNumber = isFinite;
27
28
  const isUndefined = (thing) => thing == void 0;
28
29
  const ifNotUndefined = (value, then, otherwise) =>
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://beta.tinybase.org/guides/releases/#v5-0"><em>NEW!</em> v5.0 release</a> <span id="one-with">&quot;The One You Can Sync&quot;</span></p><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.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&#x27;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 &amp; 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://beta.tinybase.org/api/persister-browser">storage</a>, <a href="https://beta.tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://beta.tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://beta.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.3kB - 12.5kB</a>, no dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://beta.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://beta.tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://beta.tinybase.org/react.svg"> React</a></div><div><a href="https://beta.tinybase.org/api/persister-partykit-client"><img width="48" src="https://beta.tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/turso.svg">Turso</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://beta.tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://beta.tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://beta.tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://beta.tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://beta.tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://beta.tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://beta.tinybase.org/api/persister-automerge"><img width="48" src="https://beta.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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/5.0.0-beta.22" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;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://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://beta.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://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
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://beta.tinybase.org/guides/releases/#v5-0"><em>NEW!</em> v5.0 release</a> <span id="one-with">&quot;The One You Can Sync&quot;</span></p><p><a class="start" href="https://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.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&#x27;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 &amp; 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://beta.tinybase.org/api/persister-browser">storage</a>, <a href="https://beta.tinybase.org/api/persister-indexed-db/">IndexedDB</a>, <a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence/">SQLite</a>, <a href="https://beta.tinybase.org/guides/schemas-and-persistence/synchronizing-data/">CRDTs</a>; and (<em>new!</em>) <a href="https://beta.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.3kB - 12.6kB</a>, no dependencies. <a href="#well-tested-and-documented">100% tested</a>, <a href="https://beta.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://beta.tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://beta.tinybase.org/react.svg"> React</a></div><div><a href="https://beta.tinybase.org/api/persister-partykit-client"><img width="48" src="https://beta.tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/turso.svg">Turso</a></div><div><a href="https://beta.tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://beta.tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://beta.tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://beta.tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://beta.tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://beta.tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://beta.tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://beta.tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://beta.tinybase.org/api/persister-automerge"><img width="48" src="https://beta.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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;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&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/5.0.0-beta.25" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;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://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://beta.tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://beta.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://beta.tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
2
2
 
3
3
  ```js
4
4
  import {createStore} from 'tinybase';
@@ -265,4 +265,4 @@ export const createShop: typeof createShopDecl = () => {
265
265
  };
266
266
  ```
267
267
 
268
- <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>12.5kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>4.6kB</em>, the ui-react-dom components are another <em>2.5kB</em>, and everything is super fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.3kB</td></tr><tr><th class="right">tinybase (complete)</th><td>12.5kB</td><td>129.4kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>4.6kB</td><td>47.2kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.5kB</td><td>20.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://beta.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>2,372</td><td>2,372</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,556</td><td>2,556</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>999</td><td>999</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>950</td><td>950</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">6,720</td></tr><tr><th class="right">Assertions</th><td colspan="3">31,380</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://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.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://beta.tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://beta.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://beta.tinybase.org/youtube.webp"></a></section>
268
+ <section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://beta.tinybase.org/api/store/"><code>store</code></a> module alone, you&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>12.6kB</em>.</p><p>The optional <a href="https://beta.tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>4.6kB</em>, the ui-react-dom components are another <em>2.5kB</em>, and everything is super fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged in the <a href="https://beta.tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.3kB</td></tr><tr><th class="right">tinybase (complete)</th><td>12.6kB</td><td>129.6kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react/">ui-react</a></th><td>4.6kB</td><td>47.2kB</td></tr><tr><th class="right"><a href="https://beta.tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.5kB</td><td>20.4kB</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://beta.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>2,376</td><td>2,376</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,560</td><td>2,560</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,000</td><td>1,000</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>951</td><td>951</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">6,720</td></tr><tr><th class="right">Assertions</th><td colspan="3">31,385</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://beta.tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://beta.tinybase.org/demos/">Try the demos</a></p><p><a href="https://beta.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://beta.tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://beta.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://beta.tinybase.org/youtube.webp"></a></section>
package/releases.md CHANGED
@@ -60,7 +60,7 @@ synchronizer2.destroy();
60
60
  server.destroy();
61
61
  ```
62
62
 
63
- <p>This release includes two types of <a href="https://beta.tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>: the <a href="https://beta.tinybase.org/api/synchronizer-local/interfaces/synchronizer/localsynchronizer/"><code>LocalSynchronizer</code></a> (for demonstrating synchronization on a single local system), and more importantly the <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> (that uses WebSockets to communicate between different systems, shown above).</p><p>Notice that the <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> assumes that there exists a server that can forward requests to other <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> systems. This can be created using the <a href="https://beta.tinybase.org/api/synchronizer-ws-server/functions/creation/createwsserver/"><code>createWsServer</code></a> function that takes a WebSocketServer as also shown above.</p><h3 id="breaking-changes-in-v5-0">Breaking <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> in v5.0</h3><h4 id="module-file-structure">Module File Structure</h4><p>Previously, the distributed package contained a <code>lib</code> folder with both code and type definitions. In v5.0, they have been hoisted to the top level of the package so that less-capable bundlers can find the correct files.</p><p>If you previously had <code>/lib/</code> in your import paths, you should remove it. You also do not have to explicitly specify whether you need the <code>cjs</code> version of <a href="https://beta.tinybase.org/">TinyBase</a> - if you are using a <code>require</code> rather than an <code>import</code>, you will get it automatically.</p><p>The non-minified version of the code is now default and you need to be explicit with you <em>want</em> minified code. Previously you would add <code>/debug</code> to the import path to get non-minified code, but now you add <code>/min</code> to the import path to get <em>minified</em> code.</p><p>Please read the comprehensive <a href="https://beta.tinybase.org/guides/the-basics/importing-tinybase/">Importing TinyBase</a> guide for more details of how to construct the correct import paths in v5.0.</p><h4 id="the-tinybase-inspector">The <a href="https://beta.tinybase.org/">TinyBase</a> Inspector</h4><p>Previously, the React-based inspector (then known as <code>StoreInspector</code>) resided in the debug version of the <a href="https://beta.tinybase.org/api/ui-react-dom/"><code>ui-react-dom</code></a> module. It now lives in its own <a href="https://beta.tinybase.org/api/ui-react-inspector/"><code>ui-react-inspector</code></a> module (so that it can be used against non-debug code) and has been renamed to Inspector.</p><p>Please update your imports and rename the component when used, accordingly. See the API documentation for details, or the <a href="https://beta.tinybase.org/demos/ui-components/inspector/"><inspector></inspector></a>demo, for example.</p><h4 id="api-changes">API <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a></h4><p>The following changes have been made to the existing <a href="https://beta.tinybase.org/">TinyBase</a> API for consistency. These are less common parts of the API but should straightforward to correct if you are using them.</p><p>In the type definitions:</p><ul><li>The GetTransactionChanges and GetTransactionLog types have been removed.</li><li>The TransactionChanges type has been renamed as the <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> type.</li><li>The <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> type now uses <code>undefined</code> instead of <code>null</code> to indicate a <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a> or <a href="https://beta.tinybase.org/api/store/type-aliases/store/value/"><code>Value</code></a> that has been deleted or that was not present.</li><li>The <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/transactionlog/"><code>TransactionLog</code></a> type is now an array instead of a JavaScript object.</li></ul><p>In the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> interface:</p><ul><li>There is a new <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionchanges/"><code>getTransactionChanges</code></a> method and a new getTransactionLog method.</li><li>The setTransactionChanges method is renamed as the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/setter/applychanges/"><code>applyChanges</code></a> method.</li><li>A <a href="https://beta.tinybase.org/api/store/type-aliases/callback/dorollback/"><code>DoRollback</code></a> function no longer gets passed arguments. You can use the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionchanges/"><code>getTransactionChanges</code></a> method and <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionlog/"><code>getTransactionLog</code></a> method directly instead.</li><li>Similarly, a <a href="https://beta.tinybase.org/api/store/type-aliases/listener/transactionlistener/"><code>TransactionListener</code></a> function no longer gets passed arguments.</li></ul><p>In the <a href="https://beta.tinybase.org/api/persisters/"><code>persisters</code></a> module:</p><ul><li>The <a href="https://beta.tinybase.org/api/persisters/functions/creation/createcustompersister/"><code>createCustomPersister</code></a> function now takes a final optional boolean (<code>supportsMergeableStore</code>) to indicate that the <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> can support <a href="https://beta.tinybase.org/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> as well as <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> objects.</li><li>A <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>&#x27;s <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/methods/load/load/"><code>load</code></a> method and <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/methods/load/startautoload/"><code>startAutoLoad</code></a> method now take a <a href="https://beta.tinybase.org/api/store/type-aliases/store/content/"><code>Content</code></a> object as one parameter, rather than <a href="https://beta.tinybase.org/api/store/type-aliases/store/tables/"><code>Tables</code></a> and <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> as two.</li><li>If you create a custom <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>, the setPersisted method now receives changes made to a <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> directly by reference, rather than via a callback. Similarly, the <a href="https://beta.tinybase.org/api/persisters/type-aliases/creation/persisterlistener/"><code>PersisterListener</code></a> you register in your addPersisterListener implementation now takes <a href="https://beta.tinybase.org/api/store/type-aliases/store/content/"><code>Content</code></a> and <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> objects directly rather than via a callback.</li><li>The broadcastTransactionChanges method in the <a href="https://beta.tinybase.org/api/persister-partykit-server/"><code>persister-partykit-server</code></a> module has been renamed to the broadcastChanges method.</li></ul><h2 id="v4-8">v4.8</h2><p>This release includes the new <a href="https://beta.tinybase.org/api/persister-powersync/"><code>persister-powersync</code></a> module, which provides a <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for <a href="https://www.powersync.com/">PowerSync&#x27;s SQLite</a> database.</p><p>Much like the other SQLite persisters, use it by passing in a PowerSync instance to the <a href="https://beta.tinybase.org/api/persister-powersync/functions/creation/createpowersyncpersister/"><code>createPowerSyncPersister</code></a> function; something like:</p>
63
+ <p>This release includes two types of <a href="https://beta.tinybase.org/api/synchronizers/interfaces/synchronizer/synchronizer/"><code>Synchronizer</code></a>: the <a href="https://beta.tinybase.org/api/synchronizer-local/interfaces/synchronizer/localsynchronizer/"><code>LocalSynchronizer</code></a> (for demonstrating synchronization on a single local system), and more importantly the <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> (that uses WebSockets to communicate between different systems, shown above).</p><p>Notice that the <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> assumes that there exists a server that can forward requests to other <a href="https://beta.tinybase.org/api/synchronizer-ws-client/interfaces/synchronizer/wssynchronizer/"><code>WsSynchronizer</code></a> systems. This can be created using the <a href="https://beta.tinybase.org/api/synchronizer-ws-server/functions/creation/createwsserver/"><code>createWsServer</code></a> function that takes a WebSocketServer as also shown above.</p><h3 id="breaking-changes-in-v5-0">Breaking <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> in v5.0</h3><h4 id="module-file-structure">Module File Structure</h4><p>Previously, the distributed package contained a <code>lib</code> folder with both code and type definitions. In v5.0, they have been hoisted to the top level of the package so that less-capable bundlers can find the correct files.</p><p>If you previously had <code>/lib/</code> in your import paths, you should remove it. You also do not have to explicitly specify whether you need the <code>cjs</code> version of <a href="https://beta.tinybase.org/">TinyBase</a> - if you are using a <code>require</code> rather than an <code>import</code>, you will get it automatically.</p><p>The non-minified version of the code is now default and you need to be explicit with you <em>want</em> minified code. Previously you would add <code>/debug</code> to the import path to get non-minified code, but now you add <code>/min</code> to the import path to get <em>minified</em> code.</p><p>Please read the comprehensive <a href="https://beta.tinybase.org/guides/the-basics/importing-tinybase/">Importing TinyBase</a> guide for more details of how to construct the correct import paths in v5.0.</p><h4 id="expo-sqlite-persister">Expo SQLite <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a></h4><p>Previously the <a href="https://beta.tinybase.org/api/persister-expo-sqlite/"><code>persister-expo-sqlite</code></a> module supported expo-sqlite v13 and the persister-expo-sqlite-next module supported their modern &#x27;next&#x27; package. In v5.0, the <a href="https://beta.tinybase.org/api/persister-expo-sqlite/"><code>persister-expo-sqlite</code></a> module only supports v14 and later, and the persister-expo-sqlite-next module has been removed.</p><h4 id="the-tinybase-inspector">The <a href="https://beta.tinybase.org/">TinyBase</a> Inspector</h4><p>Previously, the React-based inspector (then known as <code>StoreInspector</code>) resided in the debug version of the <a href="https://beta.tinybase.org/api/ui-react-dom/"><code>ui-react-dom</code></a> module. It now lives in its own <a href="https://beta.tinybase.org/api/ui-react-inspector/"><code>ui-react-inspector</code></a> module (so that it can be used against non-debug code) and has been renamed to Inspector.</p><p>Please update your imports and rename the component when used, accordingly. See the API documentation for details, or the <a href="https://beta.tinybase.org/demos/ui-components/inspector/"><inspector></inspector></a>demo, for example.</p><h4 id="api-changes">API <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a></h4><p>The following changes have been made to the existing <a href="https://beta.tinybase.org/">TinyBase</a> API for consistency. These are less common parts of the API but should straightforward to correct if you are using them.</p><p>In the type definitions:</p><ul><li>The GetTransactionChanges and GetTransactionLog types have been removed.</li><li>The TransactionChanges type has been renamed as the <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> type.</li><li>The <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> type now uses <code>undefined</code> instead of <code>null</code> to indicate a <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a> or <a href="https://beta.tinybase.org/api/store/type-aliases/store/value/"><code>Value</code></a> that has been deleted or that was not present.</li><li>The <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/transactionlog/"><code>TransactionLog</code></a> type is now an array instead of a JavaScript object.</li></ul><p>In the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> interface:</p><ul><li>There is a new <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionchanges/"><code>getTransactionChanges</code></a> method and a new getTransactionLog method.</li><li>The setTransactionChanges method is renamed as the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/setter/applychanges/"><code>applyChanges</code></a> method.</li><li>A <a href="https://beta.tinybase.org/api/store/type-aliases/callback/dorollback/"><code>DoRollback</code></a> function no longer gets passed arguments. You can use the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionchanges/"><code>getTransactionChanges</code></a> method and <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/transaction/gettransactionlog/"><code>getTransactionLog</code></a> method directly instead.</li><li>Similarly, a <a href="https://beta.tinybase.org/api/store/type-aliases/listener/transactionlistener/"><code>TransactionListener</code></a> function no longer gets passed arguments.</li></ul><p>In the <a href="https://beta.tinybase.org/api/persisters/"><code>persisters</code></a> module:</p><ul><li>The <a href="https://beta.tinybase.org/api/persisters/functions/creation/createcustompersister/"><code>createCustomPersister</code></a> function now takes a final optional boolean (<code>supportsMergeableStore</code>) to indicate that the <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> can support <a href="https://beta.tinybase.org/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> as well as <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> objects.</li><li>A <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>&#x27;s <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/methods/load/load/"><code>load</code></a> method and <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/methods/load/startautoload/"><code>startAutoLoad</code></a> method now take a <a href="https://beta.tinybase.org/api/store/type-aliases/store/content/"><code>Content</code></a> object as one parameter, rather than <a href="https://beta.tinybase.org/api/store/type-aliases/store/tables/"><code>Tables</code></a> and <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> as two.</li><li>If you create a custom <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a>, the setPersisted method now receives changes made to a <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> directly by reference, rather than via a callback. Similarly, the <a href="https://beta.tinybase.org/api/persisters/type-aliases/creation/persisterlistener/"><code>PersisterListener</code></a> you register in your addPersisterListener implementation now takes <a href="https://beta.tinybase.org/api/store/type-aliases/store/content/"><code>Content</code></a> and <a href="https://beta.tinybase.org/api/store/type-aliases/transaction/changes/"><code>Changes</code></a> objects directly rather than via a callback.</li><li>The broadcastTransactionChanges method in the <a href="https://beta.tinybase.org/api/persister-partykit-server/"><code>persister-partykit-server</code></a> module has been renamed to the broadcastChanges method.</li></ul><h2 id="v4-8">v4.8</h2><p>This release includes the new <a href="https://beta.tinybase.org/api/persister-powersync/"><code>persister-powersync</code></a> module, which provides a <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for <a href="https://www.powersync.com/">PowerSync&#x27;s SQLite</a> database.</p><p>Much like the other SQLite persisters, use it by passing in a PowerSync instance to the <a href="https://beta.tinybase.org/api/persister-powersync/functions/creation/createpowersyncpersister/"><code>createPowerSyncPersister</code></a> function; something like:</p>
64
64
 
65
65
  ```js yolo
66
66
  const powerSync = usePowerSync();
@@ -102,7 +102,7 @@ const persister = createElectricSqlPersister(store, electric, {
102
102
  });
103
103
  ```
104
104
 
105
- <p>This release is accompanied by a <a href="https://github.com/tinyplex/tinybase-ts-react-electricsql">template project</a> to get started quickly with this integration. Enjoy!</p><h2 id="v4-5">v4.5</h2><p>This release includes the new <a href="https://beta.tinybase.org/api/persister-expo-sqlite-next/"><code>persister-expo-sqlite-next</code></a> module, which provides a <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for the modern version of Expo&#x27;s <a href="https://docs.expo.dev/versions/latest/sdk/sqlite">SQLite</a> library, designated &#x27;next&#x27; as of November 2023. This API should be used if you are installing the <code>expo-sqlite/next</code> module.</p><p>Note that <a href="https://beta.tinybase.org/">TinyBase</a> support for the legacy version of Expo-SQLite (<code>expo-sqlite</code>) is still available in the <a href="https://beta.tinybase.org/api/persister-expo-sqlite/"><code>persister-expo-sqlite</code></a> module.</p><p>Thank you to Expo for providing this functionality!</p><h2 id="v4-4">v4.4</h2><p>This relatively straightforward release adds a selection of new listeners to the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> object, and their respective hooks. These are for listening to changes in the &#x27;existence&#x27; of entities rather than to their value. For example, the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablelistener/"><code>addHasTableListener</code></a> method will let you listen for the presence (or not) of a specific table.</p><p>The full set of new existence-listening methods and hooks to work with this is as follows:</p><div class="table"><table><thead><tr><th>Existence of:</th><th>Add Listener</th><th>Hook</th><th>Add Listener Hook</th></tr></thead><tbody><tr><td><a href="https://beta.tinybase.org/api/store/type-aliases/store/tables/"><code>Tables</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastableslistener/"><code>addHasTablesListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastables/"><code>useHasTables</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastableslistener/"><code>useHasTablesListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablelistener/"><code>addHasTableListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastable/"><code>useHasTable</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablelistener/"><code>useHasTableListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a> <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablecelllistener/"><code>addHasTableCellListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablecell/"><code>useHasTableCell</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablecelllistener/"><code>useHasTableCellListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/row/"><code>Row</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasrowlistener/"><code>addHasRowListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasrow/"><code>useHasRow</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasrowlistener/"><code>useHasRowListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhascelllistener/"><code>addHasCellListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehascell/"><code>useHasCell</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehascelllistener/"><code>useHasCellListener</code></a></td></tr><tr><td><a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasvalueslistener/"><code>addHasValuesListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalues/"><code>useHasValues</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalueslistener/"><code>useHasValuesListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/value/"><code>Value</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasvaluelistener/"><code>addHasValueListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalue/"><code>useHasValue</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvaluelistener/"><code>useHasValueListener</code></a></td></tr></tbody></table></div><p>These methods may become particularly important in future versions of <a href="https://beta.tinybase.org/">TinyBase</a> that support <code>null</code> as valid Cells and <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a>.</p><h2 id="v4-3">v4.3</h2><p>We&#x27;re excited to announce <a href="https://beta.tinybase.org/">TinyBase</a> 4.3, which provides an integration with <a href="https://www.partykit.io/">PartyKit</a>, a cloud-based collaboration provider.</p><p>This allows you to enjoy the benefits of both a &quot;local-first&quot; architecture and a &quot;sharing-first&quot; platform. You can have structured data on the client with fast, reactive user experiences, but also benefit from cloud-based persistence and room-based collaboration.</p><p><img src="https://beta.tinybase.org/partykit.gif" alt="PartyKit" title="PartyKit"></p><p>This release includes two new modules:</p><ul><li>The <a href="https://beta.tinybase.org/api/persister-partykit-server/"><code>persister-partykit-server</code></a> module provides a server class for coordinating clients and persisting <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> data to the PartyKit cloud.</li><li>The <a href="https://beta.tinybase.org/api/persister-partykit-client/"><code>persister-partykit-client</code></a> module provides the API to create connections to the server and a binding to your <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a>.</li></ul><p>A <a href="https://beta.tinybase.org/">TinyBase</a> server implementation on PartyKit can be as simple as this:</p>
105
+ <p>This release is accompanied by a <a href="https://github.com/tinyplex/tinybase-ts-react-electricsql">template project</a> to get started quickly with this integration. Enjoy!</p><h2 id="v4-5">v4.5</h2><p>This release includes the new persister-expo-sqlite-next module, which provides a <a href="https://beta.tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for the modern version of Expo&#x27;s <a href="https://docs.expo.dev/versions/latest/sdk/sqlite">SQLite</a> library, designated &#x27;next&#x27; as of November 2023. This API should be used if you are installing the <code>expo-sqlite/next</code> module.</p><p>Note that <a href="https://beta.tinybase.org/">TinyBase</a> support for the legacy version of Expo-SQLite (<code>expo-sqlite</code>) is still available in the <a href="https://beta.tinybase.org/api/persister-expo-sqlite/"><code>persister-expo-sqlite</code></a> module.</p><p>NB as of <a href="https://beta.tinybase.org/">TinyBase</a> v5.0, this is now the default and legacy support has been removed.</p><p>Thank you to Expo for providing this functionality!</p><h2 id="v4-4">v4.4</h2><p>This relatively straightforward release adds a selection of new listeners to the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> object, and their respective hooks. These are for listening to changes in the &#x27;existence&#x27; of entities rather than to their value. For example, the <a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablelistener/"><code>addHasTableListener</code></a> method will let you listen for the presence (or not) of a specific table.</p><p>The full set of new existence-listening methods and hooks to work with this is as follows:</p><div class="table"><table><thead><tr><th>Existence of:</th><th>Add Listener</th><th>Hook</th><th>Add Listener Hook</th></tr></thead><tbody><tr><td><a href="https://beta.tinybase.org/api/store/type-aliases/store/tables/"><code>Tables</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastableslistener/"><code>addHasTablesListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastables/"><code>useHasTables</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastableslistener/"><code>useHasTablesListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablelistener/"><code>addHasTableListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastable/"><code>useHasTable</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablelistener/"><code>useHasTableListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/table/"><code>Table</code></a> <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhastablecelllistener/"><code>addHasTableCellListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablecell/"><code>useHasTableCell</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehastablecelllistener/"><code>useHasTableCellListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/row/"><code>Row</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasrowlistener/"><code>addHasRowListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasrow/"><code>useHasRow</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasrowlistener/"><code>useHasRowListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/cell/"><code>Cell</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhascelllistener/"><code>addHasCellListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehascell/"><code>useHasCell</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehascelllistener/"><code>useHasCellListener</code></a></td></tr><tr><td><a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasvalueslistener/"><code>addHasValuesListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalues/"><code>useHasValues</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalueslistener/"><code>useHasValuesListener</code></a></td></tr><tr><td>A <a href="https://beta.tinybase.org/api/store/type-aliases/store/value/"><code>Value</code></a></td><td><a href="https://beta.tinybase.org/api/store/interfaces/store/store/methods/listener/addhasvaluelistener/"><code>addHasValueListener</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvalue/"><code>useHasValue</code></a></td><td><a href="https://beta.tinybase.org/api/ui-react/functions/store-hooks/usehasvaluelistener/"><code>useHasValueListener</code></a></td></tr></tbody></table></div><p>These methods may become particularly important in future versions of <a href="https://beta.tinybase.org/">TinyBase</a> that support <code>null</code> as valid Cells and <a href="https://beta.tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a>.</p><h2 id="v4-3">v4.3</h2><p>We&#x27;re excited to announce <a href="https://beta.tinybase.org/">TinyBase</a> 4.3, which provides an integration with <a href="https://www.partykit.io/">PartyKit</a>, a cloud-based collaboration provider.</p><p>This allows you to enjoy the benefits of both a &quot;local-first&quot; architecture and a &quot;sharing-first&quot; platform. You can have structured data on the client with fast, reactive user experiences, but also benefit from cloud-based persistence and room-based collaboration.</p><p><img src="https://beta.tinybase.org/partykit.gif" alt="PartyKit" title="PartyKit"></p><p>This release includes two new modules:</p><ul><li>The <a href="https://beta.tinybase.org/api/persister-partykit-server/"><code>persister-partykit-server</code></a> module provides a server class for coordinating clients and persisting <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> data to the PartyKit cloud.</li><li>The <a href="https://beta.tinybase.org/api/persister-partykit-client/"><code>persister-partykit-client</code></a> module provides the API to create connections to the server and a binding to your <a href="https://beta.tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a>.</li></ul><p>A <a href="https://beta.tinybase.org/">TinyBase</a> server implementation on PartyKit can be as simple as this:</p>
106
106
 
107
107
  ```js yolo
108
108
  import {TinyBasePartyKitServer} from 'tinybase/persisters/persister-partykit-server';