@everfur/sdk 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/dist/{Chat.d-CTVJ_qWQ.d.cts → Chat.d-CGuvQApZ.d.cts} +1 -1
  3. package/dist/{Chat.d-Bt0fKiOQ.d.ts → Chat.d-DQkMkRlv.d.ts} +1 -1
  4. package/dist/{DepthViews.d-BHb0Xb-C.d.cts → DepthViews.d-Bs79si_g.d.cts} +1 -1
  5. package/dist/{DepthViews.d-Dq8eWBvw.d.cts → DepthViews.d-C9HdQhC2.d.cts} +1 -1
  6. package/dist/{DepthViews.d-BW3HrhnC.d.ts → DepthViews.d-DrCO-wqQ.d.ts} +1 -1
  7. package/dist/{DepthViews.d-BIfqdrvX.d.ts → DepthViews.d-v8fVFY4g.d.ts} +1 -1
  8. package/dist/{LifecyclePort.d-Cr1p33a7.d.cts → LifecyclePort.d-Cb9NtmP-.d.cts} +5 -0
  9. package/dist/{LifecyclePort.d-Cr1p33a7.d.ts → LifecyclePort.d-Cb9NtmP-.d.ts} +5 -0
  10. package/dist/{RecordsPage.d-Bs-dghTH.d.ts → RecordsPage.d-BDZ8JRSw.d.ts} +1 -1
  11. package/dist/{RecordsPage.d-CLrw-AvZ.d.cts → RecordsPage.d-a_h8Hlxr.d.cts} +1 -1
  12. package/dist/animations/index.cjs +1 -1
  13. package/dist/animations/index.d.cts +3 -3
  14. package/dist/animations/index.d.ts +3 -3
  15. package/dist/animations/index.js +1 -1
  16. package/dist/{attachments.d-DTGYmW8Y.d.cts → attachments.d-DjwKMpb0.d.cts} +1 -1
  17. package/dist/{attachments.d-DjxmIsNp.d.ts → attachments.d-HxQiuR6k.d.ts} +1 -1
  18. package/dist/{bookingCopy.d-D952V8Tq.d.cts → bookingCopy.d-CX1IaYNX.d.cts} +2 -2
  19. package/dist/{bookingCopy.d-CX-DMiwi.d.ts → bookingCopy.d-DFhHqNkX.d.ts} +2 -2
  20. package/dist/{branding.d-SCzhpyTt.d.ts → branding.d-CNeG_CY3.d.ts} +7 -2
  21. package/dist/{branding.d-eGlNC86j.d.cts → branding.d-KOXyiUqX.d.cts} +7 -2
  22. package/dist/{casesRepository.d-bWJHZD-_.d.cts → casesRepository.d-BvHziaN3.d.cts} +1 -1
  23. package/dist/{casesRepository.d-CnJZlUZ4.d.ts → casesRepository.d-CsXp5ZbO.d.ts} +1 -1
  24. package/dist/chat/index.cjs +34 -34
  25. package/dist/chat/index.d.cts +11 -11
  26. package/dist/chat/index.d.ts +11 -11
  27. package/dist/chat/index.js +35 -35
  28. package/dist/chat/lite/index.cjs +34 -34
  29. package/dist/chat/lite/index.d.cts +11 -11
  30. package/dist/chat/lite/index.d.ts +11 -11
  31. package/dist/chat/lite/index.js +35 -35
  32. package/dist/{chatHandoffToken.d-BCEdhZpd.d.ts → chatHandoffToken.d-D8ziljrV.d.ts} +11 -6
  33. package/dist/{chatHandoffToken.d-uKnSnIzN.d.cts → chatHandoffToken.d-N8D7LgiG.d.cts} +11 -6
  34. package/dist/{chatTypes.d-DbdF3ij5.d.ts → checkin.d-C6v2akWa.d.ts} +69 -37
  35. package/dist/{chatTypes.d-CFyYBzps.d.cts → checkin.d-CVo0MpeG.d.cts} +69 -37
  36. package/dist/{chunk-LWPM4GD3.js → chunk-4YMKIILX.js} +5 -5
  37. package/dist/{chunk-ZZTNGAS7.js → chunk-D5AYE7FR.js} +3 -3
  38. package/dist/chunk-LFCCBV3J.js +47 -0
  39. package/dist/{chunk-5TWMQIT4.js → chunk-OMWBGNXK.js} +1 -1
  40. package/dist/client/index.cjs +21 -8
  41. package/dist/client/index.d.cts +83 -15
  42. package/dist/client/index.d.ts +83 -15
  43. package/dist/client/index.js +21 -8
  44. package/dist/{clinicBatch.d-C_kZtYt-.d.ts → clinicBatch.d-DUCpGy47.d.ts} +2 -2
  45. package/dist/{clinicBatch.d-e3Cn5HhA.d.cts → clinicBatch.d-h4AzQhUH.d.cts} +2 -2
  46. package/dist/{config.d--6siaeNg.d.ts → config.d-Ds1iysW4.d.ts} +20 -1
  47. package/dist/{config.d-Ba21AaZg.d.cts → config.d-DwLvHCYP.d.cts} +20 -1
  48. package/dist/consent/index.cjs +2 -2
  49. package/dist/consent/index.d.cts +5 -5
  50. package/dist/consent/index.d.ts +5 -5
  51. package/dist/consent/index.js +2 -2
  52. package/dist/{context.d-Bl07_JGt.d.ts → context.d-CsoglkHv.d.ts} +6 -6
  53. package/dist/{context.d-CzMV_7jD.d.cts → context.d-_IdRcaaC.d.cts} +6 -6
  54. package/dist/{copy.d-GokMma80.d.ts → copy.d-CprpMJD2.d.ts} +2 -2
  55. package/dist/{copy.d-zWWCn3wB.d.cts → copy.d-Du3C9Itf.d.cts} +2 -2
  56. package/dist/core/index.cjs +15 -13
  57. package/dist/core/index.d.cts +18 -16
  58. package/dist/core/index.d.ts +18 -16
  59. package/dist/core/index.js +15 -13
  60. package/dist/{depth.d-C_HL8yAz.d.ts → depth.d-4CAnnHdv.d.ts} +2 -2
  61. package/dist/{depth.d-De5pT7vA.d.cts → depth.d-B45A8uzH.d.cts} +2 -2
  62. package/dist/{entitlementRepository.d-DLMRDNUe.d.ts → entitlementRepository.d-BVKx1U_k.d.ts} +4 -4
  63. package/dist/{entitlementRepository.d-B4ffomns.d.cts → entitlementRepository.d-Cp2ZU7pQ.d.cts} +4 -4
  64. package/dist/{focus.d-7G0BBmA9.d.ts → focus.d-BmER-Wo9.d.ts} +1 -1
  65. package/dist/{focus.d-B0qweva0.d.cts → focus.d-DkRwLTEB.d.cts} +1 -1
  66. package/dist/health-plan/index.cjs +14 -9
  67. package/dist/health-plan/index.d.cts +14 -14
  68. package/dist/health-plan/index.d.ts +14 -14
  69. package/dist/health-plan/index.js +14 -9
  70. package/dist/{healthPlanRepository.d-fPbLceBr.d.cts → healthPlanRepository.d-B3je3K9s.d.cts} +2 -2
  71. package/dist/{healthPlanRepository.d-CdCyUWph.d.ts → healthPlanRepository.d-D8a8n9Jj.d.ts} +2 -2
  72. package/dist/{idempotency.d-IDta7Jjj.d.cts → idempotency.d-CqQ4xvQT.d.cts} +1 -1
  73. package/dist/{idempotency.d-CoUlC-Yd.d.ts → idempotency.d-Cs5pjjdA.d.ts} +1 -1
  74. package/dist/{identity.d-B7dPRGqm.d.ts → identity.d-Bj7WLFXU.d.ts} +1 -1
  75. package/dist/{identity.d-_MK9Y7a4.d.cts → identity.d-Dg3l3zT5.d.cts} +1 -1
  76. package/dist/{inbox.d-CuuPTWyW.d.ts → inbox.d-DVfTwkEB.d.ts} +1 -1
  77. package/dist/{inbox.d-ChNXTovj.d.cts → inbox.d-DYCjhSnO.d.cts} +1 -1
  78. package/dist/index.cjs +45 -44
  79. package/dist/index.d.cts +20 -18
  80. package/dist/index.d.ts +20 -18
  81. package/dist/index.js +46 -45
  82. package/dist/{introEvents.d-D6Ay0ORN.d.ts → introEvents.d-CmC7ag_3.d.ts} +1 -1
  83. package/dist/{introEvents.d-JvAWRKYu.d.cts → introEvents.d-Wc0-QPLf.d.cts} +1 -1
  84. package/dist/{layout.d-D3d4QMeO.d.ts → layout.d-BZbIqvZ_.d.ts} +2 -2
  85. package/dist/{layout.d-ByfOEhpG.d.cts → layout.d-yLooG8Z0.d.cts} +2 -2
  86. package/dist/models.d-DHAQqrQr.d.ts +182 -0
  87. package/dist/models.d-Dml2f9-U.d.cts +182 -0
  88. package/dist/notifications/inbox/index.cjs +3 -3
  89. package/dist/notifications/inbox/index.d.cts +7 -7
  90. package/dist/notifications/inbox/index.d.ts +7 -7
  91. package/dist/notifications/inbox/index.js +3 -3
  92. package/dist/notifications/index.cjs +2 -2
  93. package/dist/notifications/index.d.cts +7 -7
  94. package/dist/notifications/index.d.ts +7 -7
  95. package/dist/notifications/index.js +2 -2
  96. package/dist/{optInView.d-BpFTJaaX.d.ts → optInView.d-B_yFAfKk.d.ts} +2 -2
  97. package/dist/{optInView.d-Bxvg0WLJ.d.cts → optInView.d-Td2Uv3iq.d.cts} +2 -2
  98. package/dist/parse.d-DtHmpAMT.d.cts +282 -0
  99. package/dist/parse.d-DtHmpAMT.d.ts +282 -0
  100. package/dist/{pets.d-BtbJcf8T.d.cts → pets.d-CE8_oDjM.d.cts} +1 -1
  101. package/dist/{pets.d-Br960ekh.d.ts → pets.d-UFpQT-q3.d.ts} +1 -1
  102. package/dist/{petsRepository.d-Bj9rPnCr.d.cts → petsRepository.d-BVSrxwKa.d.cts} +1 -1
  103. package/dist/{petsRepository.d-CSOth5XE.d.ts → petsRepository.d-BvmFXjTc.d.ts} +1 -1
  104. package/dist/photo/index.cjs +2 -2
  105. package/dist/photo/index.js +2 -2
  106. package/dist/records/depth/index.cjs +2 -2
  107. package/dist/records/depth/index.d.cts +9 -9
  108. package/dist/records/depth/index.d.ts +9 -9
  109. package/dist/records/depth/index.js +2 -2
  110. package/dist/records/index.cjs +4 -4
  111. package/dist/records/index.d.cts +11 -11
  112. package/dist/records/index.d.ts +11 -11
  113. package/dist/records/index.js +4 -4
  114. package/dist/{requestFunnel.d-LSnmCusf.d.ts → requestFunnel.d-D8UsEFed.d.ts} +2 -2
  115. package/dist/{requestFunnel.d-BwO-jFLX.d.cts → requestFunnel.d-fmBVWfsj.d.cts} +2 -2
  116. package/dist/{route.d-Bzyamuxa.d.ts → route.d-BnWvGpNN.d.ts} +2 -2
  117. package/dist/{route.d-D70-OHBc.d.cts → route.d-DOXnhbtt.d.cts} +2 -2
  118. package/dist/{runtimeTypes.d-6nkdToBS.d.cts → runtimeTypes.d-BlejmEU1.d.cts} +34 -6
  119. package/dist/{runtimeTypes.d-Byb55WsJ.d.ts → runtimeTypes.d-C6fYXNx2.d.ts} +34 -6
  120. package/dist/{screenProps.d-DB5IMaGZ.d.cts → screenProps.d-BfYg9Eaz.d.cts} +1 -1
  121. package/dist/{screenProps.d-HGSPNGHt.d.ts → screenProps.d-Bp0vHiov.d.ts} +1 -1
  122. package/dist/sdkConfigStore.d-BHrzkVpP.d.cts +45 -0
  123. package/dist/sdkConfigStore.d-VPvsIL8E.d.ts +45 -0
  124. package/dist/server/events/index.cjs +3 -2
  125. package/dist/server/events/index.d.cts +2 -2
  126. package/dist/server/events/index.d.ts +2 -2
  127. package/dist/server/events/index.js +3 -2
  128. package/dist/server/index.cjs +5 -4
  129. package/dist/server/index.d.cts +9 -3
  130. package/dist/server/index.d.ts +9 -3
  131. package/dist/server/index.js +5 -4
  132. package/dist/shop/index.cjs +12 -6
  133. package/dist/shop/index.d.cts +3 -3
  134. package/dist/shop/index.d.ts +3 -3
  135. package/dist/shop/index.js +13 -7
  136. package/dist/slots/index.cjs +15 -16
  137. package/dist/slots/index.d.cts +6 -6
  138. package/dist/slots/index.d.ts +6 -6
  139. package/dist/slots/index.js +15 -16
  140. package/dist/slots/weather-glyphs/index.cjs +1 -1
  141. package/dist/slots/weather-glyphs/index.js +1 -1
  142. package/dist/tabs/index.cjs +79 -13
  143. package/dist/tabs/index.d.cts +129 -10
  144. package/dist/tabs/index.d.ts +129 -10
  145. package/dist/tabs/index.js +79 -13
  146. package/dist/televet/booking/index.cjs +2 -2
  147. package/dist/televet/booking/index.d.cts +6 -6
  148. package/dist/televet/booking/index.d.ts +6 -6
  149. package/dist/televet/booking/index.js +2 -2
  150. package/dist/televet/index.cjs +2 -2
  151. package/dist/televet/index.js +2 -2
  152. package/dist/testing/index.cjs +4 -3
  153. package/dist/testing/index.d.cts +1 -1
  154. package/dist/testing/index.d.ts +1 -1
  155. package/dist/testing/index.js +4 -3
  156. package/dist/testing/rn/index.cjs +3 -3
  157. package/dist/testing/rn/index.d.cts +11 -9
  158. package/dist/testing/rn/index.d.ts +11 -9
  159. package/dist/testing/rn/index.js +3 -3
  160. package/dist/testing/web/index.cjs +2 -2
  161. package/dist/testing/web/index.d.cts +11 -9
  162. package/dist/testing/web/index.d.ts +11 -9
  163. package/dist/testing/web/index.js +2 -2
  164. package/dist/texting/index.cjs +4 -4
  165. package/dist/texting/index.d.cts +22 -8
  166. package/dist/texting/index.d.ts +22 -8
  167. package/dist/texting/index.js +4 -4
  168. package/dist/{threadOptions.d-E-ZxhUSg.d.cts → threadOptions.d-B9OndNS2.d.cts} +5 -5
  169. package/dist/{threadOptions.d-Cjps2yaN.d.ts → threadOptions.d-BlpnY5xP.d.ts} +5 -5
  170. package/dist/{timelineRows.d-CPS4admm.d.ts → timelineRows.d-BPOMlI-P.d.ts} +1 -1
  171. package/dist/{timelineRows.d-BJRCgmdv.d.cts → timelineRows.d-BmHu_XLI.d.cts} +1 -1
  172. package/dist/{tokens.d-DH1mYjZl.d.cts → tokens.d-DxM-tKjz.d.cts} +2 -0
  173. package/dist/{tokens.d-DH1mYjZl.d.ts → tokens.d-DxM-tKjz.d.ts} +2 -0
  174. package/dist/{typeStyle.d-CuKAr0Ly.d.cts → typeStyle.d-DmdB2TfH.d.cts} +2 -2
  175. package/dist/{typeStyle.d-ZszGrWPf.d.ts → typeStyle.d-Ma1uBgn-.d.ts} +2 -2
  176. package/dist/ui/index.cjs +5 -4
  177. package/dist/ui/index.js +5 -4
  178. package/dist/{useHealthPlanSubscription.d-SQfx-45x.d.ts → useHealthPlanSubscription.d-BAU8x02a.d.ts} +4 -4
  179. package/dist/{useHealthPlanSubscription.d-zjsvvlhz.d.cts → useHealthPlanSubscription.d-CuJMQc_d.d.cts} +4 -4
  180. package/dist/{useInboxUnread.d-BxFKFU4o.d.ts → useInboxUnread.d-BUpXjNnT.d.ts} +2 -2
  181. package/dist/{useInboxUnread.d-7p3IWs_A.d.cts → useInboxUnread.d-By1CkCy2.d.cts} +2 -2
  182. package/dist/{usePresentation.d-DUHlQyV5.d.cts → usePresentation.d-CgEJRm6Q.d.cts} +2 -2
  183. package/dist/{usePresentation.d-CoyGEJOl.d.ts → usePresentation.d-kSW7ttTl.d.ts} +2 -2
  184. package/dist/{useRecordsDepth.d-Bk8BSerZ.d.cts → useRecordsDepth.d-BHQgBRBw.d.cts} +1 -1
  185. package/dist/{useRecordsDepth.d-BinUa8W9.d.ts → useRecordsDepth.d-diEF_tFF.d.ts} +1 -1
  186. package/dist/{useUnread.d-D-p7oEW_.d.cts → useUnread.d-CoQKIHVD.d.cts} +31 -17
  187. package/dist/{useUnread.d-CFzIPmZt.d.ts → useUnread.d-aRej_wU8.d.ts} +31 -17
  188. package/dist/video/index.cjs +2 -2
  189. package/dist/video/index.js +2 -2
  190. package/dist/{view.d-CaH6dZPJ.d.ts → view.d-CevohC1l.d.ts} +3 -3
  191. package/dist/{view.d-DV4b1cov.d.cts → view.d-DgXlfcxR.d.cts} +3 -3
  192. package/dist/web/consent/index.cjs +2 -2
  193. package/dist/web/consent/index.d.cts +5 -5
  194. package/dist/web/consent/index.d.ts +5 -5
  195. package/dist/web/consent/index.js +2 -2
  196. package/dist/web/health-plan/index.cjs +11 -11
  197. package/dist/web/health-plan/index.d.cts +16 -16
  198. package/dist/web/health-plan/index.d.ts +16 -16
  199. package/dist/web/health-plan/index.js +7 -7
  200. package/dist/web/health-plan/styles.css +59 -0
  201. package/dist/web/inbox/index.cjs +3 -3
  202. package/dist/web/inbox/index.d.cts +8 -8
  203. package/dist/web/inbox/index.d.ts +8 -8
  204. package/dist/web/inbox/index.js +3 -3
  205. package/dist/web/index.cjs +52 -51
  206. package/dist/web/index.d.cts +59 -44
  207. package/dist/web/index.d.ts +59 -44
  208. package/dist/web/index.js +52 -51
  209. package/dist/web/intro/index.cjs +2 -2
  210. package/dist/web/intro/index.d.cts +7 -7
  211. package/dist/web/intro/index.d.ts +7 -7
  212. package/dist/web/intro/index.js +2 -2
  213. package/dist/web/notifications/index.cjs +2 -2
  214. package/dist/web/notifications/index.d.cts +6 -6
  215. package/dist/web/notifications/index.d.ts +6 -6
  216. package/dist/web/notifications/index.js +2 -2
  217. package/dist/web/records/depth/index.cjs +2 -2
  218. package/dist/web/records/depth/index.d.cts +9 -9
  219. package/dist/web/records/depth/index.d.ts +9 -9
  220. package/dist/web/records/depth/index.js +2 -2
  221. package/dist/web/records/index.cjs +4 -4
  222. package/dist/web/records/index.d.cts +11 -11
  223. package/dist/web/records/index.d.ts +11 -11
  224. package/dist/web/records/index.js +4 -4
  225. package/dist/web/records-sheet/index.cjs +4 -4
  226. package/dist/web/records-sheet/index.js +4 -4
  227. package/dist/web/shop/index.cjs +9 -9
  228. package/dist/web/shop/index.d.cts +3 -3
  229. package/dist/web/shop/index.d.ts +3 -3
  230. package/dist/web/shop/index.js +4 -4
  231. package/dist/web/televet/booking/index.cjs +2 -2
  232. package/dist/web/televet/booking/index.d.cts +7 -7
  233. package/dist/web/televet/booking/index.d.ts +7 -7
  234. package/dist/web/televet/booking/index.js +2 -2
  235. package/dist/web/televet/call/index.cjs +1 -1
  236. package/dist/web/televet/call/index.js +1 -1
  237. package/dist/web/televet/index.cjs +2 -2
  238. package/dist/web/televet/index.js +2 -2
  239. package/dist/web/texting/index.cjs +4 -4
  240. package/dist/web/texting/index.d.cts +22 -8
  241. package/dist/web/texting/index.d.ts +22 -8
  242. package/dist/web/texting/index.js +4 -4
  243. package/dist/web/ui/index.cjs +8 -8
  244. package/dist/web/ui/index.js +1 -1
  245. package/dist/web/ui/styles.css +66 -0
  246. package/package.json +10 -6
  247. package/dist/chunk-PDZTFXOO.js +0 -47
@@ -0,0 +1,282 @@
1
+ /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
+ /** One font file a partner config names (`look.font.files`). */
3
+ interface SdkFontFile {
4
+ readonly family: string;
5
+ /** A weight or a variable range, as the config writes it ("400", "100 900"). */
6
+ readonly weight: string;
7
+ readonly url: string;
8
+ }
9
+ /** The schema version this SDK build reads, sent as `X-Everfur-SDK-Config-Schema`. */
10
+ declare const SDK_CONFIG_SCHEMA_VERSION: 3;
11
+ /** Every setting, resolved: the key as the backend writes it, and its value. */
12
+ interface SdkSettings {
13
+ readonly "look.color.primary": string;
14
+ readonly "look.color.on_primary": string;
15
+ readonly "look.color.accent": string;
16
+ readonly "look.color.tint": string;
17
+ readonly "look.color.chips": readonly string[];
18
+ readonly "look.color.surface": string;
19
+ readonly "look.color.heading": string;
20
+ readonly "look.color.ink": string;
21
+ readonly "look.color.muted": string;
22
+ readonly "look.color.line": string;
23
+ readonly "look.color.bubble": string;
24
+ readonly "look.color.launcher": string;
25
+ readonly "look.color.on_launcher": string;
26
+ readonly "look.color.dot": string;
27
+ readonly "look.chat_wash": readonly string[];
28
+ readonly "look.font.heading": string;
29
+ readonly "look.font.body": string;
30
+ readonly "look.font.chat": string;
31
+ readonly "look.font.label": string;
32
+ readonly "look.font.heading_weight": 500 | 600 | 700 | 800;
33
+ readonly "look.font.files": readonly SdkFontFile[];
34
+ readonly "look.radius.card": number;
35
+ readonly "look.radius.sheet": number;
36
+ readonly "look.logo.wordmark": string;
37
+ readonly "look.logo.mark": string;
38
+ readonly "look.ask_icon": string;
39
+ readonly "look.lockup": "side_by_side" | "stacked";
40
+ readonly "text.partner_name": string;
41
+ readonly "text.ask.name": string;
42
+ readonly "text.ask.greeting": string;
43
+ readonly "text.ask.placeholder": string;
44
+ readonly "text.ask.dock_placeholder": string;
45
+ readonly "text.ask.memory_chip": string;
46
+ readonly "text.ask.from_history": string;
47
+ readonly "text.ask.watch_for": string;
48
+ readonly "text.ask.new_chat": string;
49
+ readonly "text.tabs.ask": string;
50
+ readonly "text.tabs.vet": string;
51
+ readonly "text.tabs.records": string;
52
+ readonly "text.launcher.tip": string;
53
+ readonly "text.nav.page_title": string;
54
+ readonly "text.vet.book": string;
55
+ readonly "text.vet.booked": string;
56
+ readonly "text.vet.see_times": string;
57
+ readonly "text.vet.join": string;
58
+ readonly "text.vet.add_calendar": string;
59
+ readonly "text.records.empty_title": string;
60
+ readonly "text.records.empty_body": string;
61
+ readonly "text.records.request": string;
62
+ readonly "text.records.upload": string;
63
+ readonly "text.cap.counter": string;
64
+ readonly "text.cap.reached": string;
65
+ readonly "text.cap.button": string;
66
+ readonly "text.members.title": string;
67
+ readonly "text.members.badge": string;
68
+ readonly "text.members.button": string;
69
+ readonly "text.ui.not_now": string;
70
+ readonly "text.notify.records_ready": string;
71
+ readonly "text.notify.visit_reminder": string;
72
+ readonly "text.notify.vet_reply": string;
73
+ readonly "text.notify.care_due": string;
74
+ readonly "layout.nav": "bottom_tabs" | "top_tabs" | "sections_page" | "chat_first";
75
+ readonly "layout.sections": readonly ("ask" | "vet" | "records")[];
76
+ readonly "layout.vet_on_ask": "top" | "header_button" | "own_tab" | "in_answers";
77
+ readonly "layout.vet_badge": "none" | "header_pill" | "tab_dot";
78
+ readonly "layout.memory_chip": boolean;
79
+ readonly "layout.severity": "off" | "three_levels" | "four_levels";
80
+ readonly "layout.suggestions": "center" | "above_bar";
81
+ readonly "layout.opens_on": "new_chat" | "last_chat";
82
+ readonly "layout.answer_byline": "none" | "avatar" | "wordmark";
83
+ readonly "layout.launcher": "none" | "floating_button";
84
+ readonly "layout.presentation": "in_tab" | "full_screen";
85
+ readonly "features.chat": boolean;
86
+ readonly "features.records": boolean;
87
+ readonly "features.video_visits": boolean;
88
+ readonly "features.prescriptions": boolean;
89
+ readonly "features.shop": "off" | "everfur_care" | "partner_pick" | "partner_cart";
90
+ readonly "features.partner_data": readonly ("park_checkins" | "camera_events" | "dna_results")[];
91
+ readonly "features.texting": boolean;
92
+ readonly "features.texting_cap": number | null;
93
+ readonly "features.notify.records_ready": boolean;
94
+ readonly "features.notify.visit_reminder": boolean;
95
+ readonly "features.notify.vet_reply": boolean;
96
+ readonly "features.notify.care_due": boolean;
97
+ readonly "access.mode": "open" | "free_cap" | "members_only";
98
+ readonly "access.free_messages": number;
99
+ readonly "access.locked": readonly ("video_visits" | "texting" | "link_records" | "previous_results" | "dashboard" | "goals")[];
100
+ readonly "plan.name": string;
101
+ readonly "plan.sold_by": "everfur" | "partner";
102
+ readonly "plan.price_display": "full" | "monthly_equivalent" | "hidden";
103
+ readonly "plan.price_year": string;
104
+ readonly "plan.price_month": string;
105
+ readonly "vet.visits_per_year": number | null;
106
+ readonly "vet.extra_visit_price": string | null;
107
+ readonly "vet.name": string;
108
+ readonly "vet.title": string;
109
+ readonly "vet.photo": string;
110
+ readonly "units.weight": "lb" | "kg";
111
+ readonly "units.temperature": "F" | "C";
112
+ readonly "units.distance": "mi" | "km";
113
+ readonly "units.currency": "$" | "US$";
114
+ }
115
+ type SdkSettingKey = keyof SdkSettings;
116
+ /** How a key's value is read off the wire. */
117
+ type SdkSettingKind = 'color' | 'colorOrNone' | 'hexList' | 'fontFiles' | 'boolean' | 'number' | 'numberOrNull' | 'money' | 'moneyOrNull' | 'choice' | 'itemList' | 'string' | 'text';
118
+ /** One row of the schema, as the parser reads it. */
119
+ interface SdkSettingSpec {
120
+ readonly key: SdkSettingKey;
121
+ readonly kind: SdkSettingKind;
122
+ readonly default: unknown;
123
+ readonly oneOf?: readonly (string | number | boolean)[];
124
+ readonly items?: readonly string[];
125
+ readonly range?: readonly [number, number];
126
+ readonly max?: number;
127
+ readonly emptyOk?: boolean;
128
+ /** A Reference row: the key is read, its screen is not drawn this round. */
129
+ readonly reference?: boolean;
130
+ }
131
+ /** The 101 settings, in the schema's order. */
132
+ declare const SDK_SETTING_SPECS: readonly SdkSettingSpec[];
133
+ /** Everfur's own app: every key at its default. */
134
+ declare const SDK_SETTING_DEFAULTS: SdkSettings;
135
+ /** The words the drawn screens show that are not a setting, the same for every partner (`fixed_strings`). */
136
+ declare const SDK_FIXED_STRINGS: {
137
+ readonly "ask.emergency": "Emergency? Call a vet.";
138
+ readonly "ask.privacy": "Confidential. {partner} can't see this chat.";
139
+ readonly "ask.you": "You";
140
+ readonly "ask.today": "Today";
141
+ readonly "ask.follow_ups": "Follow-up questions";
142
+ readonly "ask.attach.photo": "Photo";
143
+ readonly "ask.attach.camera": "Camera";
144
+ readonly "banner.four.0": "Good to know";
145
+ readonly "banner.four.1": "Monitor at home";
146
+ readonly "banner.four.2": "See a vet today";
147
+ readonly "banner.four.3": "Call a vet now";
148
+ readonly "banner.three.0": "All clear";
149
+ readonly "banner.three.1": "Monitor at home";
150
+ readonly "banner.three.2": "See a vet now";
151
+ readonly "banner.body.lowest": "Just general info about {pet}. Nothing here needs action right now.";
152
+ readonly "locked.video_visits": "Video visits with a vet";
153
+ readonly "locked.texting": "Ask by text";
154
+ readonly "locked.link_records": "Link {pet}'s vet records";
155
+ readonly "locked.previous_results": "Previous results";
156
+ readonly "locked.dashboard": "Health dashboard";
157
+ readonly "locked.goals": "Goals for {pet}";
158
+ readonly "plan.price.year": "a year";
159
+ readonly "plan.price.month": "/month";
160
+ readonly "plan.price.billed": "Billed Annually";
161
+ readonly "vet.wellness_tab": "Wellness";
162
+ readonly "vet.opening": "Next opening {when}";
163
+ readonly "vet.next_visit": "Next video visit";
164
+ readonly "vet.badge": "Booked";
165
+ readonly "vet.length": "10 minutes";
166
+ readonly "vet.kind_wellness": "wellness video call";
167
+ readonly "vet.reschedule": "Reschedule";
168
+ readonly "vet.cancel": "Cancel";
169
+ readonly "vet.note": "The vet has {pet}'s records and what you've asked {assistant}. The visit opens right here, 15 minutes before.";
170
+ readonly "vet.book_another": "Book another visit";
171
+ readonly "vet.past_visits": "Past visits";
172
+ readonly "vet.allowance": "{left} of {visits} video visits left this year";
173
+ readonly "vet.extra": "Extra visits are {price} each";
174
+ readonly "vet.gate.visits": "{pet} lives in {state}: a licensed vet can see {them} by video.";
175
+ readonly "vet.gate.wellness": "{pet} lives in {state}: a vet gives general advice by video. No prescriptions.";
176
+ readonly "vet.rx": "Prescriptions, if the vet decides {pet} needs one.";
177
+ readonly "vet.card.when": "Video visit, tomorrow from {when}";
178
+ readonly "vet.card.wellness_when": "Wellness video call, general advice";
179
+ readonly "vet.card.wellness": "A vet can talk it through with you by video: general advice, no exam.";
180
+ readonly "vet.next.text": "We'll text you and send a notification 30 minutes before.";
181
+ readonly "vet.next.notify": "We'll send a notification 30 minutes before.";
182
+ readonly "vet.next.summary": "{pet}'s summary goes to the vet ahead of the call.";
183
+ readonly "vet.next.join": "Join right here in the app. No links to hunt for.";
184
+ readonly "vet.done": "Done";
185
+ readonly "vet.legal": "Video visits are with a licensed veterinarian.";
186
+ readonly "vet.legal.rx": "Prescriptions where allowed, starting with California.";
187
+ readonly "vet.legal.emergency": "In an emergency, go to the nearest emergency animal hospital.";
188
+ readonly "vet.privacy": "Everfur is a separate provider. Your visits and messages are confidential, and {partner} can't see them.";
189
+ readonly "records.status.in_range": "In range";
190
+ readonly "records.status.watch": "Watch";
191
+ readonly "records.vitals.temperature": "Temperature";
192
+ readonly "records.vitals.heart_rate": "Heart rate";
193
+ readonly "records.vitals.weight": "Weight";
194
+ readonly "records.needs": "Needs a look";
195
+ readonly "records.care": "Upcoming care";
196
+ readonly "records.tiles": "Records & history";
197
+ readonly "records.tile.labs": "Labs & bloodwork";
198
+ readonly "records.tile.vaccines": "Vaccines";
199
+ readonly "records.tile.visits": "Visits & records";
200
+ readonly "records.tile.screenings": "Screenings";
201
+ readonly "records.chart.over": "Over";
202
+ readonly "records.chart.under": "Under";
203
+ readonly "records.history": "History";
204
+ readonly "pdata.park_checkins": "Park check-ins";
205
+ readonly "pdata.camera_events": "Camera events";
206
+ readonly "pdata.dna_results": "{partner} DNA";
207
+ readonly "pdata.tag.park_checkins": "Park check-in";
208
+ readonly "pdata.tag.camera_events": "Camera";
209
+ readonly "pdata.tag.dna_results": "{partner} DNA";
210
+ readonly "ask.tag.records": "Records";
211
+ readonly "vet.book_another.for": "For {pet}";
212
+ readonly "upload.title": "Upload a document";
213
+ readonly "upload.body": "A PDF, or a photo of a paper record. Add them all; we sort them by date.";
214
+ readonly "upload.photo": "Take a photo";
215
+ readonly "upload.photo.note": "of a paper record";
216
+ readonly "upload.library": "Choose from photos";
217
+ readonly "upload.file": "Choose a file";
218
+ readonly "upload.file.note": "PDF";
219
+ readonly "load.error": "Couldn't load";
220
+ readonly "load.retry": "Try again";
221
+ };
222
+ type SdkFixedStringId = keyof typeof SDK_FIXED_STRINGS;
223
+ /** Which layout values can be drawn together (`combinations`). */
224
+ declare const SDK_COMBINATIONS: {
225
+ readonly vetOnAskByNav: {
226
+ readonly bottom_tabs: readonly ["top", "own_tab", "header_button", "in_answers"];
227
+ readonly top_tabs: readonly ["own_tab", "header_button", "in_answers"];
228
+ readonly sections_page: readonly ["own_tab", "in_answers"];
229
+ readonly chat_first: readonly ["header_button", "in_answers"];
230
+ };
231
+ readonly presentationByNav: {
232
+ readonly bottom_tabs: readonly ["in_tab"];
233
+ readonly top_tabs: readonly ["in_tab", "full_screen"];
234
+ readonly sections_page: readonly ["in_tab"];
235
+ readonly chat_first: readonly ["in_tab"];
236
+ };
237
+ };
238
+
239
+ /** Who can be seen where: from our state data (televet licensing), never a partner setting. */
240
+ interface SdkStateGate {
241
+ /** States where a vet can see the pet by video and prescribe (California). */
242
+ readonly videoAndRx: readonly string[];
243
+ /** The wellness states: general advice by video, no prescriptions. */
244
+ readonly adviceOnly: readonly string[];
245
+ }
246
+ /** One partner's resolved config, as the SDK draws from it. */
247
+ interface SdkConfigV3 {
248
+ readonly schemaVersion: number;
249
+ /** The config's partner id (the tenant's client id). */
250
+ readonly partner: string;
251
+ /** The config's revision, echoed as If-None-Match. */
252
+ readonly revision: number;
253
+ readonly settings: SdkSettings;
254
+ readonly fixedStrings: Readonly<Record<SdkFixedStringId, string>>;
255
+ readonly stateGate: SdkStateGate;
256
+ }
257
+ /**
258
+ * One key's value, parsed against its row. `undefined` means "take the default": the value is the wrong kind or
259
+ * outside what the row allows.
260
+ */
261
+ declare function parseSettingValue(spec: SdkSettingSpec, value: unknown): unknown;
262
+ /**
263
+ * The settings with every key set: the defaults, with each valid value from `raw` on top. Unknown keys are
264
+ * ignored; an invalid value keeps its default. `rejected` names the keys that fell back.
265
+ */
266
+ declare function resolveSettings(raw: unknown): {
267
+ readonly settings: SdkSettings;
268
+ readonly rejected: readonly string[];
269
+ };
270
+ /** The fixed strings: this build's own, with each string the backend sent for a known id on top. */
271
+ declare function resolveFixedStrings(raw: unknown): Readonly<Record<SdkFixedStringId, string>>;
272
+ /** The state gate. Absent or malformed, no state allows visits: the Vet section fails closed. */
273
+ declare function parseStateGate(raw: unknown): SdkStateGate;
274
+ /**
275
+ * A 200 body, parsed. null when it is not a config at all (no object, no revision, no settings object): the caller
276
+ * keeps its last good config. Every other fault is per key (see `resolveSettings`).
277
+ */
278
+ declare function parseSdkConfig(body: unknown): SdkConfigV3 | null;
279
+ /** A config back to its wire shape, for the device cache (re-read through `parseSdkConfig`). */
280
+ declare function serializeSdkConfig(config: SdkConfigV3): string;
281
+
282
+ export { type SdkConfigV3 as S, type SdkSettings as a, type SdkSettingKey as b, type SdkFixedStringId as c, SDK_COMBINATIONS as d, SDK_CONFIG_SCHEMA_VERSION as e, SDK_FIXED_STRINGS as f, SDK_SETTING_DEFAULTS as g, SDK_SETTING_SPECS as h, type SdkFontFile as i, type SdkSettingKind as j, type SdkSettingSpec as k, type SdkStateGate as l, parseSettingValue as m, parseStateGate as n, resolveSettings as o, parseSdkConfig as p, resolveFixedStrings as r, serializeSdkConfig as s };
@@ -1,6 +1,6 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
3
- import { j as FetchLike } from './config.d-Ba21AaZg.cjs';
3
+ import { k as FetchLike } from './config.d-DwLvHCYP.cjs';
4
4
  import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile.d-CSs1wlXT.cjs';
5
5
 
6
6
  /** How your backend reaches Everfur for pet writes. Build it once and reuse it. */
@@ -1,6 +1,6 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
3
- import { j as FetchLike } from './config.d--6siaeNg.js';
3
+ import { k as FetchLike } from './config.d-Ds1iysW4.js';
4
4
  import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile.d-CSs1wlXT.js';
5
5
 
6
6
  /** How your backend reaches Everfur for pet writes. Build it once and reuse it. */
@@ -1,6 +1,6 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
3
- import { A as AuthContext } from './identity.d-_MK9Y7a4.cjs';
3
+ import { A as AuthContext } from './identity.d-Dg3l3zT5.cjs';
4
4
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
5
5
  import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile.d-CSs1wlXT.cjs';
6
6
 
@@ -1,6 +1,6 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
3
- import { A as AuthContext } from './identity.d-B7dPRGqm.js';
3
+ import { A as AuthContext } from './identity.d-Bj7WLFXU.js';
4
4
  import { P as PetRef } from './ids.d-B2GAAifq.js';
5
5
  import { P as PetHealthProfileInput, a as PetHealthProfile } from './profile.d-CSs1wlXT.js';
6
6
 
@@ -1,8 +1,8 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
- "use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime");var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
2
+ "use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime");var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
3
3
  return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
4
4
  return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
5
- return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
5
+ return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null,...fields.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...fields.freeCap})}:{}})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
6
6
  /* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
7
7
  return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function fileHandleFromMedia(source){let handle={uri:source.uri,mimeType:source.mimeType},size=mediaByteSize(source);return size!==null&&(handle.sizeBytes=size),/* @__PURE__ */Object.freeze(handle)}function mediaByteSize(source){let candidate=source.byteSize??source.sizeBytes;return typeof candidate=="number"&&Number.isFinite(candidate)&&candidate>=0?candidate:null}function captureOptionsFor(mode,maxDurationSeconds){/* @__PURE__ */
8
8
  return Object.freeze({mode:mode})}function isCaptureAvailable(camera){return camera!=null&&camera.isAvailable===true}var defaultTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function delayAbortable2(ms,signal,timers){return new Promise(resolve=>{if(signal.aborted){resolve();return}let holder={handle:void 0},done=()=>{timers.clearTimeout(holder.handle),signal.removeEventListener("abort",done),resolve()};holder.handle=timers.setTimeout(done,ms),signal.addEventListener("abort",done,{once:true})})}function mergeSignals2(a,b){if(!b)return a;let ctrl=new AbortController;if(a.aborted||b.aborted)return ctrl.abort(),ctrl.signal;let onAbort=()=>ctrl.abort();return a.addEventListener("abort",onAbort,{once:true}),b.addEventListener("abort",onAbort,{once:true}),ctrl.signal}var MediaStore=class{constructor(initial){this.listeners=/* @__PURE__ */new Set;this.epoch=0;this.inFlight=null;this.snapshot=/* @__PURE__ */Object.freeze({...initial})}subscribe(listener){return this.listeners.add(listener),()=>{this.listeners.delete(listener)}}getSnapshot(){return this.snapshot}patch(partial){this.snapshot=/* @__PURE__ */Object.freeze({...this.snapshot,...partial});for(let listener of this.listeners)listener()}beginOperation(external){this.inFlight?.abort();let ctrl=new AbortController;this.inFlight=ctrl;let epoch=this.epoch;return{signal:external?mergeSignals2(ctrl.signal,external):ctrl.signal,epoch:epoch,settle:()=>{this.inFlight===ctrl&&(this.inFlight=null)}}}alive(epoch){return epoch===this.epoch}rescope(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null}dispose(){this.epoch+=1,this.inFlight?.abort(),this.inFlight=null,this.listeners.clear()}};function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function isRecord2(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}var CONSUMER_SAFE_DETECTION_KEYS=/* @__PURE__ */Object.freeze(["primary_label","primary_confidence","subtype_label","subtype_display","subtype_confidence","risk_tier","confidence_tier","copy_short","disease_name","disease_framing","model_version","skin_v2","eye_v2","llm_checkup"]),OPERATOR_INTERNAL_KEYS=/* @__PURE__ */Object.freeze(["decision_audit","decision_thresholds","per_class_auroc","ood_layers","gate1_score","possible_conditions","top_class"]),BOOLEAN_KEYS=/* @__PURE__ */new Set(["skin_v2","eye_v2","llm_checkup"]),CONFIDENCE_KEYS=/* @__PURE__ */new Set(["primary_confidence","subtype_confidence"]),RISK_TIER_VALUES=/* @__PURE__ */new Set(["low_risk","concern","uncertain"]),CONFIDENCE_TIER_VALUES=/* @__PURE__ */new Set(["possible","probable"]),STRING_LIMITS=/* @__PURE__ */Object.freeze({primary_label:64,subtype_label:64,subtype_display:128,copy_short:512,disease_name:128,disease_framing:512,model_version:64});function projectDetectionMetadata(raw){let source=isRecord2(raw)?raw:{},out={};for(let key of CONSUMER_SAFE_DETECTION_KEYS){if(!(key in source))continue;let value=source[key],accepted=acceptKey(key,value);accepted!==DROP&&(out[key]=accepted)}let dropped=0;for(let key of OPERATOR_INTERNAL_KEYS)key in source&&(dropped+=1);/* @__PURE__ */