@ovok/native 1.5.6 → 1.6.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 (722) hide show
  1. package/README.md +35 -19
  2. package/android/src/main/AndroidManifest.xml +1 -20
  3. package/app.plugin.js +181 -0
  4. package/lib/commonjs/index.js +5 -104
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  7. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  8. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
  9. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  10. package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
  11. package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
  12. package/lib/commonjs/modules/auth/index.js +44 -0
  13. package/lib/commonjs/modules/auth/index.js.map +1 -1
  14. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
  15. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
  16. package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
  17. package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
  18. package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
  19. package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
  20. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
  21. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  22. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
  23. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  24. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  25. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  26. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  27. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  28. package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
  29. package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
  30. package/lib/commonjs/modules/auth/session/events.js +19 -0
  31. package/lib/commonjs/modules/auth/session/events.js.map +1 -0
  32. package/lib/commonjs/modules/auth/session/index.js +13 -0
  33. package/lib/commonjs/modules/auth/session/index.js.map +1 -0
  34. package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
  35. package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
  36. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
  37. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  38. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  39. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  40. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
  41. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  42. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  43. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  44. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
  45. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  46. package/lib/commonjs/modules/auth/types/session.js +2 -0
  47. package/lib/commonjs/modules/auth/types/session.js.map +1 -0
  48. package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
  49. package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
  50. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  51. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  52. package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
  53. package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
  54. package/lib/commonjs/modules/background-sync/index.js +11 -0
  55. package/lib/commonjs/modules/background-sync/index.js.map +1 -1
  56. package/lib/commonjs/modules/bt-device/index.js +0 -22
  57. package/lib/commonjs/modules/bt-device/index.js.map +1 -1
  58. package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
  59. package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
  60. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
  61. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  62. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  63. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  64. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  65. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  66. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
  67. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
  68. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
  69. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  70. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
  71. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  72. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
  73. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  74. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
  75. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
  76. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
  77. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
  78. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
  79. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  80. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
  81. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  82. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
  83. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  84. package/lib/commonjs/modules/bt-management/index.js +154 -0
  85. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  86. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  87. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  88. package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
  89. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  90. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  92. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  93. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  94. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  95. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  96. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  97. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  98. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  99. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  100. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  101. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  102. package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
  103. package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
  104. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
  105. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  106. package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
  107. package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
  108. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
  109. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
  110. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
  111. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
  112. package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
  113. package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
  114. package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
  115. package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
  116. package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
  117. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
  118. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  119. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  120. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
  121. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  122. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
  123. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  124. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  125. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  126. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
  127. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  128. package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
  129. package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
  130. package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
  131. package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
  132. package/lib/commonjs/modules/helpers/index.js +23 -4
  133. package/lib/commonjs/modules/helpers/index.js.map +1 -1
  134. package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
  135. package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
  136. package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
  137. package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
  138. package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
  139. package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
  140. package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
  141. package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
  142. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
  143. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  144. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  145. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  146. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  147. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  148. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  149. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  150. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  151. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  152. package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  153. package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
  154. package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
  155. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
  156. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  157. package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
  158. package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
  159. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
  160. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  161. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
  162. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  163. package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
  164. package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
  165. package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
  166. package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
  167. package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
  168. package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
  169. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
  170. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  171. package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
  172. package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
  173. package/lib/commonjs/modules/ui/index.js +116 -0
  174. package/lib/commonjs/modules/ui/index.js.map +1 -0
  175. package/lib/commonjs/modules/ui/types.js +6 -0
  176. package/lib/commonjs/modules/ui/types.js.map +1 -0
  177. package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
  178. package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
  179. package/lib/module/index.js +3 -9
  180. package/lib/module/index.js.map +1 -1
  181. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  182. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  183. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
  184. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  185. package/lib/module/modules/auth/hooks/use-session.js +99 -0
  186. package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
  187. package/lib/module/modules/auth/index.js +4 -0
  188. package/lib/module/modules/auth/index.js.map +1 -1
  189. package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
  190. package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
  191. package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
  192. package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
  193. package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
  194. package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
  195. package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
  196. package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  197. package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
  198. package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  199. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  200. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  201. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  202. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  203. package/lib/module/modules/auth/session/components/session-list.js +76 -0
  204. package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
  205. package/lib/module/modules/auth/session/events.js +13 -0
  206. package/lib/module/modules/auth/session/events.js.map +1 -0
  207. package/lib/module/modules/auth/session/index.js +4 -0
  208. package/lib/module/modules/auth/session/index.js.map +1 -0
  209. package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
  210. package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
  211. package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
  212. package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  213. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  214. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  215. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
  216. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  217. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  218. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  219. package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
  220. package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  221. package/lib/module/modules/auth/types/session.js +2 -0
  222. package/lib/module/modules/auth/types/session.js.map +1 -0
  223. package/lib/module/modules/auth/utils/rate-limit.js +31 -0
  224. package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
  225. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  226. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  227. package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
  228. package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
  229. package/lib/module/modules/background-sync/index.js +1 -0
  230. package/lib/module/modules/background-sync/index.js.map +1 -1
  231. package/lib/module/modules/bt-device/index.js +0 -2
  232. package/lib/module/modules/bt-device/index.js.map +1 -1
  233. package/lib/module/modules/bt-device-instructions/index.js +6 -0
  234. package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
  235. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
  236. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  237. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  238. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  239. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  240. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  241. package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
  242. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
  243. package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
  244. package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  245. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
  246. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  247. package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
  248. package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  249. package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
  250. package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
  251. package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
  252. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
  253. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
  254. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  255. package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
  256. package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  257. package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
  258. package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  259. package/lib/module/modules/bt-management/index.js +14 -0
  260. package/lib/module/modules/bt-management/index.js.map +1 -1
  261. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  262. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  263. package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
  264. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  265. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  266. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  267. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  268. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  269. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  270. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  271. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  272. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  273. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  274. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  275. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  276. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  277. package/lib/module/modules/bt-management/services/push-notification.js +34 -0
  278. package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
  279. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
  280. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  281. package/lib/module/modules/bt-management/testing/index.js +5 -0
  282. package/lib/module/modules/bt-management/testing/index.js.map +1 -0
  283. package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
  284. package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
  285. package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
  286. package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
  287. package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
  288. package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
  289. package/lib/module/modules/bt-management/types/result-policy.js +4 -0
  290. package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
  291. package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
  292. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
  293. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  294. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  295. package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
  296. package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  297. package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
  298. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  299. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  300. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  301. package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
  302. package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  303. package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
  304. package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
  305. package/lib/module/modules/helpers/form-items/form-field.js +2 -0
  306. package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
  307. package/lib/module/modules/helpers/index.js +2 -1
  308. package/lib/module/modules/helpers/index.js.map +1 -1
  309. package/lib/module/modules/helpers/utils/s-log.js +4 -12
  310. package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
  311. package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
  312. package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
  313. package/lib/module/modules/helpers/utils/telemetry.js +218 -0
  314. package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
  315. package/lib/module/modules/image/components/optimized-image.js +32 -7
  316. package/lib/module/modules/image/components/optimized-image.js.map +1 -1
  317. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
  318. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  319. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  320. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  321. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  322. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  323. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  324. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  325. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  326. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  327. package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  328. package/lib/module/modules/tile/components/task-icon.js +2 -1
  329. package/lib/module/modules/tile/components/task-icon.js.map +1 -1
  330. package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
  331. package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  332. package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
  333. package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
  334. package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
  335. package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  336. package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
  337. package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  338. package/lib/module/modules/ui/components/health-import-card.js +135 -0
  339. package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
  340. package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
  341. package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
  342. package/lib/module/modules/ui/components/pairing-flow.js +241 -0
  343. package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
  344. package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
  345. package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  346. package/lib/module/modules/ui/components/urine-test-result.js +94 -0
  347. package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
  348. package/lib/module/modules/ui/index.js +13 -0
  349. package/lib/module/modules/ui/index.js.map +1 -0
  350. package/lib/module/modules/ui/types.js +4 -0
  351. package/lib/module/modules/ui/types.js.map +1 -0
  352. package/lib/module/modules/ui/use-ovok-ui.js +45 -0
  353. package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
  354. package/lib/typescript/commonjs/src/index.d.ts +0 -9
  355. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  358. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
  360. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
  362. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  369. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
  371. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
  373. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
  375. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  377. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  379. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  381. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  383. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  386. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  387. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  388. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  389. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  390. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  392. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
  394. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
  396. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  399. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
  401. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
  402. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
  403. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
  404. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
  405. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  410. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  411. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  412. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  413. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  415. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  416. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  417. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  419. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  421. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  425. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  427. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
  429. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  430. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  432. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  433. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  434. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  436. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  437. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  439. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  441. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
  444. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  446. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  447. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
  448. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  450. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
  452. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  454. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  455. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  456. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  458. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  459. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  460. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  461. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  462. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  463. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
  464. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  466. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  468. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
  470. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  472. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  475. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  476. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  478. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  479. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  480. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  481. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  482. package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  484. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
  486. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
  488. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  490. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  491. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  492. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
  493. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
  495. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
  496. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
  497. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  498. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  499. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  500. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  501. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  502. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  504. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  506. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  508. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  509. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  510. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  512. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
  514. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  515. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  516. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  517. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  518. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  519. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  520. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  521. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  522. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
  523. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  524. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  525. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  526. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
  527. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  528. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  529. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  530. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
  531. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  532. package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
  533. package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
  534. package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
  535. package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
  536. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
  537. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  538. package/lib/typescript/module/src/index.d.ts +0 -9
  539. package/lib/typescript/module/src/index.d.ts.map +1 -1
  540. package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  541. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  542. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  543. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
  544. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  545. package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
  546. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  547. package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  548. package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  549. package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  550. package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  551. package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  552. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  553. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  554. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
  555. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  556. package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
  557. package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
  558. package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
  559. package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
  560. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  561. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  562. package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  564. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  565. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  566. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  567. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  568. package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  569. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  570. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  571. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  572. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  573. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  574. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  575. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  576. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  577. package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
  578. package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
  579. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
  580. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  581. package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  582. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  583. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  584. package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
  585. package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
  587. package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
  588. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
  589. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  590. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  591. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  592. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  593. package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  594. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  595. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  596. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  597. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  598. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  599. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  600. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  601. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  602. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  603. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  604. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  605. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  606. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  607. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  608. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  609. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  610. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  611. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  612. package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
  613. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  614. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  615. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  616. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  617. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  618. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  620. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  623. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  624. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  625. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  626. package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  627. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
  628. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  629. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  630. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  631. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
  632. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
  633. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  634. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  635. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
  636. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  637. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  638. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  639. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  640. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  641. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  642. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  643. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  644. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  645. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  646. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  647. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
  648. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  649. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  650. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  651. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  652. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  653. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
  654. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  655. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  656. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  657. package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  658. package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  659. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  660. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  661. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  662. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  663. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  664. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  665. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  666. package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  667. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  668. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  669. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
  670. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  671. package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
  672. package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
  673. package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  674. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  675. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  676. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
  677. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  678. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
  679. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
  680. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
  681. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  682. package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  683. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  684. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  685. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  686. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  687. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  688. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  689. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  690. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  691. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  692. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  693. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  694. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  695. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  696. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  697. package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
  698. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  699. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  700. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  701. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  702. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  703. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  704. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  705. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  706. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
  707. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  708. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  709. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  710. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
  711. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  712. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  713. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  714. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
  715. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  716. package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
  717. package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
  718. package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
  719. package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
  720. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
  721. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  722. package/package.json +146 -7
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { Linking, Platform, StyleSheet, View } from "react-native";
5
+ import { Button as PaperButton, Card as PaperCard, Text as PaperText } from "react-native-paper";
6
+ import { useBluetoothState } from "../../bt-management/index.js";
7
+ import { useOvokUi } from "../use-ovok-ui.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const BluetoothStateNotice = ({
10
+ bleManager,
11
+ requestPermission,
12
+ onOpenSettings,
13
+ title,
14
+ testID,
15
+ ...uiProps
16
+ }) => {
17
+ const {
18
+ theme,
19
+ slots
20
+ } = useOvokUi(uiProps);
21
+ const Button = slots.Button ?? PaperButton;
22
+ const Card = slots.Card ?? PaperCard;
23
+ const Text = slots.Text ?? PaperText;
24
+ const {
25
+ state,
26
+ requestPermission: request
27
+ } = useBluetoothState({
28
+ bleManager,
29
+ requestPermission
30
+ });
31
+ const [busy, setBusy] = React.useState(false);
32
+ const [actionError, setActionError] = React.useState();
33
+ if (state === "on") {
34
+ return null;
35
+ }
36
+ const openSettings = async () => {
37
+ if (onOpenSettings) {
38
+ await onOpenSettings();
39
+ return;
40
+ }
41
+ await Linking.openSettings();
42
+ };
43
+ const takeAction = async () => {
44
+ setBusy(true);
45
+ setActionError(undefined);
46
+ try {
47
+ if (state === "unauthorized") {
48
+ const granted = await request();
49
+ if (granted) {
50
+ return;
51
+ }
52
+ }
53
+ if (state === "off") {
54
+ await openSettings();
55
+ }
56
+ } catch (cause) {
57
+ setActionError(cause instanceof Error ? cause.message : String(cause));
58
+ } finally {
59
+ setBusy(false);
60
+ }
61
+ };
62
+ const copy = state === "unsupported" ? {
63
+ heading: title ?? "Bluetooth is not supported",
64
+ body: "This device cannot use Bluetooth Low Energy.",
65
+ action: undefined
66
+ } : state === "unauthorized" ? {
67
+ heading: title ?? "Bluetooth permission is required",
68
+ body: Platform.OS === "android" ? "Allow Nearby devices permission to find health devices." : "Allow Bluetooth access to find health devices.",
69
+ action: "Allow access"
70
+ } : {
71
+ heading: title ?? "Bluetooth is off",
72
+ body: "Turn on Bluetooth to find and connect to health devices.",
73
+ action: "Open Bluetooth settings"
74
+ };
75
+ return /*#__PURE__*/_jsx(Card, {
76
+ theme: theme,
77
+ testID: testID,
78
+ style: {
79
+ borderRadius: theme.borderRadius(2)
80
+ },
81
+ children: /*#__PURE__*/_jsxs(View, {
82
+ style: styles.content,
83
+ children: [/*#__PURE__*/_jsx(Text, {
84
+ theme: theme,
85
+ variant: "titleMedium",
86
+ children: copy.heading
87
+ }), /*#__PURE__*/_jsx(Text, {
88
+ theme: theme,
89
+ children: copy.body
90
+ }), actionError && /*#__PURE__*/_jsx(Text, {
91
+ theme: theme,
92
+ style: {
93
+ color: theme.colors.error
94
+ },
95
+ children: actionError
96
+ }), copy.action && /*#__PURE__*/_jsx(Button, {
97
+ theme: theme,
98
+ loading: busy,
99
+ disabled: busy,
100
+ mode: "contained",
101
+ onPress: () => void takeAction(),
102
+ children: copy.action
103
+ })]
104
+ })
105
+ });
106
+ };
107
+ const styles = StyleSheet.create({
108
+ content: {
109
+ gap: 10,
110
+ padding: 16
111
+ }
112
+ });
113
+ //# sourceMappingURL=bluetooth-state-notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Linking","Platform","StyleSheet","View","Button","PaperButton","Card","PaperCard","Text","PaperText","useBluetoothState","useOvokUi","jsx","_jsx","jsxs","_jsxs","BluetoothStateNotice","bleManager","requestPermission","onOpenSettings","title","testID","uiProps","theme","slots","state","request","busy","setBusy","useState","actionError","setActionError","openSettings","takeAction","undefined","granted","cause","Error","message","String","copy","heading","body","action","OS","style","borderRadius","children","styles","content","variant","color","colors","error","loading","disabled","mode","onPress","create","gap","padding"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/bluetooth-state-notice.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAElE,SACEC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,EACjBC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAE3B,SAASC,iBAAiB,QAAQ,8BAAqB;AAEvD,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU3C,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;E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AAE5B,KAAK,CAAC6B,MAAM,CAACC;QAAM,CAAE;QAAAN,QAAA,EAAEjB;MAAW,CAAO,CAAC,EAC7FU,IAAI,CAACG,MAAM,iBACV9B,IAAA,CAACT,MAAM;QAACmB,KAAK,EAAEA,KAAM;QAAC+B,OAAO,EAAE3B,IAAK;QAAC4B,QAAQ,EAAE5B,IAAK;QAAC6B,IAAI,EAAC,WAAW;QAACC,OAAO,EAAEA,CAAA,KAAM,KAAKxB,UAAU,CAAC,CAAE;QAAAc,QAAA,EACpGP,IAAI,CAACG;MAAM,CACN,CACT;IAAA,CACG;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAG9C,UAAU,CAACwD,MAAM,CAAC;EAAET,OAAO,EAAE;IAAEU,GAAG,EAAE,EAAE;IAAEC,OAAO,EAAE;EAAG;AAAE,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { Pressable, ScrollView, StyleSheet, View } from "react-native";
5
+ import Svg, { Path, Line } from "react-native-svg";
6
+ import { useOvokUi } from "../use-ovok-ui.js";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ const MILLIMETRE = 4;
9
+ const DEFAULT_PAGE_DURATION = 30;
10
+ const DEFAULT_SPEED = 25;
11
+ const DEFAULT_GAIN = 10;
12
+ const STRIP_HEIGHT = 200;
13
+ const MAX_PATH_POINTS = 5000;
14
+ const range = count => Array.from({
15
+ length: Math.max(0, count)
16
+ }, (_, index) => index);
17
+ const buildTracePath = (samples, sampleRate, speed, gain, width) => {
18
+ if (!samples.length || sampleRate <= 0) {
19
+ return "";
20
+ }
21
+ const stride = Math.max(1, Math.ceil(samples.length / MAX_PATH_POINTS));
22
+ const centre = STRIP_HEIGHT / 2;
23
+ const points = [];
24
+ for (let index = 0; index < samples.length; index += stride) {
25
+ const sample = samples[index];
26
+ if (sample === undefined || !Number.isFinite(sample)) {
27
+ continue;
28
+ }
29
+ const x = Math.min(width, index / sampleRate * speed * MILLIMETRE);
30
+ const y = centre - sample * gain * MILLIMETRE;
31
+ points.push(`${points.length === 0 ? "M" : "L"}${x.toFixed(2)} ${y.toFixed(2)}`);
32
+ }
33
+ return points.join(" ");
34
+ };
35
+ export const EcgStripViewer = ({
36
+ samples,
37
+ sampleRate,
38
+ speed = DEFAULT_SPEED,
39
+ gain = DEFAULT_GAIN,
40
+ pageDurationSeconds = DEFAULT_PAGE_DURATION,
41
+ initialPage = 0,
42
+ onPageChange,
43
+ testID,
44
+ theme: themeOverride,
45
+ slots
46
+ }) => {
47
+ const {
48
+ theme,
49
+ slots: uiSlots
50
+ } = useOvokUi({
51
+ theme: themeOverride,
52
+ slots
53
+ });
54
+ const Text = uiSlots.Text;
55
+ const Button = uiSlots.Button;
56
+ const safeSampleRate = Math.max(1, sampleRate);
57
+ const safePageDuration = Math.max(1, pageDurationSeconds);
58
+ const samplesPerPage = Math.max(1, Math.round(safeSampleRate * safePageDuration));
59
+ const pageCount = Math.max(1, Math.ceil(samples.length / samplesPerPage));
60
+ const [page, setPage] = React.useState(Math.min(Math.max(0, Math.floor(initialPage)), pageCount - 1));
61
+ React.useEffect(() => {
62
+ setPage(Math.min(Math.max(0, Math.floor(initialPage)), pageCount - 1));
63
+ }, [initialPage, pageCount, pageDurationSeconds, sampleRate, samples]);
64
+ const pageSamples = samples.slice(page * samplesPerPage, (page + 1) * samplesPerPage);
65
+ const pageWidth = Math.max(320, Math.round(Math.min(safePageDuration, pageSamples.length / safeSampleRate) * speed * MILLIMETRE));
66
+ const path = buildTracePath(pageSamples, safeSampleRate, speed, gain, pageWidth);
67
+ const totalDuration = samples.length / safeSampleRate;
68
+ const changePage = next => {
69
+ const bounded = Math.min(Math.max(0, next), pageCount - 1);
70
+ setPage(bounded);
71
+ onPageChange?.(bounded, pageCount);
72
+ };
73
+ return /*#__PURE__*/_jsxs(View, {
74
+ testID: testID,
75
+ style: styles.container,
76
+ children: [/*#__PURE__*/_jsxs(View, {
77
+ style: styles.header,
78
+ children: [Text ? /*#__PURE__*/_jsx(Text, {
79
+ theme: theme,
80
+ variant: "titleMedium",
81
+ children: "ECG strip"
82
+ }) : null, Text ? /*#__PURE__*/_jsx(Text, {
83
+ theme: theme,
84
+ variant: "bodySmall",
85
+ children: `${totalDuration.toFixed(1)} s · ${speed} mm/s · ${gain} mm/mV`
86
+ }) : null]
87
+ }), /*#__PURE__*/_jsx(ScrollView, {
88
+ horizontal: true,
89
+ showsHorizontalScrollIndicator: true,
90
+ testID: testID ? `${testID}-scroll` : undefined,
91
+ children: /*#__PURE__*/_jsxs(Svg, {
92
+ width: pageWidth,
93
+ height: STRIP_HEIGHT,
94
+ children: [range(Math.ceil(pageWidth / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
95
+ x1: index * 20,
96
+ y1: 0,
97
+ x2: index * 20,
98
+ y2: STRIP_HEIGHT,
99
+ stroke: theme.colors.errorContainer,
100
+ strokeWidth: 1
101
+ }, `vertical-${index}`)), range(Math.ceil(STRIP_HEIGHT / 20) + 1).map(index => /*#__PURE__*/_jsx(Line, {
102
+ x1: 0,
103
+ y1: index * 20,
104
+ x2: pageWidth,
105
+ y2: index * 20,
106
+ stroke: theme.colors.errorContainer,
107
+ strokeWidth: 1
108
+ }, `horizontal-${index}`)), /*#__PURE__*/_jsx(Path, {
109
+ d: path,
110
+ fill: "none",
111
+ stroke: theme.colors.primary,
112
+ strokeWidth: 1.5
113
+ })]
114
+ })
115
+ }), /*#__PURE__*/_jsxs(View, {
116
+ style: styles.footer,
117
+ children: [Button ? /*#__PURE__*/_jsx(Button, {
118
+ theme: theme,
119
+ mode: "outlined",
120
+ compact: true,
121
+ disabled: page === 0,
122
+ onPress: () => changePage(page - 1),
123
+ children: "Previous"
124
+ }) : /*#__PURE__*/_jsx(Pressable, {
125
+ disabled: page === 0,
126
+ onPress: () => changePage(page - 1),
127
+ children: Text ? /*#__PURE__*/_jsx(Text, {
128
+ theme: theme,
129
+ children: "Previous"
130
+ }) : null
131
+ }), Text ? /*#__PURE__*/_jsxs(Text, {
132
+ theme: theme,
133
+ variant: "bodyMedium",
134
+ children: ["Page ", page + 1, " of ", pageCount]
135
+ }) : null, Button ? /*#__PURE__*/_jsx(Button, {
136
+ theme: theme,
137
+ mode: "outlined",
138
+ compact: true,
139
+ disabled: page >= pageCount - 1,
140
+ onPress: () => changePage(page + 1),
141
+ children: "Next"
142
+ }) : /*#__PURE__*/_jsx(Pressable, {
143
+ disabled: page >= pageCount - 1,
144
+ onPress: () => changePage(page + 1),
145
+ children: Text ? /*#__PURE__*/_jsx(Text, {
146
+ theme: theme,
147
+ children: "Next"
148
+ }) : null
149
+ })]
150
+ })]
151
+ });
152
+ };
153
+ const styles = StyleSheet.create({
154
+ container: {
155
+ gap: 12,
156
+ overflow: "hidden"
157
+ },
158
+ header: {
159
+ flexDirection: "row",
160
+ justifyContent: "space-between",
161
+ alignItems: "center"
162
+ },
163
+ footer: {
164
+ flexDirection: "row",
165
+ justifyContent: "space-between",
166
+ alignItems: "center"
167
+ }
168
+ });
169
+ //# sourceMappingURL=ecg-strip-viewer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","Pressable","ScrollView","StyleSheet","View","Svg","Path","Line","useOvokUi","jsx","_jsx","jsxs","_jsxs","MILLIMETRE","DEFAULT_PAGE_DURATION","DEFAULT_SPEED","DEFAULT_GAIN","STRIP_HEIGHT","MAX_PATH_POINTS","range","count","Array","from","length","Math","max","_","index","buildTracePath","samples","sampleRate","speed","gain","width","stride","ceil","centre","points","sample","undefined","Number","isFinite","x","min","y","push","toFixed","join","EcgStripViewer","pageDurationSeconds","initialPage","onPageChange","testID","theme","themeOverride","slots","uiSlots","Text","Button","safeSampleRate","safePageDuration","samplesPerPage","round","pageCount","page","setPage","useState","floor","useEffect","pageSamples","slice","pageWidth","path","totalDuration","changePage","next","bounded","style","styles","container","children","header","variant","horizontal","showsHorizontalScrollIndicator","height","map","x1","y1","x2","y2","stroke","colors","errorContainer","strokeWidth","d","fill","primary","footer","mode","compact","disabled","onPress","create","gap","overflow","flexDirection","justifyContent","alignItems"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/ecg-strip-viewer.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtE,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAGlD,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAmB3C,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,qBAAqB,GAAG,EAAE;AAChC,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,YAAY,GAAG,EAAE;AACvB,MAAMC,YAAY,GAAG,GAAG;AACxB,MAAMC,eAAe,GAAG,IAAI;AAE5B,MAAMC,KAAK,GAAIC,KAAa,IAC1BC,KAAK,CAACC,IAAI,CAAC;EAAEC,MAAM,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEL,KAAK;AAAE,CAAC,EAAE,CAACM,CAAC,EAAEC,KAAK,KAAKA,KAAK,CAAC;AAEjE,MAAMC,cAAc,GAAGA,CACrBC,OAA0B,EAC1BC,UAAkB,EAClBC,KAAa,EACbC,IAAY,EACZC,KAAa,KACF;EACX,IAAI,CAACJ,OAAO,CAACN,MAAM,IAAIO,UAAU,IAAI,CAAC,EAAE;IACtC,OAAO,EAAE;EACX;EAEA,MAAMI,MAAM,GAAGV,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACW,IAAI,CAACN,OAAO,CAACN,MAAM,GAAGL,eAAe,CAAC,CAAC;EACvE,MAAMkB,MAAM,GAAGnB,YAAY,GAAG,CAAC;EAC/B,MAAMoB,MAAgB,GAAG,EAAE;EAE3B,KAAK,IAAIV,KAAK,GAAG,CAAC,EAA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AAE;IAAEyB,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAS,CAAC;EAC1CxB,MAAM,EAAE;IAAEyB,aAAa,EAAE,KAAK;IAAEC,cAAc,EAAE,eAAe;IAAEC,UAAU,EAAE;EAAS,CAAC;EACvFV,MAAM,EAAE;IAAEQ,aAAa,EAAE,KAAK;IAAEC,cAAc,EAAE,eAAe;IAAEC,UAAU,EAAE;EAAS;AACxF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { StyleSheet, View } from "react-native";
5
+ import { ActivityIndicator, Button as PaperButton, Card as PaperCard, Switch, Text as PaperText } from "react-native-paper";
6
+ import { useHealthImport } from "../../bt-management/index.js";
7
+ import { useOvokUi } from "../use-ovok-ui.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const statusLabel = status => {
10
+ switch (status) {
11
+ case "authorized":
12
+ return "Up to date";
13
+ case "shouldRequest":
14
+ return "Waiting for permission";
15
+ case "refused":
16
+ return "Not shared";
17
+ case "unsupported":
18
+ return "Unavailable on this device";
19
+ default:
20
+ return "Checking access";
21
+ }
22
+ };
23
+ export const HealthImportCard = ({
24
+ types,
25
+ adapter,
26
+ background = false,
27
+ title = "Health data import",
28
+ labelForType = type => type,
29
+ testID,
30
+ ...uiProps
31
+ }) => {
32
+ const {
33
+ theme,
34
+ slots
35
+ } = useOvokUi(uiProps);
36
+ const Button = slots.Button ?? PaperButton;
37
+ const Card = slots.Card ?? PaperCard;
38
+ const Text = slots.Text ?? PaperText;
39
+ const {
40
+ enabled,
41
+ setEnabled,
42
+ statusByType,
43
+ notShared,
44
+ error
45
+ } = useHealthImport({
46
+ types,
47
+ background,
48
+ adapter
49
+ });
50
+ const [busy, setBusy] = React.useState(false);
51
+ const toggle = async next => {
52
+ setBusy(true);
53
+ try {
54
+ await setEnabled(next);
55
+ } finally {
56
+ setBusy(false);
57
+ }
58
+ };
59
+ return /*#__PURE__*/_jsx(Card, {
60
+ theme: theme,
61
+ testID: testID,
62
+ style: {
63
+ borderRadius: theme.borderRadius(2)
64
+ },
65
+ children: /*#__PURE__*/_jsxs(View, {
66
+ style: styles.content,
67
+ children: [/*#__PURE__*/_jsxs(View, {
68
+ style: styles.header,
69
+ children: [/*#__PURE__*/_jsx(Text, {
70
+ theme: theme,
71
+ variant: "titleMedium",
72
+ style: styles.grow,
73
+ children: title
74
+ }), busy ? /*#__PURE__*/_jsx(ActivityIndicator, {
75
+ theme: theme
76
+ }) : /*#__PURE__*/_jsx(Switch, {
77
+ accessibilityLabel: title,
78
+ theme: theme,
79
+ value: enabled,
80
+ onValueChange: value => void toggle(value)
81
+ })]
82
+ }), types.map(type => /*#__PURE__*/_jsxs(View, {
83
+ style: styles.row,
84
+ children: [/*#__PURE__*/_jsx(Text, {
85
+ theme: theme,
86
+ children: labelForType(type)
87
+ }), /*#__PURE__*/_jsx(Text, {
88
+ theme: theme,
89
+ children: statusLabel(statusByType[type])
90
+ })]
91
+ }, type)), notShared.length > 0 && /*#__PURE__*/_jsx(Text, {
92
+ theme: theme,
93
+ style: [styles.notice, {
94
+ color: theme.colors.onSurfaceVariant
95
+ }],
96
+ children: "Some data types are not shared. You can enable them in your health app."
97
+ }), error && /*#__PURE__*/_jsx(Text, {
98
+ theme: theme,
99
+ style: {
100
+ color: theme.colors.error
101
+ },
102
+ children: error.message
103
+ }), /*#__PURE__*/_jsx(Button, {
104
+ theme: theme,
105
+ mode: "outlined",
106
+ disabled: busy,
107
+ onPress: () => void toggle(!enabled),
108
+ children: enabled ? "Stop import" : "Connect health data"
109
+ })]
110
+ })
111
+ });
112
+ };
113
+ const styles = StyleSheet.create({
114
+ content: {
115
+ padding: 16
116
+ },
117
+ header: {
118
+ alignItems: "center",
119
+ flexDirection: "row",
120
+ gap: 8
121
+ },
122
+ grow: {
123
+ flex: 1
124
+ },
125
+ row: {
126
+ flexDirection: "row",
127
+ justifyContent: "space-between",
128
+ paddingVertical: 6
129
+ },
130
+ notice: {
131
+ paddingBottom: 10,
132
+ paddingTop: 4
133
+ }
134
+ });
135
+ //# sourceMappingURL=health-import-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","ActivityIndicator","Button","PaperButton","Card","PaperCard","Switch","Text","PaperText","useHealthImport","useOvokUi","jsx","_jsx","jsxs","_jsxs","statusLabel","status","HealthImportCard","types","adapter","background","title","labelForType","type","testID","uiProps","theme","slots","enabled","setEnabled","statusByType","notShared","error","busy","setBusy","useState","toggle","next","style","borderRadius","children","styles","content","header","variant","grow","accessibilityLabel","value","onValueChange","map","row","length","notice","color","colors","onSurfaceVariant","message","mode","disabled","onPress","create","padding","alignItems","flexDirection","gap","flex","justifyContent","paddingVertical","paddingBottom","paddingTop"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/health-import-card.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,iBAAiB,EACjBC,MAAM,IAAIC,WAAW,EACrBC,IAAI,IAAIC,SAAS,EACjBC,MAAM,EACNC,IAAI,IAAIC,SAAS,QACZ,oBAAoB;AAE3B,SAA8BC,eAAe,QAAQ,8BAAqB;AAE1E,SAASC,SAAS,QAAQ,mBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAW3C,MAAMC,WAAW,GAAIC,MAAe,IAAa;EAC/C,QAAQA,MAAM;IACZ,KAAK,YAAY;MAAE,OAAO,YAAY;IACtC,KAAK,eAAe;MAAE,OAAO,wBAAwB;IACrD,KAAK,SAAS;MAAE,OAAO,YAAY;IACnC,KAAK,aAAa;MAAE,OAAO,4BAA4B;IACvD;MAAS,OAAO,iBAAiB;EACnC;AACF,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAGA,CAAuB;EACrDC,KAAK;EACLC,OAAO;EACPC,UAAU,GAAG,KAA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AAK,EAAEA,KAAM;QAAC+B,IAAI,EAAC,UAAU;QAACC,QAAQ,EAAEzB,IAAK;QAAC0B,OAAO,EAAEA,CAAA,KAAM,KAAKvB,MAAM,CAAC,CAACR,OAAO,CAAE;QAAAY,QAAA,EACxFZ,OAAO,GAAG,aAAa,GAAG;MAAqB,CAC1C,CAAC;IAAA,CACL;EAAC,CACH,CAAC;AAEX,CAAC;AAED,MAAMa,MAAM,GAAG1C,UAAU,CAAC6D,MAAM,CAAC;EAC/BlB,OAAO,EAAE;IAAEmB,OAAO,EAAE;EAAG,CAAC;EACxBlB,MAAM,EAAE;IAAEmB,UAAU,EAAE,QAAQ;IAAEC,aAAa,EAAE,KAAK;IAAEC,GAAG,EAAE;EAAE,CAAC;EAC9DnB,IAAI,EAAE;IAAEoB,IAAI,EAAE;EAAE,CAAC;EACjBf,GAAG,EAAE;IAAEa,aAAa,EAAE,KAAK;IAAEG,cAAc,EAAE,eAAe;IAAEC,eAAe,EAAE;EAAE,CAAC;EAClFf,MAAM,EAAE;IAAEgB,aAAa,EAAE,EAAE;IAAEC,UAAU,EAAE;EAAE;AAC7C,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports */
4
+
5
+ import * as React from "react";
6
+ import { StyleSheet, View } from "react-native";
7
+ import { Button as PaperButton, Card as PaperCard, Text as PaperText, TextInput } from "react-native-paper";
8
+ import { measurementFieldCatalog } from "../../bt-management/index.js";
9
+ import { useOvokUi } from "../use-ovok-ui.js";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ export const ManualEntryForm = ({
12
+ measurementTypeKey,
13
+ saveMeasurement,
14
+ initialValues = {},
15
+ recordedAt = new Date(),
16
+ title = "Add measurement",
17
+ labelForField = field => field,
18
+ testID,
19
+ onSaved,
20
+ labelForUnit = unit => unit === "Cel" ? "°C" : unit,
21
+ ...uiProps
22
+ }) => {
23
+ const {
24
+ theme,
25
+ slots
26
+ } = useOvokUi(uiProps);
27
+ const Button = slots.Button ?? PaperButton;
28
+ const Card = slots.Card ?? PaperCard;
29
+ const Text = slots.Text ?? PaperText;
30
+ const fields = measurementFieldCatalog[measurementTypeKey] ?? {};
31
+ const [values, setValues] = React.useState(() => Object.fromEntries(Object.keys(fields).map(field => [field, initialValues[field]?.toString() ?? ""])));
32
+ const [dateText, setDateText] = React.useState(recordedAt.toISOString());
33
+ const [error, setError] = React.useState();
34
+ const [saving, setSaving] = React.useState(false);
35
+ const savingRef = React.useRef(false);
36
+ const save = async () => {
37
+ if (savingRef.current) {
38
+ return;
39
+ }
40
+ const data = {};
41
+ for (const [field, definition] of Object.entries(fields)) {
42
+ const raw = values[field]?.trim() ?? "";
43
+ const value = Number(raw);
44
+ if (definition.required && raw === "") {
45
+ setError(`${labelForField(field)} is required`);
46
+ return;
47
+ }
48
+ if (raw !== "" && (!Number.isFinite(value) || value < definition.min || value > definition.max)) {
49
+ setError(`${labelForField(field)} must be between ${definition.min} and ${definition.max} ${definition.unit}`);
50
+ return;
51
+ }
52
+ if (raw !== "") {
53
+ data[field] = value;
54
+ }
55
+ }
56
+ const nextDate = new Date(dateText);
57
+ if (Number.isNaN(nextDate.getTime())) {
58
+ setError("Enter a valid measurement date");
59
+ return;
60
+ }
61
+ setError(undefined);
62
+ savingRef.current = true;
63
+ setSaving(true);
64
+ const input = {
65
+ measurementTypeKey,
66
+ data,
67
+ recordedAt: nextDate
68
+ };
69
+ try {
70
+ await saveMeasurement(input);
71
+ onSaved?.(input);
72
+ } catch (cause) {
73
+ setError(cause instanceof Error ? cause.message : String(cause));
74
+ } finally {
75
+ savingRef.current = false;
76
+ setSaving(false);
77
+ }
78
+ };
79
+ return /*#__PURE__*/_jsx(Card, {
80
+ theme: theme,
81
+ testID: testID,
82
+ style: {
83
+ borderRadius: theme.borderRadius(2)
84
+ },
85
+ children: /*#__PURE__*/_jsxs(View, {
86
+ style: styles.content,
87
+ children: [/*#__PURE__*/_jsx(Text, {
88
+ theme: theme,
89
+ variant: "titleMedium",
90
+ children: title
91
+ }), Object.entries(fields).map(([field, definition]) => /*#__PURE__*/_jsx(TextInput, {
92
+ theme: theme,
93
+ label: `${labelForField(field)} (${labelForUnit(definition.unit)})`,
94
+ value: values[field] ?? "",
95
+ onChangeText: value => setValues(current => ({
96
+ ...current,
97
+ [field]: value
98
+ })),
99
+ keyboardType: "decimal-pad",
100
+ error: Boolean(error && error.startsWith(labelForField(field)))
101
+ }, field)), /*#__PURE__*/_jsx(TextInput, {
102
+ theme: theme,
103
+ label: "Measured at (ISO 8601)",
104
+ value: dateText,
105
+ onChangeText: setDateText,
106
+ autoCapitalize: "none"
107
+ }), error && /*#__PURE__*/_jsx(Text, {
108
+ theme: theme,
109
+ style: {
110
+ color: theme.colors.error
111
+ },
112
+ children: error
113
+ }), /*#__PURE__*/_jsx(Button, {
114
+ theme: theme,
115
+ mode: "contained",
116
+ loading: saving,
117
+ disabled: saving,
118
+ onPress: () => void save(),
119
+ children: "Save measurement"
120
+ })]
121
+ })
122
+ });
123
+ };
124
+ const styles = StyleSheet.create({
125
+ content: {
126
+ gap: 10,
127
+ padding: 16
128
+ }
129
+ });
130
+ //# sourceMappingURL=manual-entry-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","Button","PaperButton","Card","PaperCard","Text","PaperText","TextInput","measurementFieldCatalog","useOvokUi","jsx","_jsx","jsxs","_jsxs","ManualEntryForm","measurementTypeKey","saveMeasurement","initialValues","recordedAt","Date","title","labelForField","field","testID","onSaved","labelForUnit","unit","uiProps","theme","slots","fields","values","setValues","useState","Object","fromEntries","keys","map","toString","dateText","setDateText","toISOString","error","setError","saving","setSaving","savingRef","useRef","save","current","data","definition","entries","raw","trim","value","Number","required","isFinite","min","max","nextDate","isNaN","getTime","undefined","input","cause","Error","message","String","style","borderRadius","children","styles","content","variant","label","onChangeText","keyboardType","Boolean","startsWith","autoCapitalize","color","colors","mode","loading","disabled","onPress","create","gap","padding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