@wireai/activation 0.7.0 → 0.9.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 (94) hide show
  1. package/AGENTS.md +29 -5
  2. package/CHANGELOG.md +198 -6
  3. package/README.md +105 -10
  4. package/dist/analytics/index.d.mts +12 -8
  5. package/dist/analytics/index.d.ts +12 -8
  6. package/dist/analytics/index.js +525 -55
  7. package/dist/analytics/index.js.map +1 -1
  8. package/dist/analytics/index.mjs +525 -55
  9. package/dist/analytics/index.mjs.map +1 -1
  10. package/dist/coachmarks/index.d.mts +2 -2
  11. package/dist/coachmarks/index.d.ts +2 -2
  12. package/dist/coachmarks/index.js.map +1 -1
  13. package/dist/coachmarks/index.mjs.map +1 -1
  14. package/dist/{currentSession-CxnP7gAa.d.ts → currentSession-61dcm3V-.d.ts} +19 -3
  15. package/dist/{currentSession-BJBB7i4-.d.mts → currentSession-Bs2JfTJ8.d.mts} +19 -3
  16. package/dist/{decision-BzbiKwk3.d.mts → decision-Bl_M2y3r.d.mts} +1 -1
  17. package/dist/{decision-plDEOCkt.d.ts → decision-Cau5KmP6.d.ts} +1 -1
  18. package/dist/index.d.mts +620 -13
  19. package/dist/index.d.ts +620 -13
  20. package/dist/index.js +1194 -369
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +1015 -201
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/questionnaire/index.d.mts +69 -23
  25. package/dist/questionnaire/index.d.ts +69 -23
  26. package/dist/questionnaire/index.js +643 -172
  27. package/dist/questionnaire/index.js.map +1 -1
  28. package/dist/questionnaire/index.mjs +608 -137
  29. package/dist/questionnaire/index.mjs.map +1 -1
  30. package/dist/reviews/index.d.mts +24 -12
  31. package/dist/reviews/index.d.ts +24 -12
  32. package/dist/reviews/index.js +507 -173
  33. package/dist/reviews/index.js.map +1 -1
  34. package/dist/reviews/index.mjs +462 -129
  35. package/dist/reviews/index.mjs.map +1 -1
  36. package/dist/showcase/index.d.mts +2 -2
  37. package/dist/showcase/index.d.ts +2 -2
  38. package/dist/showcase/index.js.map +1 -1
  39. package/dist/showcase/index.mjs.map +1 -1
  40. package/dist/transport-DzU-TqZz.d.ts +86 -0
  41. package/dist/transport-f5VVB5hH.d.mts +86 -0
  42. package/dist/{types-GL_hQ0TN.d.mts → types-BcmagF6K.d.mts} +1 -1
  43. package/dist/{types-GL_hQ0TN.d.ts → types-BcmagF6K.d.ts} +1 -1
  44. package/dist/{types-BhpXJGlg.d.ts → types-Buj9Lw9t.d.ts} +15 -3
  45. package/dist/{types-CMuOexw0.d.mts → types-CKFhyrMu.d.mts} +1 -1
  46. package/dist/{types-CMuOexw0.d.ts → types-CKFhyrMu.d.ts} +1 -1
  47. package/dist/{types-A6pTxIZV.d.mts → types-CNUqMK0D.d.mts} +15 -3
  48. package/metro/index.d.ts +18 -1
  49. package/metro/index.js +80 -0
  50. package/package.json +9 -1
  51. package/src/WireOnboarding.tsx +4 -0
  52. package/src/analytics/analyticsFacade.ts +55 -10
  53. package/src/analytics/currentSession.ts +1 -1
  54. package/src/cards/CardGridSelectCard.tsx +253 -0
  55. package/src/cards/ChipSelectCard.tsx +1 -1
  56. package/src/cards/SelectionCard.tsx +15 -19
  57. package/src/cards/index.ts +13 -1
  58. package/src/cards/optionSchema.ts +65 -0
  59. package/src/coachmarks/types.ts +1 -1
  60. package/src/components/CardHandoff.tsx +39 -7
  61. package/src/components/DoneCheck.tsx +94 -0
  62. package/src/components/ModalPaneHost.tsx +141 -0
  63. package/src/components/StepDots.tsx +112 -0
  64. package/src/context/deviceId.ts +43 -0
  65. package/src/device/appVersion.ts +29 -8
  66. package/src/device/deviceContext.ts +14 -1
  67. package/src/device/deviceModel.ts +106 -0
  68. package/src/features/cache.ts +1 -1
  69. package/src/haptics/expo-haptics.d.ts +31 -0
  70. package/src/haptics/haptics.ts +58 -0
  71. package/src/icons/IconRegistry.tsx +53 -0
  72. package/src/icons/WireIcon.tsx +85 -0
  73. package/src/icons/expoIcons.ts +165 -0
  74. package/src/icons/index.ts +18 -0
  75. package/src/icons/vocabulary.ts +154 -0
  76. package/src/index.ts +22 -0
  77. package/src/questionnaire/QuestionnaireGate.tsx +315 -164
  78. package/src/questionnaire/decision.ts +4 -2
  79. package/src/questionnaire/index.ts +3 -2
  80. package/src/questionnaire/steps.ts +261 -0
  81. package/src/questionnaire/types.ts +33 -12
  82. package/src/reviews/ReviewGate.tsx +250 -152
  83. package/src/reviews/index.ts +7 -3
  84. package/src/reviews/transport.ts +77 -3
  85. package/src/reviews/types.ts +13 -0
  86. package/src/session/persistedSession.ts +1 -1
  87. package/src/session-analytics/lifecycle.ts +1 -1
  88. package/src/session-analytics/useSessionStart.ts +2 -2
  89. package/src/showcase/FeatureShowcase.tsx +1 -1
  90. package/src/showcase/showcaseColors.ts +1 -1
  91. package/src/theme/mergeThemeOver.ts +27 -0
  92. package/src/types.ts +8 -0
  93. package/dist/transport-BeO_Brcu.d.mts +0 -40
  94. package/dist/transport-DLpd1v5_.d.ts +0 -40
@@ -1,23 +1,413 @@
1
+ import { Platform, Dimensions, I18nManager, NativeModules, TurboModuleRegistry } from 'react-native';
1
2
  import { useRef, useEffect } from 'react';
2
- import { Platform, Dimensions, I18nManager } from 'react-native';
3
3
 
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
8
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
9
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
10
  }) : x)(function(x) {
7
11
  if (typeof require !== "undefined") return require.apply(this, arguments);
8
12
  throw Error('Dynamic require of "' + x + '" is not supported');
9
13
  });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
17
+ var __export = (target, all) => {
18
+ for (var name2 in all)
19
+ __defProp(target, name2, { get: all[name2], enumerable: true });
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (let key of __getOwnPropNames(from))
24
+ if (!__hasOwnProp.call(to, key) && key !== except)
25
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
+ }
27
+ return to;
28
+ };
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // node_modules/expo-modules-core/src/errors/CodedError.ts
32
+ var CodedError;
33
+ var init_CodedError = __esm({
34
+ "node_modules/expo-modules-core/src/errors/CodedError.ts"() {
35
+ CodedError = class extends Error {
36
+ constructor(code, message) {
37
+ super(message);
38
+ this.code = code;
39
+ }
40
+ };
41
+ }
42
+ });
43
+
44
+ // node_modules/expo-modules-core/src/NativeModulesProxy.ts
45
+ var NativeModulesProxy_default;
46
+ var init_NativeModulesProxy = __esm({
47
+ "node_modules/expo-modules-core/src/NativeModulesProxy.ts"() {
48
+ NativeModulesProxy_default = {};
49
+ }
50
+ });
51
+
52
+ // node_modules/expo-modules-core/src/TurboModuleToExpoModuleProxy.ts
53
+ function createTurboModuleToExpoProxy(turboModule, name2) {
54
+ return null;
55
+ }
56
+ var init_TurboModuleToExpoModuleProxy = __esm({
57
+ "node_modules/expo-modules-core/src/TurboModuleToExpoModuleProxy.ts"() {
58
+ }
59
+ });
60
+ var init_ensureNativeModulesAreInstalled = __esm({
61
+ "node_modules/expo-modules-core/src/ensureNativeModulesAreInstalled.ts"() {
62
+ }
63
+ });
64
+ function requireOptionalNativeModule(moduleName) {
65
+ var _a2, _b, _c, _d, _e;
66
+ try {
67
+ return (_e = (_d = (_c = (_b = (_a2 = globalThis.expo) == null ? void 0 : _a2.modules) == null ? void 0 : _b[moduleName]) != null ? _c : NativeModulesProxy_default[moduleName]) != null ? _d : createTurboModuleToExpoProxy(TurboModuleRegistry.get(moduleName), moduleName)) != null ? _e : null;
68
+ } catch (e) {
69
+ const error = e;
70
+ console.warn(`An error occurred while requiring the '${moduleName}' module: ${error.message}`);
71
+ return null;
72
+ }
73
+ }
74
+ var init_requireNativeModule = __esm({
75
+ "node_modules/expo-modules-core/src/requireNativeModule.ts"() {
76
+ init_NativeModulesProxy();
77
+ init_TurboModuleToExpoModuleProxy();
78
+ init_ensureNativeModulesAreInstalled();
79
+ }
80
+ });
81
+
82
+ // node_modules/expo-modules-core/src/sweet/setUpJsLogger.fx.ts
83
+ var init_setUpJsLogger_fx = __esm({
84
+ "node_modules/expo-modules-core/src/sweet/setUpJsLogger.fx.ts"() {
85
+ init_CodedError();
86
+ init_requireNativeModule();
87
+ if (__DEV__ && typeof window !== "undefined" && (process.env.EXPO_OS === "android" || process.env.EXPO_OS === "ios")) {
88
+ const NativeJSLogger = requireOptionalNativeModule("ExpoModulesCoreJSLogger");
89
+ if (NativeJSLogger) {
90
+ const onNewException = {
91
+ eventName: "ExpoModulesCoreJSLogger.onNewError",
92
+ action: console.error
93
+ };
94
+ const onNewWarning = {
95
+ eventName: "ExpoModulesCoreJSLogger.onNewWarning",
96
+ action: console.warn
97
+ };
98
+ const onNewDebug = {
99
+ eventName: "ExpoModulesCoreJSLogger.onNewDebug",
100
+ action: console.debug
101
+ };
102
+ const onNewInfo = {
103
+ eventName: "ExpoModulesCoreJSLogger.onNewInfo",
104
+ action: console.info
105
+ };
106
+ const onNewTrace = {
107
+ eventName: "ExpoModulesCoreJSLogger.onNewTrace",
108
+ action: console.trace
109
+ };
110
+ const listeners = [
111
+ onNewException,
112
+ onNewWarning,
113
+ onNewDebug,
114
+ onNewInfo,
115
+ onNewTrace
116
+ ];
117
+ for (const listener of listeners) {
118
+ NativeJSLogger.addListener(listener.eventName, ({ message }) => {
119
+ listener.action(message);
120
+ });
121
+ }
122
+ }
123
+ }
124
+ globalThis.ExpoModulesCore_CodedError = CodedError;
125
+ }
126
+ });
127
+
128
+ // node_modules/expo-modules-core/src/registerWebModule.ts
129
+ var init_registerWebModule = __esm({
130
+ "node_modules/expo-modules-core/src/registerWebModule.ts"() {
131
+ }
132
+ });
133
+
134
+ // node_modules/expo-modules-core/src/TypedArrays.types.ts
135
+ var init_TypedArrays_types = __esm({
136
+ "node_modules/expo-modules-core/src/TypedArrays.types.ts"() {
137
+ }
138
+ });
139
+
140
+ // node_modules/expo-modules-core/src/PermissionsInterface.ts
141
+ var init_PermissionsInterface = __esm({
142
+ "node_modules/expo-modules-core/src/PermissionsInterface.ts"() {
143
+ }
144
+ });
145
+ var init_PermissionsHook = __esm({
146
+ "node_modules/expo-modules-core/src/PermissionsHook.ts"() {
147
+ "use client";
148
+ }
149
+ });
150
+ var init_Refs = __esm({
151
+ "node_modules/expo-modules-core/src/Refs.ts"() {
152
+ }
153
+ });
154
+ var init_useReleasingSharedObject = __esm({
155
+ "node_modules/expo-modules-core/src/hooks/useReleasingSharedObject.ts"() {
156
+ "use client";
157
+ }
158
+ });
159
+
160
+ // node_modules/expo-modules-core/src/reload.ts
161
+ var init_reload = __esm({
162
+ "node_modules/expo-modules-core/src/reload.ts"() {
163
+ }
164
+ });
165
+
166
+ // node_modules/expo-modules-core/src/index.ts
167
+ var init_src = __esm({
168
+ "node_modules/expo-modules-core/src/index.ts"() {
169
+ init_setUpJsLogger_fx();
170
+ init_requireNativeModule();
171
+ init_registerWebModule();
172
+ init_TypedArrays_types();
173
+ init_PermissionsInterface();
174
+ init_PermissionsHook();
175
+ init_Refs();
176
+ init_useReleasingSharedObject();
177
+ init_reload();
178
+ init_CodedError();
179
+ }
180
+ });
181
+
182
+ // node_modules/expo-constants/build/Constants.types.js
183
+ var AppOwnership, ExecutionEnvironment, UserInterfaceIdiom;
184
+ var init_Constants_types = __esm({
185
+ "node_modules/expo-constants/build/Constants.types.js"() {
186
+ (function(AppOwnership2) {
187
+ AppOwnership2["Expo"] = "expo";
188
+ })(AppOwnership || (AppOwnership = {}));
189
+ (function(ExecutionEnvironment2) {
190
+ ExecutionEnvironment2["Bare"] = "bare";
191
+ ExecutionEnvironment2["Standalone"] = "standalone";
192
+ ExecutionEnvironment2["StoreClient"] = "storeClient";
193
+ })(ExecutionEnvironment || (ExecutionEnvironment = {}));
194
+ (function(UserInterfaceIdiom2) {
195
+ UserInterfaceIdiom2["Handset"] = "handset";
196
+ UserInterfaceIdiom2["Tablet"] = "tablet";
197
+ UserInterfaceIdiom2["Desktop"] = "desktop";
198
+ UserInterfaceIdiom2["TV"] = "tv";
199
+ UserInterfaceIdiom2["Unsupported"] = "unsupported";
200
+ })(UserInterfaceIdiom || (UserInterfaceIdiom = {}));
201
+ }
202
+ });
203
+
204
+ // node_modules/expo-constants/build/ExponentConstants.js
205
+ var ExponentConstants_default;
206
+ var init_ExponentConstants = __esm({
207
+ "node_modules/expo-constants/build/ExponentConstants.js"() {
208
+ init_src();
209
+ ExponentConstants_default = requireOptionalNativeModule("ExponentConstants");
210
+ }
211
+ });
212
+
213
+ // node_modules/expo-constants/build/Constants.js
214
+ var Constants_exports = {};
215
+ __export(Constants_exports, {
216
+ AppOwnership: () => AppOwnership,
217
+ ExecutionEnvironment: () => ExecutionEnvironment,
218
+ UserInterfaceIdiom: () => UserInterfaceIdiom,
219
+ default: () => Constants_default
220
+ });
221
+ function isEmbeddedManifest(manifest) {
222
+ return !isExpoUpdatesManifest(manifest);
223
+ }
224
+ function isExpoUpdatesManifest(manifest) {
225
+ return "metadata" in manifest;
226
+ }
227
+ function getManifest(suppressWarning = false) {
228
+ if (!rawManifest) {
229
+ const invalidManifestType = rawManifest === null ? "null" : "undefined";
230
+ if (nativeConstants.executionEnvironment === ExecutionEnvironment.Bare && Platform.OS !== "web") {
231
+ if (!suppressWarning) {
232
+ console.warn(`Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`);
233
+ }
234
+ } else if (nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient || nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone) {
235
+ throw new CodedError("ERR_CONSTANTS_MANIFEST_UNAVAILABLE", `Constants.manifest is ${invalidManifestType}, must be an object.`);
236
+ }
237
+ }
238
+ return rawManifest;
239
+ }
240
+ var ExpoUpdates, rawUpdatesManifest, rawDevLauncherManifest, rawAppConfig, _a, rawManifest, name, appOwnership, nativeConstants, constants, Constants_default;
241
+ var init_Constants = __esm({
242
+ "node_modules/expo-constants/build/Constants.js"() {
243
+ init_src();
244
+ init_Constants_types();
245
+ init_ExponentConstants();
246
+ init_Constants_types();
247
+ if (!ExponentConstants_default) {
248
+ console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");
249
+ }
250
+ ExpoUpdates = requireOptionalNativeModule("ExpoUpdates");
251
+ rawUpdatesManifest = null;
252
+ if (ExpoUpdates) {
253
+ let updatesManifest;
254
+ if (ExpoUpdates.manifest) {
255
+ updatesManifest = ExpoUpdates.manifest;
256
+ } else if (ExpoUpdates.manifestString) {
257
+ updatesManifest = JSON.parse(ExpoUpdates.manifestString);
258
+ }
259
+ if (updatesManifest && Object.keys(updatesManifest).length > 0) {
260
+ rawUpdatesManifest = updatesManifest;
261
+ }
262
+ }
263
+ rawDevLauncherManifest = null;
264
+ if (NativeModules.EXDevLauncher) {
265
+ let devLauncherManifest;
266
+ if (NativeModules.EXDevLauncher.manifestString) {
267
+ devLauncherManifest = JSON.parse(NativeModules.EXDevLauncher.manifestString);
268
+ }
269
+ if (devLauncherManifest && Object.keys(devLauncherManifest).length > 0) {
270
+ rawDevLauncherManifest = devLauncherManifest;
271
+ }
272
+ }
273
+ rawAppConfig = null;
274
+ if (ExponentConstants_default && ExponentConstants_default.manifest) {
275
+ const appConfig = ExponentConstants_default.manifest;
276
+ if (typeof appConfig === "string") {
277
+ rawAppConfig = JSON.parse(appConfig);
278
+ } else {
279
+ rawAppConfig = appConfig;
280
+ }
281
+ }
282
+ rawManifest = (_a = rawUpdatesManifest != null ? rawUpdatesManifest : rawDevLauncherManifest) != null ? _a : rawAppConfig;
283
+ ({ name, appOwnership, ...nativeConstants } = ExponentConstants_default || {});
284
+ constants = {
285
+ ...nativeConstants,
286
+ // Ensure this is null in bare workflow
287
+ appOwnership: appOwnership != null ? appOwnership : null
288
+ };
289
+ Object.defineProperties(constants, {
290
+ /**
291
+ * Use `manifest` property by default.
292
+ * This property is only used for internal purposes.
293
+ * It behaves similarly to the original one, but suppresses warning upon no manifest available.
294
+ * `expo-asset` uses it to prevent users from seeing mentioned warning.
295
+ */
296
+ __unsafeNoWarnManifest: {
297
+ get() {
298
+ const maybeManifest = getManifest(true);
299
+ if (!maybeManifest || !isEmbeddedManifest(maybeManifest)) {
300
+ return null;
301
+ }
302
+ return maybeManifest;
303
+ },
304
+ enumerable: false
305
+ },
306
+ __unsafeNoWarnManifest2: {
307
+ get() {
308
+ const maybeManifest = getManifest(true);
309
+ if (!maybeManifest || !isExpoUpdatesManifest(maybeManifest)) {
310
+ return null;
311
+ }
312
+ return maybeManifest;
313
+ },
314
+ enumerable: false
315
+ },
316
+ manifest: {
317
+ get() {
318
+ const maybeManifest = getManifest();
319
+ if (!maybeManifest || !isEmbeddedManifest(maybeManifest)) {
320
+ return null;
321
+ }
322
+ return maybeManifest;
323
+ },
324
+ enumerable: true
325
+ },
326
+ manifest2: {
327
+ get() {
328
+ const maybeManifest = getManifest();
329
+ if (!maybeManifest || !isExpoUpdatesManifest(maybeManifest)) {
330
+ return null;
331
+ }
332
+ return maybeManifest;
333
+ },
334
+ enumerable: true
335
+ },
336
+ expoConfig: {
337
+ get() {
338
+ var _a2, _b;
339
+ const maybeManifest = getManifest(true);
340
+ if (!maybeManifest) {
341
+ return null;
342
+ }
343
+ if (ExpoUpdates && ExpoUpdates.isEmbeddedLaunch) {
344
+ return rawAppConfig;
345
+ }
346
+ if (isExpoUpdatesManifest(maybeManifest)) {
347
+ return (_b = (_a2 = maybeManifest.extra) == null ? void 0 : _a2.expoClient) != null ? _b : null;
348
+ } else if (isEmbeddedManifest(maybeManifest)) {
349
+ return maybeManifest;
350
+ }
351
+ return null;
352
+ },
353
+ enumerable: true
354
+ },
355
+ expoGoConfig: {
356
+ get() {
357
+ var _a2, _b;
358
+ const maybeManifest = getManifest(true);
359
+ if (!maybeManifest) {
360
+ return null;
361
+ }
362
+ if (isExpoUpdatesManifest(maybeManifest)) {
363
+ return (_b = (_a2 = maybeManifest.extra) == null ? void 0 : _a2.expoGo) != null ? _b : null;
364
+ } else if (isEmbeddedManifest(maybeManifest)) {
365
+ return maybeManifest;
366
+ }
367
+ return null;
368
+ },
369
+ enumerable: true
370
+ },
371
+ easConfig: {
372
+ get() {
373
+ var _a2, _b;
374
+ const maybeManifest = getManifest(true);
375
+ if (!maybeManifest) {
376
+ return null;
377
+ }
378
+ if (isExpoUpdatesManifest(maybeManifest)) {
379
+ return (_b = (_a2 = maybeManifest.extra) == null ? void 0 : _a2.eas) != null ? _b : null;
380
+ } else if (isEmbeddedManifest(maybeManifest)) {
381
+ return maybeManifest;
382
+ }
383
+ return null;
384
+ },
385
+ enumerable: true
386
+ },
387
+ __rawManifest_TEST: {
388
+ get() {
389
+ return rawManifest;
390
+ },
391
+ set(value) {
392
+ rawManifest = value;
393
+ },
394
+ enumerable: false
395
+ }
396
+ });
397
+ Constants_default = constants;
398
+ }
399
+ });
10
400
 
11
401
  // src/reviews/transport.ts
12
- var reportAppEvent = (target, name, options = {}) => {
13
- if (!(target == null ? void 0 : target.serverUrl) || !name) return;
402
+ var reportAppEvent = (target, name2, options = {}) => {
403
+ if (!(target == null ? void 0 : target.serverUrl) || !name2) return;
14
404
  try {
15
405
  const url = `${target.serverUrl.replace(/\/$/, "")}/v1/events`;
16
406
  const headers = { "Content-Type": "application/json" };
17
407
  if (target.apiKey) headers.Authorization = `Bearer ${target.apiKey}`;
18
408
  const event = {
19
409
  event_type: "app_event",
20
- question_key: name
410
+ question_key: name2
21
411
  };
22
412
  if (options.sessionId) event.session_id = options.sessionId;
23
413
  if (options.deviceKey) event.user_context = { device_key: options.deviceKey };
@@ -37,24 +427,24 @@ var reportAppEvent = (target, name, options = {}) => {
37
427
  // src/analytics/screenTracking.ts
38
428
  var getActiveRouteName = (state) => {
39
429
  let current = state;
40
- let name;
430
+ let name2;
41
431
  while (current && Array.isArray(current.routes) && current.routes.length > 0) {
42
432
  const index = typeof current.index === "number" ? current.index : 0;
43
433
  const route = current.routes[index];
44
434
  if (!route) break;
45
- name = route.name;
435
+ name2 = route.name;
46
436
  current = route.state;
47
437
  }
48
- return name;
438
+ return name2;
49
439
  };
50
440
  var createScreenTracker = (options = {}) => {
51
441
  let lastScreen;
52
442
  return {
53
443
  track: (screen) => {
54
- var _a;
444
+ var _a2;
55
445
  if (!screen || screen === lastScreen) return;
56
446
  lastScreen = screen;
57
- (_a = options.onScreen) == null ? void 0 : _a.call(options, screen);
447
+ (_a2 = options.onScreen) == null ? void 0 : _a2.call(options, screen);
58
448
  if (options.shouldTrack && !options.shouldTrack(screen)) return;
59
449
  reportAppEvent(options.target, "screen", {
60
450
  sessionId: options.sessionId,
@@ -96,8 +486,8 @@ var useScreenTracking = (navigationRef, options = {}) => {
96
486
  const tracker = trackerRef.current;
97
487
  if (!tracker || !(navigationRef == null ? void 0 : navigationRef.addListener)) return;
98
488
  const report = () => {
99
- var _a, _b;
100
- return tracker.track((_b = (_a = navigationRef.getCurrentRoute) == null ? void 0 : _a.call(navigationRef)) == null ? void 0 : _b.name);
489
+ var _a2, _b;
490
+ return tracker.track((_b = (_a2 = navigationRef.getCurrentRoute) == null ? void 0 : _a2.call(navigationRef)) == null ? void 0 : _b.name);
101
491
  };
102
492
  report();
103
493
  const unsubscribe = navigationRef.addListener("state", report);
@@ -170,9 +560,16 @@ var coerceVersion = (value) => {
170
560
  return trimmed.length > 0 ? trimmed : void 0;
171
561
  };
172
562
  var runtimeRequire = (moduleName) => {
563
+ if (typeof __require !== "function") return void 0;
173
564
  try {
174
- if (typeof __require !== "function") return void 0;
175
- return __require(moduleName);
565
+ switch (moduleName) {
566
+ case "expo-constants":
567
+ return init_Constants(), __toCommonJS(Constants_exports);
568
+ case "expo-application":
569
+ return __require("expo-application");
570
+ default:
571
+ return void 0;
572
+ }
176
573
  } catch {
177
574
  return void 0;
178
575
  }
@@ -192,14 +589,14 @@ var safeInterop = (requireModule, moduleName) => {
192
589
  };
193
590
  var detectAppVersion = (requireModule = runtimeRequire) => {
194
591
  try {
195
- const constants = safeInterop(requireModule, "expo-constants");
196
- if (constants) {
197
- const expoConfig = constants.expoConfig;
592
+ const constants2 = safeInterop(requireModule, "expo-constants");
593
+ if (constants2) {
594
+ const expoConfig = constants2.expoConfig;
198
595
  if (expoConfig && typeof expoConfig === "object") {
199
596
  const fromExpoConfig = coerceVersion(expoConfig.version);
200
597
  if (fromExpoConfig) return fromExpoConfig;
201
598
  }
202
- const fromNative = coerceVersion(constants.nativeAppVersion);
599
+ const fromNative = coerceVersion(constants2.nativeAppVersion);
203
600
  if (fromNative) return fromNative;
204
601
  }
205
602
  const application = safeInterop(requireModule, "expo-application");
@@ -212,6 +609,48 @@ var detectAppVersion = (requireModule = runtimeRequire) => {
212
609
  return void 0;
213
610
  };
214
611
 
612
+ // src/device/deviceModel.ts
613
+ var coerceModel = (value) => {
614
+ if (typeof value !== "string") return void 0;
615
+ const trimmed = value.trim();
616
+ return trimmed.length > 0 ? trimmed : void 0;
617
+ };
618
+ var runtimeRequire2 = (moduleName) => {
619
+ if (moduleName !== "expo-device") return void 0;
620
+ if (typeof __require !== "function") return void 0;
621
+ try {
622
+ return __require("expo-device");
623
+ } catch {
624
+ return void 0;
625
+ }
626
+ };
627
+ var interop2 = (mod) => {
628
+ if (!mod || typeof mod !== "object") return void 0;
629
+ const def = mod.default;
630
+ if (def && typeof def === "object") return def;
631
+ return mod;
632
+ };
633
+ var safeInterop2 = (requireModule, moduleName) => {
634
+ try {
635
+ return interop2(requireModule(moduleName));
636
+ } catch {
637
+ return void 0;
638
+ }
639
+ };
640
+ var detectNativeModel = (requireModule = runtimeRequire2) => {
641
+ try {
642
+ const device = safeInterop2(requireModule, "expo-device");
643
+ if (device) {
644
+ const modelName = coerceModel(device.modelName);
645
+ if (modelName) return modelName;
646
+ const modelId = coerceModel(device.modelId);
647
+ if (modelId) return modelId;
648
+ }
649
+ } catch {
650
+ }
651
+ return void 0;
652
+ };
653
+
215
654
  // src/device/deviceContext.ts
216
655
  var deriveFormFactor = (iosIdiom, width, height) => {
217
656
  if (iosIdiom === "pad") return "tablet";
@@ -222,7 +661,7 @@ var deriveFormFactor = (iosIdiom, width, height) => {
222
661
  return void 0;
223
662
  };
224
663
  var collectDeviceContext = () => {
225
- var _a;
664
+ var _a2;
226
665
  const ctx = { platform: Platform.OS };
227
666
  try {
228
667
  const version = Platform.Version;
@@ -231,26 +670,26 @@ var collectDeviceContext = () => {
231
670
  }
232
671
  } catch {
233
672
  }
234
- let constants = {};
673
+ let constants2 = {};
235
674
  try {
236
- constants = (_a = Platform.constants) != null ? _a : {};
675
+ constants2 = (_a2 = Platform.constants) != null ? _a2 : {};
237
676
  } catch {
238
- constants = {};
677
+ constants2 = {};
239
678
  }
240
679
  let iosIdiom;
241
680
  try {
242
681
  if (Platform.OS === "android") {
243
- const brand = constants.Brand;
244
- const model = constants.Model;
245
- const release = constants.Release;
682
+ const brand = constants2.Brand;
683
+ const model = constants2.Model;
684
+ const release = constants2.Release;
246
685
  if (typeof brand === "string" && brand) ctx.brand = brand;
247
686
  if (typeof model === "string" && model) ctx.model = model;
248
687
  if (release !== void 0 && release !== null && String(release)) {
249
688
  ctx.osVersion = String(release);
250
689
  }
251
690
  } else if (Platform.OS === "ios") {
252
- const osVersion = constants.osVersion;
253
- const idiom = constants.interfaceIdiom;
691
+ const osVersion = constants2.osVersion;
692
+ const idiom = constants2.interfaceIdiom;
254
693
  if (osVersion !== void 0 && osVersion !== null && String(osVersion)) {
255
694
  ctx.osVersion = String(osVersion);
256
695
  }
@@ -258,6 +697,8 @@ var collectDeviceContext = () => {
258
697
  ctx.interfaceIdiom = idiom;
259
698
  iosIdiom = idiom;
260
699
  }
700
+ const iosModel = detectNativeModel();
701
+ if (iosModel) ctx.model = iosModel;
261
702
  }
262
703
  } catch {
263
704
  }
@@ -289,10 +730,10 @@ var collectDeviceContext = () => {
289
730
 
290
731
  // src/analytics/contextEnvelope.ts
291
732
  var buildContextEnvelope = (input = {}) => {
292
- var _a;
733
+ var _a2;
293
734
  const device = { ...collectDeviceContext() };
294
735
  if (input.appVersion) device.appVersion = input.appVersion;
295
- const effectiveAppVersion = (_a = input.appVersion) != null ? _a : device.appVersion;
736
+ const effectiveAppVersion = (_a2 = input.appVersion) != null ? _a2 : device.appVersion;
296
737
  const envelope = { device };
297
738
  if (input.sessionId) envelope.sessionId = input.sessionId;
298
739
  if (effectiveAppVersion) envelope.appVersion = effectiveAppVersion;
@@ -338,10 +779,10 @@ var parsePersisted = (raw) => {
338
779
  }
339
780
  };
340
781
  var createEventQueue = (options) => {
341
- var _a, _b, _c, _d, _e, _f, _g;
782
+ var _a2, _b, _c, _d, _e, _f, _g;
342
783
  const target = options.target;
343
784
  const storage = options.storage;
344
- const key = (_b = options.storageKey) != null ? _b : `wireai:evtq:${(_a = options.appId) != null ? _a : "default"}`;
785
+ const key = (_b = options.storageKey) != null ? _b : `wireai:evtq:${(_a2 = options.appId) != null ? _a2 : "default"}`;
345
786
  const maxSize = (_c = options.maxSize) != null ? _c : DEFAULTS.maxSize;
346
787
  const batchSize = (_d = options.batchSize) != null ? _d : DEFAULTS.batchSize;
347
788
  const baseBackoffMs = (_e = options.baseBackoffMs) != null ? _e : DEFAULTS.baseBackoffMs;
@@ -360,13 +801,13 @@ var createEventQueue = (options) => {
360
801
  }
361
802
  };
362
803
  const stamp = (event) => {
363
- var _a2;
804
+ var _a3;
364
805
  const env = resolveEnvelope();
365
806
  const stamped = { ...event };
366
807
  if (!env) return stamped;
367
808
  if (!stamped.device && env.device) stamped.device = env.device;
368
809
  if (!stamped.session_id && env.sessionId) stamped.session_id = env.sessionId;
369
- const uc = { ...(_a2 = stamped.user_context) != null ? _a2 : {} };
810
+ const uc = { ...(_a3 = stamped.user_context) != null ? _a3 : {} };
370
811
  if (env.appVersion && uc.app_version === void 0) uc.app_version = env.appVersion;
371
812
  if (env.appBuild && uc.app_build === void 0) uc.app_build = env.appBuild;
372
813
  if (env.networkType && uc.network_type === void 0) uc.network_type = env.networkType;
@@ -562,7 +1003,7 @@ var namespaceExtra = (extra) => {
562
1003
  return out;
563
1004
  };
564
1005
  var resolveUserContext = (ctx = {}, opts = {}) => {
565
- var _a;
1006
+ var _a2;
566
1007
  const result = {};
567
1008
  const bucket = {};
568
1009
  const userId = sanitizeUserId(ctx.userId);
@@ -572,7 +1013,7 @@ var resolveUserContext = (ctx = {}, opts = {}) => {
572
1013
  result.deviceKey = deviceKey;
573
1014
  bucket.device_key = deviceKey;
574
1015
  }
575
- const appVersion = (_a = cleanString(ctx.appVersion)) != null ? _a : cleanString(opts.autoAppVersion);
1016
+ const appVersion = (_a2 = cleanString(ctx.appVersion)) != null ? _a2 : cleanString(opts.autoAppVersion);
576
1017
  if (appVersion) {
577
1018
  result.appVersion = appVersion;
578
1019
  bucket.app_version = appVersion;
@@ -591,20 +1032,46 @@ var resolveUserContext = (ctx = {}, opts = {}) => {
591
1032
  return result;
592
1033
  };
593
1034
 
1035
+ // src/context/deviceId.ts
1036
+ var AUTO_DEVICE_ID_PREFIX = "wdev_";
1037
+ var deviceIdStorageKey = (appId) => `wireai:analytics:deviceKey:${appId != null ? appId : "default"}`;
1038
+ var randomChunk = () => Math.floor(Math.random() * 4294967296).toString(36).padStart(6, "0");
1039
+ var mintDeviceId = () => {
1040
+ const time = Date.now().toString(36);
1041
+ return `${AUTO_DEVICE_ID_PREFIX}${time}_${randomChunk()}${randomChunk()}`;
1042
+ };
1043
+
594
1044
  // src/analytics/analyticsFacade.ts
595
1045
  var createAnalytics = (config, options = {}) => {
596
- var _a, _b, _c, _d;
597
- const instanceSessionId = (_a = config.sessionId) != null ? _a : makeSessionId();
1046
+ var _a2, _b, _c, _d, _e;
1047
+ const instanceSessionId = (_a2 = config.sessionId) != null ? _a2 : makeSessionId();
598
1048
  const resolveSessionId = () => {
599
- var _a2, _b2;
600
- return (_b2 = (_a2 = config.sessionId) != null ? _a2 : getCurrentSessionId()) != null ? _b2 : instanceSessionId;
1049
+ var _a3, _b2;
1050
+ return (_b2 = (_a3 = config.sessionId) != null ? _a3 : getCurrentSessionId()) != null ? _b2 : instanceSessionId;
1051
+ };
1052
+ let userContext = { ...(_b = config.userContext) != null ? _b : {} };
1053
+ const hostDeviceKeyAtInit = typeof ((_c = config.userContext) == null ? void 0 : _c.deviceKey) === "string" && config.userContext.deviceKey.trim() ? config.userContext.deviceKey.trim() : void 0;
1054
+ let autoDeviceKey = mintDeviceId();
1055
+ if (config.storage && !hostDeviceKeyAtInit) {
1056
+ const storage = config.storage;
1057
+ const deviceKey = deviceIdStorageKey(config.appId);
1058
+ void storage.getItem(deviceKey).then((saved) => {
1059
+ const persisted = typeof saved === "string" && saved.trim() ? saved.trim() : void 0;
1060
+ if (persisted) autoDeviceKey = persisted;
1061
+ else void storage.setItem(deviceKey, autoDeviceKey).catch(() => {
1062
+ });
1063
+ }).catch(() => {
1064
+ });
1065
+ }
1066
+ const envelope = () => {
1067
+ var _a3;
1068
+ return buildContextEnvelope({
1069
+ sessionId: resolveSessionId(),
1070
+ appVersion: (_a3 = userContext.appVersion) != null ? _a3 : config.appVersion,
1071
+ appBuild: config.appBuild,
1072
+ networkType: config.networkType
1073
+ });
601
1074
  };
602
- const envelope = () => buildContextEnvelope({
603
- sessionId: resolveSessionId(),
604
- appVersion: config.appVersion,
605
- appBuild: config.appBuild,
606
- networkType: config.networkType
607
- });
608
1075
  const queue = createEventQueue({
609
1076
  target: { serverUrl: config.serverUrl, apiKey: config.apiKey },
610
1077
  storage: config.storage,
@@ -612,9 +1079,8 @@ var createAnalytics = (config, options = {}) => {
612
1079
  envelope,
613
1080
  ...options
614
1081
  });
615
- let userContext = { ...(_b = config.userContext) != null ? _b : {} };
616
- let boundUserId = sanitizeUserId((_c = config.userContext) == null ? void 0 : _c.userId);
617
- const storageKey = `wireai:analytics:userId:${(_d = config.appId) != null ? _d : "default"}`;
1082
+ let boundUserId = sanitizeUserId((_d = config.userContext) == null ? void 0 : _d.userId);
1083
+ const storageKey = `wireai:analytics:userId:${(_e = config.appId) != null ? _e : "default"}`;
618
1084
  if (config.storage) {
619
1085
  void config.storage.getItem(storageKey).then((saved) => {
620
1086
  if (saved && !boundUserId) boundUserId = saved;
@@ -622,17 +1088,21 @@ var createAnalytics = (config, options = {}) => {
622
1088
  });
623
1089
  }
624
1090
  const applyContext = (event) => {
625
- var _a2;
626
- const resolved = resolveUserContext(userContext, { autoAppVersion: config.appVersion });
1091
+ var _a3;
1092
+ const hostDeviceKey = typeof userContext.deviceKey === "string" && userContext.deviceKey.trim() ? userContext.deviceKey : void 0;
1093
+ const resolved = resolveUserContext(
1094
+ { ...userContext, deviceKey: hostDeviceKey != null ? hostDeviceKey : autoDeviceKey },
1095
+ { autoAppVersion: config.appVersion }
1096
+ );
627
1097
  if (resolved.userContext) {
628
- event.user_context = { ...resolved.userContext, ...(_a2 = event.user_context) != null ? _a2 : {} };
1098
+ event.user_context = { ...resolved.userContext, ...(_a3 = event.user_context) != null ? _a3 : {} };
629
1099
  }
630
1100
  if (boundUserId && !event.user_id) event.user_id = boundUserId;
631
1101
  };
632
1102
  const setUserContext = (partial) => {
633
- var _a2, _b2;
1103
+ var _a3, _b2;
634
1104
  if (!partial || typeof partial !== "object") return;
635
- const mergedExtra = partial.extra || userContext.extra ? { ...(_a2 = userContext.extra) != null ? _a2 : {}, ...(_b2 = partial.extra) != null ? _b2 : {} } : void 0;
1105
+ const mergedExtra = partial.extra || userContext.extra ? { ...(_a3 = userContext.extra) != null ? _a3 : {}, ...(_b2 = partial.extra) != null ? _b2 : {} } : void 0;
636
1106
  userContext = { ...userContext, ...partial };
637
1107
  if (mergedExtra) userContext.extra = mergedExtra;
638
1108
  const uid = sanitizeUserId(partial.userId);
@@ -653,9 +1123,9 @@ var createAnalytics = (config, options = {}) => {
653
1123
  applyContext(clientEvent);
654
1124
  queue.enqueue(clientEvent);
655
1125
  };
656
- const screen = (name, props) => {
657
- if (!name) return;
658
- const meta = { screen: name, ...props != null ? props : {} };
1126
+ const screen = (name2, props) => {
1127
+ if (!name2) return;
1128
+ const meta = { screen: name2, ...props != null ? props : {} };
659
1129
  const clientEvent = {
660
1130
  event_type: "app_event",
661
1131
  session_id: resolveSessionId(),