@everfur/sdk 1.4.1 → 1.5.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 (200) hide show
  1. package/README.md +2 -2
  2. package/dist/{Chat.d-qQVN6VLp.d.ts → Chat.d-BCfyvzX8.d.ts} +1 -1
  3. package/dist/{Chat.d-Bl-_TsvQ.d.cts → Chat.d-Od44h51D.d.cts} +1 -1
  4. package/dist/{DepthViews.d-PmjccZLr.d.cts → DepthViews.d-BGspxovy.d.cts} +1 -1
  5. package/dist/{DepthViews.d-aOChkwU2.d.ts → DepthViews.d-BIHVrf9r.d.ts} +1 -1
  6. package/dist/{DepthViews.d-ktxIIsnb.d.cts → DepthViews.d-BaLh7Lsi.d.cts} +1 -1
  7. package/dist/{DepthViews.d-CpF_Y_z9.d.ts → DepthViews.d-CEVk9poG.d.ts} +1 -1
  8. package/dist/ErrorPolicyPort.d-BIdmYQnk.d.cts +43 -0
  9. package/dist/ErrorPolicyPort.d-BnI5qWg4.d.ts +43 -0
  10. package/dist/{RecordsPage.d-BfMSOsg_.d.ts → RecordsPage.d-D10RIgdc.d.ts} +1 -1
  11. package/dist/{RecordsPage.d-DWjFpZs1.d.cts → RecordsPage.d-DbhYNSbq.d.cts} +1 -1
  12. package/dist/animations/index.d.cts +3 -3
  13. package/dist/animations/index.d.ts +3 -3
  14. package/dist/{attachments.d-DOmkQ_8O.d.ts → attachments.d-BlukNfIf.d.ts} +1 -1
  15. package/dist/{attachments.d-DBlHzWYy.d.cts → attachments.d-CF4lLuGK.d.cts} +1 -1
  16. package/dist/{bookingCopy.d-ITpabqPr.d.ts → bookingCopy.d-BuDv16WP.d.ts} +12 -12
  17. package/dist/{bookingCopy.d-B39JAmIZ.d.cts → bookingCopy.d-rnBSqOSN.d.cts} +12 -12
  18. package/dist/{callCopy.d-Bw6oZT54.d.cts → callCopy.d-BQxpwXqT.d.cts} +3 -3
  19. package/dist/{callCopy.d-Bw6oZT54.d.ts → callCopy.d-BQxpwXqT.d.ts} +3 -3
  20. package/dist/{callRoom.d-B1DoYdJe.d.cts → callRoom.d-9Dm7XnUr.d.cts} +1 -1
  21. package/dist/{callRoom.d-Dqm1rUqT.d.ts → callRoom.d-t-khijDv.d.ts} +1 -1
  22. package/dist/{casesRepository.d-De4ZtgJ_.d.cts → casesRepository.d-CVuKTkJo.d.cts} +1 -1
  23. package/dist/{casesRepository.d-DsEeFd0F.d.ts → casesRepository.d-Dn1fK1b2.d.ts} +1 -1
  24. package/dist/chat/index.cjs +21 -21
  25. package/dist/chat/index.d.cts +12 -12
  26. package/dist/chat/index.d.ts +12 -12
  27. package/dist/chat/index.js +21 -21
  28. package/dist/chat/lite/index.cjs +21 -21
  29. package/dist/chat/lite/index.d.cts +12 -12
  30. package/dist/chat/lite/index.d.ts +12 -12
  31. package/dist/chat/lite/index.js +21 -21
  32. package/dist/{chatHandoffToken.d-B4-iQ35P.d.cts → chatHandoffToken.d-BjfmIxXk.d.cts} +6 -6
  33. package/dist/{chatHandoffToken.d-Br3Gw3w-.d.ts → chatHandoffToken.d-CFiI6IMc.d.ts} +6 -6
  34. package/dist/{checkin.d-CAKQydg8.d.cts → checkin.d-BP3ZWBfX.d.cts} +5 -5
  35. package/dist/{checkin.d-qvYXugN3.d.ts → checkin.d-CokpahFL.d.ts} +5 -5
  36. package/dist/{chunk-PJHMKQ5C.js → chunk-4KFFE42Z.js} +19 -19
  37. package/dist/{chunk-7MMJ7CYN.js → chunk-6IHY7HS7.js} +1 -1
  38. package/dist/{chunk-6I4REU4U.js → chunk-BMYNDBUR.js} +1 -1
  39. package/dist/{chunk-5OK2AF63.js → chunk-HHCGXQJR.js} +19 -19
  40. package/dist/client/index.cjs +31 -31
  41. package/dist/client/index.d.cts +19 -16
  42. package/dist/client/index.d.ts +19 -16
  43. package/dist/client/index.js +30 -30
  44. package/dist/{clinicBatch.d-B3YJc8IO.d.cts → clinicBatch.d-C0xx5L4j.d.cts} +3 -3
  45. package/dist/{clinicBatch.d-DhvQuPHV.d.ts → clinicBatch.d-DNi4UURs.d.ts} +3 -3
  46. package/dist/{config.d-DRoQ2lAx.d.ts → config.d-B7Z-KTGq.d.ts} +10 -2
  47. package/dist/{config.d-BiVy0fLx.d.cts → config.d-ClAI2RZ6.d.cts} +10 -2
  48. package/dist/consent/index.d.cts +6 -6
  49. package/dist/consent/index.d.ts +6 -6
  50. package/dist/{context.d-DZfxKxNi.d.cts → context.d-Bj6-xYPA.d.cts} +11 -5
  51. package/dist/{context.d-FjU7dQP7.d.ts → context.d-DS1GXUEY.d.ts} +11 -5
  52. package/dist/{copy.d-Ce_8KuZg.d.cts → copy.d--F5A9cXK.d.cts} +3 -3
  53. package/dist/{copy.d-BP36f_63.d.ts → copy.d-DmxuFJFe.d.ts} +3 -3
  54. package/dist/core/index.cjs +41 -40
  55. package/dist/core/index.d.cts +16 -16
  56. package/dist/core/index.d.ts +16 -16
  57. package/dist/core/index.js +41 -40
  58. package/dist/{depth.d-DzMMmRN4.d.ts → depth.d-CgzYE6_n.d.ts} +3 -3
  59. package/dist/{depth.d-BtlcIqPJ.d.cts → depth.d-DLaP0o8Y.d.cts} +3 -3
  60. package/dist/{entitlementRepository.d-BltqS1W8.d.ts → entitlementRepository.d-CkUTlVAb.d.ts} +2 -2
  61. package/dist/{entitlementRepository.d-wfqpUIKN.d.cts → entitlementRepository.d-DVTp-BB9.d.cts} +2 -2
  62. package/dist/{focus.d-BX7oahFk.d.cts → focus.d-CLTjm6In.d.cts} +1 -1
  63. package/dist/{focus.d-armXecf0.d.ts → focus.d-u-HYvim0.d.ts} +1 -1
  64. package/dist/health-plan/index.d.cts +15 -15
  65. package/dist/health-plan/index.d.ts +15 -15
  66. package/dist/{healthPlanRepository.d-DBx7-NLE.d.cts → healthPlanRepository.d-B22kjrYa.d.cts} +3 -3
  67. package/dist/{healthPlanRepository.d-C7K9dJK5.d.ts → healthPlanRepository.d-CwRXeoM7.d.ts} +3 -3
  68. package/dist/{idempotency.d-Dak2-pON.d.cts → idempotency.d-CFVMhWcv.d.cts} +1 -1
  69. package/dist/{idempotency.d-symqJ8Tt.d.ts → idempotency.d-dOFfV91-.d.ts} +1 -1
  70. package/dist/{identity.d-DOKJFaiz.d.ts → identity.d-D4VtpqRr.d.ts} +1 -1
  71. package/dist/{identity.d-DIH9h3Le.d.cts → identity.d-DDpXOtas.d.cts} +1 -1
  72. package/dist/{inbox.d-AuGKeaZv.d.cts → inbox.d-CPcMMz-Y.d.cts} +2 -2
  73. package/dist/{inbox.d-B5b57OXc.d.ts → inbox.d-DJ9xgU1Z.d.ts} +2 -2
  74. package/dist/index.cjs +246 -245
  75. package/dist/index.d.cts +17 -17
  76. package/dist/index.d.ts +17 -17
  77. package/dist/index.js +244 -243
  78. package/dist/{introEvents.d-ehik7PEn.d.cts → introEvents.d-B7acmGwf.d.cts} +1 -1
  79. package/dist/{introEvents.d-S4Q4BOSt.d.ts → introEvents.d-DW3gLljE.d.ts} +1 -1
  80. package/dist/{layout.d-Bm2_1wa4.d.ts → layout.d-C8y_ki1V.d.ts} +1 -1
  81. package/dist/{layout.d-CFF-nBXf.d.cts → layout.d-DfaFM_lp.d.cts} +1 -1
  82. package/dist/{models.d-DOwpK1ZF.d.ts → models.d-BKmOfoqV.d.cts} +2 -2
  83. package/dist/{models.d-Su_BBBTW.d.cts → models.d-BULqCO2R.d.ts} +2 -2
  84. package/dist/notifications/inbox/index.d.cts +7 -7
  85. package/dist/notifications/inbox/index.d.ts +7 -7
  86. package/dist/notifications/index.d.cts +8 -8
  87. package/dist/notifications/index.d.ts +8 -8
  88. package/dist/{optInView.d-DbGx1A9R.d.cts → optInView.d-ByDJMrMv.d.cts} +13 -13
  89. package/dist/{optInView.d-xnIxCLlH.d.ts → optInView.d-DVshLxbD.d.ts} +13 -13
  90. package/dist/{parse.d-DtHmpAMT.d.cts → parse.d-BDZ7ffgj.d.cts} +4 -1
  91. package/dist/{parse.d-DtHmpAMT.d.ts → parse.d-BDZ7ffgj.d.ts} +4 -1
  92. package/dist/{pets.d-BEqKykpu.d.ts → pets.d-BpLObpfM.d.ts} +1 -1
  93. package/dist/{pets.d-BS6sLxY-.d.cts → pets.d-DXhzTNuI.d.cts} +1 -1
  94. package/dist/{petsRepository.d-iHrHkXM2.d.ts → petsRepository.d-_QfM7F6T.d.ts} +1 -1
  95. package/dist/{petsRepository.d-DB5CNKsK.d.cts → petsRepository.d-ai_tZ3lu.d.cts} +1 -1
  96. package/dist/records/depth/index.d.cts +10 -10
  97. package/dist/records/depth/index.d.ts +10 -10
  98. package/dist/records/index.cjs +1 -1
  99. package/dist/records/index.d.cts +11 -11
  100. package/dist/records/index.d.ts +11 -11
  101. package/dist/records/index.js +1 -1
  102. package/dist/{requestFunnel.d-SySe6xHp.d.cts → requestFunnel.d-BwZDfWVD.d.cts} +3 -3
  103. package/dist/{requestFunnel.d-CehftayS.d.ts → requestFunnel.d-DKBPTpsy.d.ts} +3 -3
  104. package/dist/{route.d-DSSSpSB-.d.cts → route.d-DCzQh4ix.d.cts} +3 -3
  105. package/dist/{route.d-B395-hNX.d.ts → route.d-DSYEd2MR.d.ts} +3 -3
  106. package/dist/{runtimeTypes.d-DAz0Tgw5.d.ts → runtimeTypes.d-BzUig75K.d.ts} +11 -7
  107. package/dist/{runtimeTypes.d-DPh1Wh15.d.cts → runtimeTypes.d-CL4l7ta4.d.cts} +11 -7
  108. package/dist/{screenProps.d-Bd2yphad.d.cts → screenProps.d-6xmE1C-V.d.cts} +2 -2
  109. package/dist/{screenProps.d-D9Vi-Afl.d.ts → screenProps.d-fHBKArt_.d.ts} +2 -2
  110. package/dist/{sdkConfigStore.d-VPvsIL8E.d.ts → sdkConfigStore.d-BNCVVEWC.d.ts} +1 -1
  111. package/dist/{sdkConfigStore.d-BHrzkVpP.d.cts → sdkConfigStore.d-C2BAr9kI.d.cts} +1 -1
  112. package/dist/server/events/index.cjs +4 -4
  113. package/dist/server/events/index.d.cts +2 -2
  114. package/dist/server/events/index.d.ts +2 -2
  115. package/dist/server/events/index.js +4 -4
  116. package/dist/server/index.cjs +9 -9
  117. package/dist/server/index.d.cts +3 -3
  118. package/dist/server/index.d.ts +3 -3
  119. package/dist/server/index.js +9 -9
  120. package/dist/shop/index.d.cts +3 -3
  121. package/dist/shop/index.d.ts +3 -3
  122. package/dist/slots/index.d.cts +6 -6
  123. package/dist/slots/index.d.ts +6 -6
  124. package/dist/tabs/index.cjs +87 -84
  125. package/dist/tabs/index.d.cts +15 -15
  126. package/dist/tabs/index.d.ts +15 -15
  127. package/dist/tabs/index.js +95 -92
  128. package/dist/televet/booking/index.cjs +75 -75
  129. package/dist/televet/booking/index.d.cts +8 -8
  130. package/dist/televet/booking/index.d.ts +8 -8
  131. package/dist/televet/booking/index.js +3 -3
  132. package/dist/televet/call/index.d.cts +2 -2
  133. package/dist/televet/call/index.d.ts +2 -2
  134. package/dist/testing/index.d.cts +1 -1
  135. package/dist/testing/index.d.ts +1 -1
  136. package/dist/testing/rn/index.d.cts +10 -10
  137. package/dist/testing/rn/index.d.ts +10 -10
  138. package/dist/testing/web/index.d.cts +10 -10
  139. package/dist/testing/web/index.d.ts +10 -10
  140. package/dist/texting/index.d.cts +6 -6
  141. package/dist/texting/index.d.ts +6 -6
  142. package/dist/{threadOptions.d-bEAFkIsC.d.cts → threadOptions.d-Bqy5d5Fx.d.cts} +1 -1
  143. package/dist/{threadOptions.d-U5YBUKM-.d.ts → threadOptions.d-DOEIpk1t.d.ts} +1 -1
  144. package/dist/{threadOptions.d-DUQxxHyM.d.cts → threadOptions.d-Dc57dm7h.d.cts} +5 -5
  145. package/dist/{threadOptions.d-DnM9UcMx.d.ts → threadOptions.d-NSlFx-Lp.d.ts} +5 -5
  146. package/dist/{timelineRows.d-DXppCSCg.d.cts → timelineRows.d-7w8NsNi4.d.cts} +1 -1
  147. package/dist/{timelineRows.d-9Uhf4q5d.d.ts → timelineRows.d-CthNM5hV.d.ts} +1 -1
  148. package/dist/{useHealthPlanSubscription.d-CRBPMlsc.d.ts → useHealthPlanSubscription.d-CV7M21HS.d.ts} +3 -3
  149. package/dist/{useHealthPlanSubscription.d-DfjTYv1u.d.cts → useHealthPlanSubscription.d-SA9-SuKe.d.cts} +3 -3
  150. package/dist/{useInboxUnread.d-CP3KwSkn.d.ts → useInboxUnread.d-CXiaR3BZ.d.ts} +1 -1
  151. package/dist/{useInboxUnread.d-DiE_NbtS.d.cts → useInboxUnread.d-DERpMelw.d.cts} +1 -1
  152. package/dist/{usePresentation.d-DUYzYXgA.d.cts → usePresentation.d-BJzFicRQ.d.cts} +2 -2
  153. package/dist/{usePresentation.d-Buxz2Jkt.d.ts → usePresentation.d-DgSGIWS-.d.ts} +2 -2
  154. package/dist/{useRecordsDepth.d-l6D0ZS4l.d.cts → useRecordsDepth.d-C9W45gwS.d.cts} +1 -1
  155. package/dist/{useRecordsDepth.d-DG2GiAyt.d.ts → useRecordsDepth.d-ZX2rhcUx.d.ts} +1 -1
  156. package/dist/{useUnread.d-B6Ehu0ao.d.ts → useUnread.d-CedFK4k6.d.ts} +4 -4
  157. package/dist/{useUnread.d-7-cuCooM.d.cts → useUnread.d-DST1GMmL.d.cts} +4 -4
  158. package/dist/{view.d-ufGX_MKK.d.cts → view.d-3lxzyJlL.d.cts} +6 -6
  159. package/dist/{view.d-iTInze7B.d.ts → view.d-DRiYNQJ8.d.ts} +6 -6
  160. package/dist/web/consent/index.d.cts +6 -6
  161. package/dist/web/consent/index.d.ts +6 -6
  162. package/dist/web/health-plan/index.cjs +1 -1
  163. package/dist/web/health-plan/index.d.cts +16 -16
  164. package/dist/web/health-plan/index.d.ts +16 -16
  165. package/dist/web/health-plan/index.js +1 -1
  166. package/dist/web/inbox/index.d.cts +9 -8
  167. package/dist/web/inbox/index.d.ts +9 -8
  168. package/dist/web/index.cjs +191 -190
  169. package/dist/web/index.d.cts +28 -28
  170. package/dist/web/index.d.ts +28 -28
  171. package/dist/web/index.js +191 -190
  172. package/dist/web/intro/index.d.cts +8 -8
  173. package/dist/web/intro/index.d.ts +8 -8
  174. package/dist/web/notifications/index.d.cts +7 -7
  175. package/dist/web/notifications/index.d.ts +7 -7
  176. package/dist/web/records/depth/index.d.cts +10 -10
  177. package/dist/web/records/depth/index.d.ts +10 -10
  178. package/dist/web/records/index.d.cts +13 -13
  179. package/dist/web/records/index.d.ts +13 -13
  180. package/dist/web/records-sheet/index.cjs +1 -1
  181. package/dist/web/records-sheet/index.js +1 -1
  182. package/dist/web/shop/index.cjs +1 -1
  183. package/dist/web/shop/index.d.cts +3 -3
  184. package/dist/web/shop/index.d.ts +3 -3
  185. package/dist/web/shop/index.js +1 -1
  186. package/dist/web/televet/booking/index.cjs +6 -6
  187. package/dist/web/televet/booking/index.d.cts +9 -9
  188. package/dist/web/televet/booking/index.d.ts +9 -9
  189. package/dist/web/televet/booking/index.js +6 -6
  190. package/dist/web/televet/call/index.cjs +1 -1
  191. package/dist/web/televet/call/index.d.cts +2 -2
  192. package/dist/web/televet/call/index.d.ts +2 -2
  193. package/dist/web/televet/call/index.js +1 -1
  194. package/dist/web/texting/index.d.cts +6 -6
  195. package/dist/web/texting/index.d.ts +6 -6
  196. package/dist/web/ui/index.cjs +1 -1
  197. package/dist/web/ui/index.js +33 -33
  198. package/package.json +1 -32
  199. package/dist/ErrorPolicyPort.d-68yrE3BE.d.ts +0 -23
  200. package/dist/ErrorPolicyPort.d-DirW9hgO.d.cts +0 -23
@@ -5,7 +5,7 @@ return Object.freeze(n)}function x(e,t){let n=f(e);return n===null?null:/* @__PU
5
5
  return Object.freeze({active:g(t?.active,false)})}var E=240;function R(e){let t=f(e);if(t===null)return null;let n=b(t.fee_cents);return n===null||n<0?null:/* @__PURE__ */Object.freeze({feeCents:n,currency:h(t.currency)??"usd",feeRecorded:g(t.fee_recorded,n>0),summary:m(t.summary)})}function P(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function D(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function z(e,...t){if(typeof e=="function")try{let n=e(...t);return D(n)&&Promise.resolve(n).then(void 0,P),n}catch(e){P(e);return}}var F=/* @__PURE__ */new WeakMap;function A(e){if(typeof e!="function")return;let t=F.get(e);if(t!==void 0)return t;let n=(...t)=>{z(e,...t)};return F.set(e,n),n}function O(e,t){let n=null;for(let r of t){let t=e[r];typeof t=="function"&&(n??={...e},n[r]=A(t))}return n??e}function B(e,...t){let n;try{n=e(...t)}catch(e){return P(e),Promise.resolve({ok:false,error:e})}return Promise.resolve(n).then(e=>({ok:true,value:e}),e=>({ok:false,error:e}))}var L=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{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}],N=/* @__PURE__ */Object.freeze(L.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(N.map(e=>e.wireCode));var M=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),$=/* @__PURE__ */Object.freeze(N.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:M[e.wireCode]}))),W=new Map($.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),H=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set($.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...H]){let t=W.get(e+n);if(t)return t}}var V=/* @__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(e){return V[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var U=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return U.has(e)}var q=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||q.has(e)}var K=500,Y=8e3,G=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(K*2**n,Y);return Math.floor(t()*r)}var J="This feature isn't available on your account right now.",X="Something in that request was not right. Check the details and try again.",Q=/* @__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:J,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:X,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:J,runtimeDisposed:X,unknown:"Something went wrong. Please try again."}),Z="This session has ended. Please sign in again.",ee="linked_account_read_only";function te(e,t,n){return e==="conflict"&&n===ee?J:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?Z:userFacingError(e)}function userFacingError(e){return Q[e]}function ne(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var re=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===ee,l={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:te(e,t?.wireCode,r?ee:null)};t?.httpStatus!==void 0&&(l.httpStatus=t.httpStatus),t?.requestId&&(l.requestId=t.requestId),typeof t?.reasonCode=="string"&&re.test(t.reasonCode)&&(l.reasonCode=t.reasonCode);let i=t?.retryAfterSeconds;if(typeof i=="number"&&Number.isFinite(i)&&i>=0&&(l.retryAfterSeconds=Math.round(i)),n);return t?.wireMessage&&ne(l,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&ne(l,"raw",t.raw),/* @__PURE__ */Object.freeze(l)}function ok(e,t){/* @__PURE__ */
6
6
  return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
7
7
  return Object.freeze({ok:false,error:e})}var le=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function assertNever(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}function errorFrame(e){/* @__PURE__ */
8
- return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var ie="x-everfur-anon-token",ae="anonTokenInvalid";async function oe(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function se(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...n?{wireMessage:n}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[ie]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...de(e.headers),...authHeaders(t)}}}function de(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===ie||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await oe(t),r=await t.transport.request(withAuthHeaders(e,ue(t,n)));if(r.ok||pe(r.error.raw)!==ae||t.anonIdentity===void 0||t.userRef!==null)return r;let l=await t.anonIdentity.token({forceRefresh:true});return l===null||l===n?r:t.transport.request(withAuthHeaders(e,ue(t,l)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(se(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let l;try{l=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(se(e,{wireCode:pe(r.error.raw),requestId:r.error.requestId}))}let i=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!i.ok&&i.error.httpStatus===401?(t.identity.reportRejected?.(),err(ce(i.error))):i}function ue(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ce(e){let t=e.raw,n=pe(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function pe(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function fe(e,t){let n=globalThis.URL;if(typeof n=="function"){let r;try{r=t===void 0?new n(e):new n(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return be(e)}var he=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,me=/[\s\u0000-\u001f\u007f\\]/,ge={"http:":"80","https:":"443"};function be(e,t){let n=e.trim();let r=me.test(n)?null:he.exec(n);if(r===null)return null;let[,l="",i="",a="",o="",s="",d="",u="",c=""]=r,p=`${l.toLowerCase()}:`,f=Number(s);if(f>65535)return null;let h=s===""||String(f)===ge[p]?"":String(f),m=ge[p]!==void 0,g=o.toLowerCase()+(h&&`:${h}`),b=d||(m?"/":""),y=i||a?`${i}${a&&`:${a}`}@`:"";return{href:`${p}//${y}${g}${b}${u}${c}`,protocol:p,username:i,password:a,hostname:o.toLowerCase(),port:h,origin:m?`${p}//${g}`:"null",pathname:b,search:u==="?"?"":u,hash:c==="#"?"":c}}var ye="1.4.1";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:ve(e)})}function ve(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var xe=3e4,ke=Y*2,we="idempotency-key",Te=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Se=/* @__PURE__ */Object.freeze({onEvent(){}}),Ce=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function je(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Se,n=e.timers??Ce,r=e.rng??Math.random,l=e.sleep??((e,t)=>We(e,n,t)),i=e.maxAttempts??G,a=e.unaryTimeoutMs??xe,o=e.newIdempotencyKey??Ie(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??i),f=u?.idempotent??Te.has(d.method),h=u?.idempotencyKey===void 0?null:je(u.idempotencyKey),m=f?h??o():null,g=_e(d,m),b=0;for(;;){let i=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...m?{idempotencyKey:m}:{},...e});s(i({phase:"attempt"}));let o=Me(a,n),u=$e(o.signal,d.signal),f;try{f=await authedSend({...g,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),o.cancel()}if(f.ok)return s(i({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=Re(h,b,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(i({phase:"settled",...v})),err(h);if(s(i({phase:"retry",...v,delayMs:y.delayMs})),await l(y.delayMs,d.signal),d.signal?.aborted===true)return s(i({phase:"settled",...v,reason:"aborted"})),err(h);b+=1}}async function u(t){return withAuthHeaders(t,await Ne(e.auth))}async function*c(t,n,r){s(
8
+ return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var ie="x-everfur-anon-token",ae="anonTokenInvalid";async function oe(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function se(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...n?{wireMessage:n}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[ie]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...de(e.headers),...authHeaders(t)}}}function de(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===ie||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await oe(t),r=await t.transport.request(withAuthHeaders(e,ue(t,n)));if(r.ok||pe(r.error.raw)!==ae||t.anonIdentity===void 0||t.userRef!==null)return r;let l=await t.anonIdentity.token({forceRefresh:true});return l===null||l===n?r:t.transport.request(withAuthHeaders(e,ue(t,l)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(se(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let l;try{l=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(se(e,{wireCode:pe(r.error.raw),requestId:r.error.requestId}))}let i=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!i.ok&&i.error.httpStatus===401?(t.identity.reportRejected?.(),err(ce(i.error))):i}function ue(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function ce(e){let t=e.raw,n=pe(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function pe(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function fe(e,t){let n=globalThis.URL;if(typeof n=="function"){let r;try{r=t===void 0?new n(e):new n(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return be(e)}var he=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,me=/[\s\u0000-\u001f\u007f\\]/,ge={"http:":"80","https:":"443"};function be(e,t){let n=e.trim();let r=me.test(n)?null:he.exec(n);if(r===null)return null;let[,l="",i="",a="",o="",s="",d="",u="",c=""]=r,p=`${l.toLowerCase()}:`,f=Number(s);if(f>65535)return null;let h=s===""||String(f)===ge[p]?"":String(f),m=ge[p]!==void 0,g=o.toLowerCase()+(h&&`:${h}`),b=d||(m?"/":""),y=i||a?`${i}${a&&`:${a}`}@`:"";return{href:`${p}//${y}${g}${b}${u}${c}`,protocol:p,username:i,password:a,hostname:o.toLowerCase(),port:h,origin:m?`${p}//${g}`:"null",pathname:b,search:u==="?"?"":u,hash:c==="#"?"":c}}var ye="1.5.0";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:ve(e)})}function ve(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var xe=3e4,ke=Y*2,we="idempotency-key",Te=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Se=/* @__PURE__ */Object.freeze({onEvent(){}}),Ce=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function je(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Se,n=e.timers??Ce,r=e.rng??Math.random,l=e.sleep??((e,t)=>We(e,n,t)),i=e.maxAttempts??G,a=e.unaryTimeoutMs??xe,o=e.newIdempotencyKey??Ie(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??i),f=u?.idempotent??Te.has(d.method),h=u?.idempotencyKey===void 0?null:je(u.idempotencyKey),m=f?h??o():null,g=_e(d,m),b=0;for(;;){let i=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...m?{idempotencyKey:m}:{},...e});s(i({phase:"attempt"}));let o=Me(a,n),u=$e(o.signal,d.signal),f;try{f=await authedSend({...g,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),o.cancel()}if(f.ok)return s(i({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=Re(h,b,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(i({phase:"settled",...v})),err(h);if(s(i({phase:"retry",...v,delayMs:y.delayMs})),await l(y.delayMs,d.signal),d.signal?.aborted===true)return s(i({phase:"settled",...v,reason:"aborted"})),err(h);b+=1}}async function u(t){return withAuthHeaders(t,await Ne(e.auth))}async function*c(t,n,r){s(
9
9
  /* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:n.method,path:n.path,attempt:0}));try{yield*e.auth.transport.stream(n,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
10
10
  return Object.freeze({send:d,authorize:u,stream:c})}function _e(e,t){let n={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==we&&(n[t]=r);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}function Ie(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var Ee=10;function Re(e,t,n){if(n.aborted)return{retry:false,reason:"aborted"};let r=Pe(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let l=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(n.policy===void 0)return false;try{return!n.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let i=()=>{if(n.policy===void 0)return null;let t;try{t=n.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(Ee,Math.floor(t)))},a=n.perCallMaxAttempts??i()??n.maxAttempts;if(t+1>=a)return{retry:false,reason:"attempts-exhausted"};let o=De(e,n.now);return o!==null?o>ke?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:l,delayMs:o}:{retry:true,reason:l,delayMs:backoffDelayMs(t,n.rng)}}function Pe(e){let t=e.code==="unknown"?fromWire(Be(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function De(e,t){let n=Fe(e.raw);if(n!==null){let e=n-t;return e>0?e:0}let r=ze(e.raw);return r===null?null:Math.round(r*1e3)}function ze(e){for(let t of Ae(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function Fe(e){for(let t of Ae(e)){let e=t.resets_at,n=Oe(e);if(n!==null)return n}return null}function Ae(e){if(!Le(e))return[];let t=[e];for(let n of["error","detail"]){let r=e[n];Le(r)&&t.push(r)}return t}function Oe(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function Be(e){for(let t of Ae(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function Le(e){return typeof e=="object"&&e!==null}async function Ne(e){if(e.mode==="anonymous"){let t=await oe(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Me(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return{signal:n.signal,cancel:()=>t.clearTimeout(r)}}function $e(e,t){let n=()=>{};if(!t)return{signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let l=()=>r.abort();return e.addEventListener("abort",l,{once:true}),t.addEventListener("abort",l,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",l),t.removeEventListener("abort",l)}}}function We(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let l=t.setTimeout(()=>{n?.removeEventListener("abort",i),r()},e),i=()=>{t.clearTimeout(l),r()};n?.addEventListener("abort",i,{once:true})})}function He(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1}else if(n>=56320&&n<=57343)return true}return false}function Ve(e){return[...e].length}var Ue=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(Ue,t)?Ue[t]:null}var qe=50,Ke=128,Ye=120,Ge=120,Je=2e3,Xe=120,Qe=80,Ze=/* @__PURE__ */new Set(["male","female","unknown"]),et=/* @__PURE__ */new Set(["day","month","year"]),tt=/* @__PURE__ */new Set(["low","medium","high","athletic"]),nt=/* @__PURE__ */new Set(["indoor","outdoor","both"]),rt=/* @__PURE__ */new Set(["mild","moderate","severe"]),lt=/^(\d{4})-(\d{2})-(\d{2})$/,it=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],at=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...it,...at].map(([e])=>e));function ot(e){let t=lt.exec(e);if(t===null)return false;let[n,r,l]=[Number(t[1]),Number(t[2]),Number(t[3])],i=new Date(Date.UTC(n,r-1,l));return i.getUTCFullYear()===n&&i.getUTCMonth()===r-1&&i.getUTCDate()===l}var st=e=>(t,n)=>typeof n=="string"&&e.has(n)?null:`${t} must be one of ${[...e].join(", ")}`,dt=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,ut=(e,t)=>typeof t=="string"&&ot(t)?null:`${e} must be a real date written YYYY-MM-DD`,ct=(e,t={})=>(n,r)=>{if(typeof r!="string")return`${n} must be a string`;if(He(r))return`${n} contains an unpaired surrogate and cannot be encoded`;let l=t.trimmed?r.trim():r;if(t.required&&l.length===0)return`${n} is required and must not be blank`;let i=Ve(l);return i<=e?null:`${n} is ${i} characters; the server accepts at most ${e}`},pt={sex:st(Ze),spayedNeutered:dt,birthDate:ut,birthDatePrecision:st(et),activityLevel:st(tt),indoorOutdoor:st(nt),foodBrand:ct(Xe),foodType:ct(Xe),microchipId:ct(Qe)},ft=["ref","ref",false,ct(Ke,{required:true,trimmed:true})],ht=["notes","notes",false,ct(Je,{trimmed:true})],mt=[ft,["name","name",true,ct(Ye,{required:true,trimmed:true})],["dose","dose",false,ct(Ge,{trimmed:true})],["frequency","frequency",false,ct(Ge,{trimmed:true})],["startDate","start_date",false,ut],["endDate","end_date",false,ut],ht],gt={allergies:[ft,["allergen","allergen",true,ct(Ye,{required:true,trimmed:true})],["severity","severity",false,st(rt)],ht],medications:mt,supplements:mt,conditions:[ft,["conditionName","condition_name",true,ct(Ye,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,ut],ht]};function bt(e,t,n){let r=`${e}[${t}]`;if(typeof n!="object"||n===null||Array.isArray(n))return{error:`${r} must be an object`};let l=n,i={};for(let[t,n,a,o]of gt[e]){let e=l[t];if(e==null){if(a)return{error:`${r}.${t} is required`};e===null&&(i[n]=null);continue}let s=o(`${r}.${t}`,e);if(s!==null)return{error:s};i[n]=e}let a=i.start_date,o=i.end_date;return typeof a=="string"&&typeof o=="string"&&o<a?{error:`${r}.endDate must not be before startDate`}:{item:i}}function yt(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>qe)return{error:`${e} has ${t.length} items; the server accepts at most ${qe}`};let n=[],r=/* @__PURE__ */new Set;for(let l=0;l<t.length;l+=1){let i=bt(e,l,t[l]);if("error"in i)return i;let a=i.item.ref;if(typeof a=="string"){let t=a.trim();if(r.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};r.add(t)}n.push(i.item)}return{items:n}}function vt(e,t){let n=e,r={};for(let[e,t]of it){let l=n[e];if(l!==void 0){if(l!==null){let t=pt[e](e,l);if(t!==null)return{error:t}}r[t]=l}}let l=n.birthDate!==void 0,i=n.birthDatePrecision!==void 0;if(l!==i||l&&n.birthDate===null!=(n.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of at){let l=n[e];if(l===void 0)continue;let i=yt(e,l);if("error"in i)return i;r[t]=i.items}return Object.keys(r).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:r}}var xt=e=>typeof e=="string"?e:null,kt=(e,t)=>typeof t=="string"&&e.has(t)?t:null,wt=e=>typeof e=="boolean"?e:null;function Tt(e,t){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.flatMap(e=>{if(typeof e!="object"||e===null||Array.isArray(e))return[];let n=t(e);return n===null?[]:[n]})):/* @__PURE__ */Object.freeze([])}function St(e){let t=xt(e.name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:xt(e.ref),name:t,dose:xt(e.dose),frequency:xt(e.frequency),startDate:xt(e.start_date),endDate:xt(e.end_date),notes:xt(e.notes)})}function Ct(e){let t=e.profile_version;/* @__PURE__ */
11
11
  return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:kt(Ze,e.sex),spayedNeutered:wt(e.spayed_neutered),birthDate:xt(e.birth_date),birthDatePrecision:kt(et,e.birth_date_precision),activityLevel:kt(tt,e.activity_level),indoorOutdoor:kt(nt,e.indoor_outdoor),foodBrand:xt(e.food_brand),foodType:xt(e.food_type),microchipId:xt(e.microchip_id),allergies:Tt(e.allergies,e=>{let t=xt(e.allergen);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:xt(e.ref),allergen:t,severity:kt(rt,e.severity),notes:xt(e.notes)})}),medications:Tt(e.medications,St),supplements:Tt(e.supplements,St),conditions:Tt(e.conditions,e=>{let t=xt(e.condition_name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:xt(e.ref),conditionName:t,diagnosedDate:xt(e.diagnosed_date),notes:xt(e.notes)})})})}var jt=100,_t=50,It=100,Et=50,Rt=500,Pt=128,Dt=6e4;function zt(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function Ft(e,t,n){if(typeof t!="string")return zt(`${e} must be a string`);let r=Ve(t);return r<=n?null:zt(`${e} is ${r} characters; the server accepts at most ${n}`)}function At(e,t,n){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=n?null:zt(`${e} must be a finite number between 0 and ${n}`)}function Ot(petRef,e){if(typeof petRef!="string")return zt("pet_ref must be a string");if(petRef.trim().length===0)return zt("pet_ref must not be blank");if(He(petRef))return zt("pet_ref contains an unpaired surrogate and cannot be encoded");if(e!=null&&typeof e!="object")return zt("profile must be an object");let t=[Ft("pet_ref",petRef,Pt)];return e?.name!==void 0&&t.push(Ft("name",e.name,jt)),e?.species!==void 0&&t.push(Ft("species",e.species,_t)),e?.breed!==void 0&&t.push(Ft("breed",e.breed,It)),e?.ageYears!==void 0&&t.push(At("age_years",e.ageYears,Et)),e?.weightKg!==void 0&&t.push(At("weight_kg",e.weightKg,Rt)),t.find(e=>e!==null)??null}function Bt(e,t){let n=vt(e,t);return"error"in n?{error:zt(n.error)}:n}function Lt(e){if(typeof e!="object"||e===null)return{error:zt("patch must be an object")};let t=e,n=[["name","name",e=>Ft("name",e,jt)],["species","species",e=>Ft("species",e,_t)],["breed","breed",e=>Ft("breed",e,It)],["ageYears","age_years",e=>At("age_years",e,Et)],["weightKg","weight_kg",e=>At("weight_kg",e,Rt)]],r={};for(let[e,l,i]of n){let n=t[e];if(n!==void 0){if(n!==null){let e=i(n);if(e!==null)return{error:e}}r[l]=n}}let l=Bt(t,t.species);return"error"in l?l:(Object.assign(r,l.body),Object.keys(r).length===0?{error:zt("patch must change at least one field")}:{body:r})}function Nt(e){if(e==null)return{body:{}};let t=Bt(e,e.species);return"error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}var Mt=e=>typeof e=="string"?e:null,$t=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function Wt(e,petRef){let t=typeof e=="object"&&e!==null?e:{};/* @__PURE__ */
@@ -80,14 +80,14 @@ return n.jsxs("div",{"data-testid":"televet-booking-not-entitled",style:r.list,c
80
80
  /* @__PURE__ */n.jsxs("div",{"data-testid":"televet-booking-state-blocked",children:[
81
81
  /* @__PURE__ */n.jsx(TelevetStateCard,{title:Ai.stateBlockedTitle}),
82
82
  /* @__PURE__ */n.jsx(TelevetStateInterestAction,{action:i,testIDPrefix:"televet-state-interest-state-blocked"})]}):h==="reason"&&f?/* @__PURE__ */n.jsx(TelevetEarlyEmergency,{...t!==void 0?{petName:t}:{},...r?{primaryVet:r}:{},onFindEmergencyVet:l,onContinue:o}):null}function ga(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}function TelevetClinicianOutcome({state:e,cause:t,locationStatus:r,onRequestLocation:l,onRetry:i,stateInterest:a=null,renderUnavailable:o}){return e.noState?
83
- /* @__PURE__ */n.jsx("div",{"data-testid":"televet-booking-location-unknown",children:/* @__PURE__ */n.jsx(TelevetStateCard,{title:r==="blocked"?Ai.locationBlockedTitle:r==="unavailable"?Ai.locationUnavailableTitle:Ai.locationUnknownTitle,message:r==="blocked"?Ai.locationBlockedBody:r==="unavailable"?Ai.locationUnavailableBody:Ai.locationUnknownBody,actionLabel:l&&r!=="blocked"?Ai.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:l})}):e.isEmpty?/* @__PURE__ */n.jsx(TelevetClinicianEmptyState,{cause:t,onRetry:i,stateInterest:a}):/* @__PURE__ */n.jsx(EntitlementPausedState,{...o?{renderUnavailable:o}:{}})}function ba(e){return e.trim().replace(/^dr\.?\s+/i,"").slice(0,1).toUpperCase()}function parseColor(e){let t=ya(e);return t===null?null:Ca(t)}function ya(e){if(typeof e=="number")return ka(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return va(t.slice(1));if(t.toLowerCase().startsWith("0x"))return va(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return xa(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=va(t);if(e!==null)return e}return/^\d+$/.test(t)?ka(Number.parseInt(t,10)):null}function va(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:Ta(t[0]),g:Ta(t[1]),b:Ta(t[2]),a:1};if(t.length===6)return{r:wa(t,0),g:wa(t,2),b:wa(t,4),a:1};if(t.length===8){let e=wa(t,0);return{r:wa(t,2),g:wa(t,4),b:wa(t,6),a:e/255}}return null}function xa(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let l=Sa(Number(r[0])),i=Sa(Number(r[1])),a=Sa(Number(r[2]));if(l===null||i===null||a===null)return null;let o=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;o=Math.min(1,Math.max(0,e))}return{r:l,g:i,b:a,a:o}}function ka(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function wa(e,t){return Number.parseInt(e.slice(t,t+2),16)}function Ta(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function Sa(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function Ca(e){if(e.a>=1)return ja(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function ja(e,t,n){return`#${_a(e)}${_a(t)}${_a(n)}`.toUpperCase()}function _a(e){return e.toString(16).padStart(2,"0")}function Ia(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Ea(e,t){let n=ya(e),r=ya(t);if(n===null||r===null)return null;let l=n.a>=1?n:Ia(n,{...r});return ja(l.r,l.g,l.b)}function Ra(e,t){let n=ya(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Pa=.22,Da=.5,za="#FFC3BC";function Fa(e){let t=e.color;return{ink:t.brandInk,text:t.text.primary,muted:t.text.muted,line:t.borderRingCream,mist:t.surfaceSubtle,surface:t.surface,pink:t.highlight,onPink:t.onHighlight,go:t.mark,alert:t.danger,alertWash:t.badgeBgCritical}}function Aa(e){let t=e.color,n=parseColor(t.highlight)===za,r=Ra(t.highlight,n?Pa:Da);return{...Fa(e),pinkSoft:(r===null?null:Ea(r,t.surface))??t.surface}}function televetConsultCalendarKey(e){return`televet-consult-${e}`}function TelevetBookedScreen({consult:t,petName:r,onDone:l,onAddToCalendar:i,canJoinInApp:a=false,lengthMinutes:o,sharedRecords:s=false,sentPhoto:d=false}){let u=useEverfurTheme(),c=sa(),p=e.useMemo(()=>Oa(u),[u]),f=`${e.useId()}-booked-title`,h=Ni(Wi()),[m,g]=e.useState("idle"),b=async()=>{if(!i)return;g("saving");let e=new Date(t.scheduledAt);if(Number.isNaN(e.getTime())){g("failed");return}let n=typeof o=="number"&&Number.isFinite(o)&&o>0?o:vn,r=await B(i,{key:televetConsultCalendarKey(t.consultId),title:Ai.visit.title,startDate:e,endDate:new Date(e.getTime()+n*6e4),alarmOffsetMinutes:-30});if(!r.ok){g("failed");return}g(r.value===true?"saved":r.value==="handed-off"?"idle":"failed")},y=[Ai.booked.remindPromise,s&&t.clinicianName?tn(d?Ai.booked.recordsPhotoPromiseTemplate:Ai.booked.recordsPromiseTemplate,{pet:r??Ai.petFallback,vet:t.clinicianName}):tn(Ai.booked.summaryPromise,{pet:r??""}),...a?[Ai.booked.joinPromise]:[]];if(!isTelevetBookingCopyReady())/* @__PURE__ */
84
- return n.jsx("div",{style:p.screen,"data-testid":"televet-booked-copy-unapproved"});let v=t.clinicianName?.trim()??"";/* @__PURE__ */
83
+ /* @__PURE__ */n.jsx("div",{"data-testid":"televet-booking-location-unknown",children:/* @__PURE__ */n.jsx(TelevetStateCard,{title:r==="blocked"?Ai.locationBlockedTitle:r==="unavailable"?Ai.locationUnavailableTitle:Ai.locationUnknownTitle,message:r==="blocked"?Ai.locationBlockedBody:r==="unavailable"?Ai.locationUnavailableBody:Ai.locationUnknownBody,actionLabel:l&&r!=="blocked"?Ai.locationUnknownCta:void 0,onAction:r==="blocked"?void 0:l})}):e.isEmpty?/* @__PURE__ */n.jsx(TelevetClinicianEmptyState,{cause:t,onRetry:i,stateInterest:a}):/* @__PURE__ */n.jsx(EntitlementPausedState,{...o?{renderUnavailable:o}:{}})}function ba(e){return e.trim().replace(/^dr\.?\s+/i,"").slice(0,1).toUpperCase()}function parseColor(e){let t=ya(e);return t===null?null:Ca(t)}function ya(e){if(typeof e=="number")return ka(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return va(t.slice(1));if(t.toLowerCase().startsWith("0x"))return va(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return xa(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=va(t);if(e!==null)return e}return/^\d+$/.test(t)?ka(Number.parseInt(t,10)):null}function va(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:Ta(t[0]),g:Ta(t[1]),b:Ta(t[2]),a:1};if(t.length===6)return{r:wa(t,0),g:wa(t,2),b:wa(t,4),a:1};if(t.length===8){let e=wa(t,0);return{r:wa(t,2),g:wa(t,4),b:wa(t,6),a:e/255}}return null}function xa(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let l=Sa(Number(r[0])),i=Sa(Number(r[1])),a=Sa(Number(r[2]));if(l===null||i===null||a===null)return null;let o=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;o=Math.min(1,Math.max(0,e))}return{r:l,g:i,b:a,a:o}}function ka(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function wa(e,t){return Number.parseInt(e.slice(t,t+2),16)}function Ta(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function Sa(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function Ca(e){if(e.a>=1)return ja(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function ja(e,t,n){return`#${_a(e)}${_a(t)}${_a(n)}`.toUpperCase()}function _a(e){return e.toString(16).padStart(2,"0")}function Ia(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Ea(e,t){let n=ya(e),r=ya(t);if(n===null||r===null)return null;let l=n.a>=1?n:Ia(n,{...r});return ja(l.r,l.g,l.b)}function Ra(e,t){let n=ya(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Pa=.22,Da=.5,za="#FFC3BC";function Fa(e){let t=e.color;return{ink:t.brandInk,text:t.text.primary,muted:t.text.muted,line:t.borderRingCream,mist:t.surfaceSubtle,surface:t.surface,pink:t.highlight,onPink:t.onHighlight,go:t.mark,alert:t.danger,alertWash:t.badgeBgCritical}}function Aa(e){let t=e.color,n=parseColor(t.highlight)===za,r=Ra(t.highlight,n?Pa:Da);return{...Fa(e),pinkSoft:(r===null?null:Ea(r,t.surface))??t.surface}}function televetConsultCalendarKey(e){return`televet-consult-${e}`}function TelevetBookedScreen({consult:t,petName:r,onDone:l,onAddToCalendar:i,canJoinInApp:a=false,lengthMinutes:o,sharedRecords:s=false,sentPhoto:d=false}){let u=useEverfurTheme(),c=sa(),p=e.useMemo(()=>Oa(u),[u]),f=`${e.useId()}-booked-title`,h=Ni(Wi()),[m,g]=e.useState("idle"),b=async()=>{if(!i)return;g("saving");let e=new Date(t.scheduledAt);if(Number.isNaN(e.getTime())){g("failed");return}let n=typeof o=="number"&&Number.isFinite(o)&&o>0?o:vn,r=await B(i,{key:televetConsultCalendarKey(t.consultId),title:Ai.visit.title,startDate:e,endDate:new Date(e.getTime()+n*6e4),alarmOffsetMinutes:-30});if(!r.ok){g("failed");return}g(r.value===true?"saved":r.value==="handed-off"?"idle":"failed")},y=r?.trim()||Ai.petFallback.charAt(0).toUpperCase()+Ai.petFallback.slice(1),v=[Ai.booked.remindPromise,s&&t.clinicianName?tn(d?Ai.booked.recordsPhotoPromiseTemplate:Ai.booked.recordsPromiseTemplate,{pet:y,vet:t.clinicianName}):tn(Ai.booked.summaryPromise,{pet:y}),...a?[Ai.booked.joinPromise]:[]];if(!isTelevetBookingCopyReady())/* @__PURE__ */
84
+ return n.jsx("div",{style:p.screen,"data-testid":"televet-booked-copy-unapproved"});let x=t.clinicianName?.trim()??"";/* @__PURE__ */
85
85
  return n.jsxs("section",{style:p.screen,"aria-labelledby":f,"data-testid":"televet-booked",children:[
86
- /* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:p.avatar,children:v.length>0?ba(v):null}),
87
- /* @__PURE__ */n.jsx(h,{id:f,style:p.title,children:v.length>0?tn(Ai.bookedTitleTemplate,{vet:v}):Ai.bookedTitle}),
86
+ /* @__PURE__ */n.jsx("div",{"aria-hidden":"true",style:p.avatar,children:x.length>0?ba(x):null}),
87
+ /* @__PURE__ */n.jsx(h,{id:f,style:p.title,children:x.length>0?tn(Ai.bookedTitleTemplate,{vet:x}):Ai.bookedTitle}),
88
88
  /* @__PURE__ */n.jsx("p",{style:p.when,children:r?/* @__PURE__ */n.jsxs(n.Fragment,{children:[
89
89
  /* @__PURE__ */n.jsx("time",{dateTime:t.scheduledAt,children:_n(t.scheduledAt)}),tn(Ai.bookedLeadTemplate,{when:"",pet:r})]}):/* @__PURE__ */n.jsx("time",{dateTime:t.scheduledAt,children:_n(t.scheduledAt)})}),
90
- /* @__PURE__ */n.jsx("section",{"aria-label":Ai.booked.stepsLabel,style:p.card,children:/* @__PURE__ */n.jsx("ol",{style:p.steps,"data-testid":"televet-booked-steps",children:y.map((e,t)=>/* @__PURE__ */n.jsxs("li",{style:{...p.step,...t===y.length-1?p.stepLast:null},children:[
90
+ /* @__PURE__ */n.jsx("section",{"aria-label":Ai.booked.stepsLabel,style:p.card,children:/* @__PURE__ */n.jsx("ol",{style:p.steps,"data-testid":"televet-booked-steps",children:v.map((e,t)=>/* @__PURE__ */n.jsxs("li",{style:{...p.step,...t===v.length-1?p.stepLast:null},children:[
91
91
  /* @__PURE__ */n.jsx("span",{"aria-hidden":"true",style:p.stepNumber,children:String(t+1).padStart(2,"0")}),
92
92
  /* @__PURE__ */n.jsx("span",{style:p.stepText,children:e.trim()})]},e))})}),
93
93
  /* @__PURE__ */n.jsxs("div",{style:p.actions,children:[i?/* @__PURE__ */n.jsx(TelevetButton,{label:m==="saved"?Ai.booked.calendarAdded:Ai.addToCalendarCta,kind:"secondary",size:"lg",fullWidth:false,loading:m==="saving",disabled:m==="saving"||m==="saved",onPress:()=>{b()},testID:"televet-booked-calendar"}):null,
@@ -2,22 +2,22 @@
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import { P as PetRef } from '../../../ids.d-B2GAAifq.cjs';
4
4
  export { B as Brand, _ as __brand } from '../../../ids.d-B2GAAifq.cjs';
5
- import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy.d-B39JAmIZ.cjs';
6
- export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aT as TelevetJoinBlock, aU as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, aV as televetJoinDecision, ar as televetJoinOpensAtMs, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../../bookingCopy.d-B39JAmIZ.cjs';
5
+ import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy.d-rnBSqOSN.cjs';
6
+ export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aT as TelevetJoinBlock, aU as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, aV as televetJoinDecision, ar as televetJoinOpensAtMs, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../../bookingCopy.d-rnBSqOSN.cjs';
7
7
  import { T as TelevetConsult, E as EverfurTelevetFlowRequest, c as TelevetSlot } from '../../../televetGlobal.d-gZrXPaLl.cjs';
8
8
  export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, b as TelevetCancelReceipt, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../../televetGlobal.d-gZrXPaLl.cjs';
9
9
  import { a as TelevetMediaPicker, T as TelevetCalendarWriter, b as TelevetPrimaryVet } from '../../../IntakeMedia.d-LRXO38_z.cjs';
10
10
  export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCalendarEvent, g as TelevetEmergencyExits, h as TelevetEmergencyExitsProps, i as TelevetIntakeMedia, d as TelevetIntakeMediaItem, j as TelevetIntakeMediaProps, t as televetConsultCalendarKey } from '../../../IntakeMedia.d-LRXO38_z.cjs';
11
11
  import { V as VetVisitIntent } from '../../../visitIntent.d-CY7mrflo.cjs';
12
12
  import { n as EverfurTheme } from '../../../tokens.d-DDiPRgye.cjs';
13
- export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom.d-B1DoYdJe.cjs';
13
+ export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom.d-9Dm7XnUr.cjs';
14
14
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../../EverfurError.d-8NHtlgzA.cjs';
15
15
  export { E as EverfurResult } from '../../../EverfurResult.d-BFH-3s6E.cjs';
16
- export { W as WidgetPet } from '../../../petsRepository.d-DB5CNKsK.cjs';
17
- import '../../../requestFunnel.d-SySe6xHp.cjs';
18
- import '../../../ErrorPolicyPort.d-DirW9hgO.cjs';
19
- import '../../../config.d-BiVy0fLx.cjs';
20
- import '../../../identity.d-DIH9h3Le.cjs';
16
+ export { W as WidgetPet } from '../../../petsRepository.d-ai_tZ3lu.cjs';
17
+ import '../../../requestFunnel.d-BwZDfWVD.cjs';
18
+ import '../../../ErrorPolicyPort.d-BIdmYQnk.cjs';
19
+ import '../../../config.d-ClAI2RZ6.cjs';
20
+ import '../../../identity.d-DDpXOtas.cjs';
21
21
  import '../../../TelemetryPort.d-BDNr00hu.cjs';
22
22
  import '../../../profile.d-CSs1wlXT.cjs';
23
23
 
@@ -128,7 +128,7 @@ interface EverfurTelevetBookingProps {
128
128
  * ABSENT MEANS THE CONTROL DOES NOT RENDER. `POST /widget/v1/televet/state-interest` does not exist on the
129
129
  * partner plane, and the consumer WEB app already refused to ship this button over an unreachable write
130
130
  * for the same reason on its own pre-signup funnel: "the button would 401 for every visitor who pressed
131
- * it" (everfur-frontend StateUnavailableNotice.tsx:34-41).
131
+ * it" (the consumer web app StateUnavailableNotice.tsx:34-41).
132
132
  */
133
133
  readonly onStateInterest?: TelevetStateInterestWrite;
134
134
  /**
@@ -2,22 +2,22 @@
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import { P as PetRef } from '../../../ids.d-B2GAAifq.js';
4
4
  export { B as Brand, _ as __brand } from '../../../ids.d-B2GAAifq.js';
5
- import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy.d-ITpabqPr.js';
6
- export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aT as TelevetJoinBlock, aU as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, aV as televetJoinDecision, ar as televetJoinOpensAtMs, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../../bookingCopy.d-ITpabqPr.js';
5
+ import { c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../../bookingCopy.d-BuDv16WP.js';
6
+ export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, aT as TelevetJoinBlock, aU as TelevetJoinDecision, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, aV as televetJoinDecision, ar as televetJoinOpensAtMs, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../../bookingCopy.d-BuDv16WP.js';
7
7
  import { T as TelevetConsult, E as EverfurTelevetFlowRequest, c as TelevetSlot } from '../../../televetGlobal.d-DkJkV55Y.js';
8
8
  export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, b as TelevetCancelReceipt, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../../televetGlobal.d-DkJkV55Y.js';
9
9
  import { a as TelevetMediaPicker, T as TelevetCalendarWriter, b as TelevetPrimaryVet } from '../../../IntakeMedia.d-CwSkSLNM.js';
10
10
  export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCalendarEvent, g as TelevetEmergencyExits, h as TelevetEmergencyExitsProps, i as TelevetIntakeMedia, d as TelevetIntakeMediaItem, j as TelevetIntakeMediaProps, t as televetConsultCalendarKey } from '../../../IntakeMedia.d-CwSkSLNM.js';
11
11
  import { V as VetVisitIntent } from '../../../visitIntent.d-CY7mrflo.js';
12
12
  import { n as EverfurTheme } from '../../../tokens.d-DDiPRgye.js';
13
- export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom.d-Dqm1rUqT.js';
13
+ export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../../callRoom.d-t-khijDv.js';
14
14
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../../EverfurError.d-8NHtlgzA.js';
15
15
  export { E as EverfurResult } from '../../../EverfurResult.d-D_-254ZY.js';
16
- export { W as WidgetPet } from '../../../petsRepository.d-iHrHkXM2.js';
17
- import '../../../requestFunnel.d-CehftayS.js';
18
- import '../../../ErrorPolicyPort.d-68yrE3BE.js';
19
- import '../../../config.d-DRoQ2lAx.js';
20
- import '../../../identity.d-DOKJFaiz.js';
16
+ export { W as WidgetPet } from '../../../petsRepository.d-_QfM7F6T.js';
17
+ import '../../../requestFunnel.d-DKBPTpsy.js';
18
+ import '../../../ErrorPolicyPort.d-BnI5qWg4.js';
19
+ import '../../../config.d-B7Z-KTGq.js';
20
+ import '../../../identity.d-D4VtpqRr.js';
21
21
  import '../../../TelemetryPort.d-BDNr00hu.js';
22
22
  import '../../../profile.d-CSs1wlXT.js';
23
23
 
@@ -128,7 +128,7 @@ interface EverfurTelevetBookingProps {
128
128
  * ABSENT MEANS THE CONTROL DOES NOT RENDER. `POST /widget/v1/televet/state-interest` does not exist on the
129
129
  * partner plane, and the consumer WEB app already refused to ship this button over an unreachable write
130
130
  * for the same reason on its own pre-signup funnel: "the button would 401 for every visitor who pressed
131
- * it" (everfur-frontend StateUnavailableNotice.tsx:34-41).
131
+ * it" (the consumer web app StateUnavailableNotice.tsx:34-41).
132
132
  */
133
133
  readonly onStateInterest?: TelevetStateInterestWrite;
134
134
  /**
@@ -5,7 +5,7 @@ return Object.freeze(n)}function z(e,t){let n=C(e);return n===null?null:/* @__PU
5
5
  return Object.freeze({active:R(t?.active,false)})}var M=240;function W(e){let t=C(e);if(t===null)return null;let n=E(t.fee_cents);return n===null||n<0?null:/* @__PURE__ */Object.freeze({feeCents:n,currency:x(t.currency)??"usd",feeRecorded:R(t.fee_recorded,n>0),summary:I(t.summary)})}function H(e){let t=globalThis.console;try{t?.error?.("[everfur] A host callback threw; the SDK ignored it.",e)}catch{}}function V(e){return(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}function U(e,...t){if(typeof e=="function")try{let n=e(...t);return V(n)&&Promise.resolve(n).then(void 0,H),n}catch(e){H(e);return}}var q=/* @__PURE__ */new WeakMap;function K(e){if(typeof e!="function")return;let t=q.get(e);if(t!==void 0)return t;let n=(...t)=>{U(e,...t)};return q.set(e,n),n}function Y(e,t){let n=null;for(let r of t){let t=e[r];typeof t=="function"&&(n??={...e},n[r]=K(t))}return n??e}function G(e,...t){let n;try{n=e(...t)}catch(e){return H(e),Promise.resolve({ok:false,error:e})}return Promise.resolve(n).then(e=>({ok:true,value:e}),e=>({ok:false,error:e}))}var J=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{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}],Q=/* @__PURE__ */Object.freeze(J.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(Q.map(e=>e.wireCode));var X=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),Z=/* @__PURE__ */Object.freeze(Q.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:X[e.wireCode]}))),ee=new Map(Z.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),te=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(Z.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let n=e.trim().toUpperCase();if(n.length!==0)for(let e of[t??"http_envelope",...te]){let t=ee.get(e+n);if(t)return t}}var ne=/* @__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(e){return ne[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let n=(e??"").trim().toUpperCase(),r=n.replace(/[^A-Z0-9]/g,"");if(r==="AUTHREJECTED")return"authRejected";if(n.startsWith("AUTH"))return"authExpired";switch(r){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}var re=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return re.has(e)}var le=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||le.has(e)}var ie=500,ae=8e3,oe=4;function backoffDelayMs(e,t=Math.random){let n=Math.max(0,e),r=Math.min(ie*2**n,ae);return Math.floor(t()*r)}var se="This feature isn't available on your account right now.",de="Something in that request was not right. Check the details and try again.",ue=/* @__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:se,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:de,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:se,runtimeDisposed:de,unknown:"Something went wrong. Please try again."}),ce="This session has ended. Please sign in again.",pe="linked_account_read_only";function fe(e,t,n){return e==="conflict"&&n===pe?se:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?ce:userFacingError(e)}function userFacingError(e){return ue[e]}function he(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:false,writable:false,configurable:false})}var me=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let n=contractErrorFor(t?.wireCode,t?.wireEnvelope),r=e==="conflict"&&t?.reasonCode===pe,l={code:e,category:categoryFor(e),retryable:t?.retryable??(r?false:isRetryableCode(e)),displayMessage:fe(e,t?.wireCode,r?pe:null)};t?.httpStatus!==void 0&&(l.httpStatus=t.httpStatus),t?.requestId&&(l.requestId=t.requestId),typeof t?.reasonCode=="string"&&me.test(t.reasonCode)&&(l.reasonCode=t.reasonCode);let i=t?.retryAfterSeconds;if(typeof i=="number"&&Number.isFinite(i)&&i>=0&&(l.retryAfterSeconds=Math.round(i)),n);return t?.wireMessage&&he(l,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&he(l,"raw",t.raw),/* @__PURE__ */Object.freeze(l)}function ok(e,t){/* @__PURE__ */
6
6
  return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
7
7
  return Object.freeze({ok:false,error:e})}var ge=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function assertNever(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}function errorFrame(e){/* @__PURE__ */
8
- return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var be="x-everfur-anon-token",ye="anonTokenInvalid";async function ve(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ke(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...n?{wireMessage:n}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[be]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...we(e.headers),...authHeaders(t)}}}function we(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===be||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await ve(t),r=await t.transport.request(withAuthHeaders(e,Te(t,n)));if(r.ok||_e(r.error.raw)!==ye||t.anonIdentity===void 0||t.userRef!==null)return r;let l=await t.anonIdentity.token({forceRefresh:true});return l===null||l===n?r:t.transport.request(withAuthHeaders(e,Te(t,l)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ke(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let l;try{l=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ke(e,{wireCode:_e(r.error.raw),requestId:r.error.requestId}))}let i=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!i.ok&&i.error.httpStatus===401?(t.identity.reportRejected?.(),err(Se(i.error))):i}function Te(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function Se(e){let t=e.raw,n=_e(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function _e(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function Ce(e,t){let n=globalThis.URL;if(typeof n=="function"){let r;try{r=t===void 0?new n(e):new n(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return Ee(e)}var xe=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,Ie=/[\s\u0000-\u001f\u007f\\]/,Re={"http:":"80","https:":"443"};function Ee(e,t){let n=e.trim();let r=Ie.test(n)?null:xe.exec(n);if(r===null)return null;let[,l="",i="",a="",o="",s="",d="",u="",c=""]=r,p=`${l.toLowerCase()}:`,f=Number(s);if(f>65535)return null;let h=s===""||String(f)===Re[p]?"":String(f),m=Re[p]!==void 0,g=o.toLowerCase()+(h&&`:${h}`),b=d||(m?"/":""),y=i||a?`${i}${a&&`:${a}`}@`:"";return{href:`${p}//${y}${g}${b}${u}${c}`,protocol:p,username:i,password:a,hostname:o.toLowerCase(),port:h,origin:m?`${p}//${g}`:"null",pathname:b,search:u==="?"?"":u,hash:c==="#"?"":c}}var De="1.4.1";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:Pe(e)})}function Pe(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var ze=3e4,Fe=ae*2,je="idempotency-key",Oe=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ae=/* @__PURE__ */Object.freeze({onEvent(){}}),Be=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Le(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ae,n=e.timers??Be,r=e.rng??Math.random,l=e.sleep??((e,t)=>et(e,n,t)),i=e.maxAttempts??oe,a=e.unaryTimeoutMs??ze,o=e.newIdempotencyKey??$e(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??i),f=u?.idempotent??Oe.has(d.method),h=u?.idempotencyKey===void 0?null:Le(u.idempotencyKey),m=f?h??o():null,g=Ne(d,m),b=0;for(;;){let i=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...m?{idempotencyKey:m}:{},...e});s(i({phase:"attempt"}));let o=Xe(a,n),u=Ze(o.signal,d.signal),f;try{f=await authedSend({...g,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),o.cancel()}if(f.ok)return s(i({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=We(h,b,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(i({phase:"settled",...v})),err(h);if(s(i({phase:"retry",...v,delayMs:y.delayMs})),await l(y.delayMs,d.signal),d.signal?.aborted===true)return s(i({phase:"settled",...v,reason:"aborted"})),err(h);b+=1}}async function u(t){return withAuthHeaders(t,await Qe(e.auth))}async function*c(t,n,r){s(
8
+ return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:null,...e.freeCap?{freeCap:/* @__PURE__ */Object.freeze({...e.freeCap})}:{}})}var be="x-everfur-anon-token",ye="anonTokenInvalid";async function ve(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function ke(e,t){let n=e instanceof Error?e.message:typeof e=="string"?e:null;return makeEverfurError("authRejected",{retryable:false,...t?.wireCode?{wireCode:t.wireCode}:{},...t?.requestId?{requestId:t.requestId}:{},...n?{wireMessage:n}:{},...e!=null?{raw:e}:{}})}function authHeaders(e){let t={};return e.mode==="personalized"?t.authorization=`Bearer ${e.token}`:(t["x-everfur-partner-key"]=e.publishableKey,e.anonToken&&(t[be]=e.anonToken)),e.userRef&&(t["x-everfur-user-ref"]=e.userRef),e.sessionId&&(t["x-everfur-session-id"]=e.sessionId),t}function withAuthHeaders(e,t){return{...e,headers:{...we(e.headers),...authHeaders(t)}}}function we(e){if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=n.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===be||(t[n]=r)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let n=await ve(t),r=await t.transport.request(withAuthHeaders(e,Te(t,n)));if(r.ok||_e(r.error.raw)!==ye||t.anonIdentity===void 0||t.userRef!==null)return r;let l=await t.anonIdentity.token({forceRefresh:true});return l===null||l===n?r:t.transport.request(withAuthHeaders(e,Te(t,l)))}let n;try{n=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(ke(e))}let r=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:n,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(r.ok||r.error.httpStatus!==401)return r;let l;try{l=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(ke(e,{wireCode:_e(r.error.raw),requestId:r.error.requestId}))}let i=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:l,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!i.ok&&i.error.httpStatus===401?(t.identity.reportRejected?.(),err(Se(i.error))):i}function Te(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function Se(e){let t=e.raw,n=_e(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...n?{wireCode:n}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function _e(e){if(typeof e!="object"||e===null)return null;let t=e,n=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof n=="string"&&n.length>0?n:null}function Ce(e,t){let n=globalThis.URL;if(typeof n=="function"){let r;try{r=t===void 0?new n(e):new n(e,t)}catch{return null}try{if(r.protocol)return r}catch{}}return Ee(e)}var xe=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,Ie=/[\s\u0000-\u001f\u007f\\]/,Re={"http:":"80","https:":"443"};function Ee(e,t){let n=e.trim();let r=Ie.test(n)?null:xe.exec(n);if(r===null)return null;let[,l="",i="",a="",o="",s="",d="",u="",c=""]=r,p=`${l.toLowerCase()}:`,f=Number(s);if(f>65535)return null;let h=s===""||String(f)===Re[p]?"":String(f),m=Re[p]!==void 0,g=o.toLowerCase()+(h&&`:${h}`),b=d||(m?"/":""),y=i||a?`${i}${a&&`:${a}`}@`:"";return{href:`${p}//${y}${g}${b}${u}${c}`,protocol:p,username:i,password:a,hostname:o.toLowerCase(),port:h,origin:m?`${p}//${g}`:"null",pathname:b,search:u==="?"?"":u,hash:c==="#"?"":c}}var De="1.5.0";function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:Pe(e)})}function Pe(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var ze=3e4,Fe=ae*2,je="idempotency-key",Oe=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),Ae=/* @__PURE__ */Object.freeze({onEvent(){}}),Be=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Le(e){let t=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return t.length===0?null:`efs_${t}`.slice(0,128)}function createRequestFunnel(e){let t=e.observer??Ae,n=e.timers??Be,r=e.rng??Math.random,l=e.sleep??((e,t)=>et(e,n,t)),i=e.maxAttempts??oe,a=e.unaryTimeoutMs??ze,o=e.newIdempotencyKey??$e(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??i),f=u?.idempotent??Oe.has(d.method),h=u?.idempotencyKey===void 0?null:Le(u.idempotencyKey),m=f?h??o():null,g=Ne(d,m),b=0;for(;;){let i=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:b,...m?{idempotencyKey:m}:{},...e});s(i({phase:"attempt"}));let o=Xe(a,n),u=Ze(o.signal,d.signal),f;try{f=await authedSend({...g,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),o.cancel()}if(f.ok)return s(i({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=We(h,b,{maxAttempts:p,rng:r,now:n.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),v={ok:false,code:h.code,reason:y.reason,...h.httpStatus!==void 0?{httpStatus:h.httpStatus}:{},...h.requestId!==void 0?{requestId:h.requestId}:{}};if(!y.retry)return s(i({phase:"settled",...v})),err(h);if(s(i({phase:"retry",...v,delayMs:y.delayMs})),await l(y.delayMs,d.signal),d.signal?.aborted===true)return s(i({phase:"settled",...v,reason:"aborted"})),err(h);b+=1}}async function u(t){return withAuthHeaders(t,await Qe(e.auth))}async function*c(t,n,r){s(
9
9
  /* @__PURE__ */Object.freeze({call:t,phase:"stream.open",method:n.method,path:n.path,attempt:0}));try{yield*e.auth.transport.stream(n,r)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
10
10
  return Object.freeze({send:d,authorize:u,stream:c})}function Ne(e,t){let n={};for(let[t,r]of Object.entries(e.headers??{}))t.toLowerCase()!==je&&(n[t]=r);return t!==null&&(n["Idempotency-Key"]=t),{...e,headers:n}}function $e(){let e=0;return()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var Me=10;function We(e,t,n){if(n.aborted)return{retry:false,reason:"aborted"};let r=He(e);if(r==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(r!=="burst"&&!isAutoRetryable(e.code))return{retry:false,reason:"terminal-code"};let l=r==="burst"?"burst-throttle":"retryable-code";if((()=>{if(n.policy===void 0)return false;try{return!n.policy.shouldRetry(e.code,t)}catch{return false}})())return{retry:false,reason:"terminal-code"};let i=()=>{if(n.policy===void 0)return null;let t;try{t=n.policy.maxAttempts(e.code)}catch{return null}return typeof t!="number"||!Number.isFinite(t)?null:Math.max(1,Math.min(Me,Math.floor(t)))},a=n.perCallMaxAttempts??i()??n.maxAttempts;if(t+1>=a)return{retry:false,reason:"attempts-exhausted"};let o=Ve(e,n.now);return o!==null?o>Fe?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:l,delayMs:o}:{retry:true,reason:l,delayMs:backoffDelayMs(t,n.rng)}}function He(e){let t=e.code==="unknown"?fromWire(Ge(e.raw)):e.code;return t==="quotaExceeded"?"quota":t==="rateLimited"||e.httpStatus===429?"burst":null}function Ve(e,t){let n=qe(e.raw);if(n!==null){let e=n-t;return e>0?e:0}let r=Ue(e.raw);return r===null?null:Math.round(r*1e3)}function Ue(e){for(let t of Ke(e)){let e=t.retry_after_seconds;if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return e}return null}function qe(e){for(let t of Ke(e)){let e=t.resets_at,n=Ye(e);if(n!==null)return n}return null}function Ke(e){if(!Je(e))return[];let t=[e];for(let n of["error","detail"]){let r=e[n];Je(r)&&t.push(r)}return t}function Ye(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let t=Date.parse(e);return Number.isFinite(t)?t:null}return null}function Ge(e){for(let t of Ke(e)){let e=t.code;if(typeof e=="string"&&e.length>0)return e}return null}function Je(e){return typeof e=="object"&&e!==null}async function Qe(e){if(e.mode==="anonymous"){let t=await ve(e);return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}return{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}function Xe(e,t){let n=new AbortController,r=t.setTimeout(()=>n.abort(),e);return{signal:n.signal,cancel:()=>t.clearTimeout(r)}}function Ze(e,t){let n=()=>{};if(!t)return{signal:e,dispose:n};let r=new AbortController;if(e.aborted||t.aborted)return r.abort(),{signal:r.signal,dispose:n};let l=()=>r.abort();return e.addEventListener("abort",l,{once:true}),t.addEventListener("abort",l,{once:true}),{signal:r.signal,dispose:()=>{e.removeEventListener("abort",l),t.removeEventListener("abort",l)}}}function et(e,t,n){return e<=0||n?.aborted===true?Promise.resolve():new Promise(r=>{let l=t.setTimeout(()=>{n?.removeEventListener("abort",i),r()},e),i=()=>{t.clearTimeout(l),r()};n?.addEventListener("abort",i,{once:true})})}function tt(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(!(n>=56320&&n<=57343))return true;t+=1}else if(n>=56320&&n<=57343)return true}return false}function nt(e){return[...e].length}var rt=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(rt,t)?rt[t]:null}var lt=50,it=128,at=120,ot=120,st=2e3,dt=120,ut=80,ct=/* @__PURE__ */new Set(["male","female","unknown"]),pt=/* @__PURE__ */new Set(["day","month","year"]),ft=/* @__PURE__ */new Set(["low","medium","high","athletic"]),ht=/* @__PURE__ */new Set(["indoor","outdoor","both"]),mt=/* @__PURE__ */new Set(["mild","moderate","severe"]),gt=/^(\d{4})-(\d{2})-(\d{2})$/,bt=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],yt=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...bt,...yt].map(([e])=>e));function vt(e){let t=gt.exec(e);if(t===null)return false;let[n,r,l]=[Number(t[1]),Number(t[2]),Number(t[3])],i=new Date(Date.UTC(n,r-1,l));return i.getUTCFullYear()===n&&i.getUTCMonth()===r-1&&i.getUTCDate()===l}var kt=e=>(t,n)=>typeof n=="string"&&e.has(n)?null:`${t} must be one of ${[...e].join(", ")}`,wt=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,Tt=(e,t)=>typeof t=="string"&&vt(t)?null:`${e} must be a real date written YYYY-MM-DD`,St=(e,t={})=>(n,r)=>{if(typeof r!="string")return`${n} must be a string`;if(tt(r))return`${n} contains an unpaired surrogate and cannot be encoded`;let l=t.trimmed?r.trim():r;if(t.required&&l.length===0)return`${n} is required and must not be blank`;let i=nt(l);return i<=e?null:`${n} is ${i} characters; the server accepts at most ${e}`},_t={sex:kt(ct),spayedNeutered:wt,birthDate:Tt,birthDatePrecision:kt(pt),activityLevel:kt(ft),indoorOutdoor:kt(ht),foodBrand:St(dt),foodType:St(dt),microchipId:St(ut)},Ct=["ref","ref",false,St(it,{required:true,trimmed:true})],xt=["notes","notes",false,St(st,{trimmed:true})],It=[Ct,["name","name",true,St(at,{required:true,trimmed:true})],["dose","dose",false,St(ot,{trimmed:true})],["frequency","frequency",false,St(ot,{trimmed:true})],["startDate","start_date",false,Tt],["endDate","end_date",false,Tt],xt],Rt={allergies:[Ct,["allergen","allergen",true,St(at,{required:true,trimmed:true})],["severity","severity",false,kt(mt)],xt],medications:It,supplements:It,conditions:[Ct,["conditionName","condition_name",true,St(at,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Tt],xt]};function Et(e,t,n){let r=`${e}[${t}]`;if(typeof n!="object"||n===null||Array.isArray(n))return{error:`${r} must be an object`};let l=n,i={};for(let[t,n,a,o]of Rt[e]){let e=l[t];if(e==null){if(a)return{error:`${r}.${t} is required`};e===null&&(i[n]=null);continue}let s=o(`${r}.${t}`,e);if(s!==null)return{error:s};i[n]=e}let a=i.start_date,o=i.end_date;return typeof a=="string"&&typeof o=="string"&&o<a?{error:`${r}.endDate must not be before startDate`}:{item:i}}function Dt(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>lt)return{error:`${e} has ${t.length} items; the server accepts at most ${lt}`};let n=[],r=/* @__PURE__ */new Set;for(let l=0;l<t.length;l+=1){let i=Et(e,l,t[l]);if("error"in i)return i;let a=i.item.ref;if(typeof a=="string"){let t=a.trim();if(r.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};r.add(t)}n.push(i.item)}return{items:n}}function Pt(e,t){let n=e,r={};for(let[e,t]of bt){let l=n[e];if(l!==void 0){if(l!==null){let t=_t[e](e,l);if(t!==null)return{error:t}}r[t]=l}}let l=n.birthDate!==void 0,i=n.birthDatePrecision!==void 0;if(l!==i||l&&n.birthDate===null!=(n.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of yt){let l=n[e];if(l===void 0)continue;let i=Dt(e,l);if("error"in i)return i;r[t]=i.items}return Object.keys(r).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:r}}var zt=e=>typeof e=="string"?e:null,Ft=(e,t)=>typeof t=="string"&&e.has(t)?t:null,jt=e=>typeof e=="boolean"?e:null;function Ot(e,t){return Array.isArray(e)?/* @__PURE__ */Object.freeze(e.flatMap(e=>{if(typeof e!="object"||e===null||Array.isArray(e))return[];let n=t(e);return n===null?[]:[n]})):/* @__PURE__ */Object.freeze([])}function At(e){let t=zt(e.name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:zt(e.ref),name:t,dose:zt(e.dose),frequency:zt(e.frequency),startDate:zt(e.start_date),endDate:zt(e.end_date),notes:zt(e.notes)})}function Bt(e){let t=e.profile_version;/* @__PURE__ */
11
11
  return Object.freeze({profileVersion:typeof t=="number"&&Number.isInteger(t)&&t>=0?t:0,sex:Ft(ct,e.sex),spayedNeutered:jt(e.spayed_neutered),birthDate:zt(e.birth_date),birthDatePrecision:Ft(pt,e.birth_date_precision),activityLevel:Ft(ft,e.activity_level),indoorOutdoor:Ft(ht,e.indoor_outdoor),foodBrand:zt(e.food_brand),foodType:zt(e.food_type),microchipId:zt(e.microchip_id),allergies:Ot(e.allergies,e=>{let t=zt(e.allergen);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:zt(e.ref),allergen:t,severity:Ft(mt,e.severity),notes:zt(e.notes)})}),medications:Ot(e.medications,At),supplements:Ot(e.supplements,At),conditions:Ot(e.conditions,e=>{let t=zt(e.condition_name);return t===null||t.length===0?null:/* @__PURE__ */Object.freeze({ref:zt(e.ref),conditionName:t,diagnosedDate:zt(e.diagnosed_date),notes:zt(e.notes)})})})}var Lt=100,Nt=50,$t=100,Mt=50,Wt=500,Ht=128,Vt=6e4;function Ut(e){return makeEverfurError("validationFailed",{retryable:false,wireMessage:e})}function qt(e,t,n){if(typeof t!="string")return Ut(`${e} must be a string`);let r=nt(t);return r<=n?null:Ut(`${e} is ${r} characters; the server accepts at most ${n}`)}function Kt(e,t,n){return typeof t=="number"&&Number.isFinite(t)&&t>=0&&t<=n?null:Ut(`${e} must be a finite number between 0 and ${n}`)}function Yt(petRef,e){if(typeof petRef!="string")return Ut("pet_ref must be a string");if(petRef.trim().length===0)return Ut("pet_ref must not be blank");if(tt(petRef))return Ut("pet_ref contains an unpaired surrogate and cannot be encoded");if(e!=null&&typeof e!="object")return Ut("profile must be an object");let t=[qt("pet_ref",petRef,Ht)];return e?.name!==void 0&&t.push(qt("name",e.name,Lt)),e?.species!==void 0&&t.push(qt("species",e.species,Nt)),e?.breed!==void 0&&t.push(qt("breed",e.breed,$t)),e?.ageYears!==void 0&&t.push(Kt("age_years",e.ageYears,Mt)),e?.weightKg!==void 0&&t.push(Kt("weight_kg",e.weightKg,Wt)),t.find(e=>e!==null)??null}function Gt(e,t){let n=Pt(e,t);return"error"in n?{error:Ut(n.error)}:n}function Jt(e){if(typeof e!="object"||e===null)return{error:Ut("patch must be an object")};let t=e,n=[["name","name",e=>qt("name",e,Lt)],["species","species",e=>qt("species",e,Nt)],["breed","breed",e=>qt("breed",e,$t)],["ageYears","age_years",e=>Kt("age_years",e,Mt)],["weightKg","weight_kg",e=>Kt("weight_kg",e,Wt)]],r={};for(let[e,l,i]of n){let n=t[e];if(n!==void 0){if(n!==null){let e=i(n);if(e!==null)return{error:e}}r[l]=n}}let l=Gt(t,t.species);return"error"in l?l:(Object.assign(r,l.body),Object.keys(r).length===0?{error:Ut("patch must change at least one field")}:{body:r})}function Qt(e){if(e==null)return{body:{}};let t=Gt(e,e.species);return"error"in t?t:{body:{...e.name!==void 0?{name:e.name}:{},...e.species!==void 0?{species:e.species}:{},...e.breed!==void 0?{breed:e.breed}:{},...e.ageYears!==void 0?{age_years:e.ageYears}:{},...e.weightKg!==void 0?{weight_kg:e.weightKg}:{},...t.body}}}var Xt=e=>typeof e=="string"?e:null,Zt=e=>typeof e=="number"&&Number.isFinite(e)?e:null;function en(e,petRef){let t=typeof e=="object"&&e!==null?e:{};/* @__PURE__ */
@@ -80,14 +80,14 @@ return p("div",{"data-testid":"televet-booking-not-entitled",style:n.list,childr
80
80
  /* @__PURE__ */p("div",{"data-testid":"televet-booking-state-blocked",children:[
81
81
  /* @__PURE__ */f(TelevetStateCard,{title:Ki.stateBlockedTitle}),
82
82
  /* @__PURE__ */f(TelevetStateInterestAction,{action:l,testIDPrefix:"televet-state-interest-state-blocked"})]}):m==="reason"&&h?/* @__PURE__ */f(TelevetEarlyEmergency,{...t!==void 0?{petName:t}:{},...n?{primaryVet:n}:{},onFindEmergencyVet:r,onContinue:a}):null}function Ra(e){return e.noState?true:e.isPending||e.isError?false:e.isEmpty||e.notEntitled}function TelevetClinicianOutcome({state:e,cause:t,locationStatus:n,onRequestLocation:r,onRetry:l,stateInterest:i=null,renderUnavailable:a}){return e.noState?
83
- /* @__PURE__ */f("div",{"data-testid":"televet-booking-location-unknown",children:/* @__PURE__ */f(TelevetStateCard,{title:n==="blocked"?Ki.locationBlockedTitle:n==="unavailable"?Ki.locationUnavailableTitle:Ki.locationUnknownTitle,message:n==="blocked"?Ki.locationBlockedBody:n==="unavailable"?Ki.locationUnavailableBody:Ki.locationUnknownBody,actionLabel:r&&n!=="blocked"?Ki.locationUnknownCta:void 0,onAction:n==="blocked"?void 0:r})}):e.isEmpty?/* @__PURE__ */f(TelevetClinicianEmptyState,{cause:t,onRetry:l,stateInterest:i}):/* @__PURE__ */f(EntitlementPausedState,{...a?{renderUnavailable:a}:{}})}function Ea(e){return e.trim().replace(/^dr\.?\s+/i,"").slice(0,1).toUpperCase()}function parseColor(e){let t=Da(e);return t===null?null:Ba(t)}function Da(e){if(typeof e=="number")return Fa(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return Pa(t.slice(1));if(t.toLowerCase().startsWith("0x"))return Pa(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return za(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=Pa(t);if(e!==null)return e}return/^\d+$/.test(t)?Fa(Number.parseInt(t,10)):null}function Pa(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:Oa(t[0]),g:Oa(t[1]),b:Oa(t[2]),a:1};if(t.length===6)return{r:ja(t,0),g:ja(t,2),b:ja(t,4),a:1};if(t.length===8){let e=ja(t,0);return{r:ja(t,2),g:ja(t,4),b:ja(t,6),a:e/255}}return null}function za(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let l=Aa(Number(r[0])),i=Aa(Number(r[1])),a=Aa(Number(r[2]));if(l===null||i===null||a===null)return null;let o=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;o=Math.min(1,Math.max(0,e))}return{r:l,g:i,b:a,a:o}}function Fa(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function ja(e,t){return Number.parseInt(e.slice(t,t+2),16)}function Oa(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function Aa(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function Ba(e){if(e.a>=1)return La(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function La(e,t,n){return`#${Na(e)}${Na(t)}${Na(n)}`.toUpperCase()}function Na(e){return e.toString(16).padStart(2,"0")}function $a(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Ma(e,t){let n=Da(e),r=Da(t);if(n===null||r===null)return null;let l=n.a>=1?n:$a(n,{...r});return La(l.r,l.g,l.b)}function Wa(e,t){let n=Da(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Ha=.22,Va=.5,Ua="#FFC3BC";function qa(e){let t=e.color;return{ink:t.brandInk,text:t.text.primary,muted:t.text.muted,line:t.borderRingCream,mist:t.surfaceSubtle,surface:t.surface,pink:t.highlight,onPink:t.onHighlight,go:t.mark,alert:t.danger,alertWash:t.badgeBgCritical}}function Ka(e){let t=e.color,n=parseColor(t.highlight)===Ua,r=Wa(t.highlight,n?Ha:Va);return{...qa(e),pinkSoft:(r===null?null:Ma(r,t.surface))??t.surface}}function televetConsultCalendarKey(e){return`televet-consult-${e}`}function TelevetBookedScreen({consult:n,petName:r,onDone:l,onAddToCalendar:a,canJoinInApp:o=false,lengthMinutes:s,sharedRecords:d=false,sentPhoto:u=false}){let c=useEverfurTheme(),m=ka(),g=e(()=>Ya(c),[c]),b=`${i()}-booked-title`,y=Qi(ea()),[v,k]=t("idle"),w=async()=>{if(!a)return;k("saving");let e=new Date(n.scheduledAt);if(Number.isNaN(e.getTime())){k("failed");return}let t=typeof s=="number"&&Number.isFinite(s)&&s>0?s:Pn,r=await G(a,{key:televetConsultCalendarKey(n.consultId),title:Ki.visit.title,startDate:e,endDate:new Date(e.getTime()+t*6e4),alarmOffsetMinutes:-30});if(!r.ok){k("failed");return}k(r.value===true?"saved":r.value==="handed-off"?"idle":"failed")},T=[Ki.booked.remindPromise,d&&n.clinicianName?hn(u?Ki.booked.recordsPhotoPromiseTemplate:Ki.booked.recordsPromiseTemplate,{pet:r??Ki.petFallback,vet:n.clinicianName}):hn(Ki.booked.summaryPromise,{pet:r??""}),...o?[Ki.booked.joinPromise]:[]];if(!isTelevetBookingCopyReady())/* @__PURE__ */
84
- return f("div",{style:g.screen,"data-testid":"televet-booked-copy-unapproved"});let S=n.clinicianName?.trim()??"";/* @__PURE__ */
83
+ /* @__PURE__ */f("div",{"data-testid":"televet-booking-location-unknown",children:/* @__PURE__ */f(TelevetStateCard,{title:n==="blocked"?Ki.locationBlockedTitle:n==="unavailable"?Ki.locationUnavailableTitle:Ki.locationUnknownTitle,message:n==="blocked"?Ki.locationBlockedBody:n==="unavailable"?Ki.locationUnavailableBody:Ki.locationUnknownBody,actionLabel:r&&n!=="blocked"?Ki.locationUnknownCta:void 0,onAction:n==="blocked"?void 0:r})}):e.isEmpty?/* @__PURE__ */f(TelevetClinicianEmptyState,{cause:t,onRetry:l,stateInterest:i}):/* @__PURE__ */f(EntitlementPausedState,{...a?{renderUnavailable:a}:{}})}function Ea(e){return e.trim().replace(/^dr\.?\s+/i,"").slice(0,1).toUpperCase()}function parseColor(e){let t=Da(e);return t===null?null:Ba(t)}function Da(e){if(typeof e=="number")return Fa(e);if(typeof e!="string")return null;let t=e.trim();if(t.length===0)return null;if(t.startsWith("#"))return Pa(t.slice(1));if(t.toLowerCase().startsWith("0x"))return Pa(t.slice(2));if(t.toLowerCase().startsWith("rgb"))return za(t);if(/^[0-9a-fA-F]+$/.test(t)){let e=Pa(t);if(e!==null)return e}return/^\d+$/.test(t)?Fa(Number.parseInt(t,10)):null}function Pa(e){let t=e.trim();if(!/^[0-9a-fA-F]+$/.test(t))return null;if(t.length===3)return{r:Oa(t[0]),g:Oa(t[1]),b:Oa(t[2]),a:1};if(t.length===6)return{r:ja(t,0),g:ja(t,2),b:ja(t,4),a:1};if(t.length===8){let e=ja(t,0);return{r:ja(t,2),g:ja(t,4),b:ja(t,6),a:e/255}}return null}function za(e){let t=e.indexOf("("),n=e.indexOf(")");if(t<0||n<0||n<t)return null;let r=e.slice(t+1,n).split(",").map(e=>e.trim());if(r.length<3)return null;let l=Aa(Number(r[0])),i=Aa(Number(r[1])),a=Aa(Number(r[2]));if(l===null||i===null||a===null)return null;let o=1;if(r.length>=4){let e=Number(r[3]);if(!Number.isFinite(e))return null;o=Math.min(1,Math.max(0,e))}return{r:l,g:i,b:a,a:o}}function Fa(e){if(!Number.isFinite(e))return null;let t=Math.trunc(e)>>>0,n=t>>>24&255;return{r:t>>>16&255,g:t>>>8&255,b:t&255,a:n===0?1:n/255}}function ja(e,t){return Number.parseInt(e.slice(t,t+2),16)}function Oa(e){return Number.parseInt(`${e??"0"}${e??"0"}`,16)}function Aa(e){return Number.isFinite(e)?Math.min(255,Math.max(0,Math.round(e))):null}function Ba(e){if(e.a>=1)return La(e.r,e.g,e.b);let t=Math.round(e.a*1e3)/1e3;return`rgba(${e.r},${e.g},${e.b},${t})`}function La(e,t,n){return`#${Na(e)}${Na(t)}${Na(n)}`.toUpperCase()}function Na(e){return e.toString(16).padStart(2,"0")}function $a(e,t){let n=e.a,r=(e,t)=>Math.round(e*n+t*(1-n));return{r:r(e.r,t.r),g:r(e.g,t.g),b:r(e.b,t.b),a:1}}function Ma(e,t){let n=Da(e),r=Da(t);if(n===null||r===null)return null;let l=n.a>=1?n:$a(n,{...r});return La(l.r,l.g,l.b)}function Wa(e,t){let n=Da(e);if(n===null)return null;let r=Math.min(1,Math.max(0,t));return`rgba(${n.r}, ${n.g}, ${n.b}, ${r})`}var Ha=.22,Va=.5,Ua="#FFC3BC";function qa(e){let t=e.color;return{ink:t.brandInk,text:t.text.primary,muted:t.text.muted,line:t.borderRingCream,mist:t.surfaceSubtle,surface:t.surface,pink:t.highlight,onPink:t.onHighlight,go:t.mark,alert:t.danger,alertWash:t.badgeBgCritical}}function Ka(e){let t=e.color,n=parseColor(t.highlight)===Ua,r=Wa(t.highlight,n?Ha:Va);return{...qa(e),pinkSoft:(r===null?null:Ma(r,t.surface))??t.surface}}function televetConsultCalendarKey(e){return`televet-consult-${e}`}function TelevetBookedScreen({consult:n,petName:r,onDone:l,onAddToCalendar:a,canJoinInApp:o=false,lengthMinutes:s,sharedRecords:d=false,sentPhoto:u=false}){let c=useEverfurTheme(),m=ka(),g=e(()=>Ya(c),[c]),b=`${i()}-booked-title`,y=Qi(ea()),[v,k]=t("idle"),w=async()=>{if(!a)return;k("saving");let e=new Date(n.scheduledAt);if(Number.isNaN(e.getTime())){k("failed");return}let t=typeof s=="number"&&Number.isFinite(s)&&s>0?s:Pn,r=await G(a,{key:televetConsultCalendarKey(n.consultId),title:Ki.visit.title,startDate:e,endDate:new Date(e.getTime()+t*6e4),alarmOffsetMinutes:-30});if(!r.ok){k("failed");return}k(r.value===true?"saved":r.value==="handed-off"?"idle":"failed")},T=r?.trim()||Ki.petFallback.charAt(0).toUpperCase()+Ki.petFallback.slice(1),S=[Ki.booked.remindPromise,d&&n.clinicianName?hn(u?Ki.booked.recordsPhotoPromiseTemplate:Ki.booked.recordsPromiseTemplate,{pet:T,vet:n.clinicianName}):hn(Ki.booked.summaryPromise,{pet:T}),...o?[Ki.booked.joinPromise]:[]];if(!isTelevetBookingCopyReady())/* @__PURE__ */
84
+ return f("div",{style:g.screen,"data-testid":"televet-booked-copy-unapproved"});let _=n.clinicianName?.trim()??"";/* @__PURE__ */
85
85
  return p("section",{style:g.screen,"aria-labelledby":b,"data-testid":"televet-booked",children:[
86
- /* @__PURE__ */f("div",{"aria-hidden":"true",style:g.avatar,children:S.length>0?Ea(S):null}),
87
- /* @__PURE__ */f(y,{id:b,style:g.title,children:S.length>0?hn(Ki.bookedTitleTemplate,{vet:S}):Ki.bookedTitle}),
86
+ /* @__PURE__ */f("div",{"aria-hidden":"true",style:g.avatar,children:_.length>0?Ea(_):null}),
87
+ /* @__PURE__ */f(y,{id:b,style:g.title,children:_.length>0?hn(Ki.bookedTitleTemplate,{vet:_}):Ki.bookedTitle}),
88
88
  /* @__PURE__ */f("p",{style:g.when,children:r?/* @__PURE__ */p(h,{children:[
89
89
  /* @__PURE__ */f("time",{dateTime:n.scheduledAt,children:Nn(n.scheduledAt)}),hn(Ki.bookedLeadTemplate,{when:"",pet:r})]}):/* @__PURE__ */f("time",{dateTime:n.scheduledAt,children:Nn(n.scheduledAt)})}),
90
- /* @__PURE__ */f("section",{"aria-label":Ki.booked.stepsLabel,style:g.card,children:/* @__PURE__ */f("ol",{style:g.steps,"data-testid":"televet-booked-steps",children:T.map((e,t)=>/* @__PURE__ */p("li",{style:{...g.step,...t===T.length-1?g.stepLast:null},children:[
90
+ /* @__PURE__ */f("section",{"aria-label":Ki.booked.stepsLabel,style:g.card,children:/* @__PURE__ */f("ol",{style:g.steps,"data-testid":"televet-booked-steps",children:S.map((e,t)=>/* @__PURE__ */p("li",{style:{...g.step,...t===S.length-1?g.stepLast:null},children:[
91
91
  /* @__PURE__ */f("span",{"aria-hidden":"true",style:g.stepNumber,children:String(t+1).padStart(2,"0")}),
92
92
  /* @__PURE__ */f("span",{style:g.stepText,children:e.trim()})]},e))})}),
93
93
  /* @__PURE__ */p("div",{style:g.actions,children:[a?/* @__PURE__ */f(TelevetButton,{label:v==="saved"?Ki.booked.calendarAdded:Ki.addToCalendarCta,kind:"secondary",size:"lg",fullWidth:false,loading:v==="saving",disabled:v==="saving"||v==="saved",onPress:()=>{w()},testID:"televet-booked-calendar"}):null,
@@ -24,4 +24,4 @@ return t.jsxs("section",{className:s,"data-testid":"everfur-vet-call-lobby",styl
24
24
  /* @__PURE__ */t.jsx("p",{style:d.prepLabel,children:p.lobbyTipsTitle(a)}),
25
25
  /* @__PURE__ */t.jsx("ol",{style:d.tips,children:[p.lobbyTipSpot,g].map((e,r)=>/* @__PURE__ */t.jsxs("li",{style:d.tip,children:[
26
26
  /* @__PURE__ */t.jsx("span",{"aria-hidden":"true",style:d.tipNumber,children:String(r+1).padStart(2,"0")}),
27
- /* @__PURE__ */t.jsx("span",{style:d.prepBody,children:e})]},e))})]}),c===null?null:/* @__PURE__ */t.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:d.duration,children:p.lobbyDuration(c)})]})}function De(e){let{space:t,radius:r,type:a}=e,n=Re(e),l=112;return{root:{...te,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line,backgroundColor:n.surface,color:n.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Te,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:n.line,background:n.surface,color:n.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:a.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:n.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:n.mist,boxShadow:`0 0 0 4px ${n.surface}, 0 0 0 6px ${n.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:n.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:n.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:K(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:n.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:n.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${n.line}`},tipNumber:{...faceCss(e,"monoBold"),color:n.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:a.size.body,lineHeight:1.5,color:n.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:a.size.bodyTight,color:n.muted}}}var Ne="1.4.1";var Ue=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ie(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Me=Ie(Ne,Ue);var Pe=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Me}`),Ve=globalThis;function We(t,r){let a=Ve[Pe];return a===void 0?e.createElement(t.bundled,r):a(t,r)}var _e={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},Ye={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return We(_e,e)}function EverfurVetCallLobby2(e){return We(Ye,e)}exports.EVERFUR_DAILY_SETUP=re;exports.EverfurVetCall=EverfurVetCall2;exports.EverfurVetCallLobby=EverfurVetCallLobby2;exports.VET_CALL_CONSULT_MINUTES=b;exports.VET_CALL_COPY=p;exports.isEverfurDailyModule=isEverfurDailyModule;exports.isSafeRoomUrl=isSafeRoomUrl;exports.isUsableRoomCredential=isUsableRoomCredential;exports.loadEverfurDaily=loadEverfurDaily;exports.registerEverfurDaily=registerEverfurDaily;
27
+ /* @__PURE__ */t.jsx("span",{style:d.prepBody,children:e})]},e))})]}),c===null?null:/* @__PURE__ */t.jsx("p",{"data-testid":"everfur-vet-call-lobby-duration",style:d.duration,children:p.lobbyDuration(c)})]})}function De(e){let{space:t,radius:r,type:a}=e,n=Re(e),l=112;return{root:{...te,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line,backgroundColor:n.surface,color:n.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Te,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:n.line,background:n.surface,color:n.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:a.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:n.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:n.mist,boxShadow:`0 0 0 4px ${n.surface}, 0 0 0 6px ${n.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:n.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:n.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:K(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:n.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:n.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:n.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${n.line}`},tipNumber:{...faceCss(e,"monoBold"),color:n.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:a.size.body,lineHeight:1.5,color:n.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:a.size.bodyTight,color:n.muted}}}var Ne="1.5.0";var Ue=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ie(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Me=Ie(Ne,Ue);var Pe=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Me}`),Ve=globalThis;function We(t,r){let a=Ve[Pe];return a===void 0?e.createElement(t.bundled,r):a(t,r)}var _e={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},Ye={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return We(_e,e)}function EverfurVetCallLobby2(e){return We(Ye,e)}exports.EVERFUR_DAILY_SETUP=re;exports.EverfurVetCall=EverfurVetCall2;exports.EverfurVetCallLobby=EverfurVetCallLobby2;exports.VET_CALL_CONSULT_MINUTES=b;exports.VET_CALL_COPY=p;exports.isEverfurDailyModule=isEverfurDailyModule;exports.isSafeRoomUrl=isSafeRoomUrl;exports.isUsableRoomCredential=isUsableRoomCredential;exports.loadEverfurDaily=loadEverfurDaily;exports.registerEverfurDaily=registerEverfurDaily;
@@ -1,8 +1,8 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import { T as TelemetryPort } from '../../../TelemetryPort.d-BDNr00hu.cjs';
4
- export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom.d-B1DoYdJe.cjs';
5
- export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy.d-Bw6oZT54.cjs';
4
+ export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom.d-9Dm7XnUr.cjs';
5
+ export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy.d-BQxpwXqT.cjs';
6
6
  import '../../../EverfurError.d-8NHtlgzA.cjs';
7
7
 
8
8
  /** The Daily events the call surface subscribes to. */
@@ -1,8 +1,8 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
2
  import { ReactNode, CSSProperties } from 'react';
3
3
  import { T as TelemetryPort } from '../../../TelemetryPort.d-BDNr00hu.js';
4
- export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom.d-Dqm1rUqT.js';
5
- export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy.d-Bw6oZT54.js';
4
+ export { V as VetCallPhase, i as isSafeRoomUrl, a as isUsableRoomCredential } from '../../../callRoom.d-t-khijDv.js';
5
+ export { V as VET_CALL_CONSULT_MINUTES, a as VET_CALL_COPY } from '../../../callCopy.d-BQxpwXqT.js';
6
6
  import '../../../EverfurError.d-8NHtlgzA.js';
7
7
 
8
8
  /** The Daily events the call surface subscribes to. */
@@ -24,4 +24,4 @@ return s("section",{className:o,"data-testid":"everfur-vet-call-lobby",style:{..
24
24
  /* @__PURE__ */c("p",{style:f.prepLabel,children:k.lobbyTipsTitle(r)}),
25
25
  /* @__PURE__ */c("ol",{style:f.tips,children:[k.lobbyTipSpot,b].map((e,t)=>/* @__PURE__ */s("li",{style:f.tip,children:[
26
26
  /* @__PURE__ */c("span",{"aria-hidden":"true",style:f.tipNumber,children:String(t+1).padStart(2,"0")}),
27
- /* @__PURE__ */c("span",{style:f.prepBody,children:e})]},e))})]}),d===null?null:/* @__PURE__ */c("p",{"data-testid":"everfur-vet-call-lobby-duration",style:f.duration,children:k.lobbyDuration(d)})]})}function Ye(e){let{space:t,radius:r,type:n}=e,a=Ue(e),l=112;return{root:{...se,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line,backgroundColor:a.surface,color:a.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Ie,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:a.line,background:a.surface,color:a.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:n.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:a.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:a.mist,boxShadow:`0 0 0 4px ${a.surface}, 0 0 0 6px ${a.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:a.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:a.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:ae(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:a.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:a.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${a.line}`},tipNumber:{...faceCss(e,"monoBold"),color:a.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:n.size.body,lineHeight:1.5,color:a.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:n.size.bodyTight,color:a.muted}}}var qe="1.4.1";var _e=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ke(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Xe=Ke(qe,_e);var Ze=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Xe}`),Je=globalThis;function Qe(t,r){let n=Je[Ze];return n===void 0?e(t.bundled,r):n(t,r)}var et={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},tt={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return Qe(et,e)}function EverfurVetCallLobby2(e){return Qe(tt,e)}export{ue as EVERFUR_DAILY_SETUP,EverfurVetCall2 as EverfurVetCall,EverfurVetCallLobby2 as EverfurVetCallLobby,x as VET_CALL_CONSULT_MINUTES,k as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
27
+ /* @__PURE__ */c("span",{style:f.prepBody,children:e})]},e))})]}),d===null?null:/* @__PURE__ */c("p",{"data-testid":"everfur-vet-call-lobby-duration",style:f.duration,children:k.lobbyDuration(d)})]})}function Ye(e){let{space:t,radius:r,type:n}=e,a=Ue(e),l=112;return{root:{...se,boxSizing:"border-box",display:"flex",flexDirection:"column",gap:t.lg,padding:t.xl,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line,backgroundColor:a.surface,color:a.text},topRow:{display:"flex",alignItems:"center",gap:14},leave:{minHeight:Ie,padding:`0 ${t.lg}px`,margin:0,borderRadius:r.pill,borderStyle:"solid",borderWidth:1.5,borderColor:a.line,background:a.surface,color:a.ink,cursor:"pointer",...faceCss(e,"bold"),fontSize:n.size.bodyTight},label:{margin:0,...faceCss(e,"monoBold"),color:a.muted,fontSize:12,letterSpacing:"0.08em",textTransform:"uppercase"},center:{display:"flex",flexDirection:"column",alignItems:"center",gap:t.md},avatar:{position:"relative",width:l,height:l,borderRadius:r.pill,overflow:"hidden",backgroundColor:a.mist,boxShadow:`0 0 0 4px ${a.surface}, 0 0 0 6px ${a.go}`,display:"flex",alignItems:"center",justifyContent:"center"},avatarHead:{position:"absolute",top:l*.24,width:l*.28,height:l*.28,borderRadius:r.pill,backgroundColor:a.ink,opacity:.35},avatarBody:{position:"absolute",top:l*.58,width:l*.52,height:l*.34,borderTopLeftRadius:l*.26,borderTopRightRadius:l*.26,backgroundColor:a.ink,opacity:.35},titleBlock:{textAlign:"center"},title:{margin:0,...faceCss(e,"medium"),fontSize:ae(e,"heading",28),lineHeight:1.15,letterSpacing:"-0.02em",color:a.ink},prepCard:{display:"flex",flexDirection:"column",gap:t.sm,padding:t.lg,borderRadius:r.lg,borderStyle:"solid",borderWidth:1,borderColor:a.line},prepLabel:{margin:0,...faceCss(e,"bold"),fontSize:19,color:a.ink},tips:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"},tip:{display:"grid",gridTemplateColumns:"44px 1fr",gap:10,paddingTop:12,paddingBottom:12,borderTop:`1px solid ${a.line}`},tipNumber:{...faceCss(e,"monoBold"),color:a.ink,fontSize:13,paddingTop:2},prepBody:{margin:0,...faceCss(e,"regular"),fontSize:n.size.body,lineHeight:1.5,color:a.text},duration:{margin:0,textAlign:"center",...faceCss(e,"regular"),fontSize:n.size.bodyTight,color:a.muted}}}var qe="1.5.0";var _e=/* @__PURE__ */Object.freeze({k1:"X4wc1hwVONs4I9Vmclo9ExrfPZlH8-tgY7NmzxuA5lI"});function Ke(e,t){let r=Object.keys(t).sort().map(e=>`${e}=${t[e]}`).join(",");return`v${1}|${e}|${r}`}var Xe=Ke(qe,_e);var Ze=/* @__PURE__ */Symbol.for(`@everfur/sdk#WebRuntimeRenderer@${Xe}`),Je=globalThis;function Qe(t,r){let n=Je[Ze];return n===void 0?e(t.bundled,r):n(t,r)}var et={part:"televet-call",name:"EverfurVetCall",bundled:EverfurVetCall},tt={part:"televet-call",name:"EverfurVetCallLobby",bundled:EverfurVetCallLobby};function EverfurVetCall2(e){return Qe(et,e)}function EverfurVetCallLobby2(e){return Qe(tt,e)}export{ue as EVERFUR_DAILY_SETUP,EverfurVetCall2 as EverfurVetCall,EverfurVetCallLobby2 as EverfurVetCallLobby,x as VET_CALL_CONSULT_MINUTES,k as VET_CALL_COPY,isEverfurDailyModule,isSafeRoomUrl,isUsableRoomCredential,loadEverfurDaily,registerEverfurDaily};
@@ -3,14 +3,14 @@ import { ReactNode, CSSProperties } from 'react';
3
3
  import { a as CapabilityDecision } from '../../resolve.d-BTC3b6FW.cjs';
4
4
  import { E as EverfurError } from '../../EverfurError.d-8NHtlgzA.cjs';
5
5
  export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
6
- import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-DbGx1A9R.cjs';
7
- export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-DbGx1A9R.cjs';
8
- export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-DIH9h3Le.cjs';
9
- 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 FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../../config.d-BiVy0fLx.cjs';
6
+ import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../../optInView.d-ByDJMrMv.cjs';
7
+ export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../../optInView.d-ByDJMrMv.cjs';
8
+ export { a as AnonIdentityProvider, A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-DDpXOtas.cjs';
9
+ 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 FreeCapRefusal, H as HeartbeatFrame, i as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, j as UrgencyLevel } from '../../config.d-ClAI2RZ6.cjs';
10
10
  export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
11
11
  export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
12
- export { E as ErrorPolicyPort } from '../../ErrorPolicyPort.d-DirW9hgO.cjs';
13
- import '../../requestFunnel.d-SySe6xHp.cjs';
12
+ export { E as ErrorPolicyPort, a as EverfurErrorContext } from '../../ErrorPolicyPort.d-BIdmYQnk.cjs';
13
+ import '../../requestFunnel.d-BwZDfWVD.cjs';
14
14
 
15
15
  interface EverfurTextingOptInProps {
16
16
  /** Called when the member's step changes (for example to `verified` or `optedOut`). A throw is swallowed. */