atom.io 0.39.0 โ†’ 0.39.1

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 (47) hide show
  1. package/dist/data/index.js.map +1 -1
  2. package/dist/eslint-plugin/index.js +2 -1
  3. package/dist/eslint-plugin/index.js.map +1 -1
  4. package/dist/internal/index.d.ts +13 -7
  5. package/dist/internal/index.d.ts.map +1 -1
  6. package/dist/internal/index.js +34 -14
  7. package/dist/internal/index.js.map +1 -1
  8. package/dist/introspection/index.d.ts.map +1 -1
  9. package/dist/introspection/index.js.map +1 -1
  10. package/dist/json/index.d.ts.map +1 -1
  11. package/dist/json/index.js.map +1 -1
  12. package/dist/main/index.d.ts.map +1 -1
  13. package/dist/main/index.js.map +1 -1
  14. package/dist/react/index.d.ts.map +1 -1
  15. package/dist/react/index.js +43 -2
  16. package/dist/react/index.js.map +1 -1
  17. package/dist/react-devtools/index.d.ts.map +1 -1
  18. package/dist/react-devtools/index.js +4 -5
  19. package/dist/react-devtools/index.js.map +1 -1
  20. package/dist/realtime/index.d.ts.map +1 -1
  21. package/dist/realtime/index.js.map +1 -1
  22. package/dist/realtime-client/index.js.map +1 -1
  23. package/dist/realtime-react/index.js.map +1 -1
  24. package/dist/realtime-server/index.d.ts.map +1 -1
  25. package/dist/realtime-server/index.js.map +1 -1
  26. package/dist/realtime-testing/index.d.ts.map +1 -1
  27. package/dist/realtime-testing/index.js.map +1 -1
  28. package/dist/transceivers/set-rtx/index.d.ts.map +1 -1
  29. package/dist/transceivers/set-rtx/index.js.map +1 -1
  30. package/dist/web/index.js.map +1 -1
  31. package/package.json +8 -8
  32. package/src/internal/families/create-regular-atom-family.ts +3 -2
  33. package/src/internal/get-state/read-or-compute-value.ts +2 -1
  34. package/src/internal/is-fn.ts +9 -0
  35. package/src/internal/set-state/become.ts +11 -6
  36. package/src/internal/set-state/dispatch-state-update.ts +2 -1
  37. package/src/internal/set-state/operate-on-store.ts +3 -1
  38. package/src/internal/set-state/reset-atom-or-selector.ts +7 -7
  39. package/src/internal/set-state/set-atom-or-selector.ts +3 -2
  40. package/src/internal/set-state/set-atom.ts +4 -3
  41. package/src/internal/set-state/set-selector.ts +8 -7
  42. package/src/react-devtools/json-editor/editors-by-type/array-editor.tsx +1 -1
  43. package/src/react-devtools/json-editor/editors-by-type/object-editor.tsx +2 -3
  44. package/src/react-devtools/json-editor/editors-by-type/utilities/array-elements.ts +1 -1
  45. package/src/react-devtools/json-editor/editors-by-type/utilities/object-properties.ts +1 -1
  46. package/dist/use-o-DXPncKmZ.js +0 -47
  47. package/dist/use-o-DXPncKmZ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["PRETTY_TOKEN_TYPES: Record<TokenDenomination, string>","simpleLogger: Logger","$claim: unique symbol","timeline"],"sources":["../../src/main/atom.ts","../../src/main/dispose-state.ts","../../src/main/find-state.ts","../../src/main/get-state.ts","../../src/main/join.ts","../../src/main/logger.ts","../../src/main/realm.ts","../../src/main/reset-state.ts","../../src/main/selector.ts","../../src/main/set-state.ts","../../src/main/silo.ts","../../src/main/subscribe.ts","../../src/main/timeline.ts","../../src/main/transaction.ts","../../src/main/validators.ts"],"sourcesContent":["import type { ConstructorOf, Transceiver } from \"atom.io/internal\"\nimport {\n\tcreateMutableAtom,\n\tcreateMutableAtomFamily,\n\tcreateRegularAtom,\n\tcreateRegularAtomFamily,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { StateUpdate } from \"./events\"\nimport type { Setter } from \"./set-state\"\nimport type {\n\tMutableAtomFamilyToken,\n\tMutableAtomToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n} from \"./tokens\"\n\nexport type RegularAtomOptions<T> = {\n\t/** The unique identifier of the atom */\n\tkey: string\n\t/** The starting value of the atom */\n\tdefault: T | (() => T)\n\t/** Hooks used to run side effects when the atom is set */\n\teffects?: AtomEffect<T>[]\n}\n/**\n * Create a regular atom, a global reactive variable in the implicit store\n * @param options - {@link RegularAtomOptions}.\n * @returns\n * A reference to the atom created: a {@link RegularAtomToken}\n */\nexport function atom<T>(options: RegularAtomOptions<T>): RegularAtomToken<T> {\n\treturn createRegularAtom(IMPLICIT.STORE, options, undefined)\n}\n\nexport type MutableAtomOptions<T extends Transceiver<any, any, any>> = {\n\t/** The unique identifier of the atom */\n\tkey: string\n\t/** A constructor for the atom's value */\n\tclass: ConstructorOf<T>\n\t/** Hooks used to run side effects when the atom is set */\n\teffects?: AtomEffect<T>[]\n}\n/**\n * Create a mutable atom, a global reactive variable in the implicit store\n *\n * The value of a mutable atom must be some kind of {@link Transceiver}.\n *\n * @param options - {@link MutableAtomOptions}.\n * @returns\n * A reference to the atom created: a {@link MutableAtomToken}\n */\nexport function mutableAtom<T extends Transceiver<any, any, any>>(\n\toptions: MutableAtomOptions<T>,\n): MutableAtomToken<T> {\n\treturn createMutableAtom(IMPLICIT.STORE, options, undefined)\n}\n\n/**\n * A function that runs side effects when the atom is set\n * @param tools - {@link Effectors} that can be used to run side effects\n * @returns\n * Optionally, a cleanup function that will be called when the atom is disposed\n */\nexport type AtomEffect<T> = (tools: Effectors<T>) => (() => void) | void\nexport type Effectors<T> = {\n\t/**\n\t * Reset the value of the atom to its default\n\t */\n\tresetSelf: () => void\n\t/**\n\t * Set the value of the atom\n\t * @param next - The new value of the atom, or a setter function\n\t */\n\tsetSelf: <New extends T>(next: New | Setter<T, New>) => void\n\t/** Subscribe to changes to the atom */\n\tonSet: (callback: (options: StateUpdate<T>) => void) => void\n}\n\nexport type RegularAtomFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the atom family */\n\tkey: string\n\t/** The starting value of the atom family */\n\tdefault: T | ((key: K) => T)\n\t/** Hooks used to run side effects when an atom in the family is set */\n\teffects?: (key: K) => AtomEffect<T>[]\n}\n/**\n * Create a family of regular atoms, allowing for the dynamic creation and disposal of atoms.\n * @param options - {@link RegularAtomFamilyOptions}\n * @returns\n * A reference to the atom family created: a {@link RegularAtomFamilyToken}\n */\nexport function atomFamily<T, K extends Canonical>(\n\toptions: RegularAtomFamilyOptions<T, K>,\n): RegularAtomFamilyToken<T, K> {\n\treturn createRegularAtomFamily(IMPLICIT.STORE, options)\n}\n\nexport type MutableAtomFamilyOptions<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the atom family */\n\tkey: string\n\t/** The class of the transceiver to be created */\n\tclass: ConstructorOf<T>\n\t/** Hooks used to run side effects when an atom in the family is set */\n\teffects?: (key: K) => AtomEffect<T>[]\n}\n/**\n * Create a family of mutable atoms, allowing for the dynamic creation and disposal of atoms.\n *\n * The value of a mutable atom must be some kind of {@link Transceiver}.\n *\n * @param options - {@link MutableAtomFamilyOptions}\n * @returns\n * A reference to the atom family created: a {@link MutableAtomFamilyToken}\n */\nexport function mutableAtomFamily<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n>(options: MutableAtomFamilyOptions<T, K>): MutableAtomFamilyToken<T, K> {\n\treturn createMutableAtomFamily(IMPLICIT.STORE, options)\n}\n","import { disposeFromStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { ReadableFamilyToken, ReadableToken } from \".\"\n\n/**\n * Disposes of a state in the implicit store.\n *\n * Only family members can be disposed of.\n *\n * @param token - The token of the state to dispose\n * @overload Default\n */\nexport function disposeState(token: ReadableToken<any>): void\n/**\n * Disposes of a state in the implicit store.\n *\n * Only family members can be disposed of.\n *\n * @param token - The token of the state family to dispose\n * @param key - The unique key of the state to dispose\n * @overload Streamlined\n */\nexport function disposeState<K extends Canonical>(\n\ttoken: ReadableFamilyToken<any, K>,\n\tkey: K,\n): void\nexport function disposeState(\n\t...params:\n\t\t| [token: ReadableFamilyToken<any, any>, key: Canonical]\n\t\t| [token: ReadableToken<any>]\n): void {\n\tif (params.length === 2) {\n\t\tdisposeFromStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tdisposeFromStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import type {\n\tMutableAtomToken,\n\tReadableFamilyToken,\n\tReadableToken,\n\tReadonlySelectorFamilyToken,\n\tReadonlySelectorToken,\n\tRegularAtomToken,\n\tWritableFamilyToken,\n\tWritableSelectorFamilyToken,\n\tWritableSelectorToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Transceiver } from \"atom.io/internal\"\nimport { findInStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { MutableAtomFamilyToken, RegularAtomFamilyToken } from \"./tokens\"\n\n/**\n * Finds a {@link MutableAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" atom token will be returned in this case and a warning will be logged.\n *\n * @param token - A {@link MutableAtomFamilyToken}\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Mutable Atom\n */\nexport function findState<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n\tKey extends K,\n>(token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>\n/**\n * Finds a {@link RegularAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" atom token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Regular Atom\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: RegularAtomFamilyToken<T, K>,\n\tkey: Key,\n): RegularAtomToken<T, K>\n/**\n * Finds a {@link WritableSelectorToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" selector token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Writable Selector\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: WritableSelectorFamilyToken<T, K>,\n\tkey: Key,\n): WritableSelectorToken<T, K>\n/**\n * Finds a {@link ReadonlySelectorToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" selector token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Readonly Selector\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadonlySelectorFamilyToken<T, K>,\n\tkey: Key,\n): ReadonlySelectorToken<T, K>\n/**\n * Finds a {@link WritableToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom or selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Writable State\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: WritableFamilyToken<T, K>,\n\tkey: Key,\n): WritableToken<T, K>\n/**\n * Finds a {@link MutableAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom or selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" token will be returned in this case and a warning will be logged.\n *\n * @param token - A {@link ReadableFamilyToken}\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Unknown\n * @default\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadableFamilyToken<T, K>,\n\tkey: Key,\n): ReadableToken<T, K>\n\nexport function findState(\n\ttoken: ReadableFamilyToken<any, any>,\n\tkey: Canonical,\n): ReadableToken<any> {\n\tconst state = findInStore(IMPLICIT.STORE, token, key)\n\treturn state\n}\n","import type { ViewOf } from \"atom.io\"\nimport { getFromStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { ReadableFamilyToken, ReadableToken } from \".\"\n\n/**\n * Read or compute the current value of a state\n * @param token - The token of the state to get\n * @return The current value of the state\n * @overload Default\n * @default\n */\nexport function getState<T>(token: ReadableToken<T>): ViewOf<T>\n\n/**\n * Read or compute the current value of a state\n * @param token - The token of a state family\n * @param key - The unique key of the state to get\n * @return The current value of the state\n * @overload Streamlined\n */\nexport function getState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadableFamilyToken<T, K>,\n\tkey: Key,\n): ViewOf<T>\n\nexport function getState(\n\t...params:\n\t\t| [token: ReadableFamilyToken<any, any>, key: Canonical]\n\t\t| [token: ReadableToken<any>]\n): any {\n\tif (params.length === 2) {\n\t\treturn getFromStore(IMPLICIT.STORE, ...params)\n\t}\n\treturn getFromStore(IMPLICIT.STORE, ...params)\n}\n","import type { MutableAtomFamilyToken, ReadonlyPureSelectorToken } from \"atom.io\"\nimport type {\n\tFlat,\n\tJunction,\n\tJunctionEntriesBase,\n\tJunctionSchemaBase,\n\tRefinement,\n} from \"atom.io/internal\"\nimport {\n\tcreateJoin,\n\teditRelationsInStore,\n\tfindRelationsInStore,\n\tgetInternalRelationsFromStore,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport type { SetRTX } from \"atom.io/transceivers/set-rtx\"\n\n// biome-ignore format: intersection\nexport type JoinOptions<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n> =\n\tFlat<\n\t\t& JunctionSchemaBase<ASide, BSide>\n\t\t& {\n\t\t\t/** Unique identifier of the join */\n\t\t\treadonly key: string\n\t\t\t/** How many relations are allowed in each direction? */\n\t\t\treadonly cardinality: Cardinality\n\t\t\t/** Type guard for the type of the left side */\n\t\t\treadonly isAType: Refinement<string, AType>\n\t\t\t/** Type guard for the type of the right side */\n\t\t\treadonly isBType: Refinement<string, BType>\n\t\t}\n\t> & Partial<JunctionEntriesBase<AType, BType, Content>>\n\nexport type JoinToken<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null = null,\n> = {\n\t/** Unique identifier of the join */\n\tkey: string\n\t/** Discriminator */\n\ttype: `join`\n\t/** How many relations are allowed in each direction? */\n\tcardinality: Cardinality\n\t/** Name of the join's left side */\n\ta: ASide\n\t/** Name of the join's right side */\n\tb: BSide\n\t/** Never present. This is a marker that preserves the type of the left side's keys */\n\t__aType?: AType\n\t/** Never present. This is a marker that preserves the type of the right side's keys */\n\t__bType?: BType\n\t/** Never present. This is a marker that preserves the type of the data present for each relation */\n\t__content?: Content\n}\n\n/**\n * Create a join, an interface for managing relations between two sets of keys.\n *\n * Use joins when it is important to view relationships from either side.\n *\n * Under the hood, joins coordinate changes of multiple atoms to support that the desired relationships stay consistent.\n *\n * @param options - {@link JoinOptions}\n * @param defaultContent - (undefined)\n * @returns\n * A reference to the join created: a {@link JoinToken}\n * @overload No Content\n */\nexport function join<\n\tconst ASide extends string,\n\tconst AType extends string,\n\tconst BSide extends string,\n\tconst BType extends string,\n\tconst Cardinality extends `1:1` | `1:n` | `n:n`,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, null>,\n\tdefaultContent?: undefined,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, null>\n/**\n * Create a join, an interface for managing relations between two sets of keys.\n *\n * Use joins when it is important to view relationships from either side.\n *\n * Under the hood, joins coordinate changes of multiple atoms to support that the desired relationships stay consistent.\n *\n * @param options - {@link JoinOptions}\n * @param defaultContent - The default value for the content of each relation\n * @returns\n * A reference to the join created: a {@link JoinToken}\n * @overload With Content\n */\nexport function join<\n\tconst ASide extends string,\n\tconst AType extends string,\n\tconst BSide extends string,\n\tconst BType extends string,\n\tconst Cardinality extends `1:1` | `1:n` | `n:n`,\n\tconst Content extends Json.Object,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>,\n\tdefaultContent: Content,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, Content>\nexport function join<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>,\n\tdefaultContent: Content | undefined,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, Content> {\n\treturn createJoin(IMPLICIT.STORE, options, defaultContent)\n}\n\nexport type JoinStates<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n> = Cardinality extends `1:1`\n\t? (Content extends Json.Object\n\t\t\t? {\n\t\t\t\t\treadonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t[AType, Content] | null,\n\t\t\t\t\t\tBType\n\t\t\t\t\t>\n\t\t\t\t} & {\n\t\t\t\t\treadonly [B in BSide as `${B}EntryOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t[BType, Content] | null,\n\t\t\t\t\t\tAType\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t: {}) & {\n\t\t\treadonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\tAType | null,\n\t\t\t\tBType\n\t\t\t>\n\t\t} & {\n\t\t\treadonly [B in BSide as `${B}KeyOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\tBType | null,\n\t\t\t\tAType\n\t\t\t>\n\t\t}\n\t: Cardinality extends `1:n`\n\t\t? (Content extends Json.Object\n\t\t\t\t? {\n\t\t\t\t\t\treadonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t[AType, Content] | null,\n\t\t\t\t\t\t\tBType\n\t\t\t\t\t\t>\n\t\t\t\t\t} & {\n\t\t\t\t\t\treadonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t[BType, Content][],\n\t\t\t\t\t\t\tAType\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t: {}) & {\n\t\t\t\treadonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\tAType | null,\n\t\t\t\t\tBType\n\t\t\t\t>\n\t\t\t} & {\n\t\t\t\treadonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\tBType[],\n\t\t\t\t\tAType\n\t\t\t\t>\n\t\t\t}\n\t\t: Cardinality extends `n:n`\n\t\t\t? (Content extends Json.Object\n\t\t\t\t\t? {\n\t\t\t\t\t\t\treadonly [A in ASide as `${A}EntriesOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t\t[AType, Content][],\n\t\t\t\t\t\t\t\tBType\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t} & {\n\t\t\t\t\t\t\treadonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t\t[BType, Content][],\n\t\t\t\t\t\t\t\tAType\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}) & {\n\t\t\t\t\treadonly [A in ASide as `${A}KeysOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\tAType[],\n\t\t\t\t\t\tBType\n\t\t\t\t\t>\n\t\t\t\t} & {\n\t\t\t\t\treadonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\tBType[],\n\t\t\t\t\t\tAType\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t: never\n\n/**\n * Find the current value of a relation owned by a {@link join}\n * @param token - The token of the join\n * @param key - The key of the relation to find\n * @returns\n * A {@link JoinStates} interface to access the relation\n * @overload Default\n */\nexport function findRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n\tkey: AType | BType,\n): JoinStates<ASide, AType, BSide, BType, Cardinality, Content> {\n\treturn findRelationsInStore(token, key, IMPLICIT.STORE)\n}\n\n/**\n * Change one or multiple relations owned by a {@link join}\n * @param token - The token of the join\n * @param change - A function that takes a {@link Junction} interface to edit the relations\n */\nexport function editRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n\tchange: (relations: Junction<ASide, AType, BSide, BType, Content>) => void,\n): void {\n\teditRelationsInStore(token, change, IMPLICIT.STORE)\n}\n\n/**\n * @param token - The token of the join\n * @returns\n * A {@link MutableAtomFamilyToken} to access the internal relations\n */\nexport function getInternalRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n): MutableAtomFamilyToken<SetRTX<string>, string> {\n\treturn getInternalRelationsFromStore(token, IMPLICIT.STORE)\n}\n","const LOGGER_ICON_DICTIONARY = {\n\t// Lifecycle\n\t\"๐Ÿ”จ\": `Create state`,\n\t\"๐Ÿ› ๏ธ\": `Install state into store`,\n\t// Families\n\t\"๐Ÿ‘ช\": `Family member added`,\n\t\"๐Ÿ”ฅ\": `Family member deleted`,\n\t// Cache\n\t\"๐Ÿ“ƒ\": `Copy mutable`,\n\t\"๐Ÿ“–\": `Read from cache`,\n\t\"๐Ÿ“\": `Write to cache`,\n\t\"โ”\": `Cache miss`,\n\t\"โœจ\": `Value derived`,\n\t\"โญ\": `Value set`,\n\t// Operations\n\t\"โญ•\": `Operation start`,\n\t\"๐Ÿ”ด\": `Operation complete`,\n\t\"๐Ÿšซ\": `Operation blocked`,\n\t\"๐ŸŸข\": `Operation unblocked`,\n\t// Selectors\n\t\"๐Ÿ—‘\": `Evict cached value`,\n\t\"๐Ÿงน\": `Prepare to evict`,\n\t\"๐Ÿงฎ\": `Computing selector`,\n\t\"๐Ÿ”Œ\": `Register direct dependency`,\n\t\"๐Ÿ”\": `Discover root`,\n\t// Transactions\n\t\"๐Ÿ“\": `Stow update`,\n\t\"๐Ÿ›ซ\": `Begin transaction`,\n\t\"๐Ÿ›„\": `Apply transaction`,\n\t\"๐Ÿ›ฌ\": `Complete transaction`,\n\t\"๐Ÿ’ฅ\": `Transaction caught error`,\n\t\"๐Ÿช‚\": `Abort transaction`,\n\t// Timelines\n\t\"โŒ›\": `Timeline event fully captured`,\n\t\"โฉ\": `Timeline redo`,\n\t\"โช\": `Timeline undo`,\n\t\"โญ๏ธ\": `Transaction redo`,\n\t\"โฎ๏ธ\": `Transaction undo`,\n\t\"โณ\": `Timeline event partially captured`,\n\t\"โน๏ธ\": `Time-travel complete`,\n\t// Problems\n\t\"๐Ÿ’ฃ\": `Dangerous action likely to cause bad errors down the line`,\n\t\"โ—\": `Dangerous action unless in development mode`,\n\t\"โŒ\": `Conflict prevents attempted action`,\n\t\"๐Ÿž\": `Possible bug in AtomIO`,\n\t\"๐Ÿ’\": `Advice and guidance to the developer`,\n\t// Subscriptions\n\t\"๐Ÿ‘€\": `Subscription added`,\n\t\"๐Ÿ™ˆ\": `Subscription canceled`,\n\t\"๐Ÿ“ข\": `Notify subscribers`,\n\n\t// Realtime\n\t\"๐Ÿš€\": `Performance measure`,\n\t\"โœ…\": `Realtime transaction success`,\n\t\"๐Ÿ”„\": `Realtime transaction synchronized`,\n\t\"๐Ÿคž\": `Realtime optimistic update enqueued`,\n\t\"๐Ÿ‘ˆ\": `Realtime confirmed update enqueued`,\n\t\"๐Ÿง‘โ€โš–๏ธ\": `Realtime update beginning reconciliation`,\n\t\"๐Ÿ›Ž๏ธ\": `Realtime transaction received`,\n\t\"๐Ÿ‘\": `Determining perspective`,\n\t\"๐Ÿ”ญ\": `Determining realtime perspective`,\n\t\"๐Ÿ–Œ\": `Redacting realtime update`,\n\t\"๐Ÿ‘‹\": `Realtime greeting`,\n\t\"๐Ÿ‘\": `Realtime acknowledgment`,\n} as const\nexport type LoggerIcon = keyof typeof LOGGER_ICON_DICTIONARY\nexport type TokenDenomination =\n\t| `atom_family`\n\t| `atom`\n\t| `continuity`\n\t| `key`\n\t| `mutable_atom_family`\n\t| `mutable_atom`\n\t| `readonly_held_selector_family`\n\t| `readonly_held_selector`\n\t| `readonly_pure_selector_family`\n\t| `readonly_pure_selector`\n\t| `state`\n\t| `timeline`\n\t| `transaction`\n\t| `unknown`\n\t| `writable_held_selector_family`\n\t| `writable_held_selector`\n\t| `writable_pure_selector_family`\n\t| `writable_pure_selector`\n\nexport const PRETTY_TOKEN_TYPES: Record<TokenDenomination, string> = {\n\tatom_family: `atom family`,\n\tatom: `atom`,\n\tcontinuity: `continuity`,\n\tkey: `key`,\n\tmutable_atom_family: `atom family [m]`,\n\tmutable_atom: `atom [m]`,\n\treadonly_held_selector_family: `selector family [h]`,\n\treadonly_held_selector: `selector [h]`,\n\treadonly_pure_selector_family: `selector family`,\n\treadonly_pure_selector: `selector`,\n\tstate: `state`,\n\ttimeline: `timeline`,\n\ttransaction: `transaction`,\n\tunknown: `unknown`,\n\twritable_held_selector_family: `selector family [wh]`,\n\twritable_held_selector: `selector [wh]`,\n\twritable_pure_selector_family: `selector family [w]`,\n\twritable_pure_selector: `selector [w]`,\n}\n\nexport const LOG_LEVELS = [`info`, `warn`, `error`] as const\nexport type LogLevel = (typeof LOG_LEVELS)[number]\n\nexport type LogFn = (\n\ticon: LoggerIcon,\n\tdenomination: TokenDenomination,\n\ttokenKey: string,\n\tmessage: string,\n\t...rest: unknown[]\n) => void\nexport type LogFilter = (\n\t...params: Parameters<LogFn>\n) => Parameters<LogFn> | boolean\n\nexport type Logger = Record<LogLevel, LogFn>\n\nexport const simpleLog =\n\t(logLevel: keyof Logger): LogFn =>\n\t(icon, denomination, tokenKey, message, ...rest) => {\n\t\t/* eslint-disable-next-line no-console */\n\t\tconsole[logLevel](\n\t\t\t`${icon} ${PRETTY_TOKEN_TYPES[denomination]} \\`${tokenKey}\\` ${message}`,\n\t\t\t...rest,\n\t\t)\n\t}\nexport const simpleLogger: Logger = {\n\terror: simpleLog(`error`),\n\tinfo: simpleLog(`info`),\n\twarn: simpleLog(`warn`),\n}\n\nexport class AtomIOLogger implements Logger {\n\tpublic logLevel: `error` | `info` | `warn` | null\n\tpublic filter: LogFilter | undefined\n\tprivate readonly logger: Logger\n\n\tpublic constructor(\n\t\tlogLevel: `error` | `info` | `warn` | null,\n\t\tfilter?: LogFilter,\n\t\tlogger: Logger = simpleLogger,\n\t) {\n\t\tthis.logLevel = logLevel\n\t\tthis.filter = filter\n\t\tthis.logger = logger\n\t}\n\n\tpublic error: LogFn = (...args) => {\n\t\tif (this.logLevel !== null) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.error(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.error(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n\tpublic info: LogFn = (...args) => {\n\t\tif (this.logLevel === `info`) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.info(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.info(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n\tpublic warn: LogFn = (...args) => {\n\t\tif (this.logLevel !== `error` && this.logLevel !== null) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.warn(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.warn(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { Each, Store } from \"atom.io/internal\"\nimport {\n\tallocateIntoStore,\n\tclaimWithinStore,\n\tdeallocateFromStore,\n\tfuseWithinStore,\n\tIMPLICIT,\n\tmakeRootMoleculeInStore,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nexport const $claim: unique symbol = Symbol.for(`claim`)\nexport type Claim<K extends Canonical> = K & { [$claim]?: true }\n\nexport class Realm<H extends Hierarchy> {\n\tpublic store: Store\n\t/**\n\t * @param store - The store to which the realm will be attached\n\t */\n\tpublic constructor(store: Store = IMPLICIT.STORE) {\n\t\tthis.store = store\n\t\tmakeRootMoleculeInStore(`root`, store)\n\t}\n\t/**\n\t * Make space for a new subject of the realm\n\t * @param provenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy}\n\t * @param key - A unique identifier for the new subject\n\t * @param attachmentStyle - The attachment style of new subject to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain .\n\t * @returns\n\t * The subject's key, given status as a true {@link Claim}\n\t */\n\tpublic allocate<V extends Vassal<H>, A extends Above<V, H>>(\n\t\tprovenance: A,\n\t\tkey: V,\n\t\tattachmentStyle?: `all` | `any`,\n\t): Claim<V> {\n\t\treturn allocateIntoStore<H, V, A>(\n\t\t\tthis.store,\n\t\t\tprovenance,\n\t\t\tkey,\n\t\t\tattachmentStyle,\n\t\t)\n\t}\n\t/**\n\t * Fuse two reagents into a compound\n\t * @param type - the name of the compound that is being fused\n\t * @param reagentA - the left reagent of the compound\n\t * @param reagentB - the right reagent of the compound\n\t * @returns\n\t * The compound's key, given status as a true {@link Claim}\n\t */\n\tpublic fuse<\n\t\tC extends CompoundFrom<H>,\n\t\tT extends C extends CompoundTypedKey<infer t, any, any> ? t : never,\n\t\tA extends C extends CompoundTypedKey<any, infer v, any> ? v : never,\n\t\tB extends C extends CompoundTypedKey<any, any, infer m> ? m : never,\n\t>(\n\t\ttype: T,\n\t\treagentA: SingularTypedKey<A>,\n\t\treagentB: SingularTypedKey<B>,\n\t): Claim<CompoundTypedKey<T, A, B>> {\n\t\treturn fuseWithinStore<H, C, T, A, B>(this.store, type, reagentA, reagentB)\n\t}\n\t/**\n\t * Remove a subject from the realm\n\t * @param claim - The subject to be deallocated\n\t */\n\tpublic deallocate<V extends Vassal<H>>(claim: Claim<V>): void {\n\t\tdeallocateFromStore<H, V>(this.store, claim)\n\t}\n\t/**\n\t * Transfer a subject of the realm from one owner to another\n\t * @param newProvenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy}\n\t * @param claim - The subject to be claimed\n\t * @param exclusive - Whether the subjects previous owners should be detached from it\n\t * @returns\n\t * The subject's key, given status as a true {@link Claim}\n\t */\n\tpublic claim<\n\t\tV extends Exclude<Vassal<H>, CompoundTypedKey>,\n\t\tA extends Above<V, H>,\n\t>(newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V> {\n\t\treturn claimWithinStore<H, V, A>(this.store, newProvenance, claim, exclusive)\n\t}\n}\n\nexport class Anarchy {\n\tpublic store: Store\n\tpublic realm: Realm<any>\n\n\t/**\n\t * @param store - The store to which the anarchy-realm will be attached\n\t */\n\tpublic constructor(store: Store = IMPLICIT.STORE) {\n\t\tthis.store = store\n\t\tthis.realm = new Realm(store)\n\t}\n\t/**\n\t * Declare a new entity\n\t * @param provenance - A key for an owner of the entity\n\t * @param key - A unique identifier for the new entity\n\t * @param attachmentStyle - The attachment style of new entity to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain .\n\t */\n\tpublic allocate(\n\t\tprovenance: Canonical,\n\t\tkey: Canonical,\n\t\tattachmentStyle?: `all` | `any`,\n\t): void {\n\t\tallocateIntoStore<any, any, any>(\n\t\t\tthis.store,\n\t\t\tprovenance,\n\t\t\tkey,\n\t\t\tattachmentStyle,\n\t\t)\n\t}\n\t/**\n\t * Remove an entity\n\t * @param key - The entity to be deallocated\n\t */\n\tpublic deallocate(key: Canonical): void {\n\t\tdeallocateFromStore<any, any>(this.store, key)\n\t}\n\t/**\n\t * Transfer an entity from one owner to another\n\t * @param newProvenance - A key for an owner of the entity\n\t * @param key - The entity to be claimed\n\t * @param exclusive - Whether the entity's previous owners should be detached from it\n\t */\n\tpublic claim(\n\t\tnewProvenance: Canonical,\n\t\tkey: Canonical,\n\t\texclusive?: `exclusive`,\n\t): void {\n\t\tclaimWithinStore<any, any, any>(this.store, newProvenance, key, exclusive)\n\t}\n}\n\nexport const T$ = `T$`\nexport type T$ = typeof T$\nexport type TypeTag<T extends string> = `${T$}--${T}`\nexport type SingularTypedKey<T extends string = string> = `${T}::${string}`\nexport type CompoundTypedKey<\n\tA extends string = string,\n\tB extends string = string,\n\tC extends string = string,\n> = `${TypeTag<A>}==${SingularTypedKey<B>}++${SingularTypedKey<C>}`\nexport type TypedKey<\n\tA extends string = string,\n\tB extends string = string,\n\tC extends string = string,\n> = CompoundTypedKey<A, B, C> | SingularTypedKey<A>\ntype Scope = SingularTypedKey[]\ntype MutualFealty = {\n\tabove: Scope\n\tbelow: CompoundTypedKey\n}\ntype ExclusiveFealty = {\n\tabove: TypedKey | `root`\n\tbelow: Scope\n}\ntype Fealty = ExclusiveFealty | MutualFealty\n\nexport type Hierarchy<F extends Fealty[] = Fealty[]> = Each<F>\n\nexport type Vassal<H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? H[K][`below`]\n\t\t: H[K] extends { below: Array<infer V> }\n\t\t\t? V extends TypedKey\n\t\t\t\t? V\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Above<TK extends TypedKey, H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`below`]\n\t\t\t? H[K][`above`]\n\t\t\t: never\n\t\t: H[K] extends { below: Array<infer V> }\n\t\t\t? TK extends V\n\t\t\t\t? H[K] extends ExclusiveFealty\n\t\t\t\t\t? H[K][`above`]\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Below<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`above`]\n\t\t\t? H[K][`below`]\n\t\t\t: TK extends H[K][`above`][number]\n\t\t\t\t? H[K][`below`]\n\t\t\t\t: never\n\t\t: H[K] extends { above: infer V }\n\t\t\t? TK extends V\n\t\t\t\t? H[K] extends ExclusiveFealty\n\t\t\t\t\t? H[K][`below`][number]\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Mutuals<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`above`][number]\n\t\t\t? [mutual: Exclude<H[K][`above`][number], TK>, below: H[K][`below`]]\n\t\t\t: never\n\t\t: never\n}[keyof H]\n\nexport type CompoundFrom<H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : never\n}[keyof H]\n","import { IMPLICIT, resetInStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { WritableFamilyToken, WritableToken } from \".\"\n\n/**\n * Set the value of a state into the implicit store back to its default value.\n * @param token - An atom or writable selector token.\n * @overload Default\n * @default\n */\nexport function resetState(token: WritableToken<any>): void\n/**\n * Set the value of a state into the implicit store back to its default value.\n * @param token - An atom family or writable selector family token.\n * @param key - The unique key of the state to set.\n * @overload Streamlined\n */\nexport function resetState<K extends Canonical>(\n\ttoken: WritableFamilyToken<any, K>,\n\tkey: K,\n): void\nexport function resetState(\n\t...params:\n\t\t| [token: WritableFamilyToken<any, Canonical>, key: Canonical]\n\t\t| [token: WritableToken<any>]\n): void {\n\tif (params.length === 2) {\n\t\tresetInStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tresetInStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import {\n\tcreateSelectorFamily,\n\tcreateStandaloneSelector,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type {\n\tReadonlyHeldSelectorFamilyToken,\n\tReadonlyHeldSelectorToken,\n\tReadonlyPureSelectorFamilyToken,\n\tReadonlyPureSelectorToken,\n\tWritableHeldSelectorFamilyToken,\n\tWritableHeldSelectorToken,\n\tWritablePureSelectorFamilyToken,\n\tWritablePureSelectorToken,\n} from \"./tokens\"\nimport type { Read, Write } from \"./transaction\"\n\nexport type WritablePureSelectorOptions<T> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<() => T>\n\t/** For each instantiated selector, a function that sets its value */\n\tset: Write<(newValue: T) => void>\n}\nexport type ReadonlyPureSelectorOptions<T> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<() => T>\n}\nexport type ReadonlyHeldSelectorOptions<T extends object> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a constant reference to a value that will not be replaced */\n\tconst: T\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<(permanent: T) => void>\n}\nexport type WritableHeldSelectorOptions<T extends object> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a constant reference to a value that will not be replaced */\n\tconst: T\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<(permanent: T) => void>\n\t/** For each instantiated selector, a function that sets its value */\n\tset: Write<(newValue: T) => void>\n}\n\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store, and\n * should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A writable selector can be \"set\" to a new value.\n * It is strongly advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link WritableHeldSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload WritableHeld\n */\nexport function selector<T extends object>(\n\toptions: WritableHeldSelectorOptions<T>,\n): WritableHeldSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyHeldSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload ReadonlyHeld\n */\nexport function selector<T extends object>(\n\toptions: ReadonlyHeldSelectorOptions<T>,\n): ReadonlyHeldSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A writable selector can be \"set\" to a new value.\n * It is strongly advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link TransientWritableSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload WritablePure\n */\nexport function selector<T>(\n\toptions: WritablePureSelectorOptions<T>,\n): WritablePureSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyPureSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload ReadonlyPure\n */\nexport function selector<T>(\n\toptions: ReadonlyPureSelectorOptions<T>,\n): ReadonlyPureSelectorToken<T>\nexport function selector(\n\toptions:\n\t\t| ReadonlyHeldSelectorOptions<any>\n\t\t| ReadonlyPureSelectorOptions<any>\n\t\t| WritableHeldSelectorOptions<any>\n\t\t| WritablePureSelectorOptions<any>,\n):\n\t| ReadonlyHeldSelectorToken<any>\n\t| ReadonlyPureSelectorToken<any>\n\t| WritableHeldSelectorToken<any>\n\t| WritablePureSelectorToken<any> {\n\treturn createStandaloneSelector(IMPLICIT.STORE, options)\n}\n\nexport type WritablePureSelectorFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<() => T>\n\t/** For each instantiated family member, a function that sets its value */\n\tset: (key: K) => Write<(newValue: T) => void>\n}\nexport type ReadonlyPureSelectorFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<() => T>\n}\nexport type WritableHeldSelectorFamilyOptions<\n\tT extends object,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a constant reference to a value that will not be replaced */\n\tconst: (key: K) => T\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<(permanent: T) => void>\n\t/** For each instantiated family member, a function that sets its value */\n\tset: (key: K) => Write<(newValue: T) => void>\n}\nexport type ReadonlyHeldSelectorFamilyOptions<\n\tT extends object,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a constant reference to a value that will not be replaced */\n\tconst: (key: K) => T\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<(permanent: T) => void>\n}\n\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a held selector should depend on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A writable selector can be \"set\" to a new value.\n * It is advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link WritableHeldSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link WritableHeldSelectorFamilyToken}\n * @overload WritableHeld\n */\nexport function selectorFamily<T extends object, K extends Canonical>(\n\toptions: WritableHeldSelectorFamilyOptions<T, K>,\n): WritableHeldSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a held selector should depend on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyHeldSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link ReadonlyHeldSelectorFamilyToken}\n * @overload ReadonlyHeld\n */\nexport function selectorFamily<T extends object, K extends Canonical>(\n\toptions: ReadonlyHeldSelectorFamilyOptions<T, K>,\n): ReadonlyHeldSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a selector should depend on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A writable selector can be \"set\" to a new value.\n * It is advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link TransientWritableSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link TransientWritableSelectorFamilyToken}\n * @overload WritablePure\n */\nexport function selectorFamily<T, K extends Canonical>(\n\toptions: WritablePureSelectorFamilyOptions<T, K>,\n): WritablePureSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a selector should depend on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyPureSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link ReadonlyPureSelectorFamilyToken}\n * @overload ReadonlyPure\n */\nexport function selectorFamily<T, K extends Canonical>(\n\toptions: ReadonlyPureSelectorFamilyOptions<T, K>,\n): ReadonlyPureSelectorFamilyToken<T, K>\nexport function selectorFamily(\n\toptions:\n\t\t| ReadonlyHeldSelectorFamilyOptions<any, any>\n\t\t| ReadonlyPureSelectorFamilyOptions<any, any>\n\t\t| WritableHeldSelectorFamilyOptions<any, any>\n\t\t| WritablePureSelectorFamilyOptions<any, any>,\n):\n\t| ReadonlyHeldSelectorFamilyToken<any, any>\n\t| ReadonlyPureSelectorFamilyToken<any, any>\n\t| WritableHeldSelectorFamilyToken<any, any>\n\t| WritablePureSelectorFamilyToken<any, any> {\n\treturn createSelectorFamily(IMPLICIT.STORE, options)\n}\n","import { IMPLICIT, setIntoStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { WritableFamilyToken, WritableToken } from \"./tokens\"\n\n/**\n * A function that sets the value of a state.\n * @param oldValue - The current value of the state.\n * @returns\n * The new value of the state.\n */\nexport type Setter<T, New extends T> = (oldValue: T) => New\n\n/**\n * Set the value of a state into the implicit store.\n * @param token - An atom or writable selector token.\n * @param value - The new value of the state.\n * @overload Default\n * @default\n */\nexport function setState<T, New extends T>(\n\ttoken: WritableToken<T>,\n\tvalue: New | Setter<T, New>,\n): void\n\n/**\n * Set the value of a state into the implicit store.\n * @param token - An atom family or writable selector family token.\n * @param key - The unique key of the state to set.\n * @param value - The new value of the state.\n * @overload Streamlined\n */\nexport function setState<T, K extends Canonical, New extends T, Key extends K>(\n\ttoken: WritableFamilyToken<T, K>,\n\tkey: Key,\n\tvalue: New | Setter<T, New>,\n): void\nexport function setState<T, New extends T>(\n\t...params:\n\t\t| [\n\t\t\t\ttoken: WritableFamilyToken<T, Canonical>,\n\t\t\t\tkey: Canonical,\n\t\t\t\tvalue: New | Setter<T, New>,\n\t\t ]\n\t\t| [token: WritableToken<T>, value: New | Setter<T, New>]\n): void {\n\tif (params.length === 2) {\n\t\tsetIntoStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tsetIntoStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import type { findState } from \"atom.io\"\nimport {\n\tactUponStore,\n\tarbitrary,\n\tcreateMutableAtom,\n\tcreateMutableAtomFamily,\n\tcreateRegularAtom,\n\tcreateRegularAtomFamily,\n\tcreateSelectorFamily,\n\tcreateStandaloneSelector,\n\tcreateTimeline,\n\tcreateTransaction,\n\tdisposeFromStore,\n\tfindInStore,\n\tgetFromStore,\n\tIMPLICIT,\n\tinstallIntoStore,\n\tresetInStore,\n\tsetIntoStore,\n\tStore,\n\tsubscribeInStore,\n\ttimeTravel,\n} from \"atom.io/internal\"\n\nimport type {\n\tAtomIOToken,\n\tdisposeState,\n\tgetState,\n\tredo,\n\tsetState,\n\tsubscribe,\n\ttimeline,\n\tundo,\n} from \".\"\nimport type { atom, atomFamily, mutableAtom, mutableAtomFamily } from \"./atom\"\nimport type { resetState } from \"./reset-state\"\nimport type { selector, selectorFamily } from \"./selector\"\nimport type { runTransaction, transaction } from \"./transaction\"\n\nexport class Silo {\n\tpublic store: Store\n\tpublic atom: typeof atom\n\tpublic mutableAtom: typeof mutableAtom\n\tpublic atomFamily: typeof atomFamily\n\tpublic mutableAtomFamily: typeof mutableAtomFamily\n\tpublic selector: typeof selector\n\tpublic selectorFamily: typeof selectorFamily\n\tpublic transaction: typeof transaction\n\tpublic timeline: typeof timeline\n\tpublic findState: typeof findState\n\tpublic getState: typeof getState\n\tpublic setState: typeof setState\n\tpublic resetState: typeof resetState\n\tpublic disposeState: typeof disposeState\n\tpublic subscribe: typeof subscribe\n\tpublic undo: typeof undo\n\tpublic redo: typeof redo\n\tpublic runTransaction: typeof runTransaction\n\tpublic install: (tokens: AtomIOToken[], store?: Store) => void\n\n\tpublic constructor(config: Store[`config`], fromStore: Store | null = null) {\n\t\tconst s = (this.store = new Store(config, fromStore))\n\t\tthis.atom = ((options: Parameters<typeof atom>[0]) =>\n\t\t\tcreateRegularAtom(s, options, undefined)) as typeof atom\n\t\tthis.mutableAtom = ((options: Parameters<typeof mutableAtom>[0]) =>\n\t\t\tcreateMutableAtom(s, options, undefined)) as typeof mutableAtom\n\t\tthis.atomFamily = ((options: Parameters<typeof atomFamily>[0]) =>\n\t\t\tcreateRegularAtomFamily(s, options)) as typeof atomFamily\n\t\tthis.mutableAtomFamily = ((\n\t\t\toptions: Parameters<typeof mutableAtomFamily>[0],\n\t\t) => createMutableAtomFamily(s, options)) as typeof mutableAtomFamily\n\t\tthis.selector = ((options: Parameters<typeof selector>[0]) =>\n\t\t\tcreateStandaloneSelector(s, options)) as typeof selector\n\t\tthis.selectorFamily = ((options: Parameters<typeof selectorFamily>[0]) =>\n\t\t\tcreateSelectorFamily(s, options)) as typeof selectorFamily\n\t\tthis.transaction = (options) => createTransaction(s, options)\n\t\tthis.timeline = (options) => createTimeline(s, options)\n\t\tthis.findState = ((...params: Parameters<typeof findState>) =>\n\t\t\tfindInStore(s, ...params)) as typeof findState\n\t\tthis.getState = ((...params: Parameters<typeof getState>) =>\n\t\t\tgetFromStore(s, ...params)) as typeof getState\n\t\tthis.setState = ((...params: Parameters<typeof setState>) => {\n\t\t\tsetIntoStore(s, ...params)\n\t\t}) as typeof setState\n\t\tthis.resetState = ((...params: Parameters<typeof resetState>) => {\n\t\t\tresetInStore(s, ...params)\n\t\t}) as typeof resetState\n\t\tthis.disposeState = ((...params: Parameters<typeof disposeState>) => {\n\t\t\tdisposeFromStore(s, ...params)\n\t\t}) as typeof disposeState\n\t\tthis.subscribe = ((...params: Parameters<typeof subscribe>) =>\n\t\t\tsubscribeInStore(s, ...params)) as typeof subscribe\n\t\tthis.undo = (token) => {\n\t\t\ttimeTravel(s, `undo`, token)\n\t\t}\n\t\tthis.redo = (token) => {\n\t\t\ttimeTravel(s, `redo`, token)\n\t\t}\n\t\tthis.runTransaction = (token, id = arbitrary()) => actUponStore(s, token, id)\n\t\tthis.install = (tokens, source = IMPLICIT.STORE) => {\n\t\t\tinstallIntoStore(tokens, s, source)\n\t\t}\n\t}\n}\n","import type { Fn } from \"atom.io/internal\"\nimport { arbitrary, IMPLICIT, subscribeInStore } from \"atom.io/internal\"\n\nimport type {\n\tStateUpdate,\n\tTimelineEvent,\n\tTransactionOutcomeEvent,\n} from \"./events\"\nimport type { TimelineManageable } from \"./timeline\"\nimport type { ReadableToken, TimelineToken, TransactionToken } from \"./tokens\"\n\nexport type UpdateHandler<T> = (update: StateUpdate<T>) => void\nexport type TransactionUpdateHandler<F extends Fn> = (\n\tdata: TransactionOutcomeEvent<TransactionToken<F>>,\n) => void\n\n/**\n * Subscribe to a state in the implicit store\n * @param token - The token of the state to subscribe to\n * @param handleUpdate - A function that will be called when the state is updated\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the state\n * @overload State\n */\nexport function subscribe<T>(\n\ttoken: ReadableToken<T>,\n\thandleUpdate: UpdateHandler<T>,\n\tkey?: string,\n): () => void\n/**\n * Subscribe to a transaction in the implicit store\n * @param token - The token of the transaction to subscribe to\n * @param handleUpdate - A function that will be called when the transaction succeeds\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the transaction\n * @overload Transaction\n */\nexport function subscribe<F extends Fn>(\n\ttoken: TransactionToken<F>,\n\thandleUpdate: TransactionUpdateHandler<F>,\n\tkey?: string,\n): () => void\n/**\n * Subscribe to a timeline in the implicit store\n * @param token - The token of the timeline to subscribe to\n * @param handleUpdate - A function that will be called when a new update is available\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the timeline\n * @overload Timeline\n */\nexport function subscribe<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n\thandleUpdate: (update: TimelineEvent<M> | `redo` | `undo`) => void,\n\tkey?: string,\n): () => void\nexport function subscribe(\n\ttoken: ReadableToken<any> | TimelineToken<any> | TransactionToken<any>,\n\thandleUpdate: (update: any) => void,\n\tkey: string = arbitrary(),\n): () => void {\n\treturn subscribeInStore(IMPLICIT.STORE, token, handleUpdate, key)\n}\n","import type { Timeline } from \"atom.io/internal\"\nimport { createTimeline, IMPLICIT, timeTravel } from \"atom.io/internal\"\n\nimport type { AtomFamilyToken, AtomToken, TimelineEvent, TimelineToken } from \".\"\n\nexport type TimelineManageable = AtomFamilyToken<any, any> | AtomToken<any>\nexport type AtomOnly<M extends TimelineManageable> = M extends AtomFamilyToken<\n\tany,\n\tany\n>\n\t? AtomToken<any>\n\t: M extends AtomToken<any>\n\t\t? M\n\t\t: never\n\n/**\n * If there is an update ahead of the cursor (in the future of this {@link timeline}), apply it and move the cursor to the next update\n * @param timeline - A {@link TimelineToken}\n */\nexport const redo = (timeline: TimelineToken<any>): void => {\n\ttimeTravel(IMPLICIT.STORE, `redo`, timeline)\n}\n/**\n * Reverse the last update on the {@link timeline} and move the cursor to the previous update\n * @param timeline - A {@link TimelineToken}\n */\nexport const undo = (timeline: TimelineToken<any>): void => {\n\ttimeTravel(IMPLICIT.STORE, `undo`, timeline)\n}\n\nexport type TimelineOptions<ManagedAtom extends TimelineManageable> = {\n\t/** The unique identifier of the timeline */\n\tkey: string\n\t/** The managed atoms (and families of atoms) to record */\n\tscope: ManagedAtom[]\n\t/** A function that determines whether a given update should be recorded */\n\tshouldCapture?: (\n\t\tupdate: TimelineEvent<ManagedAtom>,\n\t\ttimeline: Timeline<TimelineManageable>,\n\t) => boolean\n}\n\n/**\n * Create a timeline, a mechanism for recording, undoing, and replaying changes to groups of atoms\n * @param options - {@link TimelineOptions}\n * @returns A reference to the timeline created: a {@link TimelineToken}\n */\nexport const timeline = <ManagedAtom extends TimelineManageable>(\n\toptions: TimelineOptions<ManagedAtom>,\n): TimelineToken<ManagedAtom> => {\n\treturn createTimeline(IMPLICIT.STORE, options)\n}\n","import type { AsJSON, EnvironmentData, Fn, Transceiver } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tarbitrary,\n\tcreateTransaction,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nimport type { disposeState } from \"./dispose-state\"\nimport type { findState } from \"./find-state\"\nimport type { getState } from \"./get-state\"\nimport type { resetState } from \"./reset-state\"\nimport type { setState } from \"./set-state\"\nimport type {\n\tMutableAtomToken,\n\tTransactionToken,\n\tWritablePureSelectorToken,\n} from \"./tokens\"\n\nexport type ReaderToolkit = Pick<ActorToolkit, `find` | `get` | `json`>\nexport type WriterToolkit = Pick<ActorToolkit, `find` | `get` | `json` | `set`>\nexport type ActorToolkit = Readonly<{\n\tget: typeof getState\n\tset: typeof setState\n\treset: typeof resetState\n\tfind: typeof findState\n\tjson: <T extends Transceiver<any, any, any>>(\n\t\tstate: MutableAtomToken<T>,\n\t) => WritablePureSelectorToken<AsJSON<T>>\n\tdispose: typeof disposeState\n\trun: typeof runTransaction\n\tenv: () => EnvironmentData\n}>\n\nexport type Read<F extends Fn> = (\n\ttoolkit: ReaderToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type Write<F extends Fn> = (\n\ttoolkit: WriterToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type Transact<F extends Fn> = (\n\ttoolkit: ActorToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type TransactionIO<Token extends TransactionToken<any>> =\n\tToken extends TransactionToken<infer F> ? F : never\nexport type TransactionOptions<F extends Fn> = {\n\t/** The unique identifier of the transaction */\n\tkey: string\n\t/** The operation to perform */\n\tdo: Transact<F>\n}\n\n/**\n * Create a transaction, a mechanism for batching updates multiple states in a single, all-or-nothing operation\n * @param options - {@link TransactionOptions}\n * @returns A reference to the transaction created: a {@link TransactionToken}\n */\nexport function transaction<F extends Fn>(\n\toptions: TransactionOptions<F>,\n): TransactionToken<F> {\n\treturn createTransaction(IMPLICIT.STORE, options)\n}\n\n/**\n * Execute a {@link transaction}\n * @param token - A {@link TransactionToken}\n * @param id - A unique identifier for the transaction. If not provided, a random identifier will be generated\n * @returns A function that can be called to run the transaction with its {@link TransactionIO} parameters\n */\nexport function runTransaction<F extends Fn>(\n\ttoken: TransactionToken<F>,\n\tid: string = arbitrary(),\n): (...parameters: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(IMPLICIT.STORE, token, id)\n}\n","import type {\n\tMutableAtomFamilyToken,\n\tMutableAtomToken,\n\tReadableFamilyToken,\n\tReadableToken,\n\tReadonlyPureSelectorFamilyToken,\n\tReadonlyPureSelectorToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tTransactionToken,\n\tWritableFamilyToken,\n\tWritablePureSelectorFamilyToken,\n\tWritablePureSelectorToken,\n\tWritableToken,\n} from \"./tokens\"\n\nexport type TokenType<\n\tComparison extends\n\t\t| ReadableFamilyToken<any, any>\n\t\t| ReadableToken<any>\n\t\t| TransactionToken<any>,\n> = Comparison extends ReadableToken<infer RepresentedValue>\n\t? RepresentedValue\n\t: Comparison extends ReadableFamilyToken<infer RepresentedValue, any>\n\t\t? RepresentedValue\n\t\t: Comparison extends TransactionToken<infer Fn>\n\t\t\t? Fn\n\t\t\t: never\n\nexport function isToken<KnownToken extends RegularAtomToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is RegularAtomToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends MutableAtomToken<any, any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is MutableAtomToken<TokenType<KnownToken>, any>\nexport function isToken<KnownToken extends WritablePureSelectorToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritablePureSelectorToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadonlyPureSelectorToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadonlyPureSelectorToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends WritableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritableToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<KnownToken>> {\n\treturn knownToken.key === unknownToken.key\n}\n\nexport function belongsTo<Family extends RegularAtomFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is RegularAtomToken<TokenType<Family>>\nexport function belongsTo<Family extends MutableAtomFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is MutableAtomToken<TokenType<Family>, any>\nexport function belongsTo<\n\tFamily extends WritablePureSelectorFamilyToken<any, any>,\n>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritablePureSelectorToken<TokenType<Family>>\nexport function belongsTo<\n\tFamily extends ReadonlyPureSelectorFamilyToken<any, any>,\n>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadonlyPureSelectorToken<TokenType<Family>>\nexport function belongsTo<Family extends WritableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritableToken<TokenType<Family>>\nexport function belongsTo<Family extends ReadableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<Family>>\nexport function belongsTo<Family extends ReadableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<Family>> {\n\treturn family.key === unknownToken.family?.key\n}\n"],"mappings":";;;;;;;;;AAiCA,SAAgB,KAAQ,SAAqD;AAC5E,QAAO,kBAAkB,SAAS,OAAO,SAAS;AAClD;;;;;;;;;;AAmBD,SAAgB,YACf,SACsB;AACtB,QAAO,kBAAkB,SAAS,OAAO,SAAS;AAClD;;;;;;;AAqCD,SAAgB,WACf,SAC+B;AAC/B,QAAO,wBAAwB,SAAS,OAAO;AAC/C;;;;;;;;;;AAsBD,SAAgB,kBAGd,SA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S,OAAO;AACzC;;;;;;;AAQD,SAAgB,eACf,OACA,KAAa,aACqC;AAClD,QAAO,aAAa,SAAS,OAAO,OAAO;AAC3C;;;;ACxBD,SAAgB,QACf,YACA,cACuD;AACvD,QAAO,WAAW,QAAQ,aAAa;AACvC;AA8BD,SAAgB,UACf,QACA,cACmD;AACnD,QAAO,OAAO,QAAQ,aAAa,QAAQ;AAC3C"}
1
+ {"version":3,"file":"index.js","names":["PRETTY_TOKEN_TYPES: Record<TokenDenomination, string>","simpleLogger: Logger","$claim: unique symbol","timeline"],"sources":["../../src/main/atom.ts","../../src/main/dispose-state.ts","../../src/main/find-state.ts","../../src/main/get-state.ts","../../src/main/join.ts","../../src/main/logger.ts","../../src/main/realm.ts","../../src/main/reset-state.ts","../../src/main/selector.ts","../../src/main/set-state.ts","../../src/main/silo.ts","../../src/main/subscribe.ts","../../src/main/timeline.ts","../../src/main/transaction.ts","../../src/main/validators.ts"],"sourcesContent":["import type { ConstructorOf, Transceiver } from \"atom.io/internal\"\nimport {\n\tcreateMutableAtom,\n\tcreateMutableAtomFamily,\n\tcreateRegularAtom,\n\tcreateRegularAtomFamily,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { StateUpdate } from \"./events\"\nimport type { Setter } from \"./set-state\"\nimport type {\n\tMutableAtomFamilyToken,\n\tMutableAtomToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n} from \"./tokens\"\n\nexport type RegularAtomOptions<T> = {\n\t/** The unique identifier of the atom */\n\tkey: string\n\t/** The starting value of the atom */\n\tdefault: T | (() => T)\n\t/** Hooks used to run side effects when the atom is set */\n\teffects?: AtomEffect<T>[]\n}\n/**\n * Create a regular atom, a global reactive variable in the implicit store\n * @param options - {@link RegularAtomOptions}.\n * @returns\n * A reference to the atom created: a {@link RegularAtomToken}\n */\nexport function atom<T>(options: RegularAtomOptions<T>): RegularAtomToken<T> {\n\treturn createRegularAtom(IMPLICIT.STORE, options, undefined)\n}\n\nexport type MutableAtomOptions<T extends Transceiver<any, any, any>> = {\n\t/** The unique identifier of the atom */\n\tkey: string\n\t/** A constructor for the atom's value */\n\tclass: ConstructorOf<T>\n\t/** Hooks used to run side effects when the atom is set */\n\teffects?: AtomEffect<T>[]\n}\n/**\n * Create a mutable atom, a global reactive variable in the implicit store\n *\n * The value of a mutable atom must be some kind of {@link Transceiver}.\n *\n * @param options - {@link MutableAtomOptions}.\n * @returns\n * A reference to the atom created: a {@link MutableAtomToken}\n */\nexport function mutableAtom<T extends Transceiver<any, any, any>>(\n\toptions: MutableAtomOptions<T>,\n): MutableAtomToken<T> {\n\treturn createMutableAtom(IMPLICIT.STORE, options, undefined)\n}\n\n/**\n * A function that runs side effects when the atom is set\n * @param tools - {@link Effectors} that can be used to run side effects\n * @returns\n * Optionally, a cleanup function that will be called when the atom is disposed\n */\nexport type AtomEffect<T> = (tools: Effectors<T>) => (() => void) | void\nexport type Effectors<T> = {\n\t/**\n\t * Reset the value of the atom to its default\n\t */\n\tresetSelf: () => void\n\t/**\n\t * Set the value of the atom\n\t * @param next - The new value of the atom, or a setter function\n\t */\n\tsetSelf: <New extends T>(next: New | Setter<T, New>) => void\n\t/** Subscribe to changes to the atom */\n\tonSet: (callback: (options: StateUpdate<T>) => void) => void\n}\n\nexport type RegularAtomFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the atom family */\n\tkey: string\n\t/** The starting value of the atom family */\n\tdefault: T | ((key: K) => T)\n\t/** Hooks used to run side effects when an atom in the family is set */\n\teffects?: (key: K) => AtomEffect<T>[]\n}\n/**\n * Create a family of regular atoms, allowing for the dynamic creation and disposal of atoms.\n * @param options - {@link RegularAtomFamilyOptions}\n * @returns\n * A reference to the atom family created: a {@link RegularAtomFamilyToken}\n */\nexport function atomFamily<T, K extends Canonical>(\n\toptions: RegularAtomFamilyOptions<T, K>,\n): RegularAtomFamilyToken<T, K> {\n\treturn createRegularAtomFamily(IMPLICIT.STORE, options)\n}\n\nexport type MutableAtomFamilyOptions<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the atom family */\n\tkey: string\n\t/** The class of the transceiver to be created */\n\tclass: ConstructorOf<T>\n\t/** Hooks used to run side effects when an atom in the family is set */\n\teffects?: (key: K) => AtomEffect<T>[]\n}\n/**\n * Create a family of mutable atoms, allowing for the dynamic creation and disposal of atoms.\n *\n * The value of a mutable atom must be some kind of {@link Transceiver}.\n *\n * @param options - {@link MutableAtomFamilyOptions}\n * @returns\n * A reference to the atom family created: a {@link MutableAtomFamilyToken}\n */\nexport function mutableAtomFamily<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n>(options: MutableAtomFamilyOptions<T, K>): MutableAtomFamilyToken<T, K> {\n\treturn createMutableAtomFamily(IMPLICIT.STORE, options)\n}\n","import { disposeFromStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { ReadableFamilyToken, ReadableToken } from \".\"\n\n/**\n * Disposes of a state in the implicit store.\n *\n * Only family members can be disposed of.\n *\n * @param token - The token of the state to dispose\n * @overload Default\n */\nexport function disposeState(token: ReadableToken<any>): void\n/**\n * Disposes of a state in the implicit store.\n *\n * Only family members can be disposed of.\n *\n * @param token - The token of the state family to dispose\n * @param key - The unique key of the state to dispose\n * @overload Streamlined\n */\nexport function disposeState<K extends Canonical>(\n\ttoken: ReadableFamilyToken<any, K>,\n\tkey: K,\n): void\nexport function disposeState(\n\t...params:\n\t\t| [token: ReadableFamilyToken<any, any>, key: Canonical]\n\t\t| [token: ReadableToken<any>]\n): void {\n\tif (params.length === 2) {\n\t\tdisposeFromStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tdisposeFromStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import type {\n\tMutableAtomToken,\n\tReadableFamilyToken,\n\tReadableToken,\n\tReadonlySelectorFamilyToken,\n\tReadonlySelectorToken,\n\tRegularAtomToken,\n\tWritableFamilyToken,\n\tWritableSelectorFamilyToken,\n\tWritableSelectorToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Transceiver } from \"atom.io/internal\"\nimport { findInStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { MutableAtomFamilyToken, RegularAtomFamilyToken } from \"./tokens\"\n\n/**\n * Finds a {@link MutableAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" atom token will be returned in this case and a warning will be logged.\n *\n * @param token - A {@link MutableAtomFamilyToken}\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Mutable Atom\n */\nexport function findState<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n\tKey extends K,\n>(token: MutableAtomFamilyToken<T, K>, key: Key): MutableAtomToken<T, K>\n/**\n * Finds a {@link RegularAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" atom token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Regular Atom\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: RegularAtomFamilyToken<T, K>,\n\tkey: Key,\n): RegularAtomToken<T, K>\n/**\n * Finds a {@link WritableSelectorToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" selector token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Writable Selector\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: WritableSelectorFamilyToken<T, K>,\n\tkey: Key,\n): WritableSelectorToken<T, K>\n/**\n * Finds a {@link ReadonlySelectorToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" selector token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Readonly Selector\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadonlySelectorFamilyToken<T, K>,\n\tkey: Key,\n): ReadonlySelectorToken<T, K>\n/**\n * Finds a {@link WritableToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom or selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" token will be returned in this case and a warning will be logged.\n *\n * @param token - The token of the state family\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Writable State\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: WritableFamilyToken<T, K>,\n\tkey: Key,\n): WritableToken<T, K>\n/**\n * Finds a {@link MutableAtomToken} in the store, without accessing its value.\n *\n * In an ephemeral store, this will create a new atom or selector if one does not exist with the given key.\n *\n * In an immortal store, a \"counterfeit\" token will be returned in this case and a warning will be logged.\n *\n * @param token - A {@link ReadableFamilyToken}\n * @param key - The key of the state\n * @returns\n * The current value of the state\n * @overload Unknown\n * @default\n */\nexport function findState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadableFamilyToken<T, K>,\n\tkey: Key,\n): ReadableToken<T, K>\n\nexport function findState(\n\ttoken: ReadableFamilyToken<any, any>,\n\tkey: Canonical,\n): ReadableToken<any> {\n\tconst state = findInStore(IMPLICIT.STORE, token, key)\n\treturn state\n}\n","import type { ViewOf } from \"atom.io\"\nimport { getFromStore, IMPLICIT } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { ReadableFamilyToken, ReadableToken } from \".\"\n\n/**\n * Read or compute the current value of a state\n * @param token - The token of the state to get\n * @return The current value of the state\n * @overload Default\n * @default\n */\nexport function getState<T>(token: ReadableToken<T>): ViewOf<T>\n\n/**\n * Read or compute the current value of a state\n * @param token - The token of a state family\n * @param key - The unique key of the state to get\n * @return The current value of the state\n * @overload Streamlined\n */\nexport function getState<T, K extends Canonical, Key extends K>(\n\ttoken: ReadableFamilyToken<T, K>,\n\tkey: Key,\n): ViewOf<T>\n\nexport function getState(\n\t...params:\n\t\t| [token: ReadableFamilyToken<any, any>, key: Canonical]\n\t\t| [token: ReadableToken<any>]\n): any {\n\tif (params.length === 2) {\n\t\treturn getFromStore(IMPLICIT.STORE, ...params)\n\t}\n\treturn getFromStore(IMPLICIT.STORE, ...params)\n}\n","import type { MutableAtomFamilyToken, ReadonlyPureSelectorToken } from \"atom.io\"\nimport type {\n\tFlat,\n\tJunction,\n\tJunctionEntriesBase,\n\tJunctionSchemaBase,\n\tRefinement,\n} from \"atom.io/internal\"\nimport {\n\tcreateJoin,\n\teditRelationsInStore,\n\tfindRelationsInStore,\n\tgetInternalRelationsFromStore,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport type { SetRTX } from \"atom.io/transceivers/set-rtx\"\n\n// biome-ignore format: intersection\nexport type JoinOptions<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n> =\n\tFlat<\n\t\t& JunctionSchemaBase<ASide, BSide>\n\t\t& {\n\t\t\t/** Unique identifier of the join */\n\t\t\treadonly key: string\n\t\t\t/** How many relations are allowed in each direction? */\n\t\t\treadonly cardinality: Cardinality\n\t\t\t/** Type guard for the type of the left side */\n\t\t\treadonly isAType: Refinement<string, AType>\n\t\t\t/** Type guard for the type of the right side */\n\t\t\treadonly isBType: Refinement<string, BType>\n\t\t}\n\t> & Partial<JunctionEntriesBase<AType, BType, Content>>\n\nexport type JoinToken<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null = null,\n> = {\n\t/** Unique identifier of the join */\n\tkey: string\n\t/** Discriminator */\n\ttype: `join`\n\t/** How many relations are allowed in each direction? */\n\tcardinality: Cardinality\n\t/** Name of the join's left side */\n\ta: ASide\n\t/** Name of the join's right side */\n\tb: BSide\n\t/** Never present. This is a marker that preserves the type of the left side's keys */\n\t__aType?: AType\n\t/** Never present. This is a marker that preserves the type of the right side's keys */\n\t__bType?: BType\n\t/** Never present. This is a marker that preserves the type of the data present for each relation */\n\t__content?: Content\n}\n\n/**\n * Create a join, an interface for managing relations between two sets of keys.\n *\n * Use joins when it is important to view relationships from either side.\n *\n * Under the hood, joins coordinate changes of multiple atoms to support that the desired relationships stay consistent.\n *\n * @param options - {@link JoinOptions}\n * @param defaultContent - (undefined)\n * @returns\n * A reference to the join created: a {@link JoinToken}\n * @overload No Content\n */\nexport function join<\n\tconst ASide extends string,\n\tconst AType extends string,\n\tconst BSide extends string,\n\tconst BType extends string,\n\tconst Cardinality extends `1:1` | `1:n` | `n:n`,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, null>,\n\tdefaultContent?: undefined,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, null>\n/**\n * Create a join, an interface for managing relations between two sets of keys.\n *\n * Use joins when it is important to view relationships from either side.\n *\n * Under the hood, joins coordinate changes of multiple atoms to support that the desired relationships stay consistent.\n *\n * @param options - {@link JoinOptions}\n * @param defaultContent - The default value for the content of each relation\n * @returns\n * A reference to the join created: a {@link JoinToken}\n * @overload With Content\n */\nexport function join<\n\tconst ASide extends string,\n\tconst AType extends string,\n\tconst BSide extends string,\n\tconst BType extends string,\n\tconst Cardinality extends `1:1` | `1:n` | `n:n`,\n\tconst Content extends Json.Object,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>,\n\tdefaultContent: Content,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, Content>\nexport function join<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object,\n>(\n\toptions: JoinOptions<ASide, AType, BSide, BType, Cardinality, Content>,\n\tdefaultContent: Content | undefined,\n): JoinToken<ASide, AType, BSide, BType, Cardinality, Content> {\n\treturn createJoin(IMPLICIT.STORE, options, defaultContent)\n}\n\nexport type JoinStates<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n> = Cardinality extends `1:1`\n\t? (Content extends Json.Object\n\t\t\t? {\n\t\t\t\t\treadonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t[AType, Content] | null,\n\t\t\t\t\t\tBType\n\t\t\t\t\t>\n\t\t\t\t} & {\n\t\t\t\t\treadonly [B in BSide as `${B}EntryOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t[BType, Content] | null,\n\t\t\t\t\t\tAType\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t: {}) & {\n\t\t\treadonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\tAType | null,\n\t\t\t\tBType\n\t\t\t>\n\t\t} & {\n\t\t\treadonly [B in BSide as `${B}KeyOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\tBType | null,\n\t\t\t\tAType\n\t\t\t>\n\t\t}\n\t: Cardinality extends `1:n`\n\t\t? (Content extends Json.Object\n\t\t\t\t? {\n\t\t\t\t\t\treadonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t[AType, Content] | null,\n\t\t\t\t\t\t\tBType\n\t\t\t\t\t\t>\n\t\t\t\t\t} & {\n\t\t\t\t\t\treadonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t[BType, Content][],\n\t\t\t\t\t\t\tAType\n\t\t\t\t\t\t>\n\t\t\t\t\t}\n\t\t\t\t: {}) & {\n\t\t\t\treadonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\tAType | null,\n\t\t\t\t\tBType\n\t\t\t\t>\n\t\t\t} & {\n\t\t\t\treadonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\tBType[],\n\t\t\t\t\tAType\n\t\t\t\t>\n\t\t\t}\n\t\t: Cardinality extends `n:n`\n\t\t\t? (Content extends Json.Object\n\t\t\t\t\t? {\n\t\t\t\t\t\t\treadonly [A in ASide as `${A}EntriesOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t\t[AType, Content][],\n\t\t\t\t\t\t\t\tBType\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t} & {\n\t\t\t\t\t\t\treadonly [B in BSide as `${B}EntriesOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\t\t\t[BType, Content][],\n\t\t\t\t\t\t\t\tAType\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}) & {\n\t\t\t\t\treadonly [A in ASide as `${A}KeysOf${Capitalize<BSide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\tAType[],\n\t\t\t\t\t\tBType\n\t\t\t\t\t>\n\t\t\t\t} & {\n\t\t\t\t\treadonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlyPureSelectorToken<\n\t\t\t\t\t\tBType[],\n\t\t\t\t\t\tAType\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t: never\n\n/**\n * Find the current value of a relation owned by a {@link join}\n * @param token - The token of the join\n * @param key - The key of the relation to find\n * @returns\n * A {@link JoinStates} interface to access the relation\n * @overload Default\n */\nexport function findRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n\tkey: AType | BType,\n): JoinStates<ASide, AType, BSide, BType, Cardinality, Content> {\n\treturn findRelationsInStore(token, key, IMPLICIT.STORE)\n}\n\n/**\n * Change one or multiple relations owned by a {@link join}\n * @param token - The token of the join\n * @param change - A function that takes a {@link Junction} interface to edit the relations\n */\nexport function editRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n\tchange: (relations: Junction<ASide, AType, BSide, BType, Content>) => void,\n): void {\n\teditRelationsInStore(token, change, IMPLICIT.STORE)\n}\n\n/**\n * @param token - The token of the join\n * @returns\n * A {@link MutableAtomFamilyToken} to access the internal relations\n */\nexport function getInternalRelations<\n\tASide extends string,\n\tAType extends string,\n\tBSide extends string,\n\tBType extends string,\n\tCardinality extends `1:1` | `1:n` | `n:n`,\n\tContent extends Json.Object | null,\n>(\n\ttoken: JoinToken<ASide, AType, BSide, BType, Cardinality, Content>,\n): MutableAtomFamilyToken<SetRTX<string>, string> {\n\treturn getInternalRelationsFromStore(token, IMPLICIT.STORE)\n}\n","const LOGGER_ICON_DICTIONARY = {\n\t// Lifecycle\n\t\"๐Ÿ”จ\": `Create state`,\n\t\"๐Ÿ› ๏ธ\": `Install state into store`,\n\t// Families\n\t\"๐Ÿ‘ช\": `Family member added`,\n\t\"๐Ÿ”ฅ\": `Family member deleted`,\n\t// Cache\n\t\"๐Ÿ“ƒ\": `Copy mutable`,\n\t\"๐Ÿ“–\": `Read from cache`,\n\t\"๐Ÿ“\": `Write to cache`,\n\t\"โ”\": `Cache miss`,\n\t\"โœจ\": `Value derived`,\n\t\"โญ\": `Value set`,\n\t// Operations\n\t\"โญ•\": `Operation start`,\n\t\"๐Ÿ”ด\": `Operation complete`,\n\t\"๐Ÿšซ\": `Operation blocked`,\n\t\"๐ŸŸข\": `Operation unblocked`,\n\t// Selectors\n\t\"๐Ÿ—‘\": `Evict cached value`,\n\t\"๐Ÿงน\": `Prepare to evict`,\n\t\"๐Ÿงฎ\": `Computing selector`,\n\t\"๐Ÿ”Œ\": `Register direct dependency`,\n\t\"๐Ÿ”\": `Discover root`,\n\t// Transactions\n\t\"๐Ÿ“\": `Stow update`,\n\t\"๐Ÿ›ซ\": `Begin transaction`,\n\t\"๐Ÿ›„\": `Apply transaction`,\n\t\"๐Ÿ›ฌ\": `Complete transaction`,\n\t\"๐Ÿ’ฅ\": `Transaction caught error`,\n\t\"๐Ÿช‚\": `Abort transaction`,\n\t// Timelines\n\t\"โŒ›\": `Timeline event fully captured`,\n\t\"โฉ\": `Timeline redo`,\n\t\"โช\": `Timeline undo`,\n\t\"โญ๏ธ\": `Transaction redo`,\n\t\"โฎ๏ธ\": `Transaction undo`,\n\t\"โณ\": `Timeline event partially captured`,\n\t\"โน๏ธ\": `Time-travel complete`,\n\t// Problems\n\t\"๐Ÿ’ฃ\": `Dangerous action likely to cause bad errors down the line`,\n\t\"โ—\": `Dangerous action unless in development mode`,\n\t\"โŒ\": `Conflict prevents attempted action`,\n\t\"๐Ÿž\": `Possible bug in AtomIO`,\n\t\"๐Ÿ’\": `Advice and guidance to the developer`,\n\t// Subscriptions\n\t\"๐Ÿ‘€\": `Subscription added`,\n\t\"๐Ÿ™ˆ\": `Subscription canceled`,\n\t\"๐Ÿ“ข\": `Notify subscribers`,\n\n\t// Realtime\n\t\"๐Ÿš€\": `Performance measure`,\n\t\"โœ…\": `Realtime transaction success`,\n\t\"๐Ÿ”„\": `Realtime transaction synchronized`,\n\t\"๐Ÿคž\": `Realtime optimistic update enqueued`,\n\t\"๐Ÿ‘ˆ\": `Realtime confirmed update enqueued`,\n\t\"๐Ÿง‘โ€โš–๏ธ\": `Realtime update beginning reconciliation`,\n\t\"๐Ÿ›Ž๏ธ\": `Realtime transaction received`,\n\t\"๐Ÿ‘\": `Determining perspective`,\n\t\"๐Ÿ”ญ\": `Determining realtime perspective`,\n\t\"๐Ÿ–Œ\": `Redacting realtime update`,\n\t\"๐Ÿ‘‹\": `Realtime greeting`,\n\t\"๐Ÿ‘\": `Realtime acknowledgment`,\n} as const\nexport type LoggerIcon = keyof typeof LOGGER_ICON_DICTIONARY\nexport type TokenDenomination =\n\t| `atom_family`\n\t| `atom`\n\t| `continuity`\n\t| `key`\n\t| `mutable_atom_family`\n\t| `mutable_atom`\n\t| `readonly_held_selector_family`\n\t| `readonly_held_selector`\n\t| `readonly_pure_selector_family`\n\t| `readonly_pure_selector`\n\t| `state`\n\t| `timeline`\n\t| `transaction`\n\t| `unknown`\n\t| `writable_held_selector_family`\n\t| `writable_held_selector`\n\t| `writable_pure_selector_family`\n\t| `writable_pure_selector`\n\nexport const PRETTY_TOKEN_TYPES: Record<TokenDenomination, string> = {\n\tatom_family: `atom family`,\n\tatom: `atom`,\n\tcontinuity: `continuity`,\n\tkey: `key`,\n\tmutable_atom_family: `atom family [m]`,\n\tmutable_atom: `atom [m]`,\n\treadonly_held_selector_family: `selector family [h]`,\n\treadonly_held_selector: `selector [h]`,\n\treadonly_pure_selector_family: `selector family`,\n\treadonly_pure_selector: `selector`,\n\tstate: `state`,\n\ttimeline: `timeline`,\n\ttransaction: `transaction`,\n\tunknown: `unknown`,\n\twritable_held_selector_family: `selector family [wh]`,\n\twritable_held_selector: `selector [wh]`,\n\twritable_pure_selector_family: `selector family [w]`,\n\twritable_pure_selector: `selector [w]`,\n}\n\nexport const LOG_LEVELS = [`info`, `warn`, `error`] as const\nexport type LogLevel = (typeof LOG_LEVELS)[number]\n\nexport type LogFn = (\n\ticon: LoggerIcon,\n\tdenomination: TokenDenomination,\n\ttokenKey: string,\n\tmessage: string,\n\t...rest: unknown[]\n) => void\nexport type LogFilter = (\n\t...params: Parameters<LogFn>\n) => Parameters<LogFn> | boolean\n\nexport type Logger = Record<LogLevel, LogFn>\n\nexport const simpleLog =\n\t(logLevel: keyof Logger): LogFn =>\n\t(icon, denomination, tokenKey, message, ...rest) => {\n\t\t/* eslint-disable-next-line no-console */\n\t\tconsole[logLevel](\n\t\t\t`${icon} ${PRETTY_TOKEN_TYPES[denomination]} \\`${tokenKey}\\` ${message}`,\n\t\t\t...rest,\n\t\t)\n\t}\nexport const simpleLogger: Logger = {\n\terror: simpleLog(`error`),\n\tinfo: simpleLog(`info`),\n\twarn: simpleLog(`warn`),\n}\n\nexport class AtomIOLogger implements Logger {\n\tpublic logLevel: `error` | `info` | `warn` | null\n\tpublic filter: LogFilter | undefined\n\tprivate readonly logger: Logger\n\n\tpublic constructor(\n\t\tlogLevel: `error` | `info` | `warn` | null,\n\t\tfilter?: LogFilter,\n\t\tlogger: Logger = simpleLogger,\n\t) {\n\t\tthis.logLevel = logLevel\n\t\tthis.filter = filter\n\t\tthis.logger = logger\n\t}\n\n\tpublic error: LogFn = (...args) => {\n\t\tif (this.logLevel !== null) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.error(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.error(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n\tpublic info: LogFn = (...args) => {\n\t\tif (this.logLevel === `info`) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.info(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.info(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n\tpublic warn: LogFn = (...args) => {\n\t\tif (this.logLevel !== `error` && this.logLevel !== null) {\n\t\t\tconst filterResult = this.filter?.(...args) ?? true\n\t\t\tif (filterResult === true) {\n\t\t\t\tthis.logger.warn(...args)\n\t\t\t} else if (filterResult) {\n\t\t\t\tthis.logger.warn(...filterResult)\n\t\t\t}\n\t\t}\n\t}\n}\n","import type { Each, Store } from \"atom.io/internal\"\nimport {\n\tallocateIntoStore,\n\tclaimWithinStore,\n\tdeallocateFromStore,\n\tfuseWithinStore,\n\tIMPLICIT,\n\tmakeRootMoleculeInStore,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nexport const $claim: unique symbol = Symbol.for(`claim`)\nexport type Claim<K extends Canonical> = K & { [$claim]?: true }\n\nexport class Realm<H extends Hierarchy> {\n\tpublic store: Store\n\t/**\n\t * @param store - The store to which the realm will be attached\n\t */\n\tpublic constructor(store: Store = IMPLICIT.STORE) {\n\t\tthis.store = store\n\t\tmakeRootMoleculeInStore(`root`, store)\n\t}\n\t/**\n\t * Make space for a new subject of the realm\n\t * @param provenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy}\n\t * @param key - A unique identifier for the new subject\n\t * @param attachmentStyle - The attachment style of new subject to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain .\n\t * @returns\n\t * The subject's key, given status as a true {@link Claim}\n\t */\n\tpublic allocate<V extends Vassal<H>, A extends Above<V, H>>(\n\t\tprovenance: A,\n\t\tkey: V,\n\t\tattachmentStyle?: `all` | `any`,\n\t): Claim<V> {\n\t\treturn allocateIntoStore<H, V, A>(\n\t\t\tthis.store,\n\t\t\tprovenance,\n\t\t\tkey,\n\t\t\tattachmentStyle,\n\t\t)\n\t}\n\t/**\n\t * Fuse two reagents into a compound\n\t * @param type - the name of the compound that is being fused\n\t * @param reagentA - the left reagent of the compound\n\t * @param reagentB - the right reagent of the compound\n\t * @returns\n\t * The compound's key, given status as a true {@link Claim}\n\t */\n\tpublic fuse<\n\t\tC extends CompoundFrom<H>,\n\t\tT extends C extends CompoundTypedKey<infer t, any, any> ? t : never,\n\t\tA extends C extends CompoundTypedKey<any, infer v, any> ? v : never,\n\t\tB extends C extends CompoundTypedKey<any, any, infer m> ? m : never,\n\t>(\n\t\ttype: T,\n\t\treagentA: SingularTypedKey<A>,\n\t\treagentB: SingularTypedKey<B>,\n\t): Claim<CompoundTypedKey<T, A, B>> {\n\t\treturn fuseWithinStore<H, C, T, A, B>(this.store, type, reagentA, reagentB)\n\t}\n\t/**\n\t * Remove a subject from the realm\n\t * @param claim - The subject to be deallocated\n\t */\n\tpublic deallocate<V extends Vassal<H>>(claim: Claim<V>): void {\n\t\tdeallocateFromStore<H, V>(this.store, claim)\n\t}\n\t/**\n\t * Transfer a subject of the realm from one owner to another\n\t * @param newProvenance - A key for an owner {@link Above} the new subject in the realm's {@link Hierarchy}\n\t * @param claim - The subject to be claimed\n\t * @param exclusive - Whether the subjects previous owners should be detached from it\n\t * @returns\n\t * The subject's key, given status as a true {@link Claim}\n\t */\n\tpublic claim<\n\t\tV extends Exclude<Vassal<H>, CompoundTypedKey>,\n\t\tA extends Above<V, H>,\n\t>(newProvenance: A, claim: Claim<V>, exclusive?: `exclusive`): Claim<V> {\n\t\treturn claimWithinStore<H, V, A>(this.store, newProvenance, claim, exclusive)\n\t}\n}\n\nexport class Anarchy {\n\tpublic store: Store\n\tpublic realm: Realm<any>\n\n\t/**\n\t * @param store - The store to which the anarchy-realm will be attached\n\t */\n\tpublic constructor(store: Store = IMPLICIT.STORE) {\n\t\tthis.store = store\n\t\tthis.realm = new Realm(store)\n\t}\n\t/**\n\t * Declare a new entity\n\t * @param provenance - A key for an owner of the entity\n\t * @param key - A unique identifier for the new entity\n\t * @param attachmentStyle - The attachment style of new entity to its owner(s). `any` means that if any owners remain, the subject will be retained. `all` means that the subject be retained only if all owners remain .\n\t */\n\tpublic allocate(\n\t\tprovenance: Canonical,\n\t\tkey: Canonical,\n\t\tattachmentStyle?: `all` | `any`,\n\t): void {\n\t\tallocateIntoStore<any, any, any>(\n\t\t\tthis.store,\n\t\t\tprovenance,\n\t\t\tkey,\n\t\t\tattachmentStyle,\n\t\t)\n\t}\n\t/**\n\t * Remove an entity\n\t * @param key - The entity to be deallocated\n\t */\n\tpublic deallocate(key: Canonical): void {\n\t\tdeallocateFromStore<any, any>(this.store, key)\n\t}\n\t/**\n\t * Transfer an entity from one owner to another\n\t * @param newProvenance - A key for an owner of the entity\n\t * @param key - The entity to be claimed\n\t * @param exclusive - Whether the entity's previous owners should be detached from it\n\t */\n\tpublic claim(\n\t\tnewProvenance: Canonical,\n\t\tkey: Canonical,\n\t\texclusive?: `exclusive`,\n\t): void {\n\t\tclaimWithinStore<any, any, any>(this.store, newProvenance, key, exclusive)\n\t}\n}\n\nexport const T$ = `T$`\nexport type T$ = typeof T$\nexport type TypeTag<T extends string> = `${T$}--${T}`\nexport type SingularTypedKey<T extends string = string> = `${T}::${string}`\nexport type CompoundTypedKey<\n\tA extends string = string,\n\tB extends string = string,\n\tC extends string = string,\n> = `${TypeTag<A>}==${SingularTypedKey<B>}++${SingularTypedKey<C>}`\nexport type TypedKey<\n\tA extends string = string,\n\tB extends string = string,\n\tC extends string = string,\n> = CompoundTypedKey<A, B, C> | SingularTypedKey<A>\ntype Scope = SingularTypedKey[]\ntype MutualFealty = {\n\tabove: Scope\n\tbelow: CompoundTypedKey\n}\ntype ExclusiveFealty = {\n\tabove: TypedKey | `root`\n\tbelow: Scope\n}\ntype Fealty = ExclusiveFealty | MutualFealty\n\nexport type Hierarchy<F extends Fealty[] = Fealty[]> = Each<F>\n\nexport type Vassal<H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? H[K][`below`]\n\t\t: H[K] extends { below: Array<infer V> }\n\t\t\t? V extends TypedKey\n\t\t\t\t? V\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Above<TK extends TypedKey, H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`below`]\n\t\t\t? H[K][`above`]\n\t\t\t: never\n\t\t: H[K] extends { below: Array<infer V> }\n\t\t\t? TK extends V\n\t\t\t\t? H[K] extends ExclusiveFealty\n\t\t\t\t\t? H[K][`above`]\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Below<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`above`]\n\t\t\t? H[K][`below`]\n\t\t\t: TK extends H[K][`above`][number]\n\t\t\t\t? H[K][`below`]\n\t\t\t\t: never\n\t\t: H[K] extends { above: infer V }\n\t\t\t? TK extends V\n\t\t\t\t? H[K] extends ExclusiveFealty\n\t\t\t\t\t? H[K][`below`][number]\n\t\t\t\t\t: never\n\t\t\t\t: never\n\t\t\t: never\n}[keyof H]\n\nexport type Mutuals<TK extends TypedKey | TypedKey[], H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty\n\t\t? TK extends H[K][`above`][number]\n\t\t\t? [mutual: Exclude<H[K][`above`][number], TK>, below: H[K][`below`]]\n\t\t\t: never\n\t\t: never\n}[keyof H]\n\nexport type CompoundFrom<H extends Hierarchy> = {\n\t[K in keyof H]: H[K] extends MutualFealty ? H[K][`below`] : never\n}[keyof H]\n","import { IMPLICIT, resetInStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { WritableFamilyToken, WritableToken } from \".\"\n\n/**\n * Set the value of a state into the implicit store back to its default value.\n * @param token - An atom or writable selector token.\n * @overload Default\n * @default\n */\nexport function resetState(token: WritableToken<any>): void\n/**\n * Set the value of a state into the implicit store back to its default value.\n * @param token - An atom family or writable selector family token.\n * @param key - The unique key of the state to set.\n * @overload Streamlined\n */\nexport function resetState<K extends Canonical>(\n\ttoken: WritableFamilyToken<any, K>,\n\tkey: K,\n): void\nexport function resetState(\n\t...params:\n\t\t| [token: WritableFamilyToken<any, Canonical>, key: Canonical]\n\t\t| [token: WritableToken<any>]\n): void {\n\tif (params.length === 2) {\n\t\tresetInStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tresetInStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import {\n\tcreateSelectorFamily,\n\tcreateStandaloneSelector,\n\tIMPLICIT,\n} from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type {\n\tReadonlyHeldSelectorFamilyToken,\n\tReadonlyHeldSelectorToken,\n\tReadonlyPureSelectorFamilyToken,\n\tReadonlyPureSelectorToken,\n\tWritableHeldSelectorFamilyToken,\n\tWritableHeldSelectorToken,\n\tWritablePureSelectorFamilyToken,\n\tWritablePureSelectorToken,\n} from \"./tokens\"\nimport type { Read, Write } from \"./transaction\"\n\nexport type WritablePureSelectorOptions<T> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<() => T>\n\t/** For each instantiated selector, a function that sets its value */\n\tset: Write<(newValue: T) => void>\n}\nexport type ReadonlyPureSelectorOptions<T> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<() => T>\n}\nexport type ReadonlyHeldSelectorOptions<T extends object> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a constant reference to a value that will not be replaced */\n\tconst: T\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<(permanent: T) => void>\n}\nexport type WritableHeldSelectorOptions<T extends object> = {\n\t/** The unique identifier of the selector */\n\tkey: string\n\t/** For each instantiated selector, a constant reference to a value that will not be replaced */\n\tconst: T\n\t/** For each instantiated selector, a function that computes its value */\n\tget: Read<(permanent: T) => void>\n\t/** For each instantiated selector, a function that sets its value */\n\tset: Write<(newValue: T) => void>\n}\n\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store, and\n * should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A writable selector can be \"set\" to a new value.\n * It is strongly advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link WritableHeldSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload WritableHeld\n */\nexport function selector<T extends object>(\n\toptions: WritableHeldSelectorOptions<T>,\n): WritableHeldSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyHeldSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload ReadonlyHeld\n */\nexport function selector<T extends object>(\n\toptions: ReadonlyHeldSelectorOptions<T>,\n): ReadonlyHeldSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A writable selector can be \"set\" to a new value.\n * It is strongly advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link TransientWritableSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload WritablePure\n */\nexport function selector<T>(\n\toptions: WritablePureSelectorOptions<T>,\n): WritablePureSelectorToken<T>\n/**\n * Declare a selector. The value of a selector should depend\n * on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyPureSelectorOptions}.\n * @returns\n * The token for your selector.\n * @overload ReadonlyPure\n */\nexport function selector<T>(\n\toptions: ReadonlyPureSelectorOptions<T>,\n): ReadonlyPureSelectorToken<T>\nexport function selector(\n\toptions:\n\t\t| ReadonlyHeldSelectorOptions<any>\n\t\t| ReadonlyPureSelectorOptions<any>\n\t\t| WritableHeldSelectorOptions<any>\n\t\t| WritablePureSelectorOptions<any>,\n):\n\t| ReadonlyHeldSelectorToken<any>\n\t| ReadonlyPureSelectorToken<any>\n\t| WritableHeldSelectorToken<any>\n\t| WritablePureSelectorToken<any> {\n\treturn createStandaloneSelector(IMPLICIT.STORE, options)\n}\n\nexport type WritablePureSelectorFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<() => T>\n\t/** For each instantiated family member, a function that sets its value */\n\tset: (key: K) => Write<(newValue: T) => void>\n}\nexport type ReadonlyPureSelectorFamilyOptions<T, K extends Canonical> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<() => T>\n}\nexport type WritableHeldSelectorFamilyOptions<\n\tT extends object,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a constant reference to a value that will not be replaced */\n\tconst: (key: K) => T\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<(permanent: T) => void>\n\t/** For each instantiated family member, a function that sets its value */\n\tset: (key: K) => Write<(newValue: T) => void>\n}\nexport type ReadonlyHeldSelectorFamilyOptions<\n\tT extends object,\n\tK extends Canonical,\n> = {\n\t/** The unique identifier of the family */\n\tkey: string\n\t/** For each instantiated family member, a constant reference to a value that will not be replaced */\n\tconst: (key: K) => T\n\t/** For each instantiated family member, a function that computes its value */\n\tget: (key: K) => Read<(permanent: T) => void>\n}\n\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a held selector should depend on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A writable selector can be \"set\" to a new value.\n * It is advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link WritableHeldSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link WritableHeldSelectorFamilyToken}\n * @overload WritableHeld\n */\nexport function selectorFamily<T extends object, K extends Canonical>(\n\toptions: WritableHeldSelectorFamilyOptions<T, K>,\n): WritableHeldSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a held selector should depend on the value of atoms or other selectors in the store,\n * and should be recycled when a root atom of the selector is set.\n *\n * A held selector's value must be some object.\n * The reference to that object is permanent and will not be replaced.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyHeldSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link ReadonlyHeldSelectorFamilyToken}\n * @overload ReadonlyHeld\n */\nexport function selectorFamily<T extends object, K extends Canonical>(\n\toptions: ReadonlyHeldSelectorFamilyOptions<T, K>,\n): ReadonlyHeldSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a selector should depend on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A writable selector can be \"set\" to a new value.\n * It is advised to set its dependencies to values\n * that would produce the new value of the selector.\n *\n * @param options - {@link TransientWritableSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link TransientWritableSelectorFamilyToken}\n * @overload WritablePure\n */\nexport function selectorFamily<T, K extends Canonical>(\n\toptions: WritablePureSelectorFamilyOptions<T, K>,\n): WritablePureSelectorFamilyToken<T, K>\n/**\n * Create a family of selectors, allowing for the dynamic creation and disposal of selectors.\n *\n * The value of a selector should depend on the value of atoms or other selectors in the store.\n *\n * A pure selector's current value is evicted from the store\n * in order to be garbage collected when a root atom of the selector is set.\n *\n * A readonly selector can be \"gotten\" but not \"set\".\n *\n * @param options - {@link ReadonlyPureSelectorFamilyOptions}.\n * @returns\n * A reference to the selector family created: a {@link ReadonlyPureSelectorFamilyToken}\n * @overload ReadonlyPure\n */\nexport function selectorFamily<T, K extends Canonical>(\n\toptions: ReadonlyPureSelectorFamilyOptions<T, K>,\n): ReadonlyPureSelectorFamilyToken<T, K>\nexport function selectorFamily(\n\toptions:\n\t\t| ReadonlyHeldSelectorFamilyOptions<any, any>\n\t\t| ReadonlyPureSelectorFamilyOptions<any, any>\n\t\t| WritableHeldSelectorFamilyOptions<any, any>\n\t\t| WritablePureSelectorFamilyOptions<any, any>,\n):\n\t| ReadonlyHeldSelectorFamilyToken<any, any>\n\t| ReadonlyPureSelectorFamilyToken<any, any>\n\t| WritableHeldSelectorFamilyToken<any, any>\n\t| WritablePureSelectorFamilyToken<any, any> {\n\treturn createSelectorFamily(IMPLICIT.STORE, options)\n}\n","import { IMPLICIT, setIntoStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nimport type { WritableFamilyToken, WritableToken } from \"./tokens\"\n\n/**\n * A function that sets the value of a state.\n * @param oldValue - The current value of the state.\n * @returns\n * The new value of the state.\n */\nexport type Setter<T, New extends T> = (oldValue: T) => New\n\n/**\n * Set the value of a state into the implicit store.\n * @param token - An atom or writable selector token.\n * @param value - The new value of the state.\n * @overload Default\n * @default\n */\nexport function setState<T, New extends T>(\n\ttoken: WritableToken<T>,\n\tvalue: New | Setter<T, New>,\n): void\n\n/**\n * Set the value of a state into the implicit store.\n * @param token - An atom family or writable selector family token.\n * @param key - The unique key of the state to set.\n * @param value - The new value of the state.\n * @overload Streamlined\n */\nexport function setState<T, K extends Canonical, New extends T, Key extends K>(\n\ttoken: WritableFamilyToken<T, K>,\n\tkey: Key,\n\tvalue: New | Setter<T, New>,\n): void\nexport function setState<T, New extends T>(\n\t...params:\n\t\t| [\n\t\t\t\ttoken: WritableFamilyToken<T, Canonical>,\n\t\t\t\tkey: Canonical,\n\t\t\t\tvalue: New | Setter<T, New>,\n\t\t ]\n\t\t| [token: WritableToken<T>, value: New | Setter<T, New>]\n): void {\n\tif (params.length === 2) {\n\t\tsetIntoStore(IMPLICIT.STORE, ...params)\n\t} else {\n\t\tsetIntoStore(IMPLICIT.STORE, ...params)\n\t}\n}\n","import type { findState } from \"atom.io\"\nimport {\n\tactUponStore,\n\tarbitrary,\n\tcreateMutableAtom,\n\tcreateMutableAtomFamily,\n\tcreateRegularAtom,\n\tcreateRegularAtomFamily,\n\tcreateSelectorFamily,\n\tcreateStandaloneSelector,\n\tcreateTimeline,\n\tcreateTransaction,\n\tdisposeFromStore,\n\tfindInStore,\n\tgetFromStore,\n\tIMPLICIT,\n\tinstallIntoStore,\n\tresetInStore,\n\tsetIntoStore,\n\tStore,\n\tsubscribeInStore,\n\ttimeTravel,\n} from \"atom.io/internal\"\n\nimport type {\n\tAtomIOToken,\n\tdisposeState,\n\tgetState,\n\tredo,\n\tsetState,\n\tsubscribe,\n\ttimeline,\n\tundo,\n} from \".\"\nimport type { atom, atomFamily, mutableAtom, mutableAtomFamily } from \"./atom\"\nimport type { resetState } from \"./reset-state\"\nimport type { selector, selectorFamily } from \"./selector\"\nimport type { runTransaction, transaction } from \"./transaction\"\n\nexport class Silo {\n\tpublic store: Store\n\tpublic atom: typeof atom\n\tpublic mutableAtom: typeof mutableAtom\n\tpublic atomFamily: typeof atomFamily\n\tpublic mutableAtomFamily: typeof mutableAtomFamily\n\tpublic selector: typeof selector\n\tpublic selectorFamily: typeof selectorFamily\n\tpublic transaction: typeof transaction\n\tpublic timeline: typeof timeline\n\tpublic findState: typeof findState\n\tpublic getState: typeof getState\n\tpublic setState: typeof setState\n\tpublic resetState: typeof resetState\n\tpublic disposeState: typeof disposeState\n\tpublic subscribe: typeof subscribe\n\tpublic undo: typeof undo\n\tpublic redo: typeof redo\n\tpublic runTransaction: typeof runTransaction\n\tpublic install: (tokens: AtomIOToken[], store?: Store) => void\n\n\tpublic constructor(config: Store[`config`], fromStore: Store | null = null) {\n\t\tconst s = (this.store = new Store(config, fromStore))\n\t\tthis.atom = ((options: Parameters<typeof atom>[0]) =>\n\t\t\tcreateRegularAtom(s, options, undefined)) as typeof atom\n\t\tthis.mutableAtom = ((options: Parameters<typeof mutableAtom>[0]) =>\n\t\t\tcreateMutableAtom(s, options, undefined)) as typeof mutableAtom\n\t\tthis.atomFamily = ((options: Parameters<typeof atomFamily>[0]) =>\n\t\t\tcreateRegularAtomFamily(s, options)) as typeof atomFamily\n\t\tthis.mutableAtomFamily = ((\n\t\t\toptions: Parameters<typeof mutableAtomFamily>[0],\n\t\t) => createMutableAtomFamily(s, options)) as typeof mutableAtomFamily\n\t\tthis.selector = ((options: Parameters<typeof selector>[0]) =>\n\t\t\tcreateStandaloneSelector(s, options)) as typeof selector\n\t\tthis.selectorFamily = ((options: Parameters<typeof selectorFamily>[0]) =>\n\t\t\tcreateSelectorFamily(s, options)) as typeof selectorFamily\n\t\tthis.transaction = (options) => createTransaction(s, options)\n\t\tthis.timeline = (options) => createTimeline(s, options)\n\t\tthis.findState = ((...params: Parameters<typeof findState>) =>\n\t\t\tfindInStore(s, ...params)) as typeof findState\n\t\tthis.getState = ((...params: Parameters<typeof getState>) =>\n\t\t\tgetFromStore(s, ...params)) as typeof getState\n\t\tthis.setState = ((...params: Parameters<typeof setState>) => {\n\t\t\tsetIntoStore(s, ...params)\n\t\t}) as typeof setState\n\t\tthis.resetState = ((...params: Parameters<typeof resetState>) => {\n\t\t\tresetInStore(s, ...params)\n\t\t}) as typeof resetState\n\t\tthis.disposeState = ((...params: Parameters<typeof disposeState>) => {\n\t\t\tdisposeFromStore(s, ...params)\n\t\t}) as typeof disposeState\n\t\tthis.subscribe = ((...params: Parameters<typeof subscribe>) =>\n\t\t\tsubscribeInStore(s, ...params)) as typeof subscribe\n\t\tthis.undo = (token) => {\n\t\t\ttimeTravel(s, `undo`, token)\n\t\t}\n\t\tthis.redo = (token) => {\n\t\t\ttimeTravel(s, `redo`, token)\n\t\t}\n\t\tthis.runTransaction = (token, id = arbitrary()) => actUponStore(s, token, id)\n\t\tthis.install = (tokens, source = IMPLICIT.STORE) => {\n\t\t\tinstallIntoStore(tokens, s, source)\n\t\t}\n\t}\n}\n","import type { Fn } from \"atom.io/internal\"\nimport { arbitrary, IMPLICIT, subscribeInStore } from \"atom.io/internal\"\n\nimport type {\n\tStateUpdate,\n\tTimelineEvent,\n\tTransactionOutcomeEvent,\n} from \"./events\"\nimport type { TimelineManageable } from \"./timeline\"\nimport type { ReadableToken, TimelineToken, TransactionToken } from \"./tokens\"\n\nexport type UpdateHandler<T> = (update: StateUpdate<T>) => void\nexport type TransactionUpdateHandler<F extends Fn> = (\n\tdata: TransactionOutcomeEvent<TransactionToken<F>>,\n) => void\n\n/**\n * Subscribe to a state in the implicit store\n * @param token - The token of the state to subscribe to\n * @param handleUpdate - A function that will be called when the state is updated\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the state\n * @overload State\n */\nexport function subscribe<T>(\n\ttoken: ReadableToken<T>,\n\thandleUpdate: UpdateHandler<T>,\n\tkey?: string,\n): () => void\n/**\n * Subscribe to a transaction in the implicit store\n * @param token - The token of the transaction to subscribe to\n * @param handleUpdate - A function that will be called when the transaction succeeds\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the transaction\n * @overload Transaction\n */\nexport function subscribe<F extends Fn>(\n\ttoken: TransactionToken<F>,\n\thandleUpdate: TransactionUpdateHandler<F>,\n\tkey?: string,\n): () => void\n/**\n * Subscribe to a timeline in the implicit store\n * @param token - The token of the timeline to subscribe to\n * @param handleUpdate - A function that will be called when a new update is available\n * @param key - A unique key for the subscription. If not provided, a random key will be generated.\n * @returns A function that can be called to unsubscribe from the timeline\n * @overload Timeline\n */\nexport function subscribe<M extends TimelineManageable>(\n\ttoken: TimelineToken<M>,\n\thandleUpdate: (update: TimelineEvent<M> | `redo` | `undo`) => void,\n\tkey?: string,\n): () => void\nexport function subscribe(\n\ttoken: ReadableToken<any> | TimelineToken<any> | TransactionToken<any>,\n\thandleUpdate: (update: any) => void,\n\tkey: string = arbitrary(),\n): () => void {\n\treturn subscribeInStore(IMPLICIT.STORE, token, handleUpdate, key)\n}\n","import type { Timeline } from \"atom.io/internal\"\nimport { createTimeline, IMPLICIT, timeTravel } from \"atom.io/internal\"\n\nimport type { AtomFamilyToken, AtomToken, TimelineEvent, TimelineToken } from \".\"\n\nexport type TimelineManageable = AtomFamilyToken<any, any> | AtomToken<any>\nexport type AtomOnly<M extends TimelineManageable> = M extends AtomFamilyToken<\n\tany,\n\tany\n>\n\t? AtomToken<any>\n\t: M extends AtomToken<any>\n\t\t? M\n\t\t: never\n\n/**\n * If there is an update ahead of the cursor (in the future of this {@link timeline}), apply it and move the cursor to the next update\n * @param timeline - A {@link TimelineToken}\n */\nexport const redo = (timeline: TimelineToken<any>): void => {\n\ttimeTravel(IMPLICIT.STORE, `redo`, timeline)\n}\n/**\n * Reverse the last update on the {@link timeline} and move the cursor to the previous update\n * @param timeline - A {@link TimelineToken}\n */\nexport const undo = (timeline: TimelineToken<any>): void => {\n\ttimeTravel(IMPLICIT.STORE, `undo`, timeline)\n}\n\nexport type TimelineOptions<ManagedAtom extends TimelineManageable> = {\n\t/** The unique identifier of the timeline */\n\tkey: string\n\t/** The managed atoms (and families of atoms) to record */\n\tscope: ManagedAtom[]\n\t/** A function that determines whether a given update should be recorded */\n\tshouldCapture?: (\n\t\tupdate: TimelineEvent<ManagedAtom>,\n\t\ttimeline: Timeline<TimelineManageable>,\n\t) => boolean\n}\n\n/**\n * Create a timeline, a mechanism for recording, undoing, and replaying changes to groups of atoms\n * @param options - {@link TimelineOptions}\n * @returns A reference to the timeline created: a {@link TimelineToken}\n */\nexport const timeline = <ManagedAtom extends TimelineManageable>(\n\toptions: TimelineOptions<ManagedAtom>,\n): TimelineToken<ManagedAtom> => {\n\treturn createTimeline(IMPLICIT.STORE, options)\n}\n","import type { AsJSON, EnvironmentData, Fn, Transceiver } from \"atom.io/internal\"\nimport {\n\tactUponStore,\n\tarbitrary,\n\tcreateTransaction,\n\tIMPLICIT,\n} from \"atom.io/internal\"\n\nimport type { disposeState } from \"./dispose-state\"\nimport type { findState } from \"./find-state\"\nimport type { getState } from \"./get-state\"\nimport type { resetState } from \"./reset-state\"\nimport type { setState } from \"./set-state\"\nimport type {\n\tMutableAtomToken,\n\tTransactionToken,\n\tWritablePureSelectorToken,\n} from \"./tokens\"\n\nexport type ReaderToolkit = Pick<ActorToolkit, `find` | `get` | `json`>\nexport type WriterToolkit = Pick<ActorToolkit, `find` | `get` | `json` | `set`>\nexport type ActorToolkit = Readonly<{\n\tget: typeof getState\n\tset: typeof setState\n\treset: typeof resetState\n\tfind: typeof findState\n\tjson: <T extends Transceiver<any, any, any>>(\n\t\tstate: MutableAtomToken<T>,\n\t) => WritablePureSelectorToken<AsJSON<T>>\n\tdispose: typeof disposeState\n\trun: typeof runTransaction\n\tenv: () => EnvironmentData\n}>\n\nexport type Read<F extends Fn> = (\n\ttoolkit: ReaderToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type Write<F extends Fn> = (\n\ttoolkit: WriterToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type Transact<F extends Fn> = (\n\ttoolkit: ActorToolkit,\n\t...parameters: Parameters<F>\n) => ReturnType<F>\nexport type TransactionIO<Token extends TransactionToken<any>> =\n\tToken extends TransactionToken<infer F> ? F : never\nexport type TransactionOptions<F extends Fn> = {\n\t/** The unique identifier of the transaction */\n\tkey: string\n\t/** The operation to perform */\n\tdo: Transact<F>\n}\n\n/**\n * Create a transaction, a mechanism for batching updates multiple states in a single, all-or-nothing operation\n * @param options - {@link TransactionOptions}\n * @returns A reference to the transaction created: a {@link TransactionToken}\n */\nexport function transaction<F extends Fn>(\n\toptions: TransactionOptions<F>,\n): TransactionToken<F> {\n\treturn createTransaction(IMPLICIT.STORE, options)\n}\n\n/**\n * Execute a {@link transaction}\n * @param token - A {@link TransactionToken}\n * @param id - A unique identifier for the transaction. If not provided, a random identifier will be generated\n * @returns A function that can be called to run the transaction with its {@link TransactionIO} parameters\n */\nexport function runTransaction<F extends Fn>(\n\ttoken: TransactionToken<F>,\n\tid: string = arbitrary(),\n): (...parameters: Parameters<F>) => ReturnType<F> {\n\treturn actUponStore(IMPLICIT.STORE, token, id)\n}\n","import type {\n\tMutableAtomFamilyToken,\n\tMutableAtomToken,\n\tReadableFamilyToken,\n\tReadableToken,\n\tReadonlyPureSelectorFamilyToken,\n\tReadonlyPureSelectorToken,\n\tRegularAtomFamilyToken,\n\tRegularAtomToken,\n\tTransactionToken,\n\tWritableFamilyToken,\n\tWritablePureSelectorFamilyToken,\n\tWritablePureSelectorToken,\n\tWritableToken,\n} from \"./tokens\"\n\nexport type TokenType<\n\tComparison extends\n\t\t| ReadableFamilyToken<any, any>\n\t\t| ReadableToken<any>\n\t\t| TransactionToken<any>,\n> = Comparison extends ReadableToken<infer RepresentedValue>\n\t? RepresentedValue\n\t: Comparison extends ReadableFamilyToken<infer RepresentedValue, any>\n\t\t? RepresentedValue\n\t\t: Comparison extends TransactionToken<infer Fn>\n\t\t\t? Fn\n\t\t\t: never\n\nexport function isToken<KnownToken extends RegularAtomToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is RegularAtomToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends MutableAtomToken<any, any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is MutableAtomToken<TokenType<KnownToken>, any>\nexport function isToken<KnownToken extends WritablePureSelectorToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritablePureSelectorToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadonlyPureSelectorToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadonlyPureSelectorToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends WritableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritableToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<KnownToken>>\nexport function isToken<KnownToken extends ReadableToken<any>>(\n\tknownToken: KnownToken,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<KnownToken>> {\n\treturn knownToken.key === unknownToken.key\n}\n\nexport function belongsTo<Family extends RegularAtomFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is RegularAtomToken<TokenType<Family>>\nexport function belongsTo<Family extends MutableAtomFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is MutableAtomToken<TokenType<Family>, any>\nexport function belongsTo<\n\tFamily extends WritablePureSelectorFamilyToken<any, any>,\n>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritablePureSelectorToken<TokenType<Family>>\nexport function belongsTo<\n\tFamily extends ReadonlyPureSelectorFamilyToken<any, any>,\n>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadonlyPureSelectorToken<TokenType<Family>>\nexport function belongsTo<Family extends WritableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is WritableToken<TokenType<Family>>\nexport function belongsTo<Family extends ReadableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<Family>>\nexport function belongsTo<Family extends ReadableFamilyToken<any, any>>(\n\tfamily: Family,\n\tunknownToken: ReadableToken<any>,\n): unknownToken is ReadableToken<TokenType<Family>> {\n\treturn family.key === unknownToken.family?.key\n}\n"],"mappings":";;;;;;;;;AAiCA,SAAgB,KAAQ,SAAqD;AAC5E,QAAO,kBAAkB,SAAS,OAAO,SAAS;;;;;;;;;;;AAoBnD,SAAgB,YACf,SACsB;AACtB,QAAO,kBAAkB,SAAS,OAAO,SAAS;;;;;;;;AAsCnD,SAAgB,WACf,SAC+B;AAC/B,QAAO,wBAAwB,SAAS,OAAO;;;;;;;;;;;AAuBhD,SAAgB,kBAGd,SAAuE;AACxE,QAAO,wBAAwB,SAAS,OAAO;;;;;AClGhD,SAAgB,aACf,GAAG,QAGI;AACP,KAAI,OAAO,WAAW,EACrB,kBAAiB,SAAS,OAAO,GAAG;KAEpC,kBAAiB,SAAS,OAAO,GAAG;;;;;ACwFtC,S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"sources":["../../src/react/store-context.tsx","../../src/react/use-i.ts","../../src/react/use-json.ts","../../src/react/use-loadable.ts","../../src/react/use-o.ts","../../src/react/use-tl.ts"],"sourcesContent":[],"mappings":";;;;;;cAIaA,cAAc,OAAA,CAAM,QAAQ;cAI5BC,eAAe,OAAA,CAAM;YACvB,OAAA,CAAM;UACR;AANT,CAAA,CAAA;;;iBCIgB,eACR,cAAc,kBACN,SAAS,aAAa,MAAM;iBAE5B,kBAAkB,UDRlC,CAAA,KAAaD,ECSL,mBDTiC,CCSb,CDTa,ECSV,CDTU,CAAA,EAAA,GAAA,ECUnC,CDVmC,CAAA,EAAA,CAAA,YCWzB,CDXyB,CAAA,CAAA,IAAA,ECWhB,GDXgB,GAAA,CAAA,CAAA,GAAA,ECWH,CDXG,EAAA,GCWG,GDXH,CAAA,EAAA,GAAA,IAAA;;;iBEKzB,kBAAkB,mCAC1B,iBAAiB,KACtB,OAAO;iBAEM,kBACL,4BFVX,UEWW,SFX8B,CAAA,CAAA,KAAA,EEYhC,sBFZgC,CEYT,CFZS,EEYN,CFZM,CAAA,EAAA,GAAA,EEYG,CFZH,CAAA,EEYO,MFZP,CEYc,CFZd,CAAA;;;iBGEzB,sBACR,cAAc,SAAS;;SACW;AHJ1C,CAAA;AAAyC,iBGMzB,WHNyB,cGMA,SHNR,CAAA,CAAA,KAAA,EGOzB,mBHPyB,CGOL,QHPK,CGOI,CHPJ,CAAA,EGOQ,CHPR,CAAA,EAAA,GAAA,EGQ3B,CHR2B,CAAA,EAAA,SAAA,GAAA;EAIjC,OAAaC,EAAAA,OAAAA;EAGZ,KAAA,EGEyC,CHFzC;;AADQ,iBGKO,WHLP,IAFyB,UGOO,CHPP,SGQ1B,cAAc,SAAS,eACpB;;SACmB;AFV9B,CAAA;AAAgB,iBEYA,WFZA,cEYyB,SFXjC,YEWsD,CFV9C,OAAS,EEWjB,mBFXiB,CEWG,QFXH,CEWY,CFXZ,CAAA,EEWgB,CFXhB,CAAA,EAAA,GAAA,EEYnB,CFZmB,EAAA,QAAA,EEad,CFbc,CAAA,EAAA;SAAa,EAAA,OAAA;SEcR,CFdc;CAAA;;;iBGF5B,eAAe,cAAc,KAAK;iBAElC,kBAAkB,UJNlC,CAAA,KAAaD,EIOL,mBJPiC,CIOb,CJPa,EIOV,CJPU,CAAA,EAAA,GAAA,EIQnC,CJRmC,CAAA,EIStC,CJTsC;;;KKG7B,YAAA;;;;;ALHZ,CAAA;AAAyC,iBKUzB,KAAA,CLVyB,KAAA,EKUZ,aLVY,CAAA,GAAA,CAAA,CAAA,EKUS,YLVT"}
1
+ {"version":3,"file":"index.d.ts","names":["StoreContext: React.Context<Store>","StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}>"],"sources":["../../src/react/store-context.tsx","../../src/react/use-i.ts","../../src/react/use-json.ts","../../src/react/use-loadable.ts","../../src/react/use-o.ts","../../src/react/use-tl.ts"],"sourcesContent":[],"mappings":";;;;;;cAIaA,cAAc,OAAA,CAAM,QAAQ;cAI5BC,eAAe,OAAA,CAAM;YACvB,OAAA,CAAM;UACR;AANT,CAAA,CAAA;;;iBCIgB,eACR,cAAc,kBACN,SAAS,aAAa,MAAM;iBAE5B,kBAAkB,UDRlC,CAAA,KAAaD,ECSL,mBDTiC,CCSb,CDTa,ECSV,CDTU,CAAA,EAAA,GAAA,ECUnC,CDVmC,CAAA,EAAA,CAAA,YCWzB,CDXyB,CAAA,CAAA,IAAA,ECWhB,GDXgB,GAAA,CAAA,CAAA,GAAA,ECWH,CDXG,EAAA,GCWG,GDXH,CAAA,EAAA,GAAA,IAAA;;;iBEKzB,kBAAkB,mCAC1B,iBAAiB,KACtB,OAAO;iBAEM,kBACL,4BFVX,UEWW,SFX8B,CAAA,CAAA,KAAA,EEYhC,sBFZgC,CEYT,CFZS,EEYN,CFZM,CAAA,EAAA,GAAA,EEYG,CFZH,CAAA,EEYO,MFZP,CEYc,CFZd,CAAA;;;iBGEzB,sBACR,cAAc,SAAS;;SACW;AHJ1C,CAAA;AAAyC,iBGMzB,WHNyB,cGMA,SHNR,SGOzB,oBAAoB,SAAS,IAAI,SACnC;EHJN,OAAaC,EAAAA,OAAAA;SGK6B;;AHHjC,iBGKO,WHLP,cGKgC,UACjC,cAAc,SAAS,eACpB;;SACmB;AFV9B,CAAA;AAAgB,iBEYA,WFZA,cEYyB,SFXjC,YEWsD,CFV9C,OAAS,EEWjB,mBFXiB,CEWG,QFXH,CEWY,CFXZ,CAAA,EEWgB,CFXhB,CAAA,EAAA,GAAA,EEYnB,CFZmB,EAAA,QAAA,EEad,CFbc,CAAA,EAAA;SAAa,EAAA,OAAA;SEcR,CFdc;;;;iBGF5B,eAAe,cAAc,KAAK;iBAElC,kBAAkB,UJNlC,CAAA,KAAaD,EIOL,mBJPiC,CIOb,CJPa,EIOV,CJPU,CAAA,EAAA,GAAA,EIQnC,CJRmC,CAAA,EIStC,CJTsC;;;KKG7B,YAAA;;;;;ALHZ,CAAA;AAAyC,iBKUzB,KAAA,CLVyB,KAAA,EKUZ,aLVY,CAAA,GAAA,CAAA,CAAA,EKUS,YLVT"}
@@ -1,10 +1,51 @@
1
- import { StoreContext, StoreProvider, useI, useO } from "../use-o-DXPncKmZ.js";
2
- import { findInStore, getJsonToken, subscribeToTimeline, withdraw } from "atom.io/internal";
1
+ import { IMPLICIT, findInStore, getFromStore, getJsonToken, setIntoStore, subscribeToState, subscribeToTimeline, withdraw } from "atom.io/internal";
3
2
  import { redo, undo } from "atom.io";
4
3
  import * as React$1 from "react";
5
4
  import React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
6
  import { useO as useO$1 } from "atom.io/react";
7
7
 
8
+ //#region src/react/store-context.tsx
9
+ const StoreContext = React$1.createContext(IMPLICIT.STORE);
10
+ const StoreProvider = ({ children, store = IMPLICIT.STORE }) => /* @__PURE__ */ jsx(StoreContext.Provider, {
11
+ value: store,
12
+ children
13
+ });
14
+
15
+ //#endregion
16
+ //#region src/react/parse-state-overloads.ts
17
+ function parseStateOverloads(store, ...rest) {
18
+ let token;
19
+ if (rest.length === 2) {
20
+ const family = rest[0];
21
+ const key = rest[1];
22
+ token = findInStore(store, family, key);
23
+ } else token = rest[0];
24
+ return token;
25
+ }
26
+
27
+ //#endregion
28
+ //#region src/react/use-i.ts
29
+ function useI(...params) {
30
+ const store = React$1.useContext(StoreContext);
31
+ const token = parseStateOverloads(store, ...params);
32
+ const setter = React$1.useRef(null);
33
+ setter.current ??= (next) => {
34
+ setIntoStore(store, token, next);
35
+ };
36
+ return setter.current;
37
+ }
38
+
39
+ //#endregion
40
+ //#region src/react/use-o.ts
41
+ function useO(...params) {
42
+ const store = React$1.useContext(StoreContext);
43
+ const token = parseStateOverloads(store, ...params);
44
+ const id = React$1.useId();
45
+ return React$1.useSyncExternalStore((dispatch) => subscribeToState(store, token, `use-o:${id}`, dispatch), () => getFromStore(store, token), () => getFromStore(store, token));
46
+ }
47
+
48
+ //#endregion
8
49
  //#region src/react/use-json.ts
9
50
  function useJSON(token, key) {
10
51
  const store = React$1.useContext(StoreContext);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","stateToken: MutableAtomToken<any>","state: unknown","fallback: unknown","key: Canonical","useO","React"],"sources":["../../src/react/use-json.ts","../../src/react/use-loadable.ts","../../src/react/use-tl.ts"],"sourcesContent":["import type { MutableAtomFamilyToken, MutableAtomToken } from \"atom.io\"\nimport type { AsJSON, Transceiver } from \"atom.io/internal\"\nimport { findInStore, getJsonToken } from \"atom.io/internal\"\nimport type { Canonical, Json } from \"atom.io/json\"\nimport * as React from \"react\"\n\nimport { StoreContext } from \"./store-context\"\nimport { useO } from \"./use-o\"\n\nexport function useJSON<T extends Transceiver<any, any, any>>(\n\ttoken: MutableAtomToken<T>,\n): AsJSON<T>\n\nexport function useJSON<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n>(token: MutableAtomFamilyToken<T, K>, key: K): AsJSON<T>\n\nexport function useJSON(\n\ttoken: MutableAtomFamilyToken<any, any> | MutableAtomToken<any>,\n\tkey?: Canonical,\n): Json.Serializable {\n\tconst store = React.useContext(StoreContext)\n\tconst stateToken: MutableAtomToken<any> =\n\t\ttoken.type === `mutable_atom_family` ? findInStore(store, token, key) : token\n\tconst jsonToken = getJsonToken(store, stateToken)\n\treturn useO(jsonToken)\n}\n","/** biome-ignore-all lint/correctness/useHookAtTopLevel: params are used in an invariant way */\nimport type { Loadable, ReadableFamilyToken, ReadableToken } from \"atom.io\"\nimport type { Canonical } from \"atom.io/json\"\nimport { useO } from \"atom.io/react\"\nimport React from \"react\"\n\nexport function useLoadable<T>(\n\ttoken: ReadableToken<Loadable<T>>,\n): `LOADING` | { loading: boolean; value: T }\n\nexport function useLoadable<T, K extends Canonical>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K>,\n\tkey: K,\n): `LOADING` | { loading: boolean; value: T }\n\nexport function useLoadable<T, F extends T>(\n\ttoken: ReadableToken<Loadable<T>>,\n\tfallback: F,\n): { loading: boolean; value: T }\n\nexport function useLoadable<T, K extends Canonical, F extends T>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K>,\n\tkey: K,\n\tfallback: F,\n): { loading: boolean; value: T }\n\nexport function useLoadable(\n\t...params:\n\t\t| readonly [ReadableFamilyToken<any, Canonical>, Canonical, unknown]\n\t\t| readonly [ReadableFamilyToken<any, Canonical>, Canonical]\n\t\t| readonly [ReadableToken<any>, unknown]\n\t\t| readonly [ReadableToken<any>]\n): `LOADING` | { loading: boolean; value: unknown } {\n\tlet state: unknown\n\tlet fallback: unknown\n\n\tconst [token] = params\n\tlet key: Canonical\n\tswitch (token.type) {\n\t\tcase `atom`:\n\t\tcase `mutable_atom`:\n\t\tcase `readonly_held_selector`:\n\t\tcase `readonly_pure_selector`:\n\t\tcase `writable_held_selector`:\n\t\tcase `writable_pure_selector`:\n\t\t\tstate = useO(token)\n\t\t\tfallback = params[1]\n\t\t\tbreak\n\t\tcase `atom_family`:\n\t\tcase `mutable_atom_family`:\n\t\tcase `readonly_held_selector_family`:\n\t\tcase `readonly_pure_selector_family`:\n\t\tcase `writable_held_selector_family`:\n\t\tcase `writable_pure_selector_family`:\n\t\t\tkey = params[1] as Canonical\n\t\t\tstate = useO(token, key)\n\t\t\tfallback = params[2]\n\t}\n\n\tconst wrapperRef = React.useRef({ loading: false, value: null as unknown })\n\tconst lastLoadedRef = React.useRef(\n\t\tfallback ?? (state instanceof Promise ? `LOADING` : state),\n\t)\n\n\tconst { current: lastLoaded } = lastLoadedRef\n\tlet { current: wrapper } = wrapperRef\n\n\tif (state instanceof Promise) {\n\t\tif (lastLoaded === `LOADING`) {\n\t\t\treturn `LOADING`\n\t\t}\n\t\twrapper = wrapperRef.current = { loading: true, value: lastLoaded }\n\t} else {\n\t\tlastLoadedRef.current = state\n\t\tif (wrapper.loading === true) {\n\t\t\twrapper = wrapperRef.current = { loading: false, value: state }\n\t\t} else {\n\t\t\twrapper.loading = false\n\t\t\twrapper.value = state\n\t\t}\n\t}\n\n\treturn wrapper\n}\n","import type { TimelineToken } from \"atom.io\"\nimport { redo, undo } from \"atom.io\"\nimport { subscribeToTimeline, withdraw } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nimport { StoreContext } from \"./store-context\"\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken<any>): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(store, token)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline.at,\n\t\t\tlength: timeline.history.length,\n\t\t\tundo: () => {\n\t\t\t\tundo(token)\n\t\t\t},\n\t\t\tredo: () => {\n\t\t\t\tredo(token)\n\t\t\t},\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(store, token, `use-tl:${id}`, dispatch),\n\t\tretrieve,\n\t\tretrieve,\n\t)\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,QACf,OACA,KACoB;CACpB,MAAM,QAAQA,QAAM,WAAW;CAC/B,MAAMC,aACL,MAAM,SAAS,wBAAwB,YAAY,OAAO,OAAO,OAAO;CACzE,MAAM,YAAY,aAAa,OAAO;AACtC,QAAO,KAAK;AACZ;;;;ACDD,SAAgB,YACf,GAAG,QAKgD;CACnD,IAAIC;CACJ,IAAIC;CAEJ,MAAM,CAAC,MAAM,GAAG;CAChB,IAAIC;AACJ,SAAQ,MAAM,MAAd;EACC,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;AACJ,WAAQC,OAAK;AACb,cAAW,OAAO;AAClB;EACD,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;AACJ,SAAM,OAAO;AACb,WAAQA,OAAK,OAAO;AACpB,cAAW,OAAO;CACnB;CAED,MAAM,aAAa,MAAM,OAAO;EAAE,SAAS;EAAO,OAAO;EAAiB;CAC1E,MAAM,gBAAgB,MAAM,OAC3B,aAAa,iBAAiB,UAAU,YAAY;CAGrD,MAAM,EAAE,SAAS,YAAY,GAAG;CAChC,IAAI,EAAE,SAAS,SAAS,GAAG;AAE3B,KAAI,iBAAiB,SAAS;AAC7B,MAAI,eAAe,UAClB,QAAO;AAER,YAAU,WAAW,UAAU;GAAE,SAAS;GAAM,OAAO;GAAY;CACnE,OAAM;AACN,gBAAc,UAAU;AACxB,MAAI,QAAQ,YAAY,KACvB,WAAU,WAAW,UAAU;GAAE,SAAS;GAAO,OAAO;GAAO;OACzD;AACN,WAAQ,UAAU;AAClB,WAAQ,QAAQ;EAChB;CACD;AAED,QAAO;AACP;;;;ACrED,SAAgB,MAAM,OAAyC;CAC9D,MAAM,QAAQC,QAAM,WAAW;CAC/B,MAAM,KAAKA,QAAM;CACjB,MAAM,WAAW,SAAS,OAAO;CACjC,MAAM,WAAWA,QAAM,OAAO;CAC9B,MAAM,oBAAoB;AACzB,SAAO;GACN,IAAI,SAAS;GACb,QAAQ,SAAS,QAAQ;GACzB,YAAY;AACX,SAAK;GACL;GACD,YAAY;AACX,SAAK;GACL;GACD;CACD;CACD,MAAM,OAAOA,QAAM,OAAqB;CACxC,MAAM,iBAAiB;AACtB,MACC,KAAK,QAAQ,OAAO,UAAU,MAC9B,KAAK,QAAQ,WAAW,UAAU,QAAQ,UAC1C,SAAS,YAAY,OACpB;AACD,YAAS,UAAU;AACnB,QAAK,UAAU;EACf;AACD,SAAO,KAAK;CACZ;AACD,QAAOA,QAAM,sBACX,aAAa,oBAAoB,OAAO,OAAO,UAAU,MAAM,WAChE,UACA;AAED"}
1
+ {"version":3,"file":"index.js","names":["StoreContext: React.Context<Store>","React","StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}>","token: ReadableToken<any>","React","setter: React.RefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t>","React","React","stateToken: MutableAtomToken<any>","state: unknown","fallback: unknown","key: Canonical","useO","React"],"sources":["../../src/react/store-context.tsx","../../src/react/parse-state-overloads.ts","../../src/react/use-i.ts","../../src/react/use-o.ts","../../src/react/use-json.ts","../../src/react/use-loadable.ts","../../src/react/use-tl.ts"],"sourcesContent":["import type { Store } from \"atom.io/internal\"\nimport { IMPLICIT } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nexport const StoreContext: React.Context<Store> = React.createContext(\n\tIMPLICIT.STORE,\n)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: Store\n}> = ({ children, store = IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import type {\n\tReadableFamilyToken,\n\tReadableToken,\n\tWritableFamilyToken,\n\tWritableToken,\n} from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { findInStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\n\nexport function parseStateOverloads<T, K extends Canonical>(\n\tstore: Store,\n\t...rest: [WritableFamilyToken<T, K>, K] | [WritableToken<T>]\n): WritableToken<T>\n\nexport function parseStateOverloads<T, K extends Canonical>(\n\tstore: Store,\n\t...rest: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]\n): ReadableToken<T>\n\nexport function parseStateOverloads<T, K extends Canonical>(\n\tstore: Store,\n\t...rest: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]\n): ReadableToken<T> {\n\tlet token: ReadableToken<any>\n\tif (rest.length === 2) {\n\t\tconst family = rest[0]\n\t\tconst key = rest[1]\n\n\t\ttoken = findInStore(store, family, key)\n\t} else {\n\t\ttoken = rest[0]\n\t}\n\treturn token\n}\n","import type { WritableFamilyToken, WritableToken } from \"atom.io\"\nimport { setIntoStore } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\nimport * as React from \"react\"\n\nimport { parseStateOverloads } from \"./parse-state-overloads\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useI<T>(\n\ttoken: WritableToken<T>,\n): <New extends T>(next: New | ((old: T) => New)) => void\n\nexport function useI<T, K extends Canonical>(\n\ttoken: WritableFamilyToken<T, K>,\n\tkey: K,\n): <New extends T>(next: New | ((old: T) => New)) => void\n\nexport function useI<T, K extends Canonical>(\n\t...params: [WritableFamilyToken<T, K>, K] | [WritableToken<T>]\n): <New extends T>(next: New | ((old: T) => New)) => void {\n\tconst store = React.useContext(StoreContext)\n\tconst token = parseStateOverloads(store, ...params)\n\tconst setter: React.RefObject<\n\t\t(<New extends T>(next: New | ((old: T) => New)) => void) | null\n\t> = React.useRef(null)\n\tsetter.current ??= (next) => {\n\t\tsetIntoStore(store, token, next)\n\t}\n\treturn setter.current\n}\n","import type { ReadableFamilyToken, ReadableToken } from \"atom.io\"\nimport { getFromStore, subscribeToState } from \"atom.io/internal\"\nimport type { Canonical } from \"atom.io/json\"\nimport * as React from \"react\"\n\nimport { parseStateOverloads } from \"./parse-state-overloads\"\nimport { StoreContext } from \"./store-context\"\n\nexport function useO<T>(token: ReadableToken<T>): T\n\nexport function useO<T, K extends Canonical>(\n\ttoken: ReadableFamilyToken<T, K>,\n\tkey: K,\n): T\n\nexport function useO<T, K extends Canonical>(\n\t...params: [ReadableFamilyToken<T, K>, K] | [ReadableToken<T>]\n): T {\n\tconst store = React.useContext(StoreContext)\n\tconst token = parseStateOverloads(store, ...params)\n\tconst id = React.useId()\n\treturn React.useSyncExternalStore<T>(\n\t\t(dispatch) => subscribeToState(store, token, `use-o:${id}`, dispatch),\n\t\t() => getFromStore(store, token),\n\t\t() => getFromStore(store, token),\n\t)\n}\n","import type { MutableAtomFamilyToken, MutableAtomToken } from \"atom.io\"\nimport type { AsJSON, Transceiver } from \"atom.io/internal\"\nimport { findInStore, getJsonToken } from \"atom.io/internal\"\nimport type { Canonical, Json } from \"atom.io/json\"\nimport * as React from \"react\"\n\nimport { StoreContext } from \"./store-context\"\nimport { useO } from \"./use-o\"\n\nexport function useJSON<T extends Transceiver<any, any, any>>(\n\ttoken: MutableAtomToken<T>,\n): AsJSON<T>\n\nexport function useJSON<\n\tT extends Transceiver<any, any, any>,\n\tK extends Canonical,\n>(token: MutableAtomFamilyToken<T, K>, key: K): AsJSON<T>\n\nexport function useJSON(\n\ttoken: MutableAtomFamilyToken<any, any> | MutableAtomToken<any>,\n\tkey?: Canonical,\n): Json.Serializable {\n\tconst store = React.useContext(StoreContext)\n\tconst stateToken: MutableAtomToken<any> =\n\t\ttoken.type === `mutable_atom_family` ? findInStore(store, token, key) : token\n\tconst jsonToken = getJsonToken(store, stateToken)\n\treturn useO(jsonToken)\n}\n","/** biome-ignore-all lint/correctness/useHookAtTopLevel: params are used in an invariant way */\nimport type { Loadable, ReadableFamilyToken, ReadableToken } from \"atom.io\"\nimport type { Canonical } from \"atom.io/json\"\nimport { useO } from \"atom.io/react\"\nimport React from \"react\"\n\nexport function useLoadable<T>(\n\ttoken: ReadableToken<Loadable<T>>,\n): `LOADING` | { loading: boolean; value: T }\n\nexport function useLoadable<T, K extends Canonical>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K>,\n\tkey: K,\n): `LOADING` | { loading: boolean; value: T }\n\nexport function useLoadable<T, F extends T>(\n\ttoken: ReadableToken<Loadable<T>>,\n\tfallback: F,\n): { loading: boolean; value: T }\n\nexport function useLoadable<T, K extends Canonical, F extends T>(\n\ttoken: ReadableFamilyToken<Loadable<T>, K>,\n\tkey: K,\n\tfallback: F,\n): { loading: boolean; value: T }\n\nexport function useLoadable(\n\t...params:\n\t\t| readonly [ReadableFamilyToken<any, Canonical>, Canonical, unknown]\n\t\t| readonly [ReadableFamilyToken<any, Canonical>, Canonical]\n\t\t| readonly [ReadableToken<any>, unknown]\n\t\t| readonly [ReadableToken<any>]\n): `LOADING` | { loading: boolean; value: unknown } {\n\tlet state: unknown\n\tlet fallback: unknown\n\n\tconst [token] = params\n\tlet key: Canonical\n\tswitch (token.type) {\n\t\tcase `atom`:\n\t\tcase `mutable_atom`:\n\t\tcase `readonly_held_selector`:\n\t\tcase `readonly_pure_selector`:\n\t\tcase `writable_held_selector`:\n\t\tcase `writable_pure_selector`:\n\t\t\tstate = useO(token)\n\t\t\tfallback = params[1]\n\t\t\tbreak\n\t\tcase `atom_family`:\n\t\tcase `mutable_atom_family`:\n\t\tcase `readonly_held_selector_family`:\n\t\tcase `readonly_pure_selector_family`:\n\t\tcase `writable_held_selector_family`:\n\t\tcase `writable_pure_selector_family`:\n\t\t\tkey = params[1] as Canonical\n\t\t\tstate = useO(token, key)\n\t\t\tfallback = params[2]\n\t}\n\n\tconst wrapperRef = React.useRef({ loading: false, value: null as unknown })\n\tconst lastLoadedRef = React.useRef(\n\t\tfallback ?? (state instanceof Promise ? `LOADING` : state),\n\t)\n\n\tconst { current: lastLoaded } = lastLoadedRef\n\tlet { current: wrapper } = wrapperRef\n\n\tif (state instanceof Promise) {\n\t\tif (lastLoaded === `LOADING`) {\n\t\t\treturn `LOADING`\n\t\t}\n\t\twrapper = wrapperRef.current = { loading: true, value: lastLoaded }\n\t} else {\n\t\tlastLoadedRef.current = state\n\t\tif (wrapper.loading === true) {\n\t\t\twrapper = wrapperRef.current = { loading: false, value: state }\n\t\t} else {\n\t\t\twrapper.loading = false\n\t\t\twrapper.value = state\n\t\t}\n\t}\n\n\treturn wrapper\n}\n","import type { TimelineToken } from \"atom.io\"\nimport { redo, undo } from \"atom.io\"\nimport { subscribeToTimeline, withdraw } from \"atom.io/internal\"\nimport * as React from \"react\"\n\nimport { StoreContext } from \"./store-context\"\n\nexport type TimelineMeta = {\n\tat: number\n\tlength: number\n\tundo: () => void\n\tredo: () => void\n}\n\nexport function useTL(token: TimelineToken<any>): TimelineMeta {\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tconst timeline = withdraw(store, token)\n\tconst tokenRef = React.useRef(token)\n\tconst rebuildMeta = () => {\n\t\treturn {\n\t\t\tat: timeline.at,\n\t\t\tlength: timeline.history.length,\n\t\t\tundo: () => {\n\t\t\t\tundo(token)\n\t\t\t},\n\t\t\tredo: () => {\n\t\t\t\tredo(token)\n\t\t\t},\n\t\t}\n\t}\n\tconst meta = React.useRef<TimelineMeta>(rebuildMeta())\n\tconst retrieve = () => {\n\t\tif (\n\t\t\tmeta.current.at !== timeline?.at ||\n\t\t\tmeta.current.length !== timeline?.history.length ||\n\t\t\ttokenRef.current !== token\n\t\t) {\n\t\t\ttokenRef.current = token\n\t\t\tmeta.current = rebuildMeta()\n\t\t}\n\t\treturn meta.current\n\t}\n\treturn React.useSyncExternalStore<TimelineMeta>(\n\t\t(dispatch) => subscribeToTimeline(store, token, `use-tl:${id}`, dispatch),\n\t\tretrieve,\n\t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edHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {\n\t\twidthPadding?: number\n\t}\n>","VALID_NON_NUMBER_INTERPRETATIONS: Readonly<\n\tRecord<ValidNonNumber, number | null>\n>","DEFAULT_NUMBER_CONSTRAINTS: NumberConstraints","NumberInput: FC<NumberInputProps>","TextInput: FC<TextInputProps>","DefaultFallback: FC<FallbackProps>","DEFAULT_JSON_EDITOR_COMPONENTS: JsonEditorComponents","SubEditors: Record<\n\tkeyof JsonTypes,\n\tFC<JsonEditorProps_INTERNAL<any>>\n>"],"sources":["../../src/react-devtools/AtomIODevtools.tsx","../../src/react-devtools/elastic-input/ElasticInput.tsx","../../src/react-devtools/elastic-input/NumberInput.tsx","../../src/react-devtools/elastic-input/TextInput.tsx","../../src/react-devtools/error-boundary/DefaultFallback.tsx","../../src/react-devtools/error-boundary/ReactErrorBoundary.tsx","../../src/react-devtools/json-editor/default-components.tsx","../../src/react-devtools/json-editor/json-editor-internal.tsx","../../src/react-devtools/json-editor/developer-interface.tsx","../../src/react-devtools/json-editor/editors-by-type/utilities/cast-to-json.ts","../../src/react-devtools/json-editor/index.ts"],"sourcesContent":[],"mappings":";;;;cAWaA,gBAAgB,KAAA,CAAM;;;;;KCEvB,iBAAA,GAAoB,kBAC/B,oBAAoB,mBACpB;;;ADJYA,cCSAC,YDTgB,ECSF,yBDTQ,CCUlC,iBDVkC,CCUhB,mBDVgB,CCUI,gBDVJ,CAAA,ECUuB,gBDVvB,CAAA,GAAA;;;;;iBENnB,SAAA;cAeH;KACD,cAAA,WAAyB;AFVxBD,cEWA,gBFXgB,EAAM,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,KAAA,IEWuB,cFXvB;cEatBE,kCAAkC,SAC9C,OAAO;KAOI,iBAAA;cACC,iDAAgD;ADpBjD,KC8BA,iBAAA,GD9BA;EAAA,GAAA,EAAA,MAAA;aACS;eAApB,EAAA,MAAA;UACA,EAAA,OAAA;;AAF+B,cCoCnBC,0BDpCmB,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;;YAAmB,CAAA,EOmB5C,OPnB4C,COmBpC,oBPnBoC,CAAA;QAAzD,CAAA,EAAA,MAAA,GAAA,SAAA;;AAD0B,cOwBd,UPxBc,EAAA,CAAA,CAAA,CAAA,CAAA;EAAA,IAAA;EAAA,GAAA;EAAA,IAAA;EAAA,MAAA;EAAA,MAAA;EAAA,IAAA;EAAA,UAAA;EAAA,QAAA;EAAA,SAAA;EAAA,MAAA;EAAA,KAAA;EAAA,UAAA,EOoCd,gBPpCc;EAAA;AAAA,CAAA,EOsCxB,ePtCwB,COsCR,CPtCQ,CAAA,EAAA,GOsCH,YPtCG;;;cQfd;SAGL,IAAA,CAAK,IAAA,CAAK;;ETGlB,MAAaD,EAAAA,MAAAA;USAJ,IAAA,CAAK,IAAA,CAAK;;;AREnB,CAAA;;;KSTY,kCAAkC,SACvC,aAAa,MAAM"}
1
+ {"version":3,"file":"index.d.ts","names":["AtomIODevtools: React.FC<{ hideByDefault?: boolean }>","ElasticInput: ForwardRefExoticComponent<\n\tDetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {\n\t\twidthPadding?: number\n\t}\n>","VALID_NON_NUMBER_INTERPRETATIONS: Readonly<\n\tRecord<ValidNonNumber, number | null>\n>","DEFAULT_NUMBER_CONSTRAINTS: NumberConstraints","NumberInput: FC<NumberInputProps>","TextInput: FC<TextInputProps>","DefaultFallback: FC<FallbackProps>","DEFAULT_JSON_EDITOR_COMPONENTS: JsonEditorComponents","SubEditors: Record<\n\tkeyof JsonTypes,\n\tFC<JsonEditorProps_INTERNAL<any>>\n>"],"sources":["../../src/react-devtools/AtomIODevtools.tsx","../../src/react-devtools/elastic-input/ElasticInput.tsx","../../src/react-devtools/elastic-input/NumberInput.tsx","../../src/react-devtools/elastic-input/TextInput.tsx","../../src/react-devtools/error-boundary/DefaultFallback.tsx","../../src/react-devtools/error-boundary/ReactErrorBoundary.tsx","../../src/react-devtools/json-editor/default-components.tsx","../../src/react-devtools/json-editor/json-editor-internal.tsx","../../src/react-devtools/json-editor/developer-interface.tsx","../../src/react-devtools/json-editor/editors-by-type/utilities/cast-to-json.ts","../../src/react-devtools/json-editor/index.ts"],"sourcesContent":[],"mappings":";;;;cAWaA,gBAAgB,KAAA,CAAM;;;;;KCEvB,iBAAA,GAAoB,kBAC/B,oBAAoB,mBACpB;;;ADJYA,cCSAC,YDTgB,ECSF,yBDTQ,CCUlC,iBDVkC,CCUhB,mBDVgB,CCUI,gBDVJ,CAAA,ECUuB,gBDVvB,CAAA,GAAA;;;;;iBENnB,SAAA;cAeH;KACD,cAAA,WAAyB;AFVxBD,cEWA,gBFXgB,EAAM,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,KAAA,IEWuB,cFXvB;cEatBE,kCAAkC,SAC9C,OAAO;KAOI,iBAAA;cACC,iDAAgD;ADpBjD,KC8BA,iBAAA,GD9BA;EAAA,GAAA,EAAA,MAAA;aACS;eAApB,EAAA,MAAA;UACA,EAAA,OAAA;;cCkCYC,4BAA4B;AD7BzC,KCoEK,gBAAA,GAAmB,ODpEXF,CCoEmB,iBDpEnBA,CAAAA,GAAAA;;UAC0B,CAAA,EAAA,OAAA;aAApB;QAAuC,EAAA,MAAA;SAAzD,MAAA;UAD0B,CAAA,EAAA,CAAA,CAAA,EC0EX,KAAA,CAAM,WD1EK,CC0EO,gBD1EP,CAAA,EAAA,GAAA,IAAA;gBC2EZ,KAAA,CAAM,WAAW,gBAAgB;;;;EA1FhD,KAAgB,CAAA,EAAA,MAAA,GAAA,IAAA;AAehB,CAAA;AACY,cAiFCG,WAjFD,EAiFc,EAjFW,CAiFR,gBAjFQ,CAAA;;;KCjBzB,cAAA;;;EHOZ,KAAaJ,CAAAA,EAAAA,MAAAA;;;;ECEb,MAAY,CAAA,EAAA,MAAA;CAAA;AACS,cEARK,SFAQ,EEAG,EFAH,CEAM,cFAN,CAAA;;;KGZT,aAAA;UACH;cACI;AJOb,CAAA;cIJaC,iBAAiB,GAAG;;;KCDrB,kBAAA;ELKZ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A,CAAA,IAAA,EOuBb,aPvBa,CAAA,MAAA,GAAA,MAAA,CAAA,EAAA,GAAA,OAAA;;EAOhC,KAAaC,CAAAA,EOkBJ,aPlBIA;WOmBH;UAAW,CPlBkB;;YAAmB,CAAA,EOmB5C,OPnB4C,COmBpC,oBPnBoC,CAAA;QAAzD,CAAA,EAAA,MAAA,GAAA,SAAA;;cOuBY;;;;;;;;;;;;cAYA;;GAEV,gBAAgB,OAAK;;;cCrDX;SAGL,IAAA,CAAK,IAAA,CAAK;;ETGlB,MAAaD,EAAAA,MAAAA;USAJ,IAAA,CAAK,IAAA,CAAK;;;AREnB,CAAA;;;KSTY,kCAAkC,SACvC,aAAa,MAAM"}
@@ -1,4 +1,3 @@
1
- import { useI as useI$1, useO as useO$1 } from "../use-o-DXPncKmZ.js";
2
1
  import { actUponStore, arbitrary, become, createRegularAtom, createRegularAtomFamily, createTransaction, disposeFromStore, findInStore, getFromStore } from "atom.io/internal";
3
2
  import { JSON_DEFAULTS, fromEntries, isJson, stringifyJson, toEntries } from "atom.io/json";
4
3
  import { redo, undo } from "atom.io";
@@ -567,7 +566,7 @@ const JsonEditor_INTERNAL = ({ data, set, name, rename, remove, recast, path = [
567
566
  const makeElementSetters = (data, set) => data.map((value, index) => (newValue) => {
568
567
  set(() => {
569
568
  const newData = [...data];
570
- newData[index] = become(newValue)(value);
569
+ newData[index] = become(newValue, value);
571
570
  return newData;
572
571
  });
573
572
  });
@@ -758,7 +757,7 @@ const castToJson = (input) => {
758
757
  const makePropertySetters = (data, set) => fromEntries(toEntries(data).map(([key, value]) => [key, (newValue) => {
759
758
  set({
760
759
  ...data,
761
- [key]: become(newValue)(value)
760
+ [key]: become(newValue, value)
762
761
  });
763
762
  }]));
764
763
  const makePropertyRenamers = (data, set, stableKeyMapRef) => fromEntries(toEntries(data).map(([key, value]) => [key, (newKey) => {
@@ -879,8 +878,8 @@ const ArrayEditor = ({ path = [], isReadonly = () => false, isHidden = () => fal
879
878
  //#region src/react-devtools/json-editor/editors-by-type/object-editor.tsx
880
879
  const ObjectProperty = ({ path, isReadonly, isHidden, data, set, rename, remove, recast, Components, testid, viewIsOpenAtom }) => {
881
880
  const key = path[path.length - 1];
882
- const viewIsOpen = useO$1(viewIsOpenAtom);
883
- const setViewIsOpen = useI$1(viewIsOpenAtom);
881
+ const viewIsOpen = useO(viewIsOpenAtom);
882
+ const setViewIsOpen = useI(viewIsOpenAtom);
884
883
  return /* @__PURE__ */ jsx(JsonEditor_INTERNAL, {
885
884
  path,
886
885
  name: `${key}`,