@teamvortexsoftware/vortex-react-native 0.0.13 → 1.0.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 (228) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1227 -11
  3. package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
  4. package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
  5. package/dist/VortexClient.js +192 -0
  6. package/dist/VortexClient.js.map +1 -0
  7. package/dist/VortexDeferredLinks.js +127 -0
  8. package/dist/VortexDeferredLinks.js.map +1 -0
  9. package/dist/clientInfo.js +45 -0
  10. package/dist/clientInfo.js.map +1 -0
  11. package/dist/components/ContactsPickerModal.js +182 -0
  12. package/dist/components/ContactsPickerModal.js.map +1 -0
  13. package/dist/components/InviteFormCore.js +2141 -0
  14. package/dist/components/InviteFormCore.js.map +1 -0
  15. package/dist/components/InviteFormMobile.js +463 -0
  16. package/dist/components/InviteFormMobile.js.map +1 -0
  17. package/dist/components/InviteFormWeb.js +295 -0
  18. package/dist/components/InviteFormWeb.js.map +1 -0
  19. package/dist/components/PlacedItemToolbar.js +147 -0
  20. package/dist/components/PlacedItemToolbar.js.map +1 -0
  21. package/dist/components/ShareButtons.js +1 -0
  22. package/dist/components/ShareButtons.js.map +1 -0
  23. package/dist/components/VrtxContactsImport.js +234 -0
  24. package/dist/components/VrtxContactsImport.js.map +1 -0
  25. package/dist/components/VrtxEmailInvitations.js +341 -0
  26. package/dist/components/VrtxEmailInvitations.js.map +1 -0
  27. package/dist/components/VrtxFindFriends.js +400 -0
  28. package/dist/components/VrtxFindFriends.js.map +1 -0
  29. package/dist/components/VrtxHeading.js +58 -0
  30. package/dist/components/VrtxHeading.js.map +1 -0
  31. package/dist/components/VrtxIncomingInvitations.js +657 -0
  32. package/dist/components/VrtxIncomingInvitations.js.map +1 -0
  33. package/dist/components/VrtxInvitationSuggestions.js +506 -0
  34. package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
  35. package/dist/components/VrtxInviteContacts.js +512 -0
  36. package/dist/components/VrtxInviteContacts.js.map +1 -0
  37. package/dist/components/VrtxOutgoingInvitations.js +572 -0
  38. package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
  39. package/dist/components/VrtxSearchBox.js +487 -0
  40. package/dist/components/VrtxSearchBox.js.map +1 -0
  41. package/dist/components/VrtxSelect.js +27 -0
  42. package/dist/components/VrtxSelect.js.map +1 -0
  43. package/dist/components/VrtxShareOptions.js +435 -0
  44. package/dist/components/VrtxShareOptions.js.map +1 -0
  45. package/dist/components/VrtxSubmit.js +132 -0
  46. package/dist/components/VrtxSubmit.js.map +1 -0
  47. package/dist/components/VrtxText.js +146 -0
  48. package/dist/components/VrtxText.js.map +1 -0
  49. package/dist/constants/mockData.d.mts +7 -0
  50. package/dist/constants/mockData.d.ts +7 -0
  51. package/dist/constants/mockData.js +48 -0
  52. package/dist/constants/mockData.js.map +1 -0
  53. package/dist/constants/mockData.mjs +22 -0
  54. package/dist/constants/mockData.mjs.map +1 -0
  55. package/dist/context/VortexModulesContext.js +135 -0
  56. package/dist/context/VortexModulesContext.js.map +1 -0
  57. package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
  58. package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
  59. package/dist/hooks/useInvitationFormLogic.js +300 -0
  60. package/dist/hooks/useInvitationFormLogic.js.map +1 -0
  61. package/dist/hooks/useInvitationFormLogic.mjs +276 -0
  62. package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
  63. package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
  64. package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
  65. package/dist/hooks/useThemeStyles.js +2 -0
  66. package/dist/hooks/useThemeStyles.js.map +1 -0
  67. package/dist/hooks/useVortexInvite.js +467 -56
  68. package/dist/hooks/useVortexInvite.js.map +1 -0
  69. package/dist/index-web.d.mts +93 -0
  70. package/dist/index-web.d.ts +93 -0
  71. package/dist/index-web.js +7397 -0
  72. package/dist/index-web.js.map +1 -0
  73. package/dist/index-web.mjs +7445 -0
  74. package/dist/index-web.mjs.map +1 -0
  75. package/dist/index.d.mts +656 -0
  76. package/dist/index.d.ts +656 -0
  77. package/dist/index.js +10205 -4
  78. package/dist/index.js.map +1 -0
  79. package/dist/index.mjs +10244 -0
  80. package/dist/index.mjs.map +1 -0
  81. package/dist/types/VortexClient.d.ts +106 -0
  82. package/dist/types/VortexClient.d.ts.map +1 -0
  83. package/dist/types/VortexDeferredLinks.d.ts +73 -0
  84. package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
  85. package/dist/types/clientInfo.d.ts +5 -0
  86. package/dist/types/clientInfo.d.ts.map +1 -0
  87. package/dist/types/components/ContactsPickerModal.d.ts +18 -0
  88. package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
  89. package/dist/types/components/InviteFormCore.d.ts +166 -0
  90. package/dist/types/components/InviteFormCore.d.ts.map +1 -0
  91. package/dist/types/components/InviteFormMobile.d.ts +42 -0
  92. package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
  93. package/dist/types/components/InviteFormWeb.d.ts +87 -0
  94. package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
  95. package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
  96. package/dist/types/components/PlacedItemToolbar.d.ts.map +1 -0
  97. package/dist/types/components/VrtxContactsImport.d.ts +14 -0
  98. package/dist/types/components/VrtxContactsImport.d.ts.map +1 -0
  99. package/dist/types/components/VrtxEmailInvitations.d.ts +31 -0
  100. package/dist/types/components/VrtxEmailInvitations.d.ts.map +1 -0
  101. package/dist/types/components/VrtxFindFriends.d.ts +25 -0
  102. package/dist/types/components/VrtxFindFriends.d.ts.map +1 -0
  103. package/dist/types/components/VrtxHeading.d.ts +6 -0
  104. package/dist/types/components/VrtxHeading.d.ts.map +1 -0
  105. package/dist/types/components/VrtxIncomingInvitations.d.ts +27 -0
  106. package/dist/types/components/VrtxIncomingInvitations.d.ts.map +1 -0
  107. package/dist/types/components/VrtxInvitationSuggestions.d.ts +25 -0
  108. package/dist/types/components/VrtxInvitationSuggestions.d.ts.map +1 -0
  109. package/dist/types/components/VrtxInviteContacts.d.ts +24 -0
  110. package/dist/types/components/VrtxInviteContacts.d.ts.map +1 -0
  111. package/dist/types/components/VrtxOutgoingInvitations.d.ts +27 -0
  112. package/dist/types/components/VrtxOutgoingInvitations.d.ts.map +1 -0
  113. package/dist/types/components/VrtxSearchBox.d.ts +28 -0
  114. package/dist/types/components/VrtxSearchBox.d.ts.map +1 -0
  115. package/dist/types/components/VrtxSelect.d.ts +6 -0
  116. package/dist/types/components/VrtxSelect.d.ts.map +1 -0
  117. package/dist/types/components/VrtxShareOptions.d.ts +41 -0
  118. package/dist/types/components/VrtxShareOptions.d.ts.map +1 -0
  119. package/dist/types/components/VrtxSubmit.d.ts +18 -0
  120. package/dist/types/components/VrtxSubmit.d.ts.map +1 -0
  121. package/dist/types/components/VrtxText.d.ts +8 -0
  122. package/dist/types/components/VrtxText.d.ts.map +1 -0
  123. package/dist/types/constants/mockData.d.ts +4 -0
  124. package/dist/types/constants/mockData.d.ts.map +1 -0
  125. package/dist/types/context/VortexModulesContext.d.ts +238 -0
  126. package/dist/types/context/VortexModulesContext.d.ts.map +1 -0
  127. package/dist/types/findFriends.js +10 -0
  128. package/dist/types/findFriends.js.map +1 -0
  129. package/dist/types/hooks/useInvitationFormLogic.d.ts +55 -0
  130. package/dist/types/hooks/useInvitationFormLogic.d.ts.map +1 -0
  131. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts +39 -0
  132. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts.map +1 -0
  133. package/dist/types/hooks/useThemeStyles.d.ts +1 -0
  134. package/dist/types/hooks/useThemeStyles.d.ts.map +1 -1
  135. package/dist/types/hooks/useVortexInvite.d.ts +48 -6
  136. package/dist/types/hooks/useVortexInvite.d.ts.map +1 -1
  137. package/dist/types/index-web.d.ts +23 -0
  138. package/dist/types/index-web.d.ts.map +1 -0
  139. package/dist/types/index.d.ts +21 -0
  140. package/dist/types/index.d.ts.map +1 -1
  141. package/dist/types/invitations.js +13 -0
  142. package/dist/types/invitations.js.map +1 -0
  143. package/dist/types/inviteContacts.js +14 -0
  144. package/dist/types/inviteContacts.js.map +1 -0
  145. package/dist/{shared/InvitationResult.js → types/platformOperations.js} +1 -0
  146. package/dist/types/platformOperations.js.map +1 -0
  147. package/dist/types/searchBox.js +11 -0
  148. package/dist/types/searchBox.js.map +1 -0
  149. package/dist/types/types/findFriends.d.ts +101 -0
  150. package/dist/types/types/findFriends.d.ts.map +1 -0
  151. package/dist/types/types/invitations.d.ts +301 -0
  152. package/dist/types/types/invitations.d.ts.map +1 -0
  153. package/dist/types/types/inviteContacts.d.ts +86 -0
  154. package/dist/types/types/inviteContacts.d.ts.map +1 -0
  155. package/dist/types/types/platformOperations.d.ts +185 -0
  156. package/dist/types/types/platformOperations.d.ts.map +1 -0
  157. package/dist/types/types/searchBox.d.ts +69 -0
  158. package/dist/types/types/searchBox.d.ts.map +1 -0
  159. package/dist/types/types/unfurlConfig.d.ts +34 -0
  160. package/dist/types/types/unfurlConfig.d.ts.map +1 -0
  161. package/dist/types/unfurlConfig.js +21 -0
  162. package/dist/types/unfurlConfig.js.map +1 -0
  163. package/dist/types/utils/analytics.d.ts +54 -0
  164. package/dist/types/utils/analytics.d.ts.map +1 -0
  165. package/dist/types/utils/configCache.d.ts +34 -0
  166. package/dist/types/utils/configCache.d.ts.map +1 -0
  167. package/dist/types/utils/contactUtils.d.ts +9 -0
  168. package/dist/types/utils/contactUtils.d.ts.map +1 -0
  169. package/dist/types/utils/featureWarnings.d.ts +56 -0
  170. package/dist/types/utils/featureWarnings.d.ts.map +1 -0
  171. package/dist/types/utils/formUtils.d.ts +11 -3
  172. package/dist/types/utils/formUtils.d.ts.map +1 -1
  173. package/dist/types/utils/gradientUtils.d.ts +67 -0
  174. package/dist/types/utils/gradientUtils.d.ts.map +1 -0
  175. package/dist/types/utils/invitationEvents.d.ts +21 -0
  176. package/dist/types/utils/invitationEvents.d.ts.map +1 -0
  177. package/dist/types/utils/moduleLoaders.d.ts +115 -0
  178. package/dist/types/utils/moduleLoaders.d.ts.map +1 -0
  179. package/dist/types/utils/moduleLoaders.web.d.ts +73 -0
  180. package/dist/types/utils/moduleLoaders.web.d.ts.map +1 -0
  181. package/dist/types/utils/nameUtils.d.ts +15 -0
  182. package/dist/types/utils/nameUtils.d.ts.map +1 -0
  183. package/dist/types/utils/themeUtils.d.ts +3 -1
  184. package/dist/types/utils/themeUtils.d.ts.map +1 -1
  185. package/dist/types/vortexInvite.d.ts +145 -5
  186. package/dist/types/vortexInvite.d.ts.map +1 -1
  187. package/dist/useInvitationFormLogic-Ct73M19B.d.mts +242 -0
  188. package/dist/useInvitationFormLogic-Ct73M19B.d.ts +242 -0
  189. package/dist/utils/analytics.js +92 -0
  190. package/dist/utils/analytics.js.map +1 -0
  191. package/dist/utils/configCache.js +68 -0
  192. package/dist/utils/configCache.js.map +1 -0
  193. package/dist/utils/contactUtils.d.mts +12 -0
  194. package/dist/utils/contactUtils.d.ts +12 -0
  195. package/dist/utils/contactUtils.js +37 -0
  196. package/dist/utils/contactUtils.js.map +1 -0
  197. package/dist/utils/contactUtils.mjs +12 -0
  198. package/dist/utils/contactUtils.mjs.map +1 -0
  199. package/dist/utils/featureWarnings.js +214 -0
  200. package/dist/utils/featureWarnings.js.map +1 -0
  201. package/dist/utils/formUtils.js +161 -51
  202. package/dist/utils/formUtils.js.map +1 -0
  203. package/dist/utils/gradientUtils.js +120 -0
  204. package/dist/utils/gradientUtils.js.map +1 -0
  205. package/dist/utils/invitationEvents.js +45 -0
  206. package/dist/utils/invitationEvents.js.map +1 -0
  207. package/dist/utils/moduleLoaders.js +275 -0
  208. package/dist/utils/moduleLoaders.js.map +1 -0
  209. package/dist/utils/moduleLoaders.web.js +72 -0
  210. package/dist/utils/moduleLoaders.web.js.map +1 -0
  211. package/dist/utils/nameUtils.js +51 -0
  212. package/dist/utils/nameUtils.js.map +1 -0
  213. package/dist/utils/themeUtils.js +117 -32
  214. package/dist/utils/themeUtils.js.map +1 -0
  215. package/dist/vortexInvite.js +78 -167
  216. package/dist/vortexInvite.js.map +1 -0
  217. package/package.json +69 -31
  218. package/dist/components/Clipboard.js +0 -64
  219. package/dist/shared/api.js +0 -90
  220. package/dist/tests/TestVortexInvite.js +0 -134
  221. package/dist/types/components/Clipboard.d.ts +0 -16
  222. package/dist/types/components/Clipboard.d.ts.map +0 -1
  223. package/dist/types/shared/InvitationResult.d.ts +0 -24
  224. package/dist/types/shared/InvitationResult.d.ts.map +0 -1
  225. package/dist/types/shared/api.d.ts +0 -14
  226. package/dist/types/shared/api.d.ts.map +0 -1
  227. package/dist/types/tests/TestVortexInvite.d.ts +0 -4
  228. package/dist/types/tests/TestVortexInvite.d.ts.map +0 -1
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Types for the Incoming, Outgoing, and Invitation Suggestions features.
3
+ *
4
+ * These components display lists of invitations:
5
+ * - VrtxIncomingInvitations: Invitations the user has received (with Accept/Delete actions)
6
+ * - VrtxOutgoingInvitations: Invitations the user has sent (with Cancel action)
7
+ * - VrtxInvitationSuggestions: "People you may know" suggestions (with Invite/Dismiss actions)
8
+ *
9
+ * The invitation data is provided directly via props by the host application.
10
+ */
11
+ /**
12
+ * Represents a generic invitation/suggestion item.
13
+ * Used by VrtxInvitationSuggestions component.
14
+ */
15
+ export interface InvitationItem {
16
+ /** Unique identifier for the invitation */
17
+ id: string;
18
+ /** Display name of the person */
19
+ name: string;
20
+ /** The user ID in the customer's platform */
21
+ userId?: string;
22
+ /** Optional subtitle (e.g., username, mutual friends count) */
23
+ subtitle?: string;
24
+ /** Avatar/profile image URL (optional) */
25
+ avatarUrl?: string;
26
+ /** Whether this invitation came from the Vortex backend */
27
+ isVortexInvitation?: boolean;
28
+ /** Optional metadata for app-specific data */
29
+ metadata?: Record<string, unknown>;
30
+ }
31
+ /**
32
+ * Represents an incoming invitation item.
33
+ * Used by VrtxIncomingInvitations component.
34
+ */
35
+ export interface IncomingInvitationItem {
36
+ /** Unique identifier for the invitation */
37
+ id: string;
38
+ /** Display name of the sender */
39
+ name: string;
40
+ /**
41
+ * The user ID, used for deduplication (maps to creatorId from the Vortex API).
42
+ * When both API and internal invitations share the same `userId`, the API one is kept.
43
+ */
44
+ userId?: string;
45
+ /** Avatar/profile image URL (optional) */
46
+ avatarUrl?: string;
47
+ /**
48
+ * Whether this invitation came from the Vortex backend.
49
+ * When true, the SDK will call the Vortex API for accept/delete operations.
50
+ * When false, the SDK relies entirely on the app's callbacks.
51
+ * @default false for invitations provided via config
52
+ */
53
+ isVortexInvitation?: boolean;
54
+ /** Optional metadata for app-specific data */
55
+ metadata?: Record<string, unknown>;
56
+ }
57
+ /**
58
+ * Represents an outgoing invitation item.
59
+ * Used by VrtxOutgoingInvitations component.
60
+ */
61
+ export interface OutgoingInvitationItem {
62
+ /** Unique identifier for the invitation */
63
+ id: string;
64
+ /** Display name of the invitee */
65
+ name: string;
66
+ /**
67
+ * The user ID, used for deduplication (maps to targetValue from the Vortex API).
68
+ * When both API and internal invitations share the same `userId`, the API one is kept.
69
+ */
70
+ userId?: string;
71
+ /** Avatar/profile image URL (optional) */
72
+ avatarUrl?: string;
73
+ /**
74
+ * Whether this invitation came from the Vortex backend.
75
+ * When true, the SDK will call the Vortex API for cancel operations.
76
+ * When false, the SDK relies entirely on the app's callbacks.
77
+ * @default false for invitations provided via config
78
+ */
79
+ isVortexInvitation?: boolean;
80
+ /** Optional metadata for app-specific data */
81
+ metadata?: Record<string, unknown>;
82
+ }
83
+ /**
84
+ * Configuration for VrtxIncomingInvitations component.
85
+ * Displays invitations the user has received with Accept and Delete actions.
86
+ */
87
+ export interface IncomingInvitationsConfig {
88
+ /**
89
+ * List of incoming invitations to display.
90
+ * Provided by the host application.
91
+ */
92
+ invitations: IncomingInvitationItem[];
93
+ /**
94
+ * Called when user confirms "Accept" on an invitation.
95
+ * A confirmation dialog is shown before this callback is invoked.
96
+ *
97
+ * For non-Vortex invitations (isVortexInvitation=false), return true to remove
98
+ * the invitation from the list, or false to keep it displayed.
99
+ *
100
+ * For Vortex invitations, the return value is also respected - return false
101
+ * to prevent the API call and keep the invitation in the list.
102
+ *
103
+ * @param invitation - The invitation that was accepted
104
+ * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * onAccept: async (invitation) => {
109
+ * const success = await api.acceptInvitation(invitation.id);
110
+ * return success; // Return true to remove from list
111
+ * }
112
+ * ```
113
+ */
114
+ onAccept: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;
115
+ /**
116
+ * Called when user confirms "Delete" on an invitation.
117
+ * A confirmation dialog is shown before this callback is invoked.
118
+ *
119
+ * For non-Vortex invitations (isVortexInvitation=false), return true to remove
120
+ * the invitation from the list, or false to keep it displayed.
121
+ *
122
+ * For Vortex invitations, the return value is also respected - return false
123
+ * to prevent the API call and keep the invitation in the list.
124
+ *
125
+ * @param invitation - The invitation that was deleted/declined
126
+ * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * onDelete: async (invitation) => {
131
+ * const success = await api.declineInvitation(invitation.id);
132
+ * return success; // Return true to remove from list
133
+ * }
134
+ * ```
135
+ */
136
+ onDelete: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;
137
+ /**
138
+ * Optional callback to compute a custom subtitle for each invitation.
139
+ *
140
+ * When provided, the SDK calls this function for each invitation to determine the
141
+ * displayed subtitle. Useful when the subtitle should be derived from the invitation's
142
+ * metadata (e.g., `invitation.metadata?.inviter_handle`).
143
+ *
144
+ * If not provided, no subtitle is rendered.
145
+ */
146
+ getSubtitle?: (invitation: IncomingInvitationItem) => string | undefined;
147
+ /**
148
+ * Optional: Custom text for the Accept button.
149
+ * @default "Accept"
150
+ */
151
+ acceptButtonText?: string;
152
+ /**
153
+ * Optional: Custom text for the Delete button.
154
+ * @default "Delete"
155
+ */
156
+ deleteButtonText?: string;
157
+ /**
158
+ * Optional: Custom empty state message when no invitations are present.
159
+ * @default "No incoming invitations"
160
+ */
161
+ emptyStateMessage?: string;
162
+ /**
163
+ * Optional: Custom title for the Accept confirmation dialog.
164
+ * @default "Accept Invitation"
165
+ */
166
+ acceptConfirmTitle?: string;
167
+ /**
168
+ * Optional: Custom message for the Accept confirmation dialog.
169
+ * Use {name} as a placeholder for the person's name.
170
+ * @default "Accept invitation from {name}?"
171
+ */
172
+ acceptConfirmMessage?: string;
173
+ /**
174
+ * Optional: Custom title for the Delete confirmation dialog.
175
+ * @default "Delete Invitation"
176
+ */
177
+ deleteConfirmTitle?: string;
178
+ /**
179
+ * Optional: Custom message for the Delete confirmation dialog.
180
+ * Use {name} as a placeholder for the person's name.
181
+ * @default "Delete invitation from {name}?"
182
+ */
183
+ deleteConfirmMessage?: string;
184
+ /**
185
+ * Optional: Custom text for the confirmation dialog's confirm button.
186
+ * @default "Confirm"
187
+ */
188
+ confirmButtonText?: string;
189
+ /**
190
+ * Optional: Custom text for the confirmation dialog's cancel button.
191
+ * @default "Cancel"
192
+ */
193
+ cancelButtonText?: string;
194
+ }
195
+ /**
196
+ * Configuration for VrtxOutgoingInvitations component.
197
+ * Displays invitations the user has sent with a Cancel action.
198
+ *
199
+ * Note: The component fetches invitations from the API and handles revocation automatically.
200
+ * Text customizations (button text, empty state, etc.) come from the widget configuration.
201
+ */
202
+ export interface OutgoingInvitationsConfig {
203
+ /**
204
+ * Optional: Internal invitations provided by the app (merged with API-fetched ones).
205
+ * These invitations will NOT have `isVortexInvitation` set, so your app must handle
206
+ * the cancel logic in the `onCancel` callback.
207
+ *
208
+ * If an internal invitation has the same `userId` as an API invitation,
209
+ * the API invitation is kept (deduplicated).
210
+ */
211
+ invitations?: OutgoingInvitationItem[];
212
+ /**
213
+ * Optional callback when user taps "Cancel" on an invitation.
214
+ * Called before the API revocation as a gate.
215
+ *
216
+ * Return `true` (or void/undefined) to proceed with the API revocation,
217
+ * or `false` to cancel the action.
218
+ *
219
+ * @param invitation - The invitation being cancelled
220
+ * @returns Whether to proceed with the cancellation
221
+ *
222
+ * @example
223
+ * ```typescript
224
+ * onCancel: async (invitation) => {
225
+ * // Return true to proceed, false to cancel
226
+ * return true;
227
+ * }
228
+ * ```
229
+ */
230
+ onCancel?: (invitation: OutgoingInvitationItem) => boolean | void | Promise<boolean | void>;
231
+ /**
232
+ * Optional callback to compute a custom subtitle for each invitation.
233
+ *
234
+ * When provided, the SDK calls this function for each invitation to determine the
235
+ * displayed subtitle. Useful when the subtitle should be derived from the invitation's
236
+ * metadata (e.g., `invitation.metadata?.invitee_handle`).
237
+ *
238
+ * If not provided, no subtitle is rendered.
239
+ */
240
+ getSubtitle?: (invitation: OutgoingInvitationItem) => string | undefined;
241
+ /**
242
+ * @internal Mock invitations for preview mode only.
243
+ * When provided, skips API calls and uses these invitations instead.
244
+ * This is NOT for customer use - only for internal preview/web mode.
245
+ */
246
+ _mockInvitations?: OutgoingInvitationItem[];
247
+ }
248
+ /**
249
+ * Configuration for VrtxInvitationSuggestions component.
250
+ * Displays "People you may know" suggestions with Invite and Dismiss (X) actions.
251
+ */
252
+ export interface InvitationSuggestionsConfig {
253
+ /**
254
+ * List of suggested people to display.
255
+ * Provided by the host application.
256
+ */
257
+ suggestions: InvitationItem[];
258
+ /**
259
+ * Called when user taps "Invite" on a suggestion.
260
+ * No confirmation dialog - invites immediately.
261
+ *
262
+ * @param suggestion - The suggestion that was invited
263
+ * @returns Optional promise for async operations
264
+ *
265
+ * @example
266
+ * ```typescript
267
+ * onInvite: async (suggestion) => {
268
+ * await api.sendInvitation(suggestion.id);
269
+ * // Update your local state to remove the suggestion
270
+ * }
271
+ * ```
272
+ */
273
+ onInvite: (suggestion: InvitationItem) => void | Promise<void>;
274
+ /**
275
+ * Called when user taps the dismiss (X) button on a suggestion.
276
+ * No confirmation dialog - dismisses immediately.
277
+ *
278
+ * @param suggestion - The suggestion that was dismissed
279
+ * @returns Optional promise for async operations
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * onDismiss: async (suggestion) => {
284
+ * await api.dismissSuggestion(suggestion.id);
285
+ * // Update your local state to remove the suggestion
286
+ * }
287
+ * ```
288
+ */
289
+ onDismiss: (suggestion: InvitationItem) => void | Promise<void>;
290
+ /**
291
+ * Optional: Custom text for the Invite button.
292
+ * @default "Invite"
293
+ */
294
+ inviteButtonText?: string;
295
+ /**
296
+ * Optional: Custom empty state message when no suggestions are present.
297
+ * @default "No suggestions"
298
+ */
299
+ emptyStateMessage?: string;
300
+ }
301
+ //# sourceMappingURL=invitations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invitations.d.ts","sourceRoot":"","sources":["../../../src/types/invitations.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Types for the Invite Contacts feature.
3
+ *
4
+ * The Invite Contacts component displays a list of contacts that can be invited via SMS.
5
+ * Unlike Find Friends, this component:
6
+ * - Receives pre-classified contacts directly (no fetching/classification)
7
+ * - Only shows contacts that can be invited (no member/non-member distinction)
8
+ * - Creates SMS invitations and opens the SMS app for the user to send
9
+ *
10
+ * The component renders nothing (no height) if the contacts list is empty.
11
+ */
12
+ /**
13
+ * Contact to be displayed in the Invite Contacts component.
14
+ * Each contact has a name and phone number for SMS invitation.
15
+ */
16
+ export interface InviteContactsContact {
17
+ /** Unique identifier for the contact */
18
+ id: string;
19
+ /** Display name of the contact */
20
+ name: string;
21
+ /** Phone number for SMS invitation */
22
+ phoneNumber: string;
23
+ /** Avatar/profile image URL (optional) */
24
+ avatarUrl?: string;
25
+ /** Optional metadata for the contact */
26
+ metadata?: Record<string, unknown>;
27
+ }
28
+ /**
29
+ * Configuration for the Invite Contacts feature.
30
+ * Passed to VortexInvite via the inviteContactsConfig prop.
31
+ */
32
+ export interface InviteContactsConfig {
33
+ /**
34
+ * List of contacts to display for SMS invitation.
35
+ * If empty or undefined, the component renders nothing (no height).
36
+ */
37
+ contacts: InviteContactsContact[];
38
+ /**
39
+ * Called when user taps "Invite" on a contact.
40
+ * The SDK will:
41
+ * 1. Create an SMS invitation via the API
42
+ * 2. Get the short link for the invitation
43
+ * 3. Open the SMS app with the configured message and link
44
+ *
45
+ * This callback is optional and can be used for analytics or custom handling.
46
+ *
47
+ * @param contact - The contact that was invited
48
+ * @param shortLink - The invitation short link that was created
49
+ */
50
+ onInvite?: (contact: InviteContactsContact, shortLink: string) => void | Promise<void>;
51
+ /**
52
+ * Optional: Custom text for the "Invite your contacts" link.
53
+ * @default "Invite your contacts"
54
+ */
55
+ inviteYourContactsText?: string;
56
+ /**
57
+ * Optional: Custom text for the "Invite" button.
58
+ * @default "Invite"
59
+ */
60
+ inviteButtonText?: string;
61
+ /**
62
+ * Optional: Custom empty state message (shown when contacts list becomes empty after inviting).
63
+ * @default "No contacts to invite"
64
+ */
65
+ emptyStateMessage?: string;
66
+ /**
67
+ * Optional: Called when user navigates to the contacts list.
68
+ * Can be used for analytics.
69
+ */
70
+ onNavigateToContacts?: () => void;
71
+ /**
72
+ * Optional: Called when user navigates back from the contacts list.
73
+ * Can be used for analytics.
74
+ */
75
+ onNavigateBack?: () => void;
76
+ /**
77
+ * Optional: Called when an invitation is successfully created.
78
+ * This can be used to notify other components (like Outgoing Invitations)
79
+ * that they should refresh their data.
80
+ *
81
+ * @param contact - The contact that was invited
82
+ * @param shortLink - The invitation short link that was created
83
+ */
84
+ onInvitationCreated?: (contact: InviteContactsContact, shortLink: string) => void;
85
+ }
86
+ //# sourceMappingURL=inviteContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inviteContacts.d.ts","sourceRoot":"","sources":["../../../src/types/inviteContacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAElC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvF;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAElC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACnF"}
@@ -0,0 +1,185 @@
1
+ /**
2
+ * Platform-specific operations that need different implementations
3
+ * for native (React Native) and web environments.
4
+ *
5
+ * This interface enables dependency injection, allowing components
6
+ * to work in both environments without importing platform-specific code.
7
+ */
8
+ export interface PlatformOperations {
9
+ /**
10
+ * Copy invitation link to clipboard
11
+ * - Native: Fetches shareable invitation link via Vortex API and uses expo-clipboard or @react-native-clipboard/clipboard
12
+ * - Web: Fetches shareable invitation link and uses navigator.clipboard.writeText
13
+ *
14
+ * The method handles fetching the invitation link internally via the Vortex API.
15
+ */
16
+ copyToClipboard: () => Promise<void>;
17
+ /**
18
+ * Share invitation link using native share sheet or web share API
19
+ * - Native: Fetches shareable invitation link via Vortex API and uses React Native Share API
20
+ * - Web: Fetches shareable invitation link and uses navigator.share (if available) or logs a message
21
+ *
22
+ * The method handles fetching the invitation link and composing the share message internally.
23
+ */
24
+ share: () => Promise<void>;
25
+ /**
26
+ * Close/dismiss the invitation form
27
+ * - Native: Dismisses bottom sheet or calls onClose callback
28
+ * - Web: No-op or logs a message (preview mode)
29
+ */
30
+ close: () => void;
31
+ /**
32
+ * Fetch contacts with email addresses
33
+ * - Native: Uses expo-contacts to fetch from device contacts (called on-demand)
34
+ * - Web/Preview: Returns mock data for consistent preview behavior
35
+ *
36
+ * Called on-demand when user navigates to "Add from Contacts" view.
37
+ * Contacts with multiple emails are flattened into separate entries.
38
+ */
39
+ fetchContacts: () => Promise<Array<{
40
+ id: string;
41
+ name: string;
42
+ email: string;
43
+ }>>;
44
+ /**
45
+ * Send an invitation to a user
46
+ * - Native: Calls the Vortex API via handleInviteClick with proper authentication
47
+ * - Web/Preview: Simulates invite for consistent preview behavior
48
+ *
49
+ * Called when user clicks "Invite" button for email or contact invitations.
50
+ *
51
+ * @param email - Email address of the person to invite
52
+ * @param contactName - Optional name of the contact being invited
53
+ * @returns Promise that resolves when invitation is sent successfully
54
+ */
55
+ invite: (email: string, contactName?: string) => Promise<void>;
56
+ /**
57
+ * Fetch Google contacts via Google People API
58
+ * - Native: Authenticates via Google OAuth and fetches from People API
59
+ * - Web/Preview: Returns mock data for consistent preview behavior
60
+ *
61
+ * Called on-demand when user navigates to "Add from Google Contacts" view.
62
+ * Requires authentication and proper OAuth scopes.
63
+ *
64
+ * @returns Promise that resolves with array of Google contacts
65
+ */
66
+ fetchGoogleContacts: () => Promise<Array<{
67
+ id: string;
68
+ name: string;
69
+ email: string;
70
+ }>>;
71
+ /**
72
+ * Provide haptic feedback
73
+ * - Native: Uses expo-haptics for tactile feedback (dynamically imported)
74
+ * - Web/Preview: No-op (silent fail)
75
+ *
76
+ * Optional method that provides haptic feedback when user interacts with buttons.
77
+ * If expo-haptics is not installed, the implementation should fail silently.
78
+ *
79
+ * @param style - Intensity of haptic feedback ('light', 'medium', or 'heavy')
80
+ * @returns Promise that resolves when haptic feedback is complete (or immediately for no-op)
81
+ */
82
+ triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;
83
+ /**
84
+ * Share invitation via email (mailto)
85
+ * - Native: Opens email composer with pre-filled subject and body containing invitation link
86
+ * - Web/Preview: Opens mailto link or logs message
87
+ *
88
+ * Optional method for sharing via email client.
89
+ */
90
+ shareViaEmail?: () => Promise<void>;
91
+ /**
92
+ * Share invitation via SMS
93
+ * - Native: Opens SMS composer with pre-filled message containing invitation link
94
+ * - Web/Preview: Opens sms link or logs message
95
+ *
96
+ * Optional method for sharing via SMS.
97
+ */
98
+ shareViaSms?: () => Promise<void>;
99
+ /**
100
+ * Share invitation via X/Twitter DMs
101
+ * - Native: Opens Twitter app for direct messaging with invitation link
102
+ * - Web/Preview: Opens Twitter web URL or logs message
103
+ *
104
+ * Optional method for sharing via X/Twitter direct messages.
105
+ */
106
+ shareViaTwitter?: () => Promise<void>;
107
+ /**
108
+ * Share invitation via Instagram DMs
109
+ * - Native: Opens Instagram direct inbox
110
+ * - Web/Preview: Logs message (Instagram web doesn't support direct linking to DMs)
111
+ *
112
+ * Optional method for sharing via Instagram direct messages.
113
+ */
114
+ shareViaInstagram?: () => Promise<void>;
115
+ /**
116
+ * Share invitation via WhatsApp
117
+ * - Native: Opens WhatsApp with pre-filled message containing invitation link
118
+ * - Web/Preview: Opens WhatsApp web URL or logs message
119
+ *
120
+ * Optional method for sharing via WhatsApp.
121
+ */
122
+ shareViaWhatsApp?: () => Promise<void>;
123
+ /**
124
+ * Share invitation via Line
125
+ * - Native: Opens Line app with pre-filled message containing invitation link
126
+ * - Web/Preview: Opens Line web URL or logs message
127
+ *
128
+ * Optional method for sharing via Line messenger.
129
+ */
130
+ shareViaLine?: () => Promise<void>;
131
+ /**
132
+ * Share invitation via Line LIFF (LINE Frontend Framework)
133
+ * - Native: Opens Line LIFF app URL
134
+ * - Web/Preview: Opens Line LIFF URL or logs message
135
+ *
136
+ * Optional method for sharing via Line LIFF app.
137
+ */
138
+ shareViaLineLiff?: () => Promise<void>;
139
+ /**
140
+ * Show QR code for invitation
141
+ * - Native: Displays QR code modal with invitation link encoded
142
+ * - Web/Preview: Logs message or shows QR code modal
143
+ *
144
+ * Optional method for displaying QR code for invitation link.
145
+ */
146
+ showQrCode?: () => Promise<void>;
147
+ /**
148
+ * Share invitation via Facebook Messenger
149
+ * - Native: Opens Messenger app with pre-filled message containing invitation link
150
+ * - Web/Preview: Opens Messenger web URL or logs message
151
+ *
152
+ * Optional method for sharing via Facebook Messenger.
153
+ */
154
+ shareViaFacebookMessenger?: () => Promise<void>;
155
+ /**
156
+ * Share invitation via Telegram
157
+ * - Native: Opens Telegram app with pre-filled message containing invitation link
158
+ * - Web/Preview: Opens Telegram web URL or logs message
159
+ *
160
+ * Optional method for sharing via Telegram.
161
+ */
162
+ shareViaTelegram?: () => Promise<void>;
163
+ /**
164
+ * Share invitation via Discord
165
+ * - Native: Opens Discord app
166
+ * - Web/Preview: Opens Discord web URL or logs message
167
+ *
168
+ * Optional method for sharing via Discord.
169
+ */
170
+ shareViaDiscord?: () => Promise<void>;
171
+ /**
172
+ * Create an SMS invitation and return the short link
173
+ * - Native: Calls the Vortex API to create an SMS invitation
174
+ * - Web/Preview: Returns mock link for consistent preview behavior
175
+ *
176
+ * Used by the Invite Contacts component to create SMS invitations.
177
+ * The returned short link is included in the SMS message sent by the user.
178
+ *
179
+ * @param phoneNumber - Phone number of the person to invite
180
+ * @param contactName - Optional name of the contact being invited
181
+ * @returns Promise that resolves with the invitation short link, or null if failed
182
+ */
183
+ createSmsInvitation?: (phoneNumber: string, contactName?: string) => Promise<string | null>;
184
+ }
185
+ //# sourceMappingURL=platformOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platformOperations.d.ts","sourceRoot":"","sources":["../../../src/types/platformOperations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B;;;;OAIG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAElB;;;;;;;OAOG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAEjF;;;;;;;;;;OAUG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;;;;;;;OASG;IACH,mBAAmB,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAEvF;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvE;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7F"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Types for the Search Box feature.
3
+ *
4
+ * The Search Box component displays a search input with a search button.
5
+ * When the user taps the search button, a customer-provided callback is invoked
6
+ * with the search query. The callback returns a list of matching contacts
7
+ * (identical to FindFriendsContact) which are rendered below the search box.
8
+ */
9
+ import { FindFriendsContact } from './findFriends';
10
+ /**
11
+ * Configuration for the Search Box feature.
12
+ * Passed to VortexInvite to enable and configure the Search Box component.
13
+ */
14
+ export interface SearchBoxConfig {
15
+ /**
16
+ * Called when the user taps the search button.
17
+ * The customer implements this callback to perform the search and return matching contacts.
18
+ *
19
+ * @param query - The search query entered by the user
20
+ * @returns Promise resolving to an array of matching contacts
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * onSearch: async (query) => {
25
+ * const results = await myApi.searchUsers(query);
26
+ * return results.map(user => ({
27
+ * userId: user.id,
28
+ * name: user.displayName,
29
+ * subtitle: user.email,
30
+ * avatarUrl: user.avatar,
31
+ * }));
32
+ * }
33
+ * ```
34
+ */
35
+ onSearch: (query: string) => Promise<FindFriendsContact[]> | FindFriendsContact[];
36
+ /**
37
+ * Called when user taps "Connect" on a search result contact.
38
+ * If the callback returns true, the SDK will create an invitation via the
39
+ * Vortex backend.
40
+ *
41
+ * @param contact - The contact that was tapped
42
+ * @returns Promise resolving to true if the invitation should be created
43
+ */
44
+ onConnect: (contact: FindFriendsContact) => Promise<boolean> | boolean;
45
+ /**
46
+ * Optional: Called after an invitation is successfully created.
47
+ *
48
+ * @param contact - The contact for whom the invitation was created
49
+ */
50
+ onInvitationCreated?: (contact: FindFriendsContact) => void;
51
+ /**
52
+ * Optional: Called if creating the invitation fails.
53
+ *
54
+ * @param contact - The contact for whom the invitation failed
55
+ * @param error - The error that occurred
56
+ */
57
+ onInvitationError?: (contact: FindFriendsContact, error: Error) => void;
58
+ /**
59
+ * Optional: Custom text for the "Connect" button.
60
+ * @default "Connect"
61
+ */
62
+ connectButtonText?: string;
63
+ /**
64
+ * Optional: Custom message shown when search returns no results.
65
+ * @default "No results found"
66
+ */
67
+ noResultsMessage?: string;
68
+ }
69
+ //# sourceMappingURL=searchBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"searchBox.d.ts","sourceRoot":"","sources":["../../../src/types/searchBox.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,kBAAkB,EAAE,CAAC,GAAG,kBAAkB,EAAE,CAAC;IAElF;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAEvE;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAE5D;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAExE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}