atom.io 0.6.9 → 0.7.0

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 (169) hide show
  1. package/README.md +21 -2
  2. package/dist/index.d.mts +34 -421
  3. package/dist/index.d.ts +34 -421
  4. package/dist/index.js +248 -23
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +209 -4
  7. package/dist/index.mjs.map +1 -1
  8. package/internal/dist/index.d.mts +342 -0
  9. package/internal/dist/index.d.ts +342 -0
  10. package/internal/dist/index.js +1873 -0
  11. package/internal/dist/index.js.map +1 -0
  12. package/internal/dist/index.mjs +1798 -0
  13. package/internal/dist/index.mjs.map +1 -0
  14. package/internal/package.json +15 -0
  15. package/internal/src/atom/create-atom.ts +75 -0
  16. package/internal/src/atom/delete-atom.ts +10 -0
  17. package/internal/src/atom/index.ts +3 -0
  18. package/internal/src/atom/is-default.ts +37 -0
  19. package/internal/src/caching.ts +21 -0
  20. package/internal/src/families/create-atom-family.ts +59 -0
  21. package/internal/src/families/create-readonly-selector-family.ts +45 -0
  22. package/internal/src/families/create-selector-family.ts +67 -0
  23. package/internal/src/families/index.ts +3 -0
  24. package/internal/src/get-state-internal.ts +23 -0
  25. package/internal/src/index.ts +13 -0
  26. package/internal/src/mutable/create-mutable-atom-family.ts +25 -0
  27. package/internal/src/mutable/create-mutable-atom.ts +49 -0
  28. package/internal/src/mutable/get-json-token.ts +22 -0
  29. package/internal/src/mutable/get-update-token.ts +20 -0
  30. package/internal/src/mutable/index.ts +17 -0
  31. package/internal/src/mutable/is-atom-token-mutable.ts +7 -0
  32. package/internal/src/mutable/tracker-family.ts +61 -0
  33. package/internal/src/mutable/tracker.ts +164 -0
  34. package/internal/src/mutable/transceiver.ts +110 -0
  35. package/internal/src/operation.ts +68 -0
  36. package/internal/src/selector/create-read-write-selector.ts +65 -0
  37. package/internal/src/selector/create-readonly-selector.ts +49 -0
  38. package/internal/src/selector/create-selector.ts +65 -0
  39. package/internal/src/selector/index.ts +5 -0
  40. package/internal/src/selector/lookup-selector-sources.ts +20 -0
  41. package/internal/src/selector/register-selector.ts +61 -0
  42. package/internal/src/selector/trace-selector-atoms.ts +45 -0
  43. package/internal/src/selector/update-selector-atoms.ts +34 -0
  44. package/internal/src/set-state/become.ts +10 -0
  45. package/internal/src/set-state/copy-mutable-if-needed.ts +23 -0
  46. package/internal/src/set-state/copy-mutable-in-transaction.ts +59 -0
  47. package/internal/src/set-state/copy-mutable-into-new-store.ts +34 -0
  48. package/internal/src/set-state/emit-update.ts +23 -0
  49. package/internal/src/set-state/evict-downstream.ts +39 -0
  50. package/internal/src/set-state/index.ts +2 -0
  51. package/internal/src/set-state/set-atom-state.ts +38 -0
  52. package/internal/src/set-state/set-selector-state.ts +19 -0
  53. package/internal/src/set-state/set-state-internal.ts +18 -0
  54. package/internal/src/set-state/stow-update.ts +42 -0
  55. package/internal/src/store/deposit.ts +43 -0
  56. package/internal/src/store/index.ts +5 -0
  57. package/internal/src/store/lookup.ts +26 -0
  58. package/internal/src/store/store.ts +154 -0
  59. package/internal/src/store/withdraw-new-family-member.ts +53 -0
  60. package/internal/src/store/withdraw.ts +113 -0
  61. package/internal/src/subject.ts +21 -0
  62. package/internal/src/subscribe/index.ts +1 -0
  63. package/internal/src/subscribe/recall-state.ts +19 -0
  64. package/internal/src/subscribe/subscribe-to-root-atoms.ts +47 -0
  65. package/internal/src/timeline/add-atom-to-timeline.ts +189 -0
  66. package/internal/src/timeline/index.ts +3 -0
  67. package/internal/src/timeline/time-travel-internal.ts +91 -0
  68. package/internal/src/timeline/timeline-internal.ts +115 -0
  69. package/internal/src/transaction/abort-transaction.ts +12 -0
  70. package/internal/src/transaction/apply-transaction.ts +64 -0
  71. package/internal/src/transaction/build-transaction.ts +39 -0
  72. package/internal/src/transaction/index.ts +26 -0
  73. package/internal/src/transaction/redo-transaction.ts +22 -0
  74. package/internal/src/transaction/transaction-internal.ts +64 -0
  75. package/internal/src/transaction/undo-transaction.ts +22 -0
  76. package/introspection/dist/index.d.mts +3 -197
  77. package/introspection/dist/index.d.ts +3 -197
  78. package/introspection/dist/index.js +329 -4
  79. package/introspection/dist/index.js.map +1 -1
  80. package/introspection/dist/index.mjs +310 -4
  81. package/introspection/dist/index.mjs.map +1 -1
  82. package/introspection/src/attach-atom-index.ts +84 -0
  83. package/introspection/src/attach-introspection-states.ts +38 -0
  84. package/introspection/src/attach-selector-index.ts +90 -0
  85. package/introspection/src/attach-timeline-family.ts +59 -0
  86. package/introspection/src/attach-timeline-index.ts +38 -0
  87. package/introspection/src/attach-transaction-index.ts +40 -0
  88. package/introspection/src/attach-transaction-logs.ts +43 -0
  89. package/introspection/src/index.ts +20 -0
  90. package/json/dist/index.d.mts +10 -2
  91. package/json/dist/index.d.ts +10 -2
  92. package/json/dist/index.js +83 -26
  93. package/json/dist/index.js.map +1 -1
  94. package/json/dist/index.mjs +74 -3
  95. package/json/dist/index.mjs.map +1 -1
  96. package/json/src/index.ts +5 -0
  97. package/json/src/select-json-family.ts +35 -0
  98. package/json/src/select-json.ts +22 -0
  99. package/package.json +103 -63
  100. package/react/dist/index.d.mts +9 -17
  101. package/react/dist/index.d.ts +9 -17
  102. package/react/dist/index.js +44 -27
  103. package/react/dist/index.js.map +1 -1
  104. package/react/dist/index.mjs +24 -4
  105. package/react/dist/index.mjs.map +1 -1
  106. package/react/src/index.ts +2 -0
  107. package/react/src/store-context.tsx +12 -0
  108. package/react/src/store-hooks.ts +36 -0
  109. package/react-devtools/dist/index.css +50 -1
  110. package/react-devtools/dist/index.css.map +1 -1
  111. package/react-devtools/dist/index.d.mts +104 -71
  112. package/react-devtools/dist/index.d.ts +104 -71
  113. package/react-devtools/dist/index.js +2806 -44
  114. package/react-devtools/dist/index.js.map +1 -1
  115. package/react-devtools/dist/index.mjs +2775 -10
  116. package/react-devtools/dist/index.mjs.map +1 -1
  117. package/react-devtools/src/AtomIODevtools.tsx +109 -0
  118. package/react-devtools/src/Button.tsx +23 -0
  119. package/react-devtools/src/StateEditor.tsx +75 -0
  120. package/react-devtools/src/StateIndex.tsx +159 -0
  121. package/react-devtools/src/TimelineIndex.tsx +88 -0
  122. package/react-devtools/src/TransactionIndex.tsx +70 -0
  123. package/react-devtools/src/Updates.tsx +150 -0
  124. package/react-devtools/src/devtools.scss +310 -0
  125. package/react-devtools/src/index.ts +72 -0
  126. package/realtime-react/dist/index.d.mts +8 -22
  127. package/realtime-react/dist/index.d.ts +8 -22
  128. package/realtime-react/dist/index.js +87 -32
  129. package/realtime-react/dist/index.js.map +1 -1
  130. package/realtime-react/dist/index.mjs +62 -6
  131. package/realtime-react/dist/index.mjs.map +1 -1
  132. package/realtime-react/src/index.ts +7 -0
  133. package/realtime-react/src/realtime-context.tsx +29 -0
  134. package/realtime-react/src/use-pull-family-member.ts +15 -0
  135. package/realtime-react/src/use-pull-mutable-family-member.ts +20 -0
  136. package/realtime-react/src/use-pull-mutable.ts +17 -0
  137. package/realtime-react/src/use-pull.ts +15 -0
  138. package/realtime-react/src/use-push.ts +19 -0
  139. package/realtime-react/src/use-server-action.ts +18 -0
  140. package/realtime-testing/dist/index.d.mts +49 -0
  141. package/realtime-testing/dist/index.d.ts +49 -0
  142. package/realtime-testing/dist/index.js +147 -0
  143. package/realtime-testing/dist/index.js.map +1 -0
  144. package/realtime-testing/dist/index.mjs +116 -0
  145. package/realtime-testing/dist/index.mjs.map +1 -0
  146. package/realtime-testing/src/index.ts +1 -0
  147. package/realtime-testing/src/setup-realtime-test.tsx +161 -0
  148. package/src/atom.ts +64 -9
  149. package/src/index.ts +36 -32
  150. package/src/logger.ts +3 -3
  151. package/src/selector.ts +3 -3
  152. package/src/silo.ts +29 -20
  153. package/src/subscribe.ts +3 -3
  154. package/src/timeline.ts +2 -2
  155. package/transceivers/set-rtx/dist/index.d.mts +39 -0
  156. package/transceivers/set-rtx/dist/index.d.ts +39 -0
  157. package/transceivers/set-rtx/dist/index.js +213 -0
  158. package/transceivers/set-rtx/dist/index.js.map +1 -0
  159. package/transceivers/set-rtx/dist/index.mjs +211 -0
  160. package/transceivers/set-rtx/dist/index.mjs.map +1 -0
  161. package/{realtime → transceivers/set-rtx}/package.json +1 -1
  162. package/transceivers/set-rtx/src/index.ts +1 -0
  163. package/transceivers/set-rtx/src/set-rtx.ts +242 -0
  164. package/realtime/dist/index.d.mts +0 -23
  165. package/realtime/dist/index.d.ts +0 -23
  166. package/realtime/dist/index.js +0 -32
  167. package/realtime/dist/index.js.map +0 -1
  168. package/realtime/dist/index.mjs +0 -7
  169. package/realtime/dist/index.mjs.map +0 -1
@@ -1,200 +1,6 @@
1
- import { StateToken, FamilyMetadata, TimelineUpdate, StateUpdate, TransactionUpdate, ƒn, AtomToken, ReadonlySelectorToken, SelectorToken, TransactionToken, TimelineToken, Logger, __INTERNAL__, ReadonlySelectorFamily } from 'atom.io';
2
-
3
- type primitive = boolean | number | string | null;
4
-
5
- type Serializable = primitive | Readonly<{
6
- [key: string]: Serializable;
7
- }> | ReadonlyArray<Serializable>;
8
- type Object$1<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
9
-
10
- type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
11
- type Cardinality = `1:1` | `1:n` | `n:n`;
12
-
13
- interface JunctionEntries<Content extends Object$1 | null> extends Object$1 {
14
- readonly relations: [string, string[]][];
15
- readonly contents: [string, Content][];
16
- }
17
- interface JunctionSchema<ASide extends string, BSide extends string> extends Object$1 {
18
- readonly between: [a: ASide, b: BSide];
19
- readonly cardinality: Cardinality;
20
- }
21
- type JunctionAdvancedConfiguration<Content extends Object$1 | null> = {
22
- externalStore?: (Content extends null ? {
23
- getContent?: undefined;
24
- setContent?: undefined;
25
- deleteContent?: undefined;
26
- } : {
27
- getContent: (contentKey: string) => Content | undefined;
28
- setContent: (contentKey: string, content: Content) => void;
29
- deleteContent: (g: any) => void;
30
- }) & {
31
- addRelation: (a: string, b: string) => void;
32
- deleteRelation: (a: string, b: string) => void;
33
- getRelatedKeys: (key: string) => Set<string> | undefined;
34
- has: (a: string, b?: string) => boolean;
35
- };
36
- isContent?: Refinement<unknown, Content>;
37
- makeContentKey?: (a: string, b: string) => string;
38
- };
39
- type JunctionJSON<ASide extends string, BSide extends string, Content extends Object$1 | null> = JunctionEntries<Content> & JunctionSchema<ASide, BSide>;
40
- declare class Junction<ASide extends string, BSide extends string, Content extends Object$1 | null = null> {
41
- readonly a: ASide;
42
- readonly b: BSide;
43
- readonly cardinality: Cardinality;
44
- readonly relations: Map<string, Set<string>>;
45
- readonly contents: Map<string, Content>;
46
- isContent: Refinement<unknown, Content> | null;
47
- makeContentKey: (a: string, b: string) => string;
48
- getRelatedKeys(key: string): Set<string> | undefined;
49
- protected addRelation(a: string, b: string): void;
50
- protected deleteRelation(a: string, b: string): void;
51
- protected getContentInternal(contentKey: string): Content | undefined;
52
- protected setContent(contentKey: string, content: Content): void;
53
- protected deleteContent(contentKey: string): void;
54
- constructor(data: JunctionSchema<ASide, BSide> & Partial<JunctionEntries<Content>>, config?: JunctionAdvancedConfiguration<Content>);
55
- toJSON(): JunctionJSON<ASide, BSide, Content>;
56
- set(a: string, ...rest: Content extends null ? [b: string] : [b: string, content: Content]): this;
57
- set(relation: {
58
- [Key in ASide | BSide]: string;
59
- }, ...rest: Content extends null ? [] | [b?: undefined] : [content: Content]): this;
60
- delete(a: string, b?: string): this;
61
- delete(relation: Record<ASide | BSide, string> | Record<ASide, string> | Record<BSide, string>, b?: undefined): this;
62
- getRelatedKey(key: string): string | undefined;
63
- getContent(a: string, b: string): Content | undefined;
64
- getRelationEntries(input: Record<ASide, string> | Record<BSide, string>): [string, Content][];
65
- has(a: string, b?: string): boolean;
66
- }
67
-
68
- type OperationProgress = {
69
- open: false;
70
- } | {
71
- open: true;
72
- done: Set<string>;
73
- prev: Map<string, any>;
74
- time: number;
75
- token: StateToken<any>;
76
- };
77
-
78
- type Subscriber<T> = (value: T) => void;
79
- declare class Subject<T> {
80
- subscribers: Map<string, Subscriber<T>>;
81
- subscribe(key: string, subscriber: Subscriber<T>): () => void;
82
- private unsubscribe;
83
- next(value: T): void;
84
- }
85
-
86
- type Selector<T> = {
87
- key: string;
88
- type: `selector`;
89
- family?: FamilyMetadata;
90
- install: (store: Store) => void;
91
- subject: Subject<{
92
- newValue: T;
93
- oldValue: T;
94
- }>;
95
- get: () => T;
96
- set: (newValue: T | ((oldValue: T) => T)) => void;
97
- };
98
- type ReadonlySelector<T> = {
99
- key: string;
100
- type: `readonly_selector`;
101
- family?: FamilyMetadata;
102
- install: (store: Store) => void;
103
- subject: Subject<{
104
- newValue: T;
105
- oldValue: T;
106
- }>;
107
- get: () => T;
108
- };
109
-
110
- type TimelineAtomUpdate = StateUpdate<unknown> & {
111
- key: string;
112
- type: `atom_update`;
113
- timestamp: number;
114
- family?: FamilyMetadata;
115
- };
116
- type TimelineSelectorUpdate = {
117
- key: string;
118
- type: `selector_update`;
119
- timestamp: number;
120
- atomUpdates: Omit<TimelineAtomUpdate, `timestamp`>[];
121
- };
122
- type TimelineTransactionUpdate = TransactionUpdate<ƒn> & {
123
- key: string;
124
- type: `transaction_update`;
125
- timestamp: number;
126
- };
127
- type Timeline = {
128
- type: `timeline`;
129
- key: string;
130
- at: number;
131
- timeTraveling: `into_future` | `into_past` | null;
132
- history: TimelineUpdate[];
133
- selectorTime: number | null;
134
- transactionKey: string | null;
135
- install: (store: Store) => void;
136
- subject: Subject<TimelineAtomUpdate | TimelineSelectorUpdate | TimelineTransactionUpdate | `redo` | `undo`>;
137
- };
138
-
139
- type Transaction<ƒ extends ƒn> = {
140
- key: string;
141
- type: `transaction`;
142
- install: (store: Store) => void;
143
- subject: Subject<TransactionUpdate<ƒ>>;
144
- run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>;
145
- };
146
-
147
- type TransactionUpdateInProgress<ƒ extends ƒn> = TransactionUpdate<ƒ> & {
148
- phase: `applying` | `building`;
149
- time: number;
150
- core: StoreCore;
151
- };
152
- type TransactionIdle = {
153
- phase: `idle`;
154
- };
155
- type TransactionStatus<ƒ extends ƒn> = TransactionIdle | TransactionUpdateInProgress<ƒ>;
156
-
157
- type StoreCore = Pick<Store, `atoms` | `atomsThatAreDefault` | `operation` | `readonlySelectors` | `selectorAtoms` | `selectorGraph` | `selectors` | `timelineAtoms` | `timelines` | `transactions` | `valueMap`>;
158
- declare class Store {
159
- valueMap: Map<string, any>;
160
- atoms: Map<string, Atom<any>>;
161
- selectors: Map<string, Selector<any>>;
162
- readonlySelectors: Map<string, ReadonlySelector<any>>;
163
- timelines: Map<string, Timeline>;
164
- transactions: Map<string, Transaction<ƒn>>;
165
- atomsThatAreDefault: Set<string>;
166
- timelineAtoms: Junction<"timelineKey", "atomKey", null>;
167
- selectorAtoms: Junction<"selectorKey", "atomKey", null>;
168
- selectorGraph: Junction<"upstreamSelectorKey", "downstreamSelectorKey", {
169
- source: string;
170
- }>;
171
- subject: {
172
- atomCreation: Subject<AtomToken<unknown>>;
173
- selectorCreation: Subject<ReadonlySelectorToken<unknown> | SelectorToken<unknown>>;
174
- transactionCreation: Subject<TransactionToken<ƒn>>;
175
- timelineCreation: Subject<TimelineToken>;
176
- operationStatus: Subject<OperationProgress>;
177
- };
178
- operation: OperationProgress;
179
- transactionStatus: TransactionStatus<ƒn>;
180
- config: {
181
- name: string;
182
- logger: Logger | null;
183
- logger__INTERNAL: Logger;
184
- };
185
- constructor(name: string, store?: Store | null);
186
- }
187
-
188
- type Atom<T> = {
189
- key: string;
190
- type: `atom`;
191
- family?: FamilyMetadata;
192
- subject: Subject<{
193
- newValue: T;
194
- oldValue: T;
195
- }>;
196
- default: T;
197
- };
1
+ import { AtomToken, ReadonlySelectorToken, SelectorToken, TransactionToken, ƒn, ReadonlySelectorFamily, TransactionUpdate, TimelineToken } from 'atom.io';
2
+ import * as __INTERNAL__ from 'atom.io/internal';
3
+ import { Timeline } from 'atom.io/internal';
198
4
 
199
5
  type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>;
200
6
 
@@ -1,10 +1,335 @@
1
1
  'use strict';
2
2
 
3
- var atom_io = require('atom.io');
4
- var internal = require('atom.io/internal');
3
+ var __INTERNAL__ = require('atom.io/internal');
5
4
 
6
- var E=Object.defineProperty,g=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var u=(e,o,t)=>o in e?E(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))h.call(o,t)&&u(e,t,o[t]);if(S)for(var t of S(o))F.call(o,t)&&u(e,t,o[t]);return e},m=(e,o)=>g(e,M(o));var x=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atom__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Atom Token Index (Internal)",default:()=>[...e.atoms].filter(([t])=>!t.includes("\u{1F441}\u200D\u{1F5E8}")).reduce((t,[n])=>(t[n]={key:n,type:"atom"},t),{}),effects:[({setSelf:t})=>{e.subject.atomCreation.subscribe("introspection",n=>{e.operation.open||n.key.includes("\u{1F441}\u200D\u{1F5E8}")||t(i=>{let{key:r,family:c}=n;if(c){let{key:l,subKey:d}=c,T=i[l];if(T===void 0||"familyMembers"in T){let s=T||{key:l,familyMembers:{}};return m(a({},i),{[l]:m(a({},s),{familyMembers:m(a({},s.familyMembers),{[d]:n})})})}}return m(a({},i),{[r]:n})});});}]},void 0,e);return atom_io.__INTERNAL__.selector__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Atom Token Index",get:({get:t})=>t(o)},void 0,e)};var R=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atom__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Selector Token Index (Internal)",default:()=>Object.assign([...e.readonlySelectors].filter(([t])=>!t.includes("\u{1F441}\u200D\u{1F5E8}")).reduce((t,[n])=>(t[n]={key:n,type:"readonly_selector"},t),{}),[...e.selectors].reduce((t,[n])=>(t[n]={key:n,type:"selector"},t),{})),effects:[({setSelf:t})=>{e.subject.selectorCreation.subscribe("introspection",n=>{e.operation.open||n.key.includes("\u{1F441}\u200D\u{1F5E8}")||t(i=>{let{key:r,family:c}=n;if(c){let{key:l,subKey:d}=c,T=i[l];if(T===void 0||"familyMembers"in T){let s=T||{key:l,familyMembers:{}};return m(a({},i),{[l]:m(a({},s),{familyMembers:m(a({},s.familyMembers),{[d]:n})})})}}return m(a({},i),{[r]:n})});});}]},void 0,e);return atom_io.__INTERNAL__.selector__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Selector Token Index",get:({get:t})=>t(o)})};var N=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atomFamily__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Timeline Update Log (Internal)",default:n=>{var i;return (i=e.timelines.get(n))!=null?i:{type:"timeline",key:"",at:0,timeTraveling:null,history:[],selectorTime:null,transactionKey:null,install:()=>{},subject:new internal.Subject}},effects:n=>[({setSelf:i})=>{let r=e.timelines.get(n);r==null||r.subject.subscribe("introspection",c=>{if(e.operation.open===!0){let l=e.subject.operationStatus.subscribe("introspection",d=>{d.open===!1&&(l(),i(a({},r)));});}else i(a({},r));});}]},e);return atom_io.__INTERNAL__.selectorFamily__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Timeline Update Log",get:n=>({get:i})=>i(o(n))},e)};var L=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atom__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Timeline Token Index (Internal)",default:()=>[...e.timelines].map(([n])=>({key:n,type:"timeline"})),effects:[({setSelf:n})=>{e.subject.timelineCreation.subscribe("introspection",i=>{n(r=>[...r,i]);});}]},void 0,e);return atom_io.__INTERNAL__.selector__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Timeline Token Index",get:({get:n})=>n(o)},void 0,e)};var A=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atom__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Transaction Token Index (Internal)",default:()=>[...e.transactions].map(([n])=>({key:n,type:"transaction"})),effects:[({setSelf:n})=>{e.subject.transactionCreation.subscribe("introspection",i=>{n(r=>[...r,i]);});}]},void 0,e);return atom_io.__INTERNAL__.selector__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Transaction Token Index",get:({get:n})=>n(o)},void 0,e)};var b=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>{let o=atom_io.__INTERNAL__.atomFamily__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Transaction Update Log (Internal)",default:()=>[],effects:n=>[({setSelf:i})=>{let r=e.transactions.get(n);r==null||r.subject.subscribe("introspection",c=>{c.key===n&&i(l=>[...l,c]);});}]},e);return atom_io.__INTERNAL__.selectorFamily__INTERNAL({key:"\u{1F441}\u200D\u{1F5E8} Transaction Update Log",get:n=>({get:i})=>i(o(n))},e)};var ie=(e=atom_io.__INTERNAL__.IMPLICIT.STORE)=>({atomIndex:x(e),selectorIndex:R(e),transactionIndex:A(e),findTransactionLogState:b(e),timelineIndex:L(e),findTimelineState:N(e)});
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
7
22
 
8
- exports.attachIntrospectionStates = ie;
23
+ var __INTERNAL____namespace = /*#__PURE__*/_interopNamespace(__INTERNAL__);
24
+
25
+ var __defProp = Object.defineProperty;
26
+ var __defProps = Object.defineProperties;
27
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
28
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
29
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
30
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
31
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
32
+ var __spreadValues = (a, b) => {
33
+ for (var prop in b || (b = {}))
34
+ if (__hasOwnProp.call(b, prop))
35
+ __defNormalProp(a, prop, b[prop]);
36
+ if (__getOwnPropSymbols)
37
+ for (var prop of __getOwnPropSymbols(b)) {
38
+ if (__propIsEnum.call(b, prop))
39
+ __defNormalProp(a, prop, b[prop]);
40
+ }
41
+ return a;
42
+ };
43
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
44
+ var attachAtomIndex = (store = __INTERNAL__.IMPLICIT.STORE) => {
45
+ const atomTokenIndexState__INTERNAL = __INTERNAL__.createAtom(
46
+ {
47
+ key: `\u{1F441}\u200D\u{1F5E8} Atom Token Index (Internal)`,
48
+ default: () => {
49
+ const defaultAtomIndex = [...store.atoms].filter(([key]) => !key.includes(`\u{1F441}\u200D\u{1F5E8}`)).reduce((acc, [key]) => {
50
+ acc[key] = { key, type: `atom` };
51
+ return acc;
52
+ }, {});
53
+ return defaultAtomIndex;
54
+ },
55
+ effects: [
56
+ ({ setSelf }) => {
57
+ store.subject.atomCreation.subscribe(`introspection`, (atomToken) => {
58
+ if (atomToken.key.includes(`\u{1F441}\u200D\u{1F5E8}`)) {
59
+ return;
60
+ }
61
+ const set = () => setSelf((state) => {
62
+ const { key, family } = atomToken;
63
+ if (family) {
64
+ const { key: familyKey, subKey } = family;
65
+ const current = state[familyKey];
66
+ if (current === void 0 || `familyMembers` in current) {
67
+ const familyKeyState = current || {
68
+ key: familyKey,
69
+ familyMembers: {}
70
+ };
71
+ return __spreadProps(__spreadValues({}, state), {
72
+ [familyKey]: __spreadProps(__spreadValues({}, familyKeyState), {
73
+ familyMembers: __spreadProps(__spreadValues({}, familyKeyState.familyMembers), {
74
+ [subKey]: atomToken
75
+ })
76
+ })
77
+ });
78
+ }
79
+ }
80
+ return __spreadProps(__spreadValues({}, state), {
81
+ [key]: atomToken
82
+ });
83
+ });
84
+ if (__INTERNAL__.target(store).operation.open) {
85
+ const unsubscribe = store.subject.operationStatus.subscribe(
86
+ `introspection: waiting to update atom index`,
87
+ () => {
88
+ unsubscribe();
89
+ set();
90
+ }
91
+ );
92
+ } else {
93
+ set();
94
+ }
95
+ });
96
+ }
97
+ ]
98
+ },
99
+ void 0,
100
+ store
101
+ );
102
+ return __INTERNAL__.createSelector(
103
+ {
104
+ key: `\u{1F441}\u200D\u{1F5E8} Atom Token Index`,
105
+ get: ({ get }) => get(atomTokenIndexState__INTERNAL)
106
+ },
107
+ void 0,
108
+ store
109
+ );
110
+ };
111
+ var attachSelectorIndex = (store = __INTERNAL__.IMPLICIT.STORE) => {
112
+ const readonlySelectorTokenIndexState__INTERNAL = __INTERNAL__.createAtom(
113
+ {
114
+ key: `\u{1F441}\u200D\u{1F5E8} Selector Token Index (Internal)`,
115
+ default: () => Object.assign(
116
+ [...store.readonlySelectors].filter(([key]) => !key.includes(`\u{1F441}\u200D\u{1F5E8}`)).reduce((acc, [key]) => {
117
+ acc[key] = { key, type: `readonly_selector` };
118
+ return acc;
119
+ }, {}),
120
+ [...store.selectors].reduce((acc, [key]) => {
121
+ acc[key] = { key, type: `selector` };
122
+ return acc;
123
+ }, {})
124
+ ),
125
+ effects: [
126
+ ({ setSelf }) => {
127
+ store.subject.selectorCreation.subscribe(
128
+ `introspection`,
129
+ (selectorToken) => {
130
+ if (selectorToken.key.includes(`\u{1F441}\u200D\u{1F5E8}`)) {
131
+ return;
132
+ }
133
+ const set = () => setSelf((state) => {
134
+ const { key, family } = selectorToken;
135
+ if (family) {
136
+ const { key: familyKey, subKey } = family;
137
+ const current = state[familyKey];
138
+ if (current === void 0 || `familyMembers` in current) {
139
+ const familyKeyState = current || {
140
+ key: familyKey,
141
+ familyMembers: {}
142
+ };
143
+ return __spreadProps(__spreadValues({}, state), {
144
+ [familyKey]: __spreadProps(__spreadValues({}, familyKeyState), {
145
+ familyMembers: __spreadProps(__spreadValues({}, familyKeyState.familyMembers), {
146
+ [subKey]: selectorToken
147
+ })
148
+ })
149
+ });
150
+ }
151
+ }
152
+ return __spreadProps(__spreadValues({}, state), {
153
+ [key]: selectorToken
154
+ });
155
+ });
156
+ if (__INTERNAL__.target(store).operation.open) {
157
+ const unsubscribe = store.subject.operationStatus.subscribe(
158
+ `introspection: waiting to update selector index`,
159
+ () => {
160
+ unsubscribe();
161
+ set();
162
+ }
163
+ );
164
+ } else {
165
+ set();
166
+ }
167
+ }
168
+ );
169
+ }
170
+ ]
171
+ },
172
+ void 0,
173
+ store
174
+ );
175
+ return __INTERNAL__.createSelector({
176
+ key: `\u{1F441}\u200D\u{1F5E8} Selector Token Index`,
177
+ get: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL)
178
+ });
179
+ };
180
+ var attachTimelineFamily = (store = __INTERNAL__.IMPLICIT.STORE) => {
181
+ const findTimelineLogState__INTERNAL = __INTERNAL__.createAtomFamily(
182
+ {
183
+ key: `\u{1F441}\u200D\u{1F5E8} Timeline Update Log (Internal)`,
184
+ default: (key) => {
185
+ var _a;
186
+ return (_a = store.timelines.get(key)) != null ? _a : {
187
+ type: `timeline`,
188
+ key: ``,
189
+ at: 0,
190
+ timeTraveling: null,
191
+ history: [],
192
+ selectorTime: null,
193
+ transactionKey: null,
194
+ install: () => {
195
+ },
196
+ subject: new __INTERNAL__.Subject()
197
+ };
198
+ },
199
+ effects: (key) => [
200
+ ({ setSelf }) => {
201
+ const tl = store.timelines.get(key);
202
+ tl == null ? void 0 : tl.subject.subscribe(`introspection`, (_) => {
203
+ if (store.operation.open === true) {
204
+ const unsubscribe = store.subject.operationStatus.subscribe(
205
+ `introspection`,
206
+ (operationStatus) => {
207
+ if (operationStatus.open === false) {
208
+ unsubscribe();
209
+ setSelf(__spreadValues({}, tl));
210
+ }
211
+ }
212
+ );
213
+ } else {
214
+ setSelf(__spreadValues({}, tl));
215
+ }
216
+ });
217
+ }
218
+ ]
219
+ },
220
+ store
221
+ );
222
+ const findTimelineLogState = __INTERNAL__.createSelectorFamily(
223
+ {
224
+ key: `\u{1F441}\u200D\u{1F5E8} Timeline Update Log`,
225
+ get: (key) => ({ get }) => get(findTimelineLogState__INTERNAL(key))
226
+ },
227
+ store
228
+ );
229
+ return findTimelineLogState;
230
+ };
231
+ var attachTimelineIndex = (store = __INTERNAL__.IMPLICIT.STORE) => {
232
+ const timelineTokenIndexState__INTERNAL = __INTERNAL__.createAtom(
233
+ {
234
+ key: `\u{1F441}\u200D\u{1F5E8} Timeline Token Index (Internal)`,
235
+ default: () => [...store.timelines].map(([key]) => {
236
+ return { key, type: `timeline` };
237
+ }),
238
+ effects: [
239
+ ({ setSelf }) => {
240
+ store.subject.timelineCreation.subscribe(
241
+ `introspection`,
242
+ (timelineToken) => {
243
+ setSelf((state) => [...state, timelineToken]);
244
+ }
245
+ );
246
+ }
247
+ ]
248
+ },
249
+ void 0,
250
+ store
251
+ );
252
+ const timelineTokenIndex = __INTERNAL__.createSelector(
253
+ {
254
+ key: `\u{1F441}\u200D\u{1F5E8} Timeline Token Index`,
255
+ get: ({ get }) => get(timelineTokenIndexState__INTERNAL)
256
+ },
257
+ void 0,
258
+ store
259
+ );
260
+ return timelineTokenIndex;
261
+ };
262
+ var attachTransactionIndex = (store = __INTERNAL__.IMPLICIT.STORE) => {
263
+ const transactionTokenIndexState__INTERNAL = __INTERNAL__.createAtom(
264
+ {
265
+ key: `\u{1F441}\u200D\u{1F5E8} Transaction Token Index (Internal)`,
266
+ default: () => [...store.transactions].map(([key]) => {
267
+ return { key, type: `transaction` };
268
+ }),
269
+ effects: [
270
+ ({ setSelf }) => {
271
+ store.subject.transactionCreation.subscribe(
272
+ `introspection`,
273
+ (transactionToken) => {
274
+ setSelf((state) => [...state, transactionToken]);
275
+ }
276
+ );
277
+ }
278
+ ]
279
+ },
280
+ void 0,
281
+ store
282
+ );
283
+ const transactionTokenIndex = __INTERNAL__.createSelector(
284
+ {
285
+ key: `\u{1F441}\u200D\u{1F5E8} Transaction Token Index`,
286
+ get: ({ get }) => get(transactionTokenIndexState__INTERNAL)
287
+ },
288
+ void 0,
289
+ store
290
+ );
291
+ return transactionTokenIndex;
292
+ };
293
+ var attachTransactionLogs = (store = __INTERNAL__.IMPLICIT.STORE) => {
294
+ const findTransactionUpdateLog = __INTERNAL__.createAtomFamily(
295
+ {
296
+ key: `\u{1F441}\u200D\u{1F5E8} Transaction Update Log (Internal)`,
297
+ default: () => [],
298
+ effects: (key) => [
299
+ ({ setSelf }) => {
300
+ const tx = store.transactions.get(key);
301
+ tx == null ? void 0 : tx.subject.subscribe(`introspection`, (transactionUpdate) => {
302
+ if (transactionUpdate.key === key) {
303
+ setSelf((state) => [...state, transactionUpdate]);
304
+ }
305
+ });
306
+ }
307
+ ]
308
+ },
309
+ store
310
+ );
311
+ const findTransactionUpdateLogState = __INTERNAL__.createSelectorFamily(
312
+ {
313
+ key: `\u{1F441}\u200D\u{1F5E8} Transaction Update Log`,
314
+ get: (key) => ({ get }) => get(findTransactionUpdateLog(key))
315
+ },
316
+ store
317
+ );
318
+ return findTransactionUpdateLogState;
319
+ };
320
+
321
+ // src/attach-introspection-states.ts
322
+ var attachIntrospectionStates = (store = __INTERNAL____namespace.IMPLICIT.STORE) => {
323
+ return {
324
+ atomIndex: attachAtomIndex(store),
325
+ selectorIndex: attachSelectorIndex(store),
326
+ transactionIndex: attachTransactionIndex(store),
327
+ findTransactionLogState: attachTransactionLogs(store),
328
+ timelineIndex: attachTimelineIndex(store),
329
+ findTimelineState: attachTimelineFamily(store)
330
+ };
331
+ };
332
+
333
+ exports.attachIntrospectionStates = attachIntrospectionStates;
9
334
  //# sourceMappingURL=out.js.map
10
335
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["__INTERNAL__","attachAtomIndex","store","atomTokenIndexState__INTERNAL","key","acc","setSelf","atomToken","state","family","familyKey","subKey","current","familyKeyState","__spreadProps","__spreadValues","get","attachSelectorIndex","readonlySelectorTokenIndexState__INTERNAL","selectorToken","Subject","attachTimelineFamily","findTimelineLogState__INTERNAL","_a","tl","_","unsubscribe","operationStatus","attachTimelineIndex","timelineTokenIndexState__INTERNAL","timelineToken","attachTransactionIndex","transactionTokenIndexState__INTERNAL","transactionToken","attachTransactionLogs","findTransactionUpdateLog","tx","transactionUpdate","attachIntrospectionStates"],"mappings":"6aAAA,OAAS,gBAAAA,MAAoB,UCC7B,OAAS,gBAAAA,MAAoB,UAMtB,IAAMC,EAAkB,CAC9BC,EAA4BF,EAAa,SAAS,QACP,CAC3C,IAAMG,EACLH,EAAa,eACZ,CACC,IAAK,uDACL,QAAS,IACR,CAAC,GAAGE,EAAM,KAAK,EACb,OAAO,CAAC,CAACE,CAAG,IAAM,CAACA,EAAI,SAAS,0BAAO,CAAC,EACxC,OAAuB,CAACC,EAAK,CAACD,CAAG,KACjCC,EAAID,CAAG,EAAI,CAAE,IAAAA,EAAK,KAAM,MAAO,EACxBC,GACL,CAAC,CAAC,EACP,QAAS,CACR,CAAC,CAAE,QAAAC,CAAQ,IAAM,CAChBJ,EAAM,QAAQ,aAAa,UAC1B,gBACCK,GAAc,CACVL,EAAM,UAAU,MAGhBK,EAAU,IAAI,SAAS,0BAAO,GAGlCD,EAASE,GAAU,CAClB,GAAM,CAAE,IAAAJ,EAAK,OAAAK,CAAO,EAAIF,EACxB,GAAIE,EAAQ,CACX,GAAM,CAAE,IAAKC,EAAW,OAAAC,CAAO,EAAIF,EAC7BG,EAAUJ,EAAME,CAAS,EAC/B,GAAIE,IAAY,QAAa,kBAAmBA,EAAS,CACxD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J,EAAM,QAAQ,oBAAoB,UACjC,gBACC+B,GAAqB,CACrB3B,EAASE,GAAU,CAAC,GAAGA,EAAOyB,CAAgB,CAAC,CAChD,CACD,CACD,CACD,CACD,EACA,OACA/B,CACD,EASA,OAR8BF,EAAa,mBAC1C,CACC,IAAK,mDACL,IAAK,CAAC,CAAE,IAAAgB,CAAI,IAAMA,EAAIgB,CAAoC,CAC3D,EACA,OACA9B,CACD,CAED,ECrCA,OAAS,gBAAAF,MAAoB,UAEtB,IAAMkC,EAAwB,CACpChC,EAA4BF,EAAa,SAAS,QACG,CACrD,IAAMmC,EAA2BnC,EAAa,qBAI7C,CACC,IAAK,6DACL,QAAS,IAAM,CAAC,EAChB,QAAUI,GAAQ,CACjB,CAAC,CAAE,QAAAE,CAAQ,IAAM,CAChB,IAAM8B,EAAKlC,EAAM,aAAa,IAAIE,CAAG,EACrCgC,GAAA,MAAAA,EAAI,QAAQ,UAAU,gBAAkBC,GAAsB,CACzDA,EAAkB,MAAQjC,GAC7BE,EAASE,GAAU,CAAC,GAAGA,EAAO6B,CAAiB,CAAC,CAElD,EACD,CACD,CACD,EACAnC,CACD,EAWA,OAVsCF,EAAa,yBAIlD,CACC,IAAK,kDACL,IAAMI,GAAQ,CAAC,CAAE,IAAAY,CAAI,IAAMA,EAAImB,EAAyB/B,CAAG,CAAC,CAC7D,EACAF,CACD,CAED,ENlBO,IAAMoC,GAA4B,CACxCpC,EAA4BF,EAAa,SAAS,SAS3C,CACN,UAAWC,EAAgBC,CAAK,EAChC,cAAee,EAAoBf,CAAK,EACxC,iBAAkB6B,EAAuB7B,CAAK,EAC9C,wBAAyBgC,EAAsBhC,CAAK,EACpD,cAAe0B,EAAoB1B,CAAK,EACxC,kBAAmBmB,EAAqBnB,CAAK,CAC9C","sourcesContent":["import { __INTERNAL__ } from \"atom.io\"\nimport type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tƒn,\n} from \"atom.io\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport { __INTERNAL__ } from \"atom.io\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL =\n\t\t__INTERNAL__.atom__INTERNAL<AtomTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `👁‍🗨 Atom Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\t[...store.atoms]\n\t\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.atomCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(atomToken) => {\n\t\t\t\t\t\t\t\tif (store.operation.open) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (atomToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\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],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn __INTERNAL__.selector__INTERNAL(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import { __INTERNAL__ } from \"atom.io\"\nimport type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\t__INTERNAL__.atom__INTERNAL<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `👁‍🗨 Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (store.operation.open) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\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],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn __INTERNAL__.selector__INTERNAL({\n\t\tkey: `👁‍🗨 Selector Token Index`,\n\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t})\n}\n","import type { ReadonlySelectorFamily, Store } from \"atom.io\"\nimport { __INTERNAL__ } from \"atom.io\"\nimport type { Timeline } from \"atom.io/internal\"\nimport { Subject } from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = __INTERNAL__.atomFamily__INTERNAL<\n\t\tTimeline,\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = __INTERNAL__.selectorFamily__INTERNAL<\n\t\tTimeline,\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log`,\n\t\t\tget: (key) => ({ get }) => get(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, Store, TimelineToken } from \"atom.io\"\nimport { __INTERNAL__ } from \"atom.io\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = __INTERNAL__.atom__INTERNAL<\n\t\tTimelineToken[]\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]) => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = __INTERNAL__.selector__INTERNAL(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, ƒn } from \"atom.io\"\nimport { __INTERNAL__ } from \"atom.io\"\n\nexport const attachTransactionIndex = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<ƒn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = __INTERNAL__.atom__INTERNAL<\n\t\tTransactionToken<ƒn>[]\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]) => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = __INTERNAL__.selector__INTERNAL(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, ƒn } from \"atom.io\"\nimport { __INTERNAL__ } from \"atom.io\"\n\nexport const attachTransactionLogs = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<ƒn>[]> => {\n\tconst findTransactionUpdateLog = __INTERNAL__.atomFamily__INTERNAL<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = __INTERNAL__.selectorFamily__INTERNAL<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log`,\n\t\t\tget: (key) => ({ get }) => get(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}
1
+ {"version":3,"sources":["../src/attach-introspection-states.ts","../src/attach-atom-index.ts","../src/attach-selector-index.ts","../src/attach-timeline-family.ts","../src/attach-timeline-index.ts","../src/attach-transaction-index.ts","../src/attach-transaction-logs.ts"],"names":["IMPLICIT","createAtom","createSelector","target","createAtomFamily","createSelectorFamily"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,YAAY,kBAAkB;;;ACN9B,SAAS,UAAU,YAAY,gBAAgB,cAAc;AAMtD,IAAM,kBAAkB,CAC9B,QAAe,SAAS,UACmB;AAC3C,QAAM,gCAAgC;AAAA,IACrC;AAAA,MACC,KAAK;AAAA,MACL,SAAS,MAAM;AACd,cAAM,mBAAmB,CAAC,GAAG,MAAM,KAAK,EACtC,OAAO,CAAC,C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,KAAK;AAClC,sBAAQ,CAAC,UAAU,CAAC,GAAG,OAAO,iBAAiB,CAAC;AAAA,YACjD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA;AAAA,EACD;AACA,QAAM,gCAAgCC;AAAA,IAIrC;AAAA,MACC,KAAK;AAAA,MACL,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,MAAM,IAAI,yBAAyB,GAAG,CAAC;AAAA,IAC7D;AAAA,IACA;AAAA,EACD;AACA,SAAO;AACR;;;ANvBO,IAAM,4BAA4B,CACxC,QAAyC,sBAAS,UAQ9C;AACJ,SAAO;AAAA,IACN,WAAW,gBAAgB,KAAK;AAAA,IAChC,eAAe,oBAAoB,KAAK;AAAA,IACxC,kBAAkB,uBAAuB,KAAK;AAAA,IAC9C,yBAAyB,sBAAsB,KAAK;AAAA,IACpD,eAAe,oBAAoB,KAAK;AAAA,IACxC,mBAAmB,qBAAqB,KAAK;AAAA,EAC9C;AACD","sourcesContent":["import type {\n\tReadonlySelectorFamily,\n\tReadonlySelectorToken,\n\tTimelineToken,\n\tTransactionToken,\n\tTransactionUpdate,\n\tƒn,\n} from \"atom.io\"\nimport * as __INTERNAL__ from \"atom.io/internal\"\nimport type { Timeline } from \"atom.io/internal\"\n\nimport { type AtomTokenIndex, attachAtomIndex } from \"./attach-atom-index\"\nimport type { SelectorTokenIndex } from \"./attach-selector-index\"\nimport { attachSelectorIndex } from \"./attach-selector-index\"\nimport { attachTimelineFamily } from \"./attach-timeline-family\"\nimport { attachTimelineIndex } from \"./attach-timeline-index\"\nimport { attachTransactionIndex } from \"./attach-transaction-index\"\nimport { attachTransactionLogs } from \"./attach-transaction-logs\"\n\nexport const attachIntrospectionStates = (\n\tstore: __INTERNAL__.Store = __INTERNAL__.IMPLICIT.STORE,\n): {\n\tatomIndex: ReadonlySelectorToken<AtomTokenIndex>\n\tselectorIndex: ReadonlySelectorToken<SelectorTokenIndex>\n\ttransactionIndex: ReadonlySelectorToken<TransactionToken<ƒn>[]>\n\tfindTransactionLogState: ReadonlySelectorFamily<TransactionUpdate<ƒn>[]>\n\ttimelineIndex: ReadonlySelectorToken<TimelineToken[]>\n\tfindTimelineState: ReadonlySelectorFamily<Timeline>\n} => {\n\treturn {\n\t\tatomIndex: attachAtomIndex(store),\n\t\tselectorIndex: attachSelectorIndex(store),\n\t\ttransactionIndex: attachTransactionIndex(store),\n\t\tfindTransactionLogState: attachTransactionLogs(store),\n\t\ttimelineIndex: attachTimelineIndex(store),\n\t\tfindTimelineState: attachTimelineFamily(store),\n\t}\n}\n","import type { AtomToken, ReadonlySelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type AtomTokenIndex = StateTokenIndex<AtomToken<unknown>>\n\nexport const attachAtomIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<AtomTokenIndex> => {\n\tconst atomTokenIndexState__INTERNAL = createAtom<AtomTokenIndex>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index (Internal)`,\n\t\t\tdefault: () => {\n\t\t\t\tconst defaultAtomIndex = [...store.atoms]\n\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t.reduce<AtomTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\tacc[key] = { key, type: `atom` }\n\t\t\t\t\t\treturn acc\n\t\t\t\t\t}, {})\n\t\t\t\treturn defaultAtomIndex\n\t\t\t},\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.atomCreation.subscribe(`introspection`, (atomToken) => {\n\t\t\t\t\t\tif (atomToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\tconst { key, family } = atomToken\n\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: atomToken,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t[key]: atomToken,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection: waiting to update atom index`,\n\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Atom Token Index`,\n\t\t\tget: ({ get }) => get(atomTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n}\n","import type { ReadonlySelectorToken, SelectorToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector, target } from \"atom.io/internal\"\n\nimport type { StateTokenIndex } from \".\"\n\nexport type SelectorTokenIndex = StateTokenIndex<\n\tReadonlySelectorToken<unknown> | SelectorToken<unknown>\n>\n\nexport const attachSelectorIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<SelectorTokenIndex> => {\n\tconst readonlySelectorTokenIndexState__INTERNAL =\n\t\tcreateAtom<SelectorTokenIndex>(\n\t\t\t{\n\t\t\t\tkey: `👁‍🗨 Selector Token Index (Internal)`,\n\t\t\t\tdefault: () =>\n\t\t\t\t\tObject.assign(\n\t\t\t\t\t\t[...store.readonlySelectors]\n\t\t\t\t\t\t\t.filter(([key]) => !key.includes(`👁‍🗨`))\n\t\t\t\t\t\t\t.reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\t\tacc[key] = { key, type: `readonly_selector` }\n\t\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t\t}, {}),\n\t\t\t\t\t\t[...store.selectors].reduce<SelectorTokenIndex>((acc, [key]) => {\n\t\t\t\t\t\t\tacc[key] = { key, type: `selector` }\n\t\t\t\t\t\t\treturn acc\n\t\t\t\t\t\t}, {}),\n\t\t\t\t\t),\n\t\t\t\teffects: [\n\t\t\t\t\t({ setSelf }) => {\n\t\t\t\t\t\tstore.subject.selectorCreation.subscribe(\n\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t(selectorToken) => {\n\t\t\t\t\t\t\t\tif (selectorToken.key.includes(`👁‍🗨`)) {\n\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tconst set = () =>\n\t\t\t\t\t\t\t\t\tsetSelf((state) => {\n\t\t\t\t\t\t\t\t\t\tconst { key, family } = selectorToken\n\t\t\t\t\t\t\t\t\t\tif (family) {\n\t\t\t\t\t\t\t\t\t\t\tconst { key: familyKey, subKey } = family\n\t\t\t\t\t\t\t\t\t\t\tconst current = state[familyKey]\n\t\t\t\t\t\t\t\t\t\t\tif (current === undefined || `familyMembers` in current) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst familyKeyState = current || {\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey: familyKey,\n\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t\t\t[familyKey]: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfamilyMembers: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t...familyKeyState.familyMembers,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[subKey]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t\t...state,\n\t\t\t\t\t\t\t\t\t\t\t[key]: selectorToken,\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tif (target(store).operation.open) {\n\t\t\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t\t\t`introspection: waiting to update selector index`,\n\t\t\t\t\t\t\t\t\t\t() => {\n\t\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tset()\n\t\t\t\t\t\t\t\t}\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],\n\t\t\t},\n\t\t\tundefined,\n\t\t\tstore,\n\t\t)\n\treturn createSelector({\n\t\tkey: `👁‍🗨 Selector Token Index`,\n\t\tget: ({ get }) => get(readonlySelectorTokenIndexState__INTERNAL),\n\t})\n}\n","import type { ReadonlySelectorFamily } from \"atom.io\"\nimport type { Store, Timeline } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tSubject,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTimelineFamily = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<Timeline> => {\n\tconst findTimelineLogState__INTERNAL = createAtomFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log (Internal)`,\n\t\t\tdefault: (key) =>\n\t\t\t\tstore.timelines.get(key) ?? {\n\t\t\t\t\ttype: `timeline`,\n\t\t\t\t\tkey: ``,\n\t\t\t\t\tat: 0,\n\t\t\t\t\ttimeTraveling: null,\n\t\t\t\t\thistory: [],\n\t\t\t\t\tselectorTime: null,\n\t\t\t\t\ttransactionKey: null,\n\t\t\t\t\tinstall: () => {},\n\t\t\t\t\tsubject: new Subject(),\n\t\t\t\t},\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tl = store.timelines.get(key)\n\t\t\t\t\ttl?.subject.subscribe(`introspection`, (_) => {\n\t\t\t\t\t\tif (store.operation.open === true) {\n\t\t\t\t\t\t\tconst unsubscribe = store.subject.operationStatus.subscribe(\n\t\t\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t\t\t(operationStatus) => {\n\t\t\t\t\t\t\t\t\tif (operationStatus.open === false) {\n\t\t\t\t\t\t\t\t\t\tunsubscribe()\n\t\t\t\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetSelf({ ...tl })\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTimelineLogState = createSelectorFamily<Timeline, string>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Update Log`,\n\t\t\tget: (key) => ({ get }) => get(findTimelineLogState__INTERNAL(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTimelineLogState\n}\n","import type { ReadonlySelectorToken, TimelineToken } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTimelineIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TimelineToken[]> => {\n\tconst timelineTokenIndexState__INTERNAL = createAtom<TimelineToken[]>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.timelines].map(([key]): TimelineToken => {\n\t\t\t\t\treturn { key, type: `timeline` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.timelineCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(timelineToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, timelineToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst timelineTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Timeline Token Index`,\n\t\t\tget: ({ get }) => get(timelineTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn timelineTokenIndex\n}\n","import type { ReadonlySelectorToken, TransactionToken, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport { IMPLICIT, createAtom, createSelector } from \"atom.io/internal\"\n\nexport const attachTransactionIndex = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorToken<TransactionToken<ƒn>[]> => {\n\tconst transactionTokenIndexState__INTERNAL = createAtom<\n\t\tTransactionToken<ƒn>[]\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index (Internal)`,\n\t\t\tdefault: () =>\n\t\t\t\t[...store.transactions].map(([key]): TransactionToken<ƒn> => {\n\t\t\t\t\treturn { key, type: `transaction` }\n\t\t\t\t}),\n\t\t\teffects: [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tstore.subject.transactionCreation.subscribe(\n\t\t\t\t\t\t`introspection`,\n\t\t\t\t\t\t(transactionToken) => {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionToken])\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\tconst transactionTokenIndex = createSelector(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Token Index`,\n\t\t\tget: ({ get }) => get(transactionTokenIndexState__INTERNAL),\n\t\t},\n\t\tundefined,\n\t\tstore,\n\t)\n\treturn transactionTokenIndex\n}\n","import type { ReadonlySelectorFamily, TransactionUpdate, ƒn } from \"atom.io\"\nimport type { Store } from \"atom.io/internal\"\nimport {\n\tIMPLICIT,\n\tcreateAtomFamily,\n\tcreateSelectorFamily,\n} from \"atom.io/internal\"\n\nexport const attachTransactionLogs = (\n\tstore: Store = IMPLICIT.STORE,\n): ReadonlySelectorFamily<TransactionUpdate<ƒn>[]> => {\n\tconst findTransactionUpdateLog = createAtomFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log (Internal)`,\n\t\t\tdefault: () => [],\n\t\t\teffects: (key) => [\n\t\t\t\t({ setSelf }) => {\n\t\t\t\t\tconst tx = store.transactions.get(key)\n\t\t\t\t\ttx?.subject.subscribe(`introspection`, (transactionUpdate) => {\n\t\t\t\t\t\tif (transactionUpdate.key === key) {\n\t\t\t\t\t\t\tsetSelf((state) => [...state, transactionUpdate])\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tstore,\n\t)\n\tconst findTransactionUpdateLogState = createSelectorFamily<\n\t\tTransactionUpdate<ƒn>[],\n\t\tstring\n\t>(\n\t\t{\n\t\t\tkey: `👁‍🗨 Transaction Update Log`,\n\t\t\tget: (key) => ({ get }) => get(findTransactionUpdateLog(key)),\n\t\t},\n\t\tstore,\n\t)\n\treturn findTransactionUpdateLogState\n}\n"]}