@everfur/sdk 0.18.3 → 0.19.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 (211) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/dist/{Chat.d-CKKuXVw5.d.ts → Chat.d-BHovj6Ku.d.ts} +1 -1
  3. package/dist/{Chat.d-BEbRI8FZ.d.cts → Chat.d-BO-XtVYe.d.cts} +1 -1
  4. package/dist/{DepthViews.d-BiePRa3Z.d.cts → DepthViews.d-BwIkdmWZ.d.cts} +1 -1
  5. package/dist/{DepthViews.d-Chn2xwZu.d.cts → DepthViews.d-Bx85LeiP.d.cts} +1 -1
  6. package/dist/{DepthViews.d-_WMIpymE.d.ts → DepthViews.d-CBUunxP1.d.ts} +1 -1
  7. package/dist/{DepthViews.d-CiU4f98J.d.ts → DepthViews.d-DKoZgF8l.d.ts} +1 -1
  8. package/dist/{RecordsPage.d-CRRJM35Q.d.ts → RecordsPage.d-CsvBhU0f.d.ts} +1 -1
  9. package/dist/{RecordsPage.d-CtNzoxre.d.cts → RecordsPage.d-DRFp2LXH.d.cts} +1 -1
  10. package/dist/animations/index.cjs +1 -94
  11. package/dist/animations/index.d.cts +3 -3
  12. package/dist/animations/index.d.ts +3 -3
  13. package/dist/animations/index.js +1 -94
  14. package/dist/{attachments.d-DRkqNR-o.d.ts → attachments.d-DOZjCdkb.d.ts} +2 -2
  15. package/dist/{attachments.d-BLEOCUU7.d.cts → attachments.d-DWUsHPf9.d.cts} +2 -2
  16. package/dist/{bookingCopy.d-CrUufdoE.d.ts → bookingCopy.d-BlMWlvgv.d.ts} +2 -2
  17. package/dist/{bookingCopy.d-CoiNXrY8.d.cts → bookingCopy.d-tvO7y6MK.d.cts} +2 -2
  18. package/dist/{casesRepository.d-DhI69yuj.d.ts → casesRepository.d-C7qbrOL-.d.ts} +1 -1
  19. package/dist/{casesRepository.d-OyZOSNNv.d.cts → casesRepository.d-sSo6oakf.d.cts} +1 -1
  20. package/dist/chat/index.cjs +29 -119
  21. package/dist/chat/index.d.cts +11 -10
  22. package/dist/chat/index.d.ts +11 -10
  23. package/dist/chat/index.js +30 -120
  24. package/dist/chat/lite/index.cjs +29 -119
  25. package/dist/chat/lite/index.d.cts +11 -10
  26. package/dist/chat/lite/index.d.ts +11 -10
  27. package/dist/chat/lite/index.js +30 -120
  28. package/dist/{attachments.d-d1rWAw9K.d.ts → chatHandoffToken.d-C4tEyuCT.d.ts} +33 -9
  29. package/dist/{attachments.d-CeXw6R7_.d.cts → chatHandoffToken.d-D6GUoBvs.d.cts} +33 -9
  30. package/dist/{ports.d-CIfa_XF6.d.ts → chatTypes.d-BI4vidgu.d.ts} +41 -52
  31. package/dist/{ports.d--OjPUqPb.d.cts → chatTypes.d-CSyw9em_.d.cts} +41 -52
  32. package/dist/client/index.cjs +2 -95
  33. package/dist/client/index.d.cts +7 -7
  34. package/dist/client/index.d.ts +7 -7
  35. package/dist/client/index.js +2 -95
  36. package/dist/{clinicBatch.d-DVahpaN3.d.cts → clinicBatch.d-BxA_uGBb.d.cts} +2 -2
  37. package/dist/{clinicBatch.d-CcqnQ7-d.d.ts → clinicBatch.d-T5oSAhY-.d.ts} +2 -2
  38. package/dist/{config.d-KX-EkQ9j.d.ts → config.d-N5Xzy53V.d.ts} +1 -1
  39. package/dist/{config.d-Z_fyOZke.d.cts → config.d-jCmrhM4a.d.cts} +1 -1
  40. package/dist/consent/index.cjs +1 -94
  41. package/dist/consent/index.d.cts +5 -5
  42. package/dist/consent/index.d.ts +5 -5
  43. package/dist/consent/index.js +1 -94
  44. package/dist/{context.d-DY6d4qXG.d.ts → context.d-BJEpEERH.d.ts} +7 -6
  45. package/dist/{context.d-DV5E_2Fs.d.cts → context.d-l4HkFJI8.d.cts} +7 -6
  46. package/dist/{copy.d-BPzpKGGc.d.ts → copy.d-hFRaovog.d.ts} +2 -2
  47. package/dist/{copy.d-CMY9OoCC.d.cts → copy.d-hS49oJ4w.d.cts} +2 -2
  48. package/dist/core/index.cjs +6 -99
  49. package/dist/core/index.d.cts +14 -13
  50. package/dist/core/index.d.ts +14 -13
  51. package/dist/core/index.js +6 -99
  52. package/dist/{depth.d-qVYPByPb.d.cts → depth.d-BYwddMNU.d.cts} +2 -2
  53. package/dist/{depth.d-B_qNSgXr.d.ts → depth.d-C99_xup2.d.ts} +2 -2
  54. package/dist/{entitlementRepository.d-CwTVi7he.d.cts → entitlementRepository.d-CiU_QIPL.d.cts} +2 -2
  55. package/dist/{entitlementRepository.d-BXDWPyP8.d.ts → entitlementRepository.d-qZAlET7C.d.ts} +2 -2
  56. package/dist/{focus.d-BPofD7ow.d.ts → focus.d-CG6KhDBK.d.ts} +2 -2
  57. package/dist/{focus.d-DJD4lWFB.d.cts → focus.d-RJMXplJc.d.cts} +2 -2
  58. package/dist/health-plan/index.cjs +1 -94
  59. package/dist/health-plan/index.d.cts +9 -9
  60. package/dist/health-plan/index.d.ts +9 -9
  61. package/dist/health-plan/index.js +1 -94
  62. package/dist/{idempotency.d-BVO0mU2R.d.ts → idempotency.d-D-ZWpO9p.d.ts} +1 -1
  63. package/dist/{idempotency.d-BmYuCb-n.d.cts → idempotency.d-DJyOZDPb.d.cts} +1 -1
  64. package/dist/{identity.d-3ROlHbnP.d.cts → identity.d-CA7mW59I.d.cts} +1 -1
  65. package/dist/{identity.d-CRVNfZzQ.d.ts → identity.d-DIOnFzXL.d.ts} +1 -1
  66. package/dist/index.cjs +30 -120
  67. package/dist/index.d.cts +14 -13
  68. package/dist/index.d.ts +14 -13
  69. package/dist/index.js +31 -121
  70. package/dist/{introEvents.d-DGQDEPJi.d.cts → introEvents.d-7wNDMhEF.d.cts} +1 -1
  71. package/dist/{introEvents.d-cvMxJfYd.d.ts → introEvents.d-BjqfFgE1.d.ts} +1 -1
  72. package/dist/notifications/inbox/index.cjs +44 -0
  73. package/dist/notifications/inbox/index.d.cts +50 -0
  74. package/dist/notifications/inbox/index.d.ts +50 -0
  75. package/dist/notifications/inbox/index.js +44 -0
  76. package/dist/notifications/index.cjs +18 -98
  77. package/dist/notifications/index.d.cts +12 -6
  78. package/dist/notifications/index.d.ts +12 -6
  79. package/dist/notifications/index.js +18 -98
  80. package/dist/{optInView.d-DIGu47Lz.d.ts → optInView.d-B5v4cDDW.d.ts} +2 -2
  81. package/dist/{optInView.d-CU1U_K-B.d.cts → optInView.d-BQhHPleh.d.cts} +2 -2
  82. package/dist/parse.d-DYsx1Q2V.d.cts +168 -0
  83. package/dist/parse.d-Do0sdAgm.d.ts +168 -0
  84. package/dist/{pets.d-5SMtOAwB.d.cts → pets.d-DRqMaP8A.d.cts} +1 -1
  85. package/dist/{pets.d-BRsbR8QU.d.ts → pets.d-DVrOb-Bj.d.ts} +1 -1
  86. package/dist/{petsRepository.d-DWsChqAS.d.ts → petsRepository.d-CpYWRWFq.d.ts} +1 -1
  87. package/dist/{petsRepository.d-DEnoZn92.d.cts → petsRepository.d-tZADfKA1.d.cts} +1 -1
  88. package/dist/photo/index.cjs +1 -94
  89. package/dist/photo/index.js +1 -94
  90. package/dist/records/depth/index.cjs +1 -94
  91. package/dist/records/depth/index.d.cts +9 -9
  92. package/dist/records/depth/index.d.ts +9 -9
  93. package/dist/records/depth/index.js +1 -94
  94. package/dist/records/index.cjs +2 -95
  95. package/dist/records/index.d.cts +10 -10
  96. package/dist/records/index.d.ts +10 -10
  97. package/dist/records/index.js +2 -95
  98. package/dist/{requestFunnel.d-DSvCGf4J.d.ts → requestFunnel.d-B8OVGh0p.d.ts} +2 -2
  99. package/dist/{requestFunnel.d-CQX_Z1Hi.d.cts → requestFunnel.d-C4abgvt9.d.cts} +2 -2
  100. package/dist/{parse.d-icynBIS-.d.ts → route.d-BAZqGLfl.d.ts} +90 -53
  101. package/dist/{parse.d-GzZJYu__.d.cts → route.d-CTf8h9vS.d.cts} +90 -53
  102. package/dist/{runtimeTypes.d-sXpNYnJp.d.cts → runtimeTypes.d-DbaQKGLv.d.cts} +39 -5
  103. package/dist/{runtimeTypes.d-Be_vhOER.d.ts → runtimeTypes.d-DrIz5e6L.d.ts} +39 -5
  104. package/dist/{screenProps.d-DpMK2_gi.d.ts → screenProps.d-BP8LAZWn.d.ts} +1 -1
  105. package/dist/{screenProps.d-BW6PZh5k.d.cts → screenProps.d-Di3wYGCn.d.cts} +1 -1
  106. package/dist/server/events/index.cjs +2 -95
  107. package/dist/server/events/index.d.cts +92 -5
  108. package/dist/server/events/index.d.ts +92 -5
  109. package/dist/server/events/index.js +2 -95
  110. package/dist/server/index.cjs +2 -95
  111. package/dist/server/index.d.cts +3 -3
  112. package/dist/server/index.d.ts +3 -3
  113. package/dist/server/index.js +2 -95
  114. package/dist/shop/index.d.cts +3 -3
  115. package/dist/shop/index.d.ts +3 -3
  116. package/dist/tabs/index.cjs +3 -96
  117. package/dist/tabs/index.d.cts +6 -6
  118. package/dist/tabs/index.d.ts +6 -6
  119. package/dist/tabs/index.js +3 -96
  120. package/dist/televet/booking/index.cjs +1 -94
  121. package/dist/televet/booking/index.d.cts +6 -6
  122. package/dist/televet/booking/index.d.ts +6 -6
  123. package/dist/televet/booking/index.js +1 -94
  124. package/dist/televet/index.cjs +1 -94
  125. package/dist/televet/index.js +1 -94
  126. package/dist/testing/index.cjs +1 -94
  127. package/dist/testing/index.d.cts +1 -1
  128. package/dist/testing/index.d.ts +1 -1
  129. package/dist/testing/index.js +1 -94
  130. package/dist/testing/rn/index.cjs +1 -94
  131. package/dist/testing/rn/index.d.cts +8 -7
  132. package/dist/testing/rn/index.d.ts +8 -7
  133. package/dist/testing/rn/index.js +1 -94
  134. package/dist/testing/web/index.cjs +1 -94
  135. package/dist/testing/web/index.d.cts +8 -7
  136. package/dist/testing/web/index.d.ts +8 -7
  137. package/dist/testing/web/index.js +1 -94
  138. package/dist/texting/index.cjs +1 -94
  139. package/dist/texting/index.d.cts +5 -5
  140. package/dist/texting/index.d.ts +5 -5
  141. package/dist/texting/index.js +1 -94
  142. package/dist/{threadOptions.d-DMOn3mmj.d.ts → threadOptions.d-Cwmyu8pc.d.ts} +2 -2
  143. package/dist/{threadOptions.d-Csmb-XgL.d.cts → threadOptions.d-REwBuXAY.d.cts} +2 -2
  144. package/dist/{timelineRows.d-B0XZevKx.d.ts → timelineRows.d-CTlGQTB0.d.ts} +1 -1
  145. package/dist/{timelineRows.d-Kllr7Mcu.d.cts → timelineRows.d-CongJG58.d.cts} +1 -1
  146. package/dist/unreadStore.d-gCsleb6l.d.ts +74 -0
  147. package/dist/unreadStore.d-w5x6lEpR.d.cts +74 -0
  148. package/dist/{useHealthPlanSubscription.d-bNRntgWe.d.ts → useHealthPlanSubscription.d-BSo5kFT9.d.ts} +2 -2
  149. package/dist/{useHealthPlanSubscription.d-C-c_mQ4u.d.cts → useHealthPlanSubscription.d-Br7GKHTt.d.cts} +2 -2
  150. package/dist/useInboxUnread.d-Blxu00eY.d.ts +206 -0
  151. package/dist/useInboxUnread.d-pi6FNnK-.d.cts +206 -0
  152. package/dist/{usePresentation.d-BHKhBKQn.d.cts → usePresentation.d-C6ci1s3j.d.cts} +1 -1
  153. package/dist/{usePresentation.d-CmQgbrZr.d.ts → usePresentation.d-yd9Gh4GB.d.ts} +1 -1
  154. package/dist/{useRecordsDepth.d-WW_2cWwU.d.cts → useRecordsDepth.d-BIDVPfx7.d.cts} +1 -1
  155. package/dist/{useRecordsDepth.d-BilHZaR4.d.ts → useRecordsDepth.d-C5snbNxR.d.ts} +1 -1
  156. package/dist/{appStateLifecycle.d-BQcy4J5O.d.cts → useUnread.d-CORommFJ.d.cts} +49 -14
  157. package/dist/{appStateLifecycle.d-JuPhh7Oy.d.ts → useUnread.d-w0dKMnx7.d.ts} +49 -14
  158. package/dist/video/index.cjs +1 -94
  159. package/dist/video/index.js +1 -94
  160. package/dist/{view.d-BtN_L_UF.d.ts → view.d-CK2UN4qn.d.ts} +3 -3
  161. package/dist/{view.d-BTnjZu2S.d.cts → view.d-DUhKppyl.d.cts} +3 -3
  162. package/dist/web/consent/index.cjs +1 -94
  163. package/dist/web/consent/index.d.cts +5 -5
  164. package/dist/web/consent/index.d.ts +5 -5
  165. package/dist/web/consent/index.js +1 -94
  166. package/dist/web/health-plan/index.cjs +1 -94
  167. package/dist/web/health-plan/index.d.cts +11 -11
  168. package/dist/web/health-plan/index.d.ts +11 -11
  169. package/dist/web/health-plan/index.js +1 -94
  170. package/dist/web/inbox/index.cjs +49 -0
  171. package/dist/web/inbox/index.d.cts +191 -0
  172. package/dist/web/inbox/index.d.ts +191 -0
  173. package/dist/web/inbox/index.js +49 -0
  174. package/dist/web/index.cjs +28 -118
  175. package/dist/web/index.d.cts +76 -36
  176. package/dist/web/index.d.ts +76 -36
  177. package/dist/web/index.js +28 -118
  178. package/dist/web/intro/index.cjs +3 -96
  179. package/dist/web/intro/index.d.cts +6 -6
  180. package/dist/web/intro/index.d.ts +6 -6
  181. package/dist/web/intro/index.js +3 -96
  182. package/dist/web/notifications/index.cjs +16 -96
  183. package/dist/web/notifications/index.d.cts +8 -3
  184. package/dist/web/notifications/index.d.ts +8 -3
  185. package/dist/web/notifications/index.js +16 -96
  186. package/dist/web/records/depth/index.cjs +1 -94
  187. package/dist/web/records/depth/index.d.cts +9 -9
  188. package/dist/web/records/depth/index.d.ts +9 -9
  189. package/dist/web/records/depth/index.js +1 -94
  190. package/dist/web/records/index.cjs +1 -94
  191. package/dist/web/records/index.d.cts +11 -11
  192. package/dist/web/records/index.d.ts +11 -11
  193. package/dist/web/records/index.js +1 -94
  194. package/dist/web/records-sheet/index.cjs +2 -95
  195. package/dist/web/records-sheet/index.js +2 -95
  196. package/dist/web/shop/index.d.cts +3 -3
  197. package/dist/web/shop/index.d.ts +3 -3
  198. package/dist/web/televet/booking/index.cjs +1 -94
  199. package/dist/web/televet/booking/index.d.cts +6 -6
  200. package/dist/web/televet/booking/index.d.ts +6 -6
  201. package/dist/web/televet/booking/index.js +1 -94
  202. package/dist/web/televet/index.cjs +1 -94
  203. package/dist/web/televet/index.js +1 -94
  204. package/dist/web/texting/index.cjs +1 -94
  205. package/dist/web/texting/index.d.cts +5 -5
  206. package/dist/web/texting/index.d.ts +5 -5
  207. package/dist/web/texting/index.js +1 -94
  208. package/notifications/inbox/package.json +8 -0
  209. package/package.json +29 -1
  210. package/web/inbox/native-blocked.cjs +12 -0
  211. package/web/inbox/package.json +8 -0
@@ -1,5 +1,5 @@
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
- import { a as HealthPlanPetWords, H as HealthPlanPage } from './focus.d-DJD4lWFB.cjs';
2
+ import { a as HealthPlanPetWords, H as HealthPlanPage } from './focus.d-RJMXplJc.cjs';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
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
- import { a as HealthPlanPetWords, H as HealthPlanPage } from './focus.d-BPofD7ow.js';
2
+ import { a as HealthPlanPetWords, H as HealthPlanPage } from './focus.d-CG6KhDBK.js';
3
3
  import { P as PetRef } from './ids.d-B2GAAifq.js';
4
4
 
5
5
  /**
@@ -0,0 +1,44 @@
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");function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function ok(value,warning){/* @__PURE__ */
3
+ return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
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)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var INBOX_COPY=/* @__PURE__ */Object.freeze({title:"Notifications",loading:"Loading notifications",emptyTitle:"You’re all caught up",emptyBody:"Updates about your pet’s care will show up here.",errorTitle:"Could not load your notifications",errorBody:"Check your connection and try again.",retry:"Try again",rowFallbackTitle:"Notification",unreadPrefix:"Unread.",timeAgoSuffix:"ago",now:"Now",more:"Show more",detailErrorTitle:"Could not load this notification",detailErrorBody:"Check your connection and try again.",notFoundTitle:"This notification is no longer available",notFoundBody:"The notification may have expired or been removed.",back:"Back to inbox"});function inboxCopyWith(copy){if(copy===void 0)return INBOX_COPY;let out={...INBOX_COPY};for(let key of Object.keys(INBOX_COPY)){let value=copy[key];typeof value=="string"&&value.trim().length>0&&(out[key]=value)}/* @__PURE__ */
5
+ return Object.freeze(out)}function formatInboxTime(iso,nowMs,now){let date=new Date(iso),at2=date.getTime();if(Number.isNaN(at2))return null;let diff=nowMs-at2;if(diff<6e4)return now;if(diff<36e5)return`${Math.floor(diff/6e4)}m`;if(diff<864e5)return`${Math.floor(diff/36e5)}h`;if(diff<6048e5)return`${Math.floor(diff/864e5)}d`;if(diff<5*6048e5)return`${Math.floor(diff/6048e5)}w`;let sameYear=date.getFullYear()===new Date(nowMs).getFullYear();try{return date.toLocaleDateString("en-US",{month:"short",day:"numeric",...sameYear?{}:{year:"numeric"}})}catch{return date.toISOString().slice(0,10)}}function inboxTimeTakesAgo(label){return typeof label=="string"&&/^\d+[mhdw]$/.test(label)}function inboxRowLabel(parts,copy){let time=parts.time===null?null:inboxTimeTakesAgo(parts.time)?`${parts.time} ${copy.timeAgoSuffix}`:parts.time;return[parts.unread?copy.unreadPrefix:null,parts.title,parts.body.length>0?parts.body:null,time].filter(part=>part!==null).join(" ")}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}function inboxRows(items,nowMs,copy){return items.map(item=>{let title=item.title.trim().length>0?item.title:copy.rowFallbackTitle,time=formatInboxTime(item.createdAt,nowMs,copy.now),unread=item.readAt===null;return{id:item.id,title:title,body:item.body,time:time,unread:unread,label:inboxRowLabel({title:title,body:item.body,time:time,unread:unread},copy)}})}function detailFor(ref,res){return res.ok?{kind:"ready",item:res.value.item}:res.error.httpStatus===404?{kind:"notFound",ref:ref}:{kind:"error",ref:ref}}function wantedRef(itemId,eventId){return typeof itemId=="string"?{itemId:itemId}:typeof eventId=="string"?{eventId:eventId}:null}var refKey=ref=>"itemId"in ref?`i:${ref.itemId}`:`e:${ref.eventId}`;function useInboxView(inbox,props){let{open:open}=inbox,onOpen=react.useRef(props.onOpen);onOpen.current=props.onOpen;let wanted=wantedRef(props.initialItemId,props.initialEventId),[detail,setDetail]=react.useState(()=>wanted===null?null:{kind:"loading",ref:wanted}),turn=react.useRef(0),live=react.useRef(true);react.useEffect(()=>(live.current=true,()=>{live.current=false}),[]);let show=react.useCallback(ref=>{let mine=++turn.current;setDetail({kind:"loading",ref:ref}),open(ref).then(res=>{live.current&&mine===turn.current&&setDetail(detailFor(ref,res))})},[open]),showRef=react.useRef(show);showRef.current=show;let wantedKey=wanted===null?null:refKey(wanted),shown=react.useRef(null),wantedNow=react.useRef(wanted);wantedNow.current=wanted,react.useEffect(()=>{if(wantedKey===null){shown.current=null;return}shown.current===wantedKey||wantedNow.current===null||(shown.current=wantedKey,showRef.current(wantedNow.current))},[wantedKey]);let openRow=react.useCallback(itemId=>{let handler=onOpen.current;if(handler===void 0){show({itemId:itemId});return}let mine=++turn.current;open({itemId:itemId}).then(res=>{if(!(!live.current||mine!==turn.current)){if(!res.ok){setDetail(detailFor({itemId:itemId},res));return}callHost(handler,res.value)===false&&setDetail({kind:"ready",item:res.value.item})}})},[open,show]),back=react.useCallback(()=>{turn.current+=1,shown.current=null,setDetail(null)},[]),retryDetail=react.useCallback(()=>{detail!==null&&detail.kind!=="ready"&&show(detail.ref)},[detail,show]);return react.useMemo(()=>({detail:detail,openRow:openRow,back:back,retryDetail:retryDetail}),[detail,openRow,back,retryDetail])}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=react.useState(()=>Date.now()),first=react.useRef(true);return react.useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),react.useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return react.createElement(reactNative.Text,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}react.forwardRef(function(props,ref){return react.createElement(reactNative.TextInput,{...props,...ref===null?{}:{ref:ref}})});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:"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",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 errorFrame(fields){/* @__PURE__ */
6
+ 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(
7
+ /* @__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__ */
8
+ 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 at2=findResetsAt(error.raw);if(at2!==null){let delta=at2-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 noop2=()=>{};if(!caller)return{signal:deadline,dispose:noop2};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop2};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 INTENT_BY_VISIT_EVENT=/* @__PURE__ */Object.freeze({"visit.booked":"visit","visit.reminder":"join","visit.rescheduled":"visit","visit.followup_sent":"messages","visit.message_received":"messages","visit.completed":"summary","visit.ended":"visit","visit.cancelled":null,"visit.no_show":null});function vetVisitIntentForEvent(eventType){return Object.prototype.hasOwnProperty.call(INTENT_BY_VISIT_EVENT,eventType)?INTENT_BY_VISIT_EVENT[eventType]:"visit"}var EVERFUR_NOTIFICATION_VERSION=1,EVERFUR_NOTIFICATION_TARGET_KINDS=/* @__PURE__ */Object.freeze(["record_request","pet","visit","case","chat","records","vaccine","medication","labs","order","health_plan","tip","walk","weather","pack","mood","card","membership","support","offer","inbox"]),TOP_KEYS=["v","event_id","event_type","target"],EVENT_TYPE=/^[a-z][a-z0-9_]{0,39}(\.[a-z0-9_]{1,40}){1,4}$/,WIRE_KEY=/^[a-z][a-z0-9_]{0,39}$/,UNKNOWN_FIELDS_MAX=16,INBOX_ITEM_ID=/^inb_[A-Za-z0-9_-]{1,64}$/,VISIT_PUSH_INTENTS=/* @__PURE__ */new Set(["visit","join","summary","messages","prep","waiting","notes"]),HOSTED_INTENT=/* @__PURE__ */Object.freeze({visit:"visit",join:"join",summary:"summary",messages:"messages",prep:"visit",waiting:"join",notes:"summary"}),MEDICATION_INTENTS=/* @__PURE__ */new Set(["check","refill","dose"]),ORDER_INTENTS=/* @__PURE__ */new Set(["status","prescription"]),MAX_VALUE_LENGTH=128,MAX_ENCODED_LENGTH=4096,EVENT_ID=/^evt_[A-Za-z0-9]{1,64}$/,UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,CONTROL_CHAR=/[\0-]/;function isRecord2(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function keysOf(value){return Object.keys(value)}function decodeBlock(raw){if(isRecord2(raw))return raw;if(typeof raw!="string"||raw.length===0||raw.length>MAX_ENCODED_LENGTH)return null;let decoded=JSON.parse(raw);return isRecord2(decoded)?decoded:null}function at(root,path){let current=root;for(let key of path){if(!isRecord2(current))return;current=current[key]}return current}var DATA_PATHS=[[],["data"],["request","content","data"],["notification","request","content","data"]];function locateBlock(payload){if(!isRecord2(payload))return null;for(let path of DATA_PATHS){let map=at(payload,path);if(isRecord2(map)&&"everfur"in map)return map.everfur}return TOP_KEYS.every(key=>key in payload)?payload:null}function opaqueString(value){return typeof value!="string"||value.length===0||value.length>MAX_VALUE_LENGTH||CONTROL_CHAR.test(value)||value.includes("://")||value.toLowerCase().startsWith("everfur")?null:value}function own(target,key){return Object.prototype.hasOwnProperty.call(target,key)?target[key]:void 0}function optional(target,key){let raw=own(target,key);if(raw==null)return{ok:true,value:null};let value=opaqueString(raw);return value===null?{ok:false}:{ok:true,value:value}}function required(target,key){return opaqueString(own(target,key))}function oneOf(target,key,allowed){let field=optional(target,key);if(field.ok)return field.value!==null&&allowed.has(field.value)?field.value:null}function unknownTarget(raw,kind){let fields={},count2=0;for(let key of keysOf(raw)){let value=raw[key];if(!(key==="kind"||!WIRE_KEY.test(key)||typeof value!="string")){if(opaqueString(value)===null||(count2+=1,count2>UNKNOWN_FIELDS_MAX))return null;fields[key]=value}}/* @__PURE__ */
9
+ return Object.freeze({kind:"unknown",wireKind:kind,fields:/* @__PURE__ */Object.freeze(fields)})}function visitIntents(raw,eventType){let named=oneOf(raw,"intent",VISIT_PUSH_INTENTS);if(named===void 0)return null;if(named===null)return{intent:vetVisitIntentForEvent(eventType)};let pushIntent=named;return{intent:HOSTED_INTENT[pushIntent],pushIntent:pushIntent}}function conversationOf(target){let conversation=optional(target,"conversation_id");if(conversation.ok&&!(conversation.value!==null&&!UUID.test(conversation.value)))return conversation.value}function parseTarget(raw,eventType){if(!isRecord2(raw))return null;let kind=own(raw,"kind");if(typeof kind!="string"||!WIRE_KEY.test(kind))return null;if(!EVERFUR_NOTIFICATION_TARGET_KINDS.includes(kind))return unknownTarget(raw,kind);let pet=optional(raw,"pet_ref");if(!pet.ok)return null;let petRef=pet.value;switch(kind){case"record_request":{let requestId=required(raw,"request_id");return requestId===null?null:/* @__PURE__ */Object.freeze({kind:"record_request",requestId:requestId,petRef:petRef})}case"pet":return petRef===null?null:/* @__PURE__ */Object.freeze({kind:"pet",petRef:petRef});case"visit":{let visitRef=required(raw,"visit_ref"),intents=visitIntents(raw,eventType);return visitRef===null||intents===null?null:/* @__PURE__ */Object.freeze({kind:"visit",visitRef:visitRef,petRef:petRef,...intents})}case"case":{let caseRef=required(raw,"case_ref");if(caseRef===null)return null;let conversationId=conversationOf(raw);return conversationId===void 0?null:/* @__PURE__ */Object.freeze({kind:"case",caseRef:caseRef,conversationId:conversationId,petRef:petRef})}case"chat":{if(petRef===null)return null;let conversationId=conversationOf(raw);return conversationId===void 0?null:/* @__PURE__ */Object.freeze({kind:"chat",petRef:petRef,conversationId:conversationId})}case"records":case"vaccine":case"mood":return petRef===null?null:/* @__PURE__ */Object.freeze({kind:kind,petRef:petRef});case"medication":{let medicationRef=optional(raw,"medication_ref"),intent=oneOf(raw,"intent",MEDICATION_INTENTS);return petRef===null||!medicationRef.ok||intent===void 0?null:/* @__PURE__ */Object.freeze({kind:kind,petRef:petRef,medicationRef:medicationRef.value,intent:intent})}case"labs":{let resultRef=optional(raw,"result_ref");return petRef===null||!resultRef.ok?null:/* @__PURE__ */Object.freeze({kind:kind,petRef:petRef,resultRef:resultRef.value})}case"order":{let orderRef=required(raw,"order_ref"),intent=oneOf(raw,"intent",ORDER_INTENTS);return orderRef===null||intent===void 0?null:/* @__PURE__ */Object.freeze({kind:kind,orderRef:orderRef,intent:intent})}case"health_plan":case"walk":/* @__PURE__ */
10
+ return Object.freeze({kind:kind,petRef:petRef});case"tip":{let topic=required(raw,"topic");return topic===null?null:/* @__PURE__ */Object.freeze({kind:kind,topic:topic,petRef:petRef})}case"weather":case"pack":case"membership":case"support":/* @__PURE__ */
11
+ return Object.freeze({kind:kind});case"card":{let cardRef=required(raw,"card_ref");return cardRef===null?null:/* @__PURE__ */Object.freeze({kind:kind,cardRef:cardRef})}case"offer":{let offerRef=required(raw,"offer_ref");return offerRef===null?null:/* @__PURE__ */Object.freeze({kind:kind,offerRef:offerRef})}case"inbox":{let item=optional(raw,"item_id");return!item.ok||item.value!==null&&!INBOX_ITEM_ID.test(item.value)?null:/* @__PURE__ */Object.freeze({kind:kind,itemId:item.value})}default:return null}}function parseBlock(block){if(own(block,"v")!==EVERFUR_NOTIFICATION_VERSION)return null;let eventId=own(block,"event_id");if(typeof eventId!="string"||!EVENT_ID.test(eventId))return null;let eventType=own(block,"event_type");if(typeof eventType!="string"||!EVENT_TYPE.test(eventType))return null;let target=parseTarget(own(block,"target"),eventType);if(target===null)return null;let inboxItemId=own(block,"inbox_item_id"),item=typeof inboxItemId=="string"&&INBOX_ITEM_ID.test(inboxItemId)?{inboxItemId:inboxItemId}:{};/* @__PURE__ */
12
+ return Object.freeze({eventId:eventId,eventType:eventType,target:target,...item})}function parseEverfurNotification(payload){try{let block=decodeBlock(locateBlock(payload));return block===null?null:parseBlock(block)}catch{return null}}var ITEM_ID=/^inb_[A-Za-z0-9_-]{1,64}$/,EVENT_ID2=/^evt_[A-Za-z0-9]{1,64}$/,TARGET_KEY=/^[a-z][a-z0-9_]{0,39}$/,TARGET_KEYS_MAX=16,TARGET_VALUE_MAX=128,PAGE_LIMIT_MAX=50,CURSOR_MAX=512,PET_REF_MAX=128,READ_IDS_MAX=100,TITLE_MAX=500,BODY_MAX=4e3,CONTROL_CHAR2=/[\u0000-\u001f\u007f]/;function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function malformed(call){return makeEverfurError("internalError",{retryable:false,wireMessage:`${call}: the response was not the documented shape`})}function disposed(verb){return makeEverfurError("validationFailed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function isRecord3(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isInboxItemId(value){return typeof value=="string"&&ITEM_ID.test(value)}function isNotificationEventId(value){return typeof value=="string"&&EVENT_ID2.test(value)}function opaque(value){return value.length>0&&value.length<=TARGET_VALUE_MAX&&!CONTROL_CHAR2.test(value)&&!value.includes("://")&&!value.toLowerCase().startsWith("everfur")}function readTarget(raw){if(!isRecord3(raw))return null;let kind=raw.kind;if(typeof kind!="string"||!TARGET_KEY.test(kind))return null;let out={},count2=0;for(let key of Object.keys(raw)){let value=raw[key];if(!(!TARGET_KEY.test(key)||value!==null&&typeof value!="string")){if(typeof value=="string"&&!opaque(value)||(count2+=1,count2>TARGET_KEYS_MAX))return null;out[key]=value}}/* @__PURE__ */
13
+ return Object.freeze(out)}function str(value){return typeof value=="string"&&value.length>0?value:null}function nullableStr(value){return value==null?null:typeof value=="string"&&value.length>0?value:void 0}function parseInboxItem(raw){if(!isRecord3(raw))return null;let id=raw.id,typeKey=str(raw.type_key),title=raw.title,body=raw.body,createdAt=str(raw.created_at),eventType=nullableStr(raw.event_type),petRef=nullableStr(raw.pet_ref),readAt=nullableStr(raw.read_at),eventIdRaw=nullableStr(raw.event_id);if(!isInboxItemId(id)||typeKey===null||createdAt===null||typeof title!="string"||title.length>TITLE_MAX||typeof body!="string"||body.length>BODY_MAX||eventType===void 0||petRef===void 0||readAt===void 0||eventIdRaw===void 0)return null;let eventId=eventIdRaw!==null&&isNotificationEventId(eventIdRaw)?eventIdRaw:null;/* @__PURE__ */
14
+ return Object.freeze({id:id,typeKey:typeKey,eventType:eventType,eventId:eventId,title:title,body:body,petRef:petRef,target:readTarget(raw.target),createdAt:createdAt,readAt:readAt})}function count(value){return typeof value=="number"&&Number.isInteger(value)&&value>=0?value:null}function parsePage(raw){if(!isRecord3(raw)||!Array.isArray(raw.items))return null;let unread=count(raw.unread_count),cursor=nullableStr(raw.next_cursor);if(unread===null||cursor===void 0)return null;let items=[];for(let row of raw.items){let item=parseInboxItem(row);item!==null&&items.push(item)}/* @__PURE__ */
15
+ return Object.freeze({items:/* @__PURE__ */Object.freeze(items),nextCursor:cursor,unreadCount:unread})}function parseCount(raw){return isRecord3(raw)?count(raw.unread_count):null}function notificationForInboxItem(item){if(item.eventId===null||item.eventType===null||item.target===null)return null;let target={};for(let[key,value]of Object.entries(item.target))value!==null&&(target[key]=value);return parseEverfurNotification({v:1,event_id:item.eventId,event_type:item.eventType,target:target})}function inboxOpenFor(item){/* @__PURE__ */
16
+ return Object.freeze({item:item,notification:notificationForInboxItem(item)})}function queryString(query){let pairs=[],{limit:limit,cursor:cursor,petRef:petRef,eventId:eventId}=query??{};if(limit!==void 0){if(!Number.isInteger(limit)||limit<1||limit>PAGE_LIMIT_MAX)return invalid(`limit must be an integer from 1 to ${PAGE_LIMIT_MAX}`);pairs.push(`limit=${limit}`)}if(cursor!==void 0){if(typeof cursor!="string"||cursor.length===0||cursor.length>CURSOR_MAX)return invalid("cursor must be the nextCursor of an earlier page");pairs.push(`cursor=${encodeURIComponent(cursor)}`)}if(petRef!==void 0){if(typeof petRef!="string"||petRef.length===0||petRef.length>PET_REF_MAX)return invalid(`petRef must be 1..${PET_REF_MAX} characters`);pairs.push(`pet_ref=${encodeURIComponent(petRef)}`)}if(eventId!==void 0){if(!isNotificationEventId(eventId))return invalid("eventId must be an Everfur event id (evt_...)");pairs.push(`event_id=${eventId}`)}return pairs.length===0?"":`?${pairs.join("&")}`}function createInboxClient(runtime){let over=()=>{let{services:services}=runtime.registry;return createInboxClientOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},gone=verb=>Promise.resolve(err(disposed(verb)));return{listPage:(query,opts)=>runtime.isDisposed?gone("listPage"):over().listPage(query,opts),getItem:(itemId,opts)=>runtime.isDisposed?gone("getItem"):over().getItem(itemId,opts),markRead:itemIds=>runtime.isDisposed?gone("markRead"):over().markRead(itemIds),markAllRead:()=>runtime.isDisposed?gone("markAllRead"):over().markAllRead(),unreadCount:opts=>runtime.isDisposed?gone("unreadCount"):over().unreadCount(opts)}}function createInboxClientOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),withSignal=(req,signal)=>signal?{...req,signal:signal}:req,read=async(call,body)=>{let res=await funnel.send(call,{method:"POST",path:"/widget/v1/inbox/read",body:body});if(!res.ok)return res;let unread=parseCount(res.value);return unread===null?err(malformed(call)):ok(unread)};return{async listPage(query,opts){let qs=queryString(query);if(typeof qs!="string")return err(qs);let res=await funnel.send("inbox.list",withSignal({method:"GET",path:`/widget/v1/inbox${qs}`},opts?.signal));if(!res.ok)return res;let page=parsePage(res.value);return page===null?err(malformed("inbox.list")):ok(page)},async getItem(itemId,opts){if(!isInboxItemId(itemId))return err(invalid("itemId must be an inbox item id (inb_...)"));let res=await funnel.send("inbox.get",withSignal({method:"GET",path:`/widget/v1/inbox/${itemId}`},opts?.signal));if(!res.ok)return res;let item=parseInboxItem(res.value);return item===null?err(malformed("inbox.get")):ok(item)},markRead(itemIds){return!Array.isArray(itemIds)||itemIds.length===0||itemIds.length>READ_IDS_MAX||!itemIds.every(isInboxItemId)?Promise.resolve(err(invalid(`markRead needs 1..${READ_IDS_MAX} inbox item ids`))):read("inbox.markRead",{ids:[...new Set(itemIds)]})},markAllRead(){return read("inbox.markAllRead",{all:true})},async unreadCount(opts){let res=await funnel.send("inbox.unreadCount",withSignal({method:"GET",path:"/widget/v1/inbox/unread-count"},opts?.signal));if(!res.ok)return res;let unread=parseCount(res.value);return unread===null?err(malformed("inbox.unreadCount")):ok(unread)}}}var INBOX_PAGE_SIZE=20,INITIAL=/* @__PURE__ */Object.freeze({status:"idle",items:/* @__PURE__ */Object.freeze([]),unreadCount:null,hasMore:false,refreshing:false,loadingMore:false,error:null});function isOff(error){return error.httpStatus===404}function notFound(){return makeEverfurError("resourceNotFound",{retryable:false,httpStatus:404,wireMessage:"no inbox item matched"})}function mergeHead(head,current){let seen=new Set(head.map(item=>item.id));/* @__PURE__ */
17
+ return Object.freeze([...head,...current.filter(item=>!seen.has(item.id))])}function createInboxController(deps){let{client:client}=deps,pageSize=deps.pageSize??INBOX_PAGE_SIZE,petRef=deps.petRef??null,snapshot=INITIAL,cursor=null,pages=0,disposed2=false,firstRead=null,refreshing=null,loadingMore=null,generation=0,listeners=/* @__PURE__ */new Set,set=patch=>{if(!disposed2){snapshot=/* @__PURE__ */Object.freeze({...snapshot,...patch});for(let listener of[...listeners])try{listener()}catch{}}},unread=count2=>{set({unreadCount:count2});try{deps.onUnreadCount?.(count2)}catch{}},query=after=>({limit:pageSize,...after===null?{}:{cursor:after},...petRef===null?{}:{petRef:petRef}}),landHead=(page,merge)=>{let items=merge?mergeHead(page.items,snapshot.items):page.items;(!merge||pages<=1)&&(generation+=1,cursor=page.nextCursor,pages=1),set({status:"ready",items:items,hasMore:cursor!==null,error:null}),unread(page.unreadCount)},readHead=async merge=>{let res=await client.listPage(query(null));if(!disposed2){if(res.ok){landHead(res.value,merge);return}if(isOff(res.error)){cursor=null,set({status:"off",items:INITIAL.items,hasMore:false,unreadCount:null,error:null});return}snapshot.status==="ready"?set({error:res.error}):set({status:"error",error:res.error})}},markItems=async ids=>{let before=snapshot.items,marked=ids===null?null:new Set(ids),now=/* @__PURE__ */(new Date).toISOString();set({items:/* @__PURE__ */Object.freeze(before.map(item=>item.readAt===null&&(marked===null||marked.has(item.id))?/* @__PURE__ */Object.freeze({...item,readAt:now}):item))});let res=ids===null?await client.markAllRead():await client.markRead(ids);if(disposed2)return res.ok?ok(void 0):err(res.error);if(!res.ok){let restore=new Map(before.map(item=>[item.id,item]));return set({items:/* @__PURE__ */Object.freeze(snapshot.items.map(item=>item.readAt===now?restore.get(item.id)??item:item))}),err(res.error)}return unread(res.value),ok(void 0)},load=()=>firstRead!==null||disposed2?firstRead??Promise.resolve():(set({status:"loading",error:null}),firstRead=readHead(false),firstRead);return{subscribe(listener){return listeners.add(listener),()=>listeners.delete(listener)},getSnapshot:()=>snapshot,load:load,refresh(){return disposed2?Promise.resolve():firstRead===null?load():(refreshing!==null||(snapshot.status==="error"||snapshot.status==="idle"?set({status:"loading",error:null}):set({refreshing:true}),refreshing=readHead(snapshot.status==="ready").finally(()=>{refreshing=null,set({refreshing:false})})),refreshing)},loadMore(){if(disposed2||loadingMore!==null||cursor===null||snapshot.status!=="ready")return loadingMore??Promise.resolve();let at2=generation,after=cursor;return set({loadingMore:true}),loadingMore=client.listPage(query(after)).then(res=>{if(disposed2||at2!==generation)return;if(!res.ok){set({error:res.error});return}cursor=res.value.nextCursor,pages+=1;let seen=new Set(snapshot.items.map(item=>item.id));set({items:/* @__PURE__ */Object.freeze([...snapshot.items,...res.value.items.filter(item=>!seen.has(item.id))]),hasMore:cursor!==null,error:null}),unread(res.value.unreadCount)}).finally(()=>{loadingMore=null,set({loadingMore:false})}),loadingMore},markRead:itemId=>markItems([itemId]),markAllRead:()=>markItems(null),async open(ref){let{itemId:itemId,eventId:eventId}=ref,item=itemId===void 0?null:snapshot.items.find(row=>row.id===itemId)??null;if(item===null&&eventId!==void 0&&(item=snapshot.items.find(row=>row.eventId===eventId)??null),item===null&&itemId!==void 0){let res=await client.getItem(itemId);if(!res.ok&&eventId===void 0)return err(res.error);res.ok&&(item=res.value)}if(item===null&&eventId!==void 0){let res=await client.listPage({eventId:eventId,limit:1});if(!res.ok)return err(res.error);item=res.value.items[0]??null}return item===null?err(notFound()):(item.readAt===null&&markItems([item.id]),ok(inboxOpenFor(item)))},dispose(){disposed2=true,listeners.clear()}}}var SLOT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#InboxUnread@v1");function slots(){let host=globalThis,stored=host[SLOT_SYMBOL];if(stored instanceof WeakMap)return stored;let made=/* @__PURE__ */new WeakMap;return host[SLOT_SYMBOL]=made,made}function createStore(runtime){let value=null,inFlight=null,listeners=/* @__PURE__ */new Set,set=next=>{if(next!==value){value=next;for(let listener of[...listeners])try{listener()}catch{}}};return{get:()=>value,subscribe(listener){return listeners.add(listener),()=>listeners.delete(listener)},refresh(){if(inFlight!==null)return inFlight;if(runtime.isDisposed)return Promise.resolve();let{services:services}=runtime.registry;return inFlight=createRequestFunnel({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}}).send("inbox.unreadCount",{method:"GET",path:"/widget/v1/inbox/unread-count"}).then(res=>{if(res.ok){let raw=res.value?.unread_count;typeof raw=="number"&&Number.isInteger(raw)&&raw>=0&&set(raw)}else res.error.httpStatus===404&&set(null)}).catch(()=>{}).finally(()=>{inFlight=null}),inFlight},report(count2){Number.isInteger(count2)&&count2>=0&&set(count2)}}}function inboxUnreadStoreFor(runtime,scope){let all=slots(),hit=all.get(runtime);if(hit!==void 0&&hit.key===scope)return hit.store;let store=createStore(runtime);return all.set(runtime,{key:scope,store:store}),store}function inboxUnreadScope(userRef,scopeEpoch){return`${userRef??""}\0${scopeEpoch}`}function isCoalesced(trigger,conversationId,state){if(trigger==="announced")return false;let last=state.lastRefresh;return last===null||last.conversationId!==conversationId?false:state.now-last.at<15e3}function decideChatRefresh(trigger,state){let conversationId=state.activeConversationId===null||state.activeConversationId.length===0?null:state.activeConversationId;return conversationId===null&&state.refreshesBlankThread!==true?{action:"skip",reason:"no_thread"}:state.isTurnInFlight?{action:"defer",reason:"turn_in_flight"}:state.isOffline?{action:"defer",reason:"offline"}:isCoalesced(trigger,conversationId,state)?{action:"skip",reason:"coalesced"}:{action:"refresh",conversationId:conversationId}}function useChatLifecycle(lifecycle,target){let latest=react.useRef(target);latest.current=target;let lastRefresh=react.useRef(null),deferred=react.useRef(null),probeOffline=()=>lifecycle?.isOffline===void 0?false:callHost(()=>lifecycle.isOffline?.()===!0)===true,isOffline=probeOffline(),run=react.useRef(()=>{});run.current=trigger=>{let{conversationId:conversationId,isTurnInFlight:isTurnInFlight,refresh:refresh,refreshesBlankThread:refreshesBlankThread}=latest.current,decision=decideChatRefresh(trigger,{activeConversationId:conversationId,isTurnInFlight:isTurnInFlight,refreshesBlankThread:refreshesBlankThread===true,isOffline:probeOffline(),lastRefresh:lastRefresh.current,now:Date.now()});if(decision.action!=="skip"){if(decision.action==="defer"){deferred.current!=="announced"&&(deferred.current=trigger);return}deferred.current=null,lastRefresh.current={conversationId:decision.conversationId,at:Date.now()},refresh!==void 0&&Promise.resolve(refresh()).catch(()=>{})}},react.useEffect(()=>{if(target.isTurnInFlight||isOffline)return;let owed=deferred.current;owed!==null&&run.current(owed)},[target.isTurnInFlight,isOffline]),react.useEffect(()=>{if(lifecycle===void 0)return;let stops=[],subscribe=(attach,trigger)=>{if(attach===void 0)return;let stop=callHost(()=>attach(()=>{run.current(trigger)}));typeof stop=="function"&&stops.push(stop)};return subscribe(lifecycle.onForeground?.bind(lifecycle),"foreground"),subscribe(lifecycle.onOnline?.bind(lifecycle),"foreground"),subscribe(lifecycle.onAnnounced?.bind(lifecycle),"announced"),()=>{for(let stop of stops)callHost(stop)}},[lifecycle])}function useScopedController(create,deps){let[controller,setController]=react.useState(create),adopted=react.useRef(false);return react.useEffect(()=>{let current=controller;return adopted.current&&(current=create(),setController(current)),adopted.current=true,()=>current.dispose()},deps),controller}var INBOX_REFRESH_KEY="everfur-inbox",SIGNED_OUT=/* @__PURE__ */Object.freeze({subscribe:()=>()=>{},getSnapshot:()=>SIGNED_OUT_SNAPSHOT,load:()=>Promise.resolve(),refresh:()=>Promise.resolve(),loadMore:()=>Promise.resolve(),markRead:()=>Promise.resolve(err(noUser())),markAllRead:()=>Promise.resolve(err(noUser())),open:()=>Promise.resolve(err(noUser())),dispose:()=>{}}),SIGNED_OUT_SNAPSHOT=/* @__PURE__ */Object.freeze({status:"idle",items:/* @__PURE__ */Object.freeze([]),unreadCount:null,hasMore:false,refreshing:false,loadingMore:false,error:null});function noUser(){return makeEverfurError("sessionRequired",{retryable:false,wireMessage:"the inbox needs a signed-in user on the provider"})}function useEverfurInboxClient(){let{runtime:runtime}=useEverfurContext();return react.useMemo(()=>createInboxClient(runtime),[runtime])}function useInboxState(options,lifecycle){let{runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}=useEverfurContext(),client=useEverfurInboxClient(),petRef=options.petRef??null,{pageSize:pageSize}=options,unread=react.useMemo(()=>inboxUnreadStoreFor(runtime,inboxUnreadScope(userRef,scopeEpoch)),[runtime,userRef,scopeEpoch]),controller=useScopedController(()=>userRef===null?SIGNED_OUT:createInboxController({client:client,petRef:petRef,...pageSize===void 0?{}:{pageSize:pageSize},onUnreadCount:count2=>unread.report(count2)}),[client,userRef,scopeEpoch,petRef,pageSize,unread]),snapshot=react.useSyncExternalStore(controller.subscribe,controller.getSnapshot,controller.getSnapshot),unreadCount=react.useSyncExternalStore(unread.subscribe,unread.get,unread.get);react.useEffect(()=>{controller.load()},[controller]);let refresh=react.useCallback(()=>controller.refresh(),[controller]),open=react.useCallback(ref=>controller.open(ref),[controller]);return useChatLifecycle(lifecycle,{conversationId:userRef===null?null:INBOX_REFRESH_KEY,isTurnInFlight:false,refresh:refresh}),react.useMemo(()=>({...snapshot,unreadCount:userRef===null?null:unreadCount??snapshot.unreadCount,refresh:refresh,loadMore:()=>controller.loadMore(),markRead:itemId=>controller.markRead(itemId),markAllRead:()=>controller.markAllRead(),open:open}),[snapshot,unreadCount,userRef,refresh,open,controller])}var noop=()=>{};function createAppStateLifecycle(){return{onForeground(listener){let subscription;try{let away=reactNative.AppState.currentState==="background";subscription=reactNative.AppState.addEventListener("change",next=>{next==="background"?away=!0:next==="active"&&away&&(away=!1,listener())})}catch{return noop}return()=>subscription.remove()}}}function useEverfurInbox(options={}){let{lifecycle:lifecycle}=options,port=react.useMemo(()=>lifecycle===void 0?createAppStateLifecycle():lifecycle??void 0,[lifecycle]);return useInboxState(options,port)}function EverfurInbox(props){let{onOpen:onOpen,initialItemId:initialItemId,initialEventId:initialEventId,petRef:petRef,pageSize:pageSize,lifecycle:lifecycle,copy:hostCopy,style:style}=props,theme=useEverfurTheme(),styles=react.useMemo(()=>makeInboxStyles(theme),[theme]),copy=react.useMemo(()=>inboxCopyWith(hostCopy),[hostCopy]),{userRef:userRef}=useEverfurContext(),inbox=useEverfurInbox({...petRef===void 0?{}:{petRef:petRef},...pageSize===void 0?{}:{pageSize:pageSize},...lifecycle===void 0?{}:{lifecycle:lifecycle}}),view=useInboxView(inbox,{onOpen:onOpen,initialItemId:initialItemId,initialEventId:initialEventId}),now=useCoarseNow(),rows=react.useMemo(()=>inboxRows(inbox.items,now,copy),[inbox.items,now,copy]),content;return view.detail!==null?content=/* @__PURE__ */jsxRuntime.jsx(DetailView,{detail:view.detail,copy:copy,styles:styles,now:now,onBack:view.back,onRetry:view.retryDetail}):userRef===null||inbox.status==="off"||inbox.status==="ready"&&rows.length===0?content=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.state,testID:"everfur-inbox-empty",children:[
18
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateTitle,accessibilityRole:"header",children:copy.emptyTitle}),
19
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateBody,children:copy.emptyBody})]}):inbox.status==="error"&&rows.length===0?content=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.state,accessibilityRole:"alert",testID:"everfur-inbox-error",children:[
20
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateTitle,children:copy.errorTitle}),
21
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateBody,children:copy.errorBody}),
22
+ /* @__PURE__ */jsxRuntime.jsx(ActionButton,{label:copy.retry,onPress:()=>{inbox.refresh()},styles:styles,primary:true})]}):rows.length===0?content=/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:copy.loading,accessibilityState:{busy:true},style:styles.list,testID:"everfur-inbox-loading",children:[0,1,2].map(key=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.skeletonRow,importantForAccessibility:"no-hide-descendants",children:[
23
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.skeletonTitle}),
24
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.skeletonBody})]},key))}):content=/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
25
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.list,accessibilityLabel:copy.title,testID:"everfur-inbox-list",children:rows.map(row=>/* @__PURE__ */jsxRuntime.jsx(RowButton,{row:row,styles:styles,onPress:view.openRow},row.id))}),inbox.error!==null?
26
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.state,accessibilityRole:"alert",testID:"everfur-inbox-inline-error",children:[
27
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateTitle,children:copy.errorTitle}),
28
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateBody,children:copy.errorBody}),
29
+ /* @__PURE__ */jsxRuntime.jsx(ActionButton,{label:copy.retry,onPress:()=>{inbox.refresh()},styles:styles})]}):null,inbox.hasMore?/* @__PURE__ */jsxRuntime.jsx(ActionButton,{label:copy.more,onPress:()=>{inbox.loadMore()},styles:styles,busy:inbox.loadingMore}):null]}),/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[styles.root,style],testID:"everfur-inbox",children:[view.detail===null?/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"heading",accessibilityRole:"header",style:styles.heading,children:copy.title}):null,content]})}function RowButton({row:row,styles:styles,onPress:onPress}){/* @__PURE__ */
30
+ return jsxRuntime.jsxs(reactNative.Pressable,{onPress:()=>onPress(row.id),accessibilityRole:"button",accessibilityLabel:row.label,style:row.unread?[styles.row,styles.rowUnread]:styles.row,testID:`everfur-inbox-row-${row.id}`,children:[
31
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:row.unread?styles.dot:[styles.dot,styles.dotRead]}),
32
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.rowText,importantForAccessibility:"no-hide-descendants",children:[
33
+ /* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.rowTop,children:[
34
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:row.unread?styles.rowTitleUnread:styles.rowTitle,children:row.title}),row.time===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.time,children:row.time})]}),row.body.length>0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.rowBody,numberOfLines:2,children:row.body}):null]})]})}function ActionButton(props){let{label:label,onPress:onPress,styles:styles,primary:primary=false,busy:busy=false}=props;/* @__PURE__ */
35
+ return jsxRuntime.jsx(reactNative.Pressable,{onPress:busy?void 0:onPress,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{busy:busy,disabled:busy},style:primary?styles.primary:styles.secondary,children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:primary?styles.primaryLabel:styles.secondaryLabel,children:label})})}function focusNode(node){if(node===null)return;let send=reactNative.AccessibilityInfo.sendAccessibilityEvent;typeof send=="function"&&send.call(reactNative.AccessibilityInfo,node,"focus")}function DetailView(props){let{detail:detail,copy:copy,styles:styles,now:now,onBack:onBack,onRetry:onRetry}=props,backRef=react.useRef(null);react.useEffect(()=>focusNode(backRef.current),[]);let back=/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{ref:backRef,onPress:onBack,accessibilityRole:"button",accessibilityLabel:copy.back,style:styles.back,testID:"everfur-inbox-back",children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:styles.backLabel,children:copy.back})}),body;return detail.kind==="loading"?body=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{accessible:true,accessibilityRole:"progressbar",accessibilityLabel:copy.loading,accessibilityState:{busy:true},style:styles.state,testID:"everfur-inbox-detail-loading",children:[
36
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.skeletonTitle}),
37
+ /* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.skeletonBody})]}):detail.kind==="notFound"?body=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.state,testID:"everfur-inbox-not-found",children:[
38
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateTitle,children:copy.notFoundTitle}),
39
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateBody,children:copy.notFoundBody})]}):detail.kind==="error"?body=/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.state,accessibilityRole:"alert",testID:"everfur-inbox-detail-error",children:[
40
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateTitle,children:copy.detailErrorTitle}),
41
+ /* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.stateBody,children:copy.detailErrorBody}),
42
+ /* @__PURE__ */jsxRuntime.jsx(ActionButton,{label:copy.retry,onPress:onRetry,styles:styles,primary:true})]}):body=/* @__PURE__ */jsxRuntime.jsx(DetailItem,{item:detail.item,copy:copy,styles:styles,now:now}),/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[back,body]})}function DetailItem({item:item,copy:copy,styles:styles,now:now}){let time=formatInboxTime(item.createdAt,now,copy.now),spoken=time===null?null:inboxTimeTakesAgo(time)?`${time} ${copy.timeAgoSuffix}`:time;/* @__PURE__ */
43
+ return jsxRuntime.jsxs(reactNative.View,{style:styles.detail,testID:"everfur-inbox-detail",children:[
44
+ /* @__PURE__ */jsxRuntime.jsx(Text,{tier:"heading",accessibilityRole:"header",style:styles.heading,children:item.title.trim().length>0?item.title:copy.rowFallbackTitle}),time===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.time,accessibilityLabel:spoken??void 0,children:time}),item.body.length>0?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.detailBody,children:item.body}):null]})}function makeInboxStyles(theme){let{color:color,radius:radius,space:space,type:type,slots:slots2}=theme,text=(size,ink,weight,ratio=type.lineHeight.normal)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*ratio),color:ink}),button={minHeight:48,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center"},bar={height:type.size.body,borderRadius:radius.xs,backgroundColor:color.skeleton};return reactNative.StyleSheet.create({root:{width:"100%",gap:space.md,padding:space.lg,borderRadius:radius.lg,backgroundColor:color.surface,...slotBox(slots2.card)},heading:{...text(type.size.heading,color.text.primary,"bold",type.lineHeight.snug),...headingFace(theme,"bold"),...slotText(slots2.card)},list:{gap:space.xs},row:{flexDirection:"row",alignItems:"flex-start",gap:space.sm,minHeight:48,paddingVertical:space.md,paddingHorizontal:space.lg,borderRadius:radius.md},rowUnread:{backgroundColor:color.brandSofter},dot:{width:8,height:8,marginTop:Math.round((type.size.body*type.lineHeight.normal-8)/2),borderRadius:radius.pill,backgroundColor:color.brand},dotRead:{backgroundColor:"transparent"},rowText:{flex:1,minWidth:0,gap:space.xs},rowTop:{flexDirection:"row",alignItems:"baseline",gap:space.sm},rowTitle:{flex:1,...text(type.size.body,color.text.primary,"medium",type.lineHeight.snug)},rowTitleUnread:{flex:1,...text(type.size.body,color.text.primary,"bold",type.lineHeight.snug)},rowBody:text(type.size.bodyTight,color.text.secondary,"regular"),time:text(type.size.caption,color.text.timestamp,"regular"),state:{alignItems:"center",gap:space.sm,paddingVertical:space.xl,paddingHorizontal:space.lg},stateTitle:{...text(type.size.subtitle,color.text.primary,"bold",type.lineHeight.snug),textAlign:"center"},stateBody:{...text(type.size.body,color.text.secondary,"regular"),textAlign:"center"},primary:{...button,marginTop:space.xs,backgroundColor:color.brand,...slotBox(slots2.primaryButton)},primaryLabel:{...text(type.size.body,color.text.onBrand,"bold"),...slotText(slots2.primaryButton)},secondary:{...button,alignSelf:"center",borderWidth:1,borderColor:color.brandBorder},secondaryLabel:text(type.size.body,color.brandInk,"bold"),back:{...button,alignSelf:"flex-start",paddingHorizontal:space.sm},backLabel:{...text(type.size.body,color.brandInk,"bold"),...slotText(slots2.link)},detail:{gap:space.sm},detailBody:text(type.size.body,color.text.primary,"regular",type.lineHeight.relaxed),skeletonRow:{gap:space.xs,paddingVertical:space.md,paddingHorizontal:space.lg},skeletonTitle:{...bar,width:"60%"},skeletonBody:{...bar,width:"90%",height:type.size.bodyTight}})}var INBOX_UNREAD_REFRESH_KEY="everfur-inbox-unread";function useInboxUnreadState(lifecycle){let{runtime:runtime,userRef:userRef,scopeEpoch:scopeEpoch}=useEverfurContext(),store=react.useMemo(()=>userRef===null?null:inboxUnreadStoreFor(runtime,inboxUnreadScope(userRef,scopeEpoch)),[runtime,userRef,scopeEpoch]),subscribe=react.useCallback(listener=>store===null?()=>{}:store.subscribe(listener),[store]),read=react.useCallback(()=>store===null?null:store.get(),[store]),unreadCount=react.useSyncExternalStore(subscribe,read,read),refresh=react.useCallback(()=>store===null?Promise.resolve():store.refresh(),[store]);return react.useEffect(()=>{refresh()},[refresh]),useChatLifecycle(store===null?void 0:lifecycle,{conversationId:store===null?null:INBOX_UNREAD_REFRESH_KEY,isTurnInFlight:false,refresh:refresh}),react.useMemo(()=>({unreadCount:unreadCount,refresh:refresh}),[unreadCount,refresh])}function useEverfurInboxUnread(options={}){let{lifecycle:lifecycle}=options,port=react.useMemo(()=>lifecycle===void 0?createAppStateLifecycle():lifecycle??void 0,[lifecycle]);return useInboxUnreadState(port)}exports.EverfurInbox=EverfurInbox;exports.createInboxClient=createInboxClient;exports.useEverfurInbox=useEverfurInbox;exports.useEverfurInboxClient=useEverfurInboxClient;exports.useEverfurInboxUnread=useEverfurInboxUnread;
@@ -0,0 +1,50 @@
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
+ import { ReactNode } from 'react';
3
+ import { StyleProp, ViewStyle } from 'react-native';
4
+ import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
5
+ export { B as Brand, C as ConversationId, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
6
+ import { L as LifecyclePort } from '../../LifecyclePort.d-Cr1p33a7.cjs';
7
+ import { E as EverfurInboxOpenHandler, a as EverfurInboxCopy, U as UseEverfurInboxOptions, b as EverfurInboxState, c as UseEverfurInboxUnreadOptions, d as EverfurInboxUnread } from '../../useInboxUnread.d-pi6FNnK-.cjs';
8
+ export { e as EverfurInboxClient, f as EverfurInboxItem, g as EverfurInboxOpen, h as EverfurInboxPage, i as EverfurInboxQuery, j as EverfurInboxSnapshot, k as EverfurInboxStatus, l as EverfurInboxTarget, I as InboxRuntime, m as createInboxClient, u as useEverfurInboxClient } from '../../useInboxUnread.d-pi6FNnK-.cjs';
9
+ export { d as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind } from '../../parse.d-DYsx1Q2V.cjs';
10
+ export { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.cjs';
11
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-CA7mW59I.cjs';
12
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-jCmrhM4a.cjs';
13
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
14
+ export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
15
+ export { E as ErrorPolicyPort } from '../../ErrorPolicyPort.d-DirW9hgO.cjs';
16
+
17
+ interface EverfurInboxProps {
18
+ /** A tapped item, marked read. Route its target; return `false` to have the inbox show it instead. */
19
+ readonly onOpen?: EverfurInboxOpenHandler;
20
+ /** Open this item on its own at mount (the item of a tapped push you did not route). */
21
+ readonly initialItemId?: string | null;
22
+ /**
23
+ * Open the item of this event on its own at mount, for a tapped push that named no item (a native push carries
24
+ * only its event id; `initialItemId` wins when both are set).
25
+ */
26
+ readonly initialEventId?: string | null;
27
+ /** Only this pet's items. Absent, every item of the member. */
28
+ readonly petRef?: PetRef | null;
29
+ /** Items per page, 1 to 50 (default 20). */
30
+ readonly pageSize?: number;
31
+ /** When to read again (see `useEverfurInbox`). */
32
+ readonly lifecycle?: LifecyclePort | null;
33
+ /** Any of the inbox's words, over the defaults. */
34
+ readonly copy?: Partial<EverfurInboxCopy>;
35
+ /** Merged over the root's style. */
36
+ readonly style?: StyleProp<ViewStyle>;
37
+ }
38
+ /** The member's Everfur inbox. */
39
+ declare function EverfurInbox(props: EverfurInboxProps): ReactNode;
40
+
41
+ /** The member's inbox: read on mount and when the app returns to the foreground; every verb settles. */
42
+ declare function useEverfurInbox(options?: UseEverfurInboxOptions): EverfurInboxState;
43
+
44
+ /**
45
+ * The member's unread inbox count, shared with `EverfurInbox`: read on mount and when the app returns to the
46
+ * foreground. For one app badge with the chat, add it to `useEverfurUnread().unreadCount` from "@everfur/sdk".
47
+ */
48
+ declare function useEverfurInboxUnread(options?: UseEverfurInboxUnreadOptions): EverfurInboxUnread;
49
+
50
+ export { EverfurInbox, EverfurInboxCopy, EverfurInboxOpenHandler, type EverfurInboxProps, EverfurInboxState, EverfurInboxUnread, LifecyclePort, PetRef, UseEverfurInboxOptions, UseEverfurInboxUnreadOptions, useEverfurInbox, useEverfurInboxUnread };
@@ -0,0 +1,50 @@
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
+ import { ReactNode } from 'react';
3
+ import { StyleProp, ViewStyle } from 'react-native';
4
+ import { P as PetRef } from '../../ids.d-B2GAAifq.js';
5
+ export { B as Brand, C as ConversationId, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.js';
6
+ import { L as LifecyclePort } from '../../LifecyclePort.d-Cr1p33a7.js';
7
+ import { E as EverfurInboxOpenHandler, a as EverfurInboxCopy, U as UseEverfurInboxOptions, b as EverfurInboxState, c as UseEverfurInboxUnreadOptions, d as EverfurInboxUnread } from '../../useInboxUnread.d-Blxu00eY.js';
8
+ export { e as EverfurInboxClient, f as EverfurInboxItem, g as EverfurInboxOpen, h as EverfurInboxPage, i as EverfurInboxQuery, j as EverfurInboxSnapshot, k as EverfurInboxStatus, l as EverfurInboxTarget, I as InboxRuntime, m as createInboxClient, u as useEverfurInboxClient } from '../../useInboxUnread.d-Blxu00eY.js';
9
+ export { d as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind } from '../../parse.d-Do0sdAgm.js';
10
+ export { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.js';
11
+ export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-DIOnFzXL.js';
12
+ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-N5Xzy53V.js';
13
+ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
14
+ export { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
15
+ export { E as ErrorPolicyPort } from '../../ErrorPolicyPort.d-68yrE3BE.js';
16
+
17
+ interface EverfurInboxProps {
18
+ /** A tapped item, marked read. Route its target; return `false` to have the inbox show it instead. */
19
+ readonly onOpen?: EverfurInboxOpenHandler;
20
+ /** Open this item on its own at mount (the item of a tapped push you did not route). */
21
+ readonly initialItemId?: string | null;
22
+ /**
23
+ * Open the item of this event on its own at mount, for a tapped push that named no item (a native push carries
24
+ * only its event id; `initialItemId` wins when both are set).
25
+ */
26
+ readonly initialEventId?: string | null;
27
+ /** Only this pet's items. Absent, every item of the member. */
28
+ readonly petRef?: PetRef | null;
29
+ /** Items per page, 1 to 50 (default 20). */
30
+ readonly pageSize?: number;
31
+ /** When to read again (see `useEverfurInbox`). */
32
+ readonly lifecycle?: LifecyclePort | null;
33
+ /** Any of the inbox's words, over the defaults. */
34
+ readonly copy?: Partial<EverfurInboxCopy>;
35
+ /** Merged over the root's style. */
36
+ readonly style?: StyleProp<ViewStyle>;
37
+ }
38
+ /** The member's Everfur inbox. */
39
+ declare function EverfurInbox(props: EverfurInboxProps): ReactNode;
40
+
41
+ /** The member's inbox: read on mount and when the app returns to the foreground; every verb settles. */
42
+ declare function useEverfurInbox(options?: UseEverfurInboxOptions): EverfurInboxState;
43
+
44
+ /**
45
+ * The member's unread inbox count, shared with `EverfurInbox`: read on mount and when the app returns to the
46
+ * foreground. For one app badge with the chat, add it to `useEverfurUnread().unreadCount` from "@everfur/sdk".
47
+ */
48
+ declare function useEverfurInboxUnread(options?: UseEverfurInboxUnreadOptions): EverfurInboxUnread;
49
+
50
+ export { EverfurInbox, EverfurInboxCopy, EverfurInboxOpenHandler, type EverfurInboxProps, EverfurInboxState, EverfurInboxUnread, LifecyclePort, PetRef, UseEverfurInboxOptions, UseEverfurInboxUnreadOptions, useEverfurInbox, useEverfurInboxUnread };