@everfur/sdk 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/{Chat.d-D9n8tSDD.d.cts → Chat.d-Bl-_TsvQ.d.cts} +1 -1
  2. package/dist/{Chat.d-BXuEjJsg.d.ts → Chat.d-qQVN6VLp.d.ts} +1 -1
  3. package/dist/animations/index.cjs +1 -1
  4. package/dist/animations/index.js +1 -1
  5. package/dist/{attachments.d-Bsg6duaq.d.cts → attachments.d-DBlHzWYy.d.cts} +1 -1
  6. package/dist/{attachments.d-DjWUR-h9.d.ts → attachments.d-DOmkQ_8O.d.ts} +1 -1
  7. package/dist/{branding.d-Bzs4HJoN.d.cts → branding.d-CqDLKj1U.d.cts} +1 -1
  8. package/dist/{branding.d-CiC6xfGT.d.ts → branding.d-XrZYClN4.d.ts} +1 -1
  9. package/dist/chat/index.cjs +194 -194
  10. package/dist/chat/index.d.cts +7 -7
  11. package/dist/chat/index.d.ts +7 -7
  12. package/dist/chat/index.js +202 -202
  13. package/dist/chat/lite/index.cjs +205 -205
  14. package/dist/chat/lite/index.d.cts +7 -7
  15. package/dist/chat/lite/index.d.ts +7 -7
  16. package/dist/chat/lite/index.js +205 -205
  17. package/dist/{chatHandoffToken.d-sbumx0He.d.cts → chatHandoffToken.d-B4-iQ35P.d.cts} +3 -3
  18. package/dist/{chatHandoffToken.d-YJY6TZbj.d.ts → chatHandoffToken.d-Br3Gw3w-.d.ts} +3 -3
  19. package/dist/{checkin.d-DxpoRutq.d.cts → checkin.d-CAKQydg8.d.cts} +14 -2
  20. package/dist/{checkin.d-C6vh9KVr.d.ts → checkin.d-qvYXugN3.d.ts} +14 -2
  21. package/dist/{chunk-AJEELSFO.js → chunk-5OK2AF63.js} +14 -14
  22. package/dist/{chunk-II4QDD6F.js → chunk-6I4REU4U.js} +1 -1
  23. package/dist/{chunk-ZPIOCHKW.js → chunk-7MMJ7CYN.js} +1 -1
  24. package/dist/{chunk-FZ6DAQFH.js → chunk-PJHMKQ5C.js} +19 -19
  25. package/dist/client/index.cjs +2 -2
  26. package/dist/client/index.d.cts +7 -7
  27. package/dist/client/index.d.ts +7 -7
  28. package/dist/client/index.js +2 -2
  29. package/dist/consent/index.cjs +1 -1
  30. package/dist/consent/index.js +2 -2
  31. package/dist/{context.d-Cq2C4vdh.d.cts → context.d-DZfxKxNi.d.cts} +3 -3
  32. package/dist/{context.d-D1l56nFr.d.ts → context.d-FjU7dQP7.d.ts} +3 -3
  33. package/dist/core/index.cjs +21 -21
  34. package/dist/core/index.d.cts +10 -10
  35. package/dist/core/index.d.ts +10 -10
  36. package/dist/core/index.js +21 -21
  37. package/dist/{entitlementRepository.d-x2YFdgYD.d.ts → entitlementRepository.d-BltqS1W8.d.ts} +1 -1
  38. package/dist/{entitlementRepository.d-CEDU1gZE.d.cts → entitlementRepository.d-wfqpUIKN.d.cts} +1 -1
  39. package/dist/health-plan/index.cjs +1 -1
  40. package/dist/health-plan/index.d.cts +4 -4
  41. package/dist/health-plan/index.d.ts +4 -4
  42. package/dist/health-plan/index.js +1 -1
  43. package/dist/index.cjs +221 -221
  44. package/dist/index.d.cts +13 -13
  45. package/dist/index.d.ts +13 -13
  46. package/dist/index.js +221 -221
  47. package/dist/notifications/inbox/index.cjs +9 -9
  48. package/dist/notifications/inbox/index.js +9 -9
  49. package/dist/notifications/index.cjs +3 -3
  50. package/dist/notifications/index.d.cts +3 -3
  51. package/dist/notifications/index.d.ts +3 -3
  52. package/dist/notifications/index.js +6 -6
  53. package/dist/photo/index.cjs +1 -1
  54. package/dist/photo/index.js +23 -23
  55. package/dist/{presentation.d-CWGjwq8Z.d.cts → presentation.d-BkIvMtIl.d.cts} +3 -3
  56. package/dist/{presentation.d-CWGjwq8Z.d.ts → presentation.d-BkIvMtIl.d.ts} +3 -3
  57. package/dist/records/depth/index.cjs +1 -1
  58. package/dist/records/depth/index.js +1 -1
  59. package/dist/records/index.cjs +2 -2
  60. package/dist/records/index.d.cts +2 -2
  61. package/dist/records/index.d.ts +2 -2
  62. package/dist/records/index.js +71 -71
  63. package/dist/{route.d-IP_gkOWL.d.ts → route.d-B395-hNX.d.ts} +1 -1
  64. package/dist/{route.d-9wclfD-y.d.cts → route.d-DSSSpSB-.d.cts} +1 -1
  65. package/dist/{runtimeTypes.d-BdUe3tYs.d.ts → runtimeTypes.d-DAz0Tgw5.d.ts} +5 -5
  66. package/dist/{runtimeTypes.d-_UZ6rMUY.d.cts → runtimeTypes.d-DPh1Wh15.d.cts} +5 -5
  67. package/dist/server/events/index.cjs +3 -3
  68. package/dist/server/events/index.js +3 -3
  69. package/dist/server/index.cjs +8 -8
  70. package/dist/server/index.d.cts +15 -1
  71. package/dist/server/index.d.ts +15 -1
  72. package/dist/server/index.js +8 -8
  73. package/dist/slots/index.cjs +1 -1
  74. package/dist/slots/index.js +1 -1
  75. package/dist/tabs/index.cjs +2 -2
  76. package/dist/tabs/index.js +24 -24
  77. package/dist/televet/booking/index.cjs +51 -51
  78. package/dist/televet/booking/index.js +1 -1
  79. package/dist/televet/index.cjs +1 -1
  80. package/dist/televet/index.js +1 -1
  81. package/dist/testing/index.cjs +1 -1
  82. package/dist/testing/index.js +1 -1
  83. package/dist/testing/rn/index.cjs +8 -8
  84. package/dist/testing/rn/index.d.cts +5 -5
  85. package/dist/testing/rn/index.d.ts +5 -5
  86. package/dist/testing/rn/index.js +9 -9
  87. package/dist/testing/web/index.cjs +3 -3
  88. package/dist/testing/web/index.d.cts +5 -5
  89. package/dist/testing/web/index.d.ts +5 -5
  90. package/dist/testing/web/index.js +1 -1
  91. package/dist/texting/index.cjs +1 -1
  92. package/dist/texting/index.js +26 -26
  93. package/dist/{threadOptions.d-BW0rePcs.d.cts → threadOptions.d-DUQxxHyM.d.cts} +3 -3
  94. package/dist/{threadOptions.d-CrAb71J2.d.ts → threadOptions.d-DnM9UcMx.d.ts} +3 -3
  95. package/dist/{typeStyle.d-rzVzCfLz.d.ts → typeStyle.d-8mcLhtbH.d.ts} +1 -1
  96. package/dist/{typeStyle.d-B-YgiWcS.d.cts → typeStyle.d-CLrQZW-r.d.cts} +1 -1
  97. package/dist/{unreadStore.d-gCsleb6l.d.ts → unreadStore.d-CLnChKca.d.ts} +17 -9
  98. package/dist/{unreadStore.d-w5x6lEpR.d.cts → unreadStore.d-Donv4bcF.d.cts} +17 -9
  99. package/dist/{usePresentation.d-w5_oWKmh.d.ts → usePresentation.d-Buxz2Jkt.d.ts} +1 -1
  100. package/dist/{usePresentation.d-DefUwatV.d.cts → usePresentation.d-DUYzYXgA.d.cts} +1 -1
  101. package/dist/{useUnread.d-DeRDFtTb.d.cts → useUnread.d-7-cuCooM.d.cts} +3 -3
  102. package/dist/{useUnread.d-xDOpYyqx.d.ts → useUnread.d-B6Ehu0ao.d.ts} +3 -3
  103. package/dist/video/index.cjs +1 -1
  104. package/dist/video/index.js +1 -1
  105. package/dist/web/consent/index.cjs +3 -3
  106. package/dist/web/consent/index.js +5 -5
  107. package/dist/web/health-plan/index.cjs +2 -2
  108. package/dist/web/health-plan/index.d.cts +5 -5
  109. package/dist/web/health-plan/index.d.ts +5 -5
  110. package/dist/web/health-plan/index.js +1 -1
  111. package/dist/web/inbox/index.cjs +5 -5
  112. package/dist/web/inbox/index.js +5 -5
  113. package/dist/web/index.cjs +176 -176
  114. package/dist/web/index.d.cts +18 -18
  115. package/dist/web/index.d.ts +18 -18
  116. package/dist/web/index.js +181 -181
  117. package/dist/web/intro/index.cjs +10 -10
  118. package/dist/web/intro/index.js +6 -6
  119. package/dist/web/notifications/index.cjs +5 -5
  120. package/dist/web/notifications/index.d.cts +2 -2
  121. package/dist/web/notifications/index.d.ts +2 -2
  122. package/dist/web/notifications/index.js +1 -1
  123. package/dist/web/records/depth/index.cjs +1 -1
  124. package/dist/web/records/depth/index.js +1 -1
  125. package/dist/web/records/index.cjs +1 -1
  126. package/dist/web/records/index.js +1 -1
  127. package/dist/web/records-sheet/index.cjs +2 -2
  128. package/dist/web/records-sheet/index.js +2 -2
  129. package/dist/web/shop/index.cjs +1 -1
  130. package/dist/web/shop/index.js +15 -15
  131. package/dist/web/televet/booking/index.cjs +2 -2
  132. package/dist/web/televet/booking/index.js +64 -64
  133. package/dist/web/televet/call/index.cjs +1 -1
  134. package/dist/web/televet/call/index.js +1 -1
  135. package/dist/web/televet/index.cjs +6 -6
  136. package/dist/web/televet/index.js +1 -1
  137. package/dist/web/texting/index.cjs +1 -1
  138. package/dist/web/texting/index.js +1 -1
  139. package/dist/web/ui/index.cjs +1 -1
  140. package/dist/web/ui/index.js +33 -33
  141. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
- "use strict";var e=require("zod");var t=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],r=/* @__PURE__ */Object.freeze(t.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(r.map(e=>e.wireCode));var n=/* @__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"}),o=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:n[e.wireCode]}))),a=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...l]){let t=a.get(e+r);if(t)return t}}function contractDocUrl(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}var i=null;function publishedDocUrl(e){return null}var s=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),u=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),c=/* @__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 c[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var d=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return d.has(e)}var f=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||f.has(e)}function shouldRetry(e,t=false){return t||isAutoRetryable(e)}var p=500,h=8e3,b=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(p*2**r,h);return Math.floor(t()*n)}function canRecreateOnNotFound(e){return e==="conversationNotFound"}var g="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:g,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:m,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:g,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),_="This session has ended. Please sign in again.",v="linked_account_read_only";function isLinkedAccountReadOnly(e){return e!=null&&e.code==="conflict"&&e.reasonCode===v}function k(e,t,r){return e==="conflict"&&r===v?g:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?_:userFacingError(e)}function userFacingError(e){return y[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var w=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===v,o={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:k(e,t?.wireCode,n?v:null)};t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&w.test(t.reasonCode)&&(o.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(o.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&x(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(o,"raw",t.raw),/* @__PURE__ */Object.freeze(o)}function ok(e,t){/* @__PURE__ */
2
+ "use strict";var e=require("zod");var t=[{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}],r=/* @__PURE__ */Object.freeze(t.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(r.map(e=>e.wireCode));var n=/* @__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"}),o=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:n[e.wireCode]}))),a=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...l]){let t=a.get(e+r);if(t)return t}}function contractDocUrl(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}var i=null;function publishedDocUrl(e){return null}var s=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),u=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),c=/* @__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 c[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var d=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return d.has(e)}var f=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||f.has(e)}function shouldRetry(e,t=false){return t||isAutoRetryable(e)}var p=500,h=8e3,b=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(p*2**r,h);return Math.floor(t()*n)}function canRecreateOnNotFound(e){return e==="conversationNotFound"}var g="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:g,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:m,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:g,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),_="This session has ended. Please sign in again.",v="linked_account_read_only";function isLinkedAccountReadOnly(e){return e!=null&&e.code==="conflict"&&e.reasonCode===v}function k(e,t,r){return e==="conflict"&&r===v?g:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?_:userFacingError(e)}function userFacingError(e){return y[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var w=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===v,o={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:k(e,t?.wireCode,n?v:null)};t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&w.test(t.reasonCode)&&(o.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(o.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&x(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(o,"raw",t.raw),/* @__PURE__ */Object.freeze(o)}function ok(e,t){/* @__PURE__ */
3
3
  return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}function err(e){/* @__PURE__ */
4
- return Object.freeze({ok:false,error:e})}function isOk(e){return e.ok}function isErr(e){return!e.ok}var C=class _EverfurThrownError extends Error{constructor(e){super(`${e.code}: ${e.displayMessage}`),this.name="EverfurThrownError",this.error=e,this.code=e.code,this.category=e.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(e){if(e.ok)return e.value;throw new C(e.error)}var E=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var S=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var F="1.4.0";var O="react-native",A="2026-09-19",R="EVERFUR_API_BASE_URL";function T(e,t){/* @__PURE__ */
4
+ return Object.freeze({ok:false,error:e})}function isOk(e){return e.ok}function isErr(e){return!e.ok}var C=class _EverfurThrownError extends Error{constructor(e){super(`${e.code}: ${e.displayMessage}`),this.name="EverfurThrownError",this.error=e,this.code=e.code,this.category=e.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(e){if(e.ok)return e.value;throw new C(e.error)}var E=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var S=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var F="1.4.1";var O="react-native",A="2026-09-19",R="EVERFUR_API_BASE_URL";function T(e,t){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:e,message:t})})}function checkPublishableKey(e){let t=typeof e=="string"?e.trim():"";return t.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(t)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(e,t){let r=checkPublishableKey(e?.publishableKey);if(r!==null)/* @__PURE__ */
6
6
  return Object.freeze({ok:false,failure:r});let n=e.publishableKey.trim(),o=tryResolveApiBaseUrl(e.apiBaseUrl);if(!o.ok)return o;let a=e.contractVersion?.trim()||A;/* @__PURE__ */
7
7
  return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:n,apiBaseUrl:o.value,contractVersion:a,sdkVersion:F,platform:t?.platform??O,debug:e.debug===true})})}function resolveClientConfig(e,t){let r=tryResolveClientConfig(e,t);if(!r.ok)throw new E("invalid-argument",r.failure.message);return r.config}function tryResolveApiBaseUrl(e){let t=e?.trim(),r=t&&t.length>0?t:M(R);return r?B(r):T("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${R}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(e){let t=tryResolveApiBaseUrl(e);if(!t.ok)throw new E("invalid-argument",t.failure.message);return t.value}function buildBaseHeaders(e){return{"X-Everfur-SDK-Version":e.sdkVersion,"X-Everfur-SDK-Platform":e.platform,"X-Everfur-Contract":e.contractVersion}}function I(e){return e.slice(e.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function j(e){return e.length===0||e.includes("@")?false:e.startsWith("[")&&e.endsWith("]")?true:!e.includes(":")}function z(e,t){let r=e.indexOf("://");return r<0||e.slice(r+3).includes("@")?false:j(t)}function N(e,t){return`${e}://${t}`}function B(e){let t=e.trim(),r=S.exec(t);if(r===null||r[2]===void 0||r[2].length===0)return T("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let n=(r[1]??"").toLowerCase(),o=I(r[2]);if(o.length===0)return T("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let a=z(t,o)?`: ${N(n,o)}`:"";if(n!=="https"){if(!(n==="http"&&D(o)))return n==="http"?T("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${a}`):T("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${a}`)}let l=t.endsWith("/")?t.slice(0,-1):t;/* @__PURE__ */
@@ -7,13 +7,13 @@ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFra
7
7
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids.d-B2GAAifq.cjs';
8
8
  export { a as AnonIdentityProvider, A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, b as authHeaders, c as authedSend, d as createAnonIdentityProvider, e as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-DIH9h3Le.cjs';
9
9
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve.d-BTC3b6FW.cjs';
10
- export { a as ENTITLEMENTS_PATH, E as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-CEDU1gZE.cjs';
10
+ export { a as ENTITLEMENTS_PATH, E as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-wfqpUIKN.cjs';
11
11
  import { n as EverfurTheme, c as EverfurFontSource, s as EverfurThemeSlots } from '../tokens.d-DDiPRgye.cjs';
12
12
  export { F as DEFAULT_MAX_FONT_SCALE, G as EASING_CURVES, H as EVERFUR_DARK, I as EVERFUR_LIGHT, E as EverfurColorTokens, J as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, m as EverfurTextScaleTier, o as EverfurThemeMeta, p as EverfurThemeSlot, q as EverfurThemeSlotKey, r as EverfurThemeSlotName, t as EverfurTypeRole, u as EverfurTypeRoleFace, v as EverfurTypeRoleStyle, w as EverfurTypeSizeTokens, x as EverfurTypeTokens, y as EverfurWeightTokens, P as PHONE_TEXT_SCALE_CAPS, S as SLOT_MIN_BORDER_CONTRAST, K as SLOT_MIN_CONTRAST, L as SYSTEM_FONT_FAMILY, M as SYSTEM_MONO_FAMILY, N as SlotGrounds, O as SlotSurrounds, Q as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, z as THEME_SLOT_KEYS_BY_SLOT, A as THEME_SLOT_NAMES, B as TYPE_ROLE_DEFAULTS, C as TYPE_ROLE_NAMES, R as cssCubicBezier, U as deepFreeze, V as guardSlotContrast, W as mergeThemeSlots, X as parseThemeSlots, D as themeSlotKeysFor } from '../tokens.d-DDiPRgye.cjs';
13
- export { E as EverfurFaceStyle, a as EverfurRoleTextStyle, b as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as textRole, c as themeAdjustments, w as withServerBranding } from '../typeStyle.d-B-YgiWcS.cjs';
14
- import { T as ThemeLockName, C as ClientBranding } from '../branding.d-Bzs4HJoN.cjs';
15
- export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, q as EverfurTextScaleCapOverrides, h as EverfurTextScaleCapsInput, i as EverfurThemeFontFaceKey, j as EverfurThemeFontUrlsInput, k as EverfurThemeFontsInput, E as EverfurThemeInput, l as EverfurThemeSlotInput, m as EverfurThemeSlotsInput, n as EverfurTypeRoleInput, r as EverfurTypeRoleOverride, s as EverfurTypeRoleOverrides, t as EverfurTypeRoles, o as EverfurTypeRolesInput, L as LOCKABLE_THEME_FIELDS, u as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, v as SLOT_LOCK_PREFIX, w as SlotLockName, S as SurfaceStyle, x as THEME_SCHEMA_VERSIONS, y as TYPE_ROLE_RANGES, p as expandAppearance, z as hardenBrandAssetUrl, B as hardenHttpsUrl, D as isEmptyBranding, F as isKnownBrandingSchema, G as lockedFieldsOf, H as parseClientBranding, I as parsePx } from '../branding.d-Bzs4HJoN.cjs';
16
- export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-CWGjwq8Z.cjs';
13
+ export { E as EverfurFaceStyle, a as EverfurRoleTextStyle, b as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as textRole, c as themeAdjustments, w as withServerBranding } from '../typeStyle.d-CLrQZW-r.cjs';
14
+ import { T as ThemeLockName, C as ClientBranding } from '../branding.d-CqDLKj1U.cjs';
15
+ export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, q as EverfurTextScaleCapOverrides, h as EverfurTextScaleCapsInput, i as EverfurThemeFontFaceKey, j as EverfurThemeFontUrlsInput, k as EverfurThemeFontsInput, E as EverfurThemeInput, l as EverfurThemeSlotInput, m as EverfurThemeSlotsInput, n as EverfurTypeRoleInput, r as EverfurTypeRoleOverride, s as EverfurTypeRoleOverrides, t as EverfurTypeRoles, o as EverfurTypeRolesInput, L as LOCKABLE_THEME_FIELDS, u as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, v as SLOT_LOCK_PREFIX, w as SlotLockName, S as SurfaceStyle, x as THEME_SCHEMA_VERSIONS, y as TYPE_ROLE_RANGES, p as expandAppearance, z as hardenBrandAssetUrl, B as hardenHttpsUrl, D as isEmptyBranding, F as isKnownBrandingSchema, G as lockedFieldsOf, H as parseClientBranding, I as parsePx } from '../branding.d-CqDLKj1U.cjs';
16
+ export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-BkIvMtIl.cjs';
17
17
  import { R as RequestFunnel } from '../requestFunnel.d-SySe6xHp.cjs';
18
18
  export { F as FunnelSendOptions, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-SySe6xHp.cjs';
19
19
  export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-DB5CNKsK.cjs';
@@ -27,7 +27,7 @@ import '../profile.d-CSs1wlXT.cjs';
27
27
  /** Which wire shape a code arrives in. The two envelopes are different objects, not casings. */
28
28
  type ContractErrorEnvelope = "http_envelope" | "oauth_error" | "sse_frame";
29
29
  /** Every wire error code the contract declares, spelled EXACTLY as the server sends it. */
30
- type ContractWireErrorCode = "AccessDeniedException" | "AuthorizationException" | "ConflictException" | "DAILY_QUOTA_EXCEEDED" | "FILE_TOO_LARGE" | "IDEMPOTENCY_KEY_IN_FLIGHT" | "IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST" | "INVALID_CONTENT_TYPE" | "InternalFailureException" | "MethodNotAllowedException" | "NotImplementedException" | "PaymentRequiredException" | "ResourceNotFoundException" | "ServiceUnavailableException" | "TIER_UPGRADE_REQUIRED" | "ThrottlingException" | "ValidationException" | "accessDenied" | "access_denied" | "anchor_not_found" | "anchor_ref_invalid" | "anonTokenInvalid" | "attachment_unreadable" | "authExpired" | "authRejected" | "before_invalid" | "bundle_mismatch" | "bundle_not_uploaded" | "bundles_unavailable" | "catalog_empty_refused" | "catalog_shrink_refused" | "consent_invalid" | "consent_required" | "consent_scope_wrong_route" | "device_cipher_unavailable" | "email_invalid" | "endpoint_not_allowed" | "environment_mismatch" | "event_cursor_invalid" | "event_filter_invalid" | "event_id_invalid" | "event_payload_invalid" | "event_type_not_available" | "event_type_unknown" | "idempotency_key_invalid" | "idempotency_key_required" | "idempotency_key_reused" | "inbox_cursor_invalid" | "insufficientCapability" | "insufficient_scope" | "internal_error" | "invalidRequest" | "invalid_client" | "invalid_client_metadata" | "invalid_grant" | "invalid_redirect_uri" | "invalid_request" | "invalid_scope" | "invalid_target" | "item_id_invalid" | "linked_account_read_only" | "mcp_connection_not_found" | "mcp_request_conflict" | "mcp_request_gone" | "mcp_request_not_found" | "not_found" | "open_url_not_allowed" | "partner_visit_link_conflict" | "partner_visit_owner_only" | "partner_visit_pet_already_mapped" | "payload_too_large" | "petRefInUse" | "pet_health_list_removals_unconfirmed" | "pet_health_species_unsupported" | "pet_not_registered" | "provider_unsupported" | "rateLimited" | "read_target_invalid" | "record_species_unsupported" | "record_subject_not_found" | "record_upload_invalid" | "records_consent_required" | "restricted_key" | "sandbox_only" | "session_required" | "session_revoked" | "share_limit_reached" | "slow_down" | "species_unsupported" | "subscription_keys_invalid" | "tenant_filter_invalid" | "tenant_has_no_capabilities" | "tenant_resource_not_found" | "tenant_surface_not_enabled" | "ticket_not_resolved" | "tickets_disabled" | "timeout" | "token_invalid" | "unavailable" | "unrestrictedKeyRequired" | "unsupported_grant_type" | "unsupported_response_type" | "user_ref_invalid" | "verify_mint_rate_limited" | "verify_mint_refused" | "verify_mint_unavailable" | "verify_user_ref_invalid" | "web_push_unavailable" | "webhook_endpoint_update_empty" | "webhook_endpoint_update_invalid" | "webhook_url_rejected";
30
+ type ContractWireErrorCode = "AccessDeniedException" | "AuthorizationException" | "ConflictException" | "DAILY_QUOTA_EXCEEDED" | "FILE_TOO_LARGE" | "IDEMPOTENCY_KEY_IN_FLIGHT" | "IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST" | "INVALID_CONTENT_TYPE" | "InternalFailureException" | "MethodNotAllowedException" | "NotImplementedException" | "PaymentRequiredException" | "ResourceNotFoundException" | "ServiceUnavailableException" | "TIER_UPGRADE_REQUIRED" | "ThrottlingException" | "ValidationException" | "accessDenied" | "access_denied" | "anchor_not_found" | "anchor_ref_invalid" | "anonTokenInvalid" | "attachment_unreadable" | "authExpired" | "authRejected" | "before_invalid" | "bundle_mismatch" | "bundle_not_uploaded" | "bundles_unavailable" | "catalog_empty_refused" | "catalog_shrink_refused" | "consent_invalid" | "consent_required" | "consent_scope_wrong_route" | "device_cipher_unavailable" | "email_invalid" | "endpoint_not_allowed" | "environment_mismatch" | "event_cursor_invalid" | "event_filter_invalid" | "event_id_invalid" | "event_payload_invalid" | "event_type_not_available" | "event_type_unknown" | "idempotency_key_invalid" | "idempotency_key_required" | "idempotency_key_reused" | "inbox_cursor_invalid" | "insufficientCapability" | "insufficient_scope" | "internal_error" | "invalidRequest" | "invalid_client" | "invalid_client_metadata" | "invalid_grant" | "invalid_redirect_uri" | "invalid_request" | "invalid_scope" | "invalid_target" | "item_id_invalid" | "linked_account_read_only" | "mcp_connection_not_found" | "mcp_request_conflict" | "mcp_request_gone" | "mcp_request_not_found" | "not_found" | "open_url_not_allowed" | "partner_visit_link_conflict" | "partner_visit_owner_only" | "partner_visit_pet_already_mapped" | "payload_too_large" | "petRefInUse" | "pet_health_list_removals_unconfirmed" | "pet_health_species_unsupported" | "pet_not_registered" | "provider_unsupported" | "rateLimited" | "read_target_invalid" | "record_species_unsupported" | "record_subject_not_found" | "record_upload_invalid" | "records_consent_required" | "restricted_key" | "sandbox_only" | "session_required" | "session_revoked" | "share_limit_reached" | "slow_down" | "species_unsupported" | "subscription_keys_invalid" | "tenant_filter_invalid" | "tenant_has_no_capabilities" | "tenant_resource_not_found" | "tenant_surface_not_enabled" | "ticket_not_resolved" | "tickets_disabled" | "timeout" | "timezone_invalid" | "token_invalid" | "unavailable" | "unrestrictedKeyRequired" | "unsupported_grant_type" | "unsupported_response_type" | "user_ref_invalid" | "verify_mint_rate_limited" | "verify_mint_refused" | "verify_mint_unavailable" | "verify_user_ref_invalid" | "web_push_unavailable" | "webhook_endpoint_update_empty" | "webhook_endpoint_update_invalid" | "webhook_url_rejected";
31
31
 
32
32
  /** One registry row, reduced to the facts the SDK needs at runtime. */
33
33
  interface ContractErrorRow {
@@ -92,7 +92,7 @@ declare function publishedDocUrl(entry: ContractErrorRow): string | null;
92
92
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
93
93
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
94
94
  */
95
- declare const SDK_VERSION = "1.4.0";
95
+ declare const SDK_VERSION = "1.4.1";
96
96
 
97
97
  /**
98
98
  * Parse a permissive colour into a normalized string (`#RRGGBB` when opaque, else `rgba(r,g,b,a)`), or null.
@@ -7,13 +7,13 @@ export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFra
7
7
  export { B as Brand, a as ClientId, C as ConversationId, D as DocumentId, J as JobId, P as PetRef, R as RecordsRequestId, b as ResponseId, U as UserRef, _ as __brand, c as conversationId, p as petRef, d as unsafeClientId, e as unsafeConversationId, f as unsafeDocumentId, g as unsafeJobId, h as unsafePetRef, i as unsafeRecordsRequestId, j as unsafeResponseId, k as unsafeUserRef, u as userRef } from '../ids.d-B2GAAifq.js';
8
8
  export { a as AnonIdentityProvider, A as AuthContext, D as DeviceAuth, I as IdentityProvider, M as MintedToken, T as TokenProvider, b as authHeaders, c as authedSend, d as createAnonIdentityProvider, e as createIdentityProvider, n as newSessionId, w as withAuthHeaders } from '../identity.d-DOKJFaiz.js';
9
9
  export { a as CapabilityDecision, b as CapabilityDisabled, C as CapabilityName, c as DecideOptions, D as DisabledLevel, E as EntitlementDecision, L as LevelGrant, R as ResolvedEntitlements, d as decideCapability, e as deniedDecisionsFor, r as requires, f as resolveEntitlements } from '../resolve.d-BTC3b6FW.js';
10
- export { a as ENTITLEMENTS_PATH, E as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-x2YFdgYD.js';
10
+ export { a as ENTITLEMENTS_PATH, E as EntitlementResolution, F as FetchEntitlementsArgs, f as fetchEntitlements } from '../entitlementRepository.d-BltqS1W8.js';
11
11
  import { n as EverfurTheme, c as EverfurFontSource, s as EverfurThemeSlots } from '../tokens.d-DDiPRgye.js';
12
12
  export { F as DEFAULT_MAX_FONT_SCALE, G as EASING_CURVES, H as EVERFUR_DARK, I as EVERFUR_LIGHT, E as EverfurColorTokens, J as EverfurEasingCurve, a as EverfurFontFaceKey, b as EverfurFontFamilies, d as EverfurFontWeight, e as EverfurLetterSpacingTokens, f as EverfurLineHeightTokens, g as EverfurMotionDurationTokens, h as EverfurMotionTokens, i as EverfurRadiusTokens, j as EverfurSpaceTokens, k as EverfurSpringToken, l as EverfurTextColorTokens, m as EverfurTextScaleTier, o as EverfurThemeMeta, p as EverfurThemeSlot, q as EverfurThemeSlotKey, r as EverfurThemeSlotName, t as EverfurTypeRole, u as EverfurTypeRoleFace, v as EverfurTypeRoleStyle, w as EverfurTypeSizeTokens, x as EverfurTypeTokens, y as EverfurWeightTokens, P as PHONE_TEXT_SCALE_CAPS, S as SLOT_MIN_BORDER_CONTRAST, K as SLOT_MIN_CONTRAST, L as SYSTEM_FONT_FAMILY, M as SYSTEM_MONO_FAMILY, N as SlotGrounds, O as SlotSurrounds, Q as TEXT_SCALE_TIER_CAPS, T as THEME_SLOT_KEYS, z as THEME_SLOT_KEYS_BY_SLOT, A as THEME_SLOT_NAMES, B as TYPE_ROLE_DEFAULTS, C as TYPE_ROLE_NAMES, R as cssCubicBezier, U as deepFreeze, V as guardSlotContrast, W as mergeThemeSlots, X as parseThemeSlots, D as themeSlotKeysFor } from '../tokens.d-DDiPRgye.js';
13
- export { E as EverfurFaceStyle, a as EverfurRoleTextStyle, b as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as textRole, c as themeAdjustments, w as withServerBranding } from '../typeStyle.d-rzVzCfLz.js';
14
- import { T as ThemeLockName, C as ClientBranding } from '../branding.d-CiC6xfGT.js';
15
- export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, q as EverfurTextScaleCapOverrides, h as EverfurTextScaleCapsInput, i as EverfurThemeFontFaceKey, j as EverfurThemeFontUrlsInput, k as EverfurThemeFontsInput, E as EverfurThemeInput, l as EverfurThemeSlotInput, m as EverfurThemeSlotsInput, n as EverfurTypeRoleInput, r as EverfurTypeRoleOverride, s as EverfurTypeRoleOverrides, t as EverfurTypeRoles, o as EverfurTypeRolesInput, L as LOCKABLE_THEME_FIELDS, u as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, v as SLOT_LOCK_PREFIX, w as SlotLockName, S as SurfaceStyle, x as THEME_SCHEMA_VERSIONS, y as TYPE_ROLE_RANGES, p as expandAppearance, z as hardenBrandAssetUrl, B as hardenHttpsUrl, D as isEmptyBranding, F as isKnownBrandingSchema, G as lockedFieldsOf, H as parseClientBranding, I as parsePx } from '../branding.d-CiC6xfGT.js';
16
- export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-CWGjwq8Z.js';
13
+ export { E as EverfurFaceStyle, a as EverfurRoleTextStyle, b as EverfurThemeAdjustment, R as ResolveThemeInput, T as TEXT_SCALE_FLOOR, f as face, h as headingFace, p as previewTheme, r as resolveTheme, t as textRole, c as themeAdjustments, w as withServerBranding } from '../typeStyle.d-8mcLhtbH.js';
14
+ import { T as ThemeLockName, C as ClientBranding } from '../branding.d-XrZYClN4.js';
15
+ export { A as APPEARANCE_PRESETS, a as APPEARANCE_PRESET_NAMES, b as APPEARANCE_SIZE_RANGES, c as EverfurAppearance, d as EverfurAppearanceFont, e as EverfurAppearancePreset, f as EverfurAppearanceRules, g as EverfurAppearanceVariables, q as EverfurTextScaleCapOverrides, h as EverfurTextScaleCapsInput, i as EverfurThemeFontFaceKey, j as EverfurThemeFontUrlsInput, k as EverfurThemeFontsInput, E as EverfurThemeInput, l as EverfurThemeSlotInput, m as EverfurThemeSlotsInput, n as EverfurTypeRoleInput, r as EverfurTypeRoleOverride, s as EverfurTypeRoleOverrides, t as EverfurTypeRoles, o as EverfurTypeRolesInput, L as LOCKABLE_THEME_FIELDS, u as LockableThemeField, M as MAX_FONT_SCALE_CEILING, R as RadiusScale, v as SLOT_LOCK_PREFIX, w as SlotLockName, S as SurfaceStyle, x as THEME_SCHEMA_VERSIONS, y as TYPE_ROLE_RANGES, p as expandAppearance, z as hardenBrandAssetUrl, B as hardenHttpsUrl, D as isEmptyBranding, F as isKnownBrandingSchema, G as lockedFieldsOf, H as parseClientBranding, I as parsePx } from '../branding.d-XrZYClN4.js';
16
+ export { D as DEFAULT_PRESENTATION, E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, l as EverfurPresentationField, i as EverfurPresentationInput, j as EverfurSafetyDisclaimerPlacement, P as PRESENTATION_LOCK, k as PRESENTATION_LOCK_PREFIX, m as PRESENTATION_WIRE_NAMES, n as isPresentationFieldLocked, o as isPresentationLockName, p as parsePresentation, r as resolvePresentation } from '../presentation.d-BkIvMtIl.js';
17
17
  import { R as RequestFunnel } from '../requestFunnel.d-CehftayS.js';
18
18
  export { F as FunnelSendOptions, a as RequestFunnelDeps, c as createRequestFunnel } from '../requestFunnel.d-CehftayS.js';
19
19
  export { c as PET_AGE_YEARS_MAX, d as PET_BREED_MAX, e as PET_NAME_MAX, f as PET_SPECIES_MAX, g as PET_WEIGHT_KG_MAX, P as PetProfileInput, a as PetProfilePatch, h as PetsRepository, R as RegisteredPet, W as WidgetPet, i as createPetsRepository, w as widgetPetFromWire } from '../petsRepository.d-iHrHkXM2.js';
@@ -27,7 +27,7 @@ import '../profile.d-CSs1wlXT.js';
27
27
  /** Which wire shape a code arrives in. The two envelopes are different objects, not casings. */
28
28
  type ContractErrorEnvelope = "http_envelope" | "oauth_error" | "sse_frame";
29
29
  /** Every wire error code the contract declares, spelled EXACTLY as the server sends it. */
30
- type ContractWireErrorCode = "AccessDeniedException" | "AuthorizationException" | "ConflictException" | "DAILY_QUOTA_EXCEEDED" | "FILE_TOO_LARGE" | "IDEMPOTENCY_KEY_IN_FLIGHT" | "IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST" | "INVALID_CONTENT_TYPE" | "InternalFailureException" | "MethodNotAllowedException" | "NotImplementedException" | "PaymentRequiredException" | "ResourceNotFoundException" | "ServiceUnavailableException" | "TIER_UPGRADE_REQUIRED" | "ThrottlingException" | "ValidationException" | "accessDenied" | "access_denied" | "anchor_not_found" | "anchor_ref_invalid" | "anonTokenInvalid" | "attachment_unreadable" | "authExpired" | "authRejected" | "before_invalid" | "bundle_mismatch" | "bundle_not_uploaded" | "bundles_unavailable" | "catalog_empty_refused" | "catalog_shrink_refused" | "consent_invalid" | "consent_required" | "consent_scope_wrong_route" | "device_cipher_unavailable" | "email_invalid" | "endpoint_not_allowed" | "environment_mismatch" | "event_cursor_invalid" | "event_filter_invalid" | "event_id_invalid" | "event_payload_invalid" | "event_type_not_available" | "event_type_unknown" | "idempotency_key_invalid" | "idempotency_key_required" | "idempotency_key_reused" | "inbox_cursor_invalid" | "insufficientCapability" | "insufficient_scope" | "internal_error" | "invalidRequest" | "invalid_client" | "invalid_client_metadata" | "invalid_grant" | "invalid_redirect_uri" | "invalid_request" | "invalid_scope" | "invalid_target" | "item_id_invalid" | "linked_account_read_only" | "mcp_connection_not_found" | "mcp_request_conflict" | "mcp_request_gone" | "mcp_request_not_found" | "not_found" | "open_url_not_allowed" | "partner_visit_link_conflict" | "partner_visit_owner_only" | "partner_visit_pet_already_mapped" | "payload_too_large" | "petRefInUse" | "pet_health_list_removals_unconfirmed" | "pet_health_species_unsupported" | "pet_not_registered" | "provider_unsupported" | "rateLimited" | "read_target_invalid" | "record_species_unsupported" | "record_subject_not_found" | "record_upload_invalid" | "records_consent_required" | "restricted_key" | "sandbox_only" | "session_required" | "session_revoked" | "share_limit_reached" | "slow_down" | "species_unsupported" | "subscription_keys_invalid" | "tenant_filter_invalid" | "tenant_has_no_capabilities" | "tenant_resource_not_found" | "tenant_surface_not_enabled" | "ticket_not_resolved" | "tickets_disabled" | "timeout" | "token_invalid" | "unavailable" | "unrestrictedKeyRequired" | "unsupported_grant_type" | "unsupported_response_type" | "user_ref_invalid" | "verify_mint_rate_limited" | "verify_mint_refused" | "verify_mint_unavailable" | "verify_user_ref_invalid" | "web_push_unavailable" | "webhook_endpoint_update_empty" | "webhook_endpoint_update_invalid" | "webhook_url_rejected";
30
+ type ContractWireErrorCode = "AccessDeniedException" | "AuthorizationException" | "ConflictException" | "DAILY_QUOTA_EXCEEDED" | "FILE_TOO_LARGE" | "IDEMPOTENCY_KEY_IN_FLIGHT" | "IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST" | "INVALID_CONTENT_TYPE" | "InternalFailureException" | "MethodNotAllowedException" | "NotImplementedException" | "PaymentRequiredException" | "ResourceNotFoundException" | "ServiceUnavailableException" | "TIER_UPGRADE_REQUIRED" | "ThrottlingException" | "ValidationException" | "accessDenied" | "access_denied" | "anchor_not_found" | "anchor_ref_invalid" | "anonTokenInvalid" | "attachment_unreadable" | "authExpired" | "authRejected" | "before_invalid" | "bundle_mismatch" | "bundle_not_uploaded" | "bundles_unavailable" | "catalog_empty_refused" | "catalog_shrink_refused" | "consent_invalid" | "consent_required" | "consent_scope_wrong_route" | "device_cipher_unavailable" | "email_invalid" | "endpoint_not_allowed" | "environment_mismatch" | "event_cursor_invalid" | "event_filter_invalid" | "event_id_invalid" | "event_payload_invalid" | "event_type_not_available" | "event_type_unknown" | "idempotency_key_invalid" | "idempotency_key_required" | "idempotency_key_reused" | "inbox_cursor_invalid" | "insufficientCapability" | "insufficient_scope" | "internal_error" | "invalidRequest" | "invalid_client" | "invalid_client_metadata" | "invalid_grant" | "invalid_redirect_uri" | "invalid_request" | "invalid_scope" | "invalid_target" | "item_id_invalid" | "linked_account_read_only" | "mcp_connection_not_found" | "mcp_request_conflict" | "mcp_request_gone" | "mcp_request_not_found" | "not_found" | "open_url_not_allowed" | "partner_visit_link_conflict" | "partner_visit_owner_only" | "partner_visit_pet_already_mapped" | "payload_too_large" | "petRefInUse" | "pet_health_list_removals_unconfirmed" | "pet_health_species_unsupported" | "pet_not_registered" | "provider_unsupported" | "rateLimited" | "read_target_invalid" | "record_species_unsupported" | "record_subject_not_found" | "record_upload_invalid" | "records_consent_required" | "restricted_key" | "sandbox_only" | "session_required" | "session_revoked" | "share_limit_reached" | "slow_down" | "species_unsupported" | "subscription_keys_invalid" | "tenant_filter_invalid" | "tenant_has_no_capabilities" | "tenant_resource_not_found" | "tenant_surface_not_enabled" | "ticket_not_resolved" | "tickets_disabled" | "timeout" | "timezone_invalid" | "token_invalid" | "unavailable" | "unrestrictedKeyRequired" | "unsupported_grant_type" | "unsupported_response_type" | "user_ref_invalid" | "verify_mint_rate_limited" | "verify_mint_refused" | "verify_mint_unavailable" | "verify_user_ref_invalid" | "web_push_unavailable" | "webhook_endpoint_update_empty" | "webhook_endpoint_update_invalid" | "webhook_url_rejected";
31
31
 
32
32
  /** One registry row, reduced to the facts the SDK needs at runtime. */
33
33
  interface ContractErrorRow {
@@ -92,7 +92,7 @@ declare function publishedDocUrl(entry: ContractErrorRow): string | null;
92
92
  * Package semver, sent as X-Everfur-SDK-Version. MUST track package.json version (release checklist Item 12
93
93
  * keeps the npm semver tag and this constant in lockstep). Set inside the SDK, never by partner code.
94
94
  */
95
- declare const SDK_VERSION = "1.4.0";
95
+ declare const SDK_VERSION = "1.4.1";
96
96
 
97
97
  /**
98
98
  * Parse a permissive colour into a normalized string (`#RRGGBB` when opaque, else `rgba(r,g,b,a)`), or null.
@@ -1,7 +1,7 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
- import{z as e}from"zod";var t=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],r=/* @__PURE__ */Object.freeze(t.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(r.map(e=>e.wireCode));var n=/* @__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"}),o=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:n[e.wireCode]}))),a=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...l]){let t=a.get(e+r);if(t)return t}}function contractDocUrl(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}var i=null;function publishedDocUrl(e){return null}var s=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),u=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),c=/* @__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 c[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var d=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return d.has(e)}var f=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||f.has(e)}function shouldRetry(e,t=false){return t||isAutoRetryable(e)}var p=500,h=8e3,b=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(p*2**r,h);return Math.floor(t()*n)}function canRecreateOnNotFound(e){return e==="conversationNotFound"}var g="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:g,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:m,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:g,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),v="This session has ended. Please sign in again.",_="linked_account_read_only";function isLinkedAccountReadOnly(e){return e!=null&&e.code==="conflict"&&e.reasonCode===_}function k(e,t,r){return e==="conflict"&&r===_?g:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?v:userFacingError(e)}function userFacingError(e){return y[e]}function w(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var C=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===_,o={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:k(e,t?.wireCode,n?_:null)};t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&C.test(t.reasonCode)&&(o.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(o.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&w(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&w(o,"raw",t.raw),/* @__PURE__ */Object.freeze(o)}function ok(e,t){/* @__PURE__ */
2
+ import{z as e}from"zod";var t=[{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}],r=/* @__PURE__ */Object.freeze(t.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(r.map(e=>e.wireCode));var n=/* @__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"}),o=/* @__PURE__ */Object.freeze(r.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:n[e.wireCode]}))),a=new Map(o.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),l=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(o.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...l]){let t=a.get(e+r);if(t)return t}}function contractDocUrl(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}var i=null;function publishedDocUrl(e){return null}var s=/* @__PURE__ */Object.freeze(["authExpired","authRejected","sessionRequired","accessDenied","paymentRequired","quotaExceeded","rateLimited","validationFailed","sdkUpdateRequired","conflict","idempotencyConflict","idempotencyInFlight","conversationNotFound","petNotFound","resourceNotFound","streamTimeout","mediaUploadFailed","moderationBlocked","upstreamLlmTimeout","internalError","notImplemented","serviceUnavailable","streamIncomplete","identitySignatureRequired","runtimeDisposed","unknown"]),u=/* @__PURE__ */Object.freeze(["authentication","authorization","entitlement","rateLimit","invalidRequest","notFound","conflict","connection","server","media","policy","unknown"]),c=/* @__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 c[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var d=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return d.has(e)}var f=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||f.has(e)}function shouldRetry(e,t=false){return t||isAutoRetryable(e)}var p=500,h=8e3,b=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(p*2**r,h);return Math.floor(t()*n)}function canRecreateOnNotFound(e){return e==="conversationNotFound"}var g="This feature isn't available on your account right now.",m="Something in that request was not right. Check the details and try again.",y=/* @__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:g,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:m,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:g,runtimeDisposed:m,unknown:"Something went wrong. Please try again."}),v="This session has ended. Please sign in again.",_="linked_account_read_only";function isLinkedAccountReadOnly(e){return e!=null&&e.code==="conflict"&&e.reasonCode===_}function k(e,t,r){return e==="conflict"&&r===_?g:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?v:userFacingError(e)}function userFacingError(e){return y[e]}function w(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var C=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===_,o={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:k(e,t?.wireCode,n?_:null)};t?.httpStatus!==void 0&&(o.httpStatus=t.httpStatus),t?.requestId&&(o.requestId=t.requestId),typeof t?.reasonCode=="string"&&C.test(t.reasonCode)&&(o.reasonCode=t.reasonCode);let a=t?.retryAfterSeconds;if(typeof a=="number"&&Number.isFinite(a)&&a>=0&&(o.retryAfterSeconds=Math.round(a)),r);return t?.wireMessage&&w(o,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&w(o,"raw",t.raw),/* @__PURE__ */Object.freeze(o)}function ok(e,t){/* @__PURE__ */
3
3
  return Object.freeze(t===void 0?{ok:true,value:e}:{ok:true,value:e,warning:t})}function err(e){/* @__PURE__ */
4
- return Object.freeze({ok:false,error:e})}function isOk(e){return e.ok}function isErr(e){return!e.ok}var x=class _EverfurThrownError extends Error{constructor(e){super(`${e.code}: ${e.displayMessage}`),this.name="EverfurThrownError",this.error=e,this.code=e.code,this.category=e.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(e){if(e.ok)return e.value;throw new x(e.error)}var F=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var S=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var E="1.4.0";var O="react-native",j="2026-09-19",z="EVERFUR_API_BASE_URL";function A(e,t){/* @__PURE__ */
4
+ return Object.freeze({ok:false,error:e})}function isOk(e){return e.ok}function isErr(e){return!e.ok}var x=class _EverfurThrownError extends Error{constructor(e){super(`${e.code}: ${e.displayMessage}`),this.name="EverfurThrownError",this.error=e,this.code=e.code,this.category=e.category,Object.setPrototypeOf(this,_EverfurThrownError.prototype)}};function unwrap(e){if(e.ok)return e.value;throw new x(e.error)}var F=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var S=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var E="1.4.1";var O="react-native",j="2026-09-19",z="EVERFUR_API_BASE_URL";function A(e,t){/* @__PURE__ */
5
5
  return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:e,message:t})})}function checkPublishableKey(e){let t=typeof e=="string"?e.trim():"";return t.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(t)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(e,t){let r=checkPublishableKey(e?.publishableKey);if(r!==null)/* @__PURE__ */
6
6
  return Object.freeze({ok:false,failure:r});let n=e.publishableKey.trim(),o=tryResolveApiBaseUrl(e.apiBaseUrl);if(!o.ok)return o;let a=e.contractVersion?.trim()||j;/* @__PURE__ */
7
7
  return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:n,apiBaseUrl:o.value,contractVersion:a,sdkVersion:E,platform:t?.platform??O,debug:e.debug===true})})}function resolveClientConfig(e,t){let r=tryResolveClientConfig(e,t);if(!r.ok)throw new F("invalid-argument",r.failure.message);return r.config}function tryResolveApiBaseUrl(e){let t=e?.trim(),r=t&&t.length>0?t:M(z);return r?N(r):A("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${z}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(e){let t=tryResolveApiBaseUrl(e);if(!t.ok)throw new F("invalid-argument",t.failure.message);return t.value}function buildBaseHeaders(e){return{"X-Everfur-SDK-Version":e.sdkVersion,"X-Everfur-SDK-Platform":e.platform,"X-Everfur-Contract":e.contractVersion}}function I(e){return e.slice(e.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function R(e){return e.length===0||e.includes("@")?false:e.startsWith("[")&&e.endsWith("]")?true:!e.includes(":")}function B(e,t){let r=e.indexOf("://");return r<0||e.slice(r+3).includes("@")?false:R(t)}function T(e,t){return`${e}://${t}`}function N(e){let t=e.trim(),r=S.exec(t);if(r===null||r[2]===void 0||r[2].length===0)return A("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let n=(r[1]??"").toLowerCase(),o=I(r[2]);if(o.length===0)return A("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let a=B(t,o)?`: ${T(n,o)}`:"";if(n!=="https"){if(!(n==="http"&&D(o)))return n==="http"?A("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${a}`):A("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${a}`)}let l=t.endsWith("/")?t.slice(0,-1):t;/* @__PURE__ */
@@ -1,5 +1,5 @@
1
1
  /*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
2
- "use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime");var n=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[n[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:a}=e.type;if(r===null&&a===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:a??e.type.weight[n[t]]};let o=face(e,t);return o.fontWeight===void 0||a===null?o:{fontFamily:o.fontFamily,fontWeight:a}}function a(e){return e<=450?"regular":e<=650?"medium":"bold"}var o={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=i.get(e);r===void 0&&(r=/* @__PURE__ */new Map,i.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=l(e,t);return r.set(t,a),a}var i=/* @__PURE__ */new WeakMap;function l(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=a(Number(n)),l=r.face==="mono"?face(e,o[i]):r.face==="heading"?headingFace(e,i):face(e,i),s=r.face==="heading"?e.type.headingWeight??n:n,d=l.fontWeight===void 0?l:{fontFamily:l.fontFamily,fontWeight:s},u=r.size,c={...d,fontSize:u,lineHeight:Math.round(u*r.lineHeight*100)/100};return r.letterSpacing!==0&&(c.letterSpacing=Math.round(u*r.letterSpacing*100)/100),r.uppercase&&(c.textTransform="uppercase"),/* @__PURE__ */Object.freeze(c)}var s=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),d=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var u=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],c=/* @__PURE__ */Object.freeze(u.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(c.map(e=>e.wireCode));var p=/* @__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"}),f=/* @__PURE__ */Object.freeze(c.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:p[e.wireCode]}))),h=new Map(f.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),v=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(f.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...v]){let t=h.get(e+r);if(t)return t}}var b=/* @__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 b[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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 _=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return _.has(e)}var y=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||y.has(e)}var g=500,m=8e3,w=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(g*2**r,m);return Math.floor(t()*n)}var C="This feature isn't available on your account right now.",E="Something in that request was not right. Check the details and try again.",S=/* @__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:C,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:E,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:C,runtimeDisposed:E,unknown:"Something went wrong. Please try again."}),F="This session has ended. Please sign in again.",k="linked_account_read_only";function T(e,t,r){return e==="conflict"&&r===k?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?F:userFacingError(e)}function userFacingError(e){return S[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var I=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===k,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,n?k:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&I.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&x(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
2
+ "use strict";var e=require("react"),t=require("react-native"),r=require("react/jsx-runtime");var n=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(e,t){let r=e.type,a=r.families[t];return t==="mono"||r.namedFaces[t]?{fontFamily:a}:{fontFamily:a,fontWeight:r.weight[n[t]]}}function headingFace(e,t="bold"){let{headingFamily:r,headingWeight:a}=e.type;if(r===null&&a===null)return face(e,t);if(r!==null)return{fontFamily:r,fontWeight:a??e.type.weight[n[t]]};let o=face(e,t);return o.fontWeight===void 0||a===null?o:{fontFamily:o.fontFamily,fontWeight:a}}function a(e){return e<=450?"regular":e<=650?"medium":"bold"}var o={regular:"mono",medium:"monoMedium",bold:"monoBold"};function textRole(e,t){let r=i.get(e);r===void 0&&(r=/* @__PURE__ */new Map,i.set(e,r));let n=r.get(t);if(n!==void 0)return n;let a=l(e,t);return r.set(t,a),a}var i=/* @__PURE__ */new WeakMap;function l(e,t){let r=e.type.roles[t],n=r.weight==="400"&&r.face!=="mono"?e.type.weight.regular:r.weight,i=a(Number(n)),l=r.face==="mono"?face(e,o[i]):r.face==="heading"?headingFace(e,i):face(e,i),s=r.face==="heading"?e.type.headingWeight??n:n,d=l.fontWeight===void 0?l:{fontFamily:l.fontFamily,fontWeight:s},u=r.size,c={...d,fontSize:u,lineHeight:Math.round(u*r.lineHeight*100)/100};return r.letterSpacing!==0&&(c.letterSpacing=Math.round(u*r.letterSpacing*100)/100),r.uppercase&&(c.textTransform="uppercase"),/* @__PURE__ */Object.freeze(c)}var s=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",changeable:"You can change this at any time.",saving:"Saving"}),d=/* @__PURE__ */Object.freeze({transcript_exposure:/* @__PURE__ */Object.freeze({title:"Conversation sharing",body:e=>`Let ${e} read the conversations you have with Everfur.`}),partner_context:/* @__PURE__ */Object.freeze({title:"Pet details",body:e=>`Let Everfur use the pet details ${e} already holds as background in your conversations.`})});function consentRowView(e,t){if(e.status==="signed_out")return{kind:"signedOut"};let r=e.scopes.find(e=>e.scope===t);return r===void 0?e.error!==null?{kind:"failed",error:e.error}:{kind:"loading"}:r.loaded?{kind:"row",scope:r.scope,granted:r.granted,hasDecision:r.hasDecision,saving:r.saving,error:r.error}:r.error!==null?{kind:"failed",error:r.error}:{kind:"loading"}}var u=[{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}],c=/* @__PURE__ */Object.freeze(u.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(c.map(e=>e.wireCode));var p=/* @__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"}),f=/* @__PURE__ */Object.freeze(c.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:p[e.wireCode]}))),h=new Map(f.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),v=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(f.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...v]){let t=h.get(e+r);if(t)return t}}var b=/* @__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 b[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){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 _=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return _.has(e)}var y=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||y.has(e)}var g=500,m=8e3,w=4;function backoffDelayMs(e,t=Math.random){let r=Math.max(0,e),n=Math.min(g*2**r,m);return Math.floor(t()*n)}var C="This feature isn't available on your account right now.",E="Something in that request was not right. Check the details and try again.",S=/* @__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:C,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:E,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:C,runtimeDisposed:E,unknown:"Something went wrong. Please try again."}),F="This session has ended. Please sign in again.",k="linked_account_read_only";function T(e,t,r){return e==="conflict"&&r===k?C:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?F:userFacingError(e)}function userFacingError(e){return S[e]}function x(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var I=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===k,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:T(e,t?.wireCode,n?k:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&I.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let o=t?.retryAfterSeconds;if(typeof o=="number"&&Number.isFinite(o)&&o>=0&&(a.retryAfterSeconds=Math.round(o)),r);return t?.wireMessage&&x(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&x(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}function ok(e,t){/* @__PURE__ */
3
3
  return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
4
4
  return Object.freeze({ok:false,error:e})}var R=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(e){/* @__PURE__ */
5
5
  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 O="x-everfur-anon-token",j="anonTokenInvalid";async function z(e){if(e.userRef!==null||e.anonIdentity===void 0)return null;try{return await e.anonIdentity.token()}catch{return null}}function D(e,t){let r=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}:{},...r?{wireMessage:r}:{},...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[O]=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:{...A(e.headers),...authHeaders(t)}}}function A(e){if(!e)return{};let t={};for(let[r,n]of Object.entries(e)){let e=r.toLowerCase();e==="authorization"||e==="x-everfur-partner-key"||e===O||(t[r]=n)}return t}async function authedSend(e,t){if(t.mode==="anonymous"){let r=await z(t),n=await t.transport.request(withAuthHeaders(e,N(t,r)));if(n.ok||q(n.error.raw)!==j||t.anonIdentity===void 0||t.userRef!==null)return n;let a=await t.anonIdentity.token({forceRefresh:true});return a===null||a===r?n:t.transport.request(withAuthHeaders(e,N(t,a)))}let r;try{r=await t.identity.currentToken()}catch(e){return t.identity.reportRejected?.(),err(D(e))}let n=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:r,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await t.identity.currentToken({forceRefresh:!0})}catch(e){return t.identity.reportRejected?.(),err(D(e,{wireCode:q(n.error.raw),requestId:n.error.requestId}))}let o=await t.transport.request(withAuthHeaders(e,{mode:"personalized",token:a,userRef:t.userRef,...t.sessionId?{sessionId:t.sessionId}:{}}));return!o.ok&&o.error.httpStatus===401?(t.identity.reportRejected?.(),err(M(o.error))):o}function N(e,t){return{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{},...t!==null?{anonToken:t}:{}}}function M(e){let t=e.raw,r=q(t);return makeEverfurError("authRejected",{retryable:false,...e.httpStatus!==void 0?{httpStatus:e.httpStatus}:{},...e.requestId?{requestId:e.requestId}:{},...r?{wireCode:r}:{},...e.reasonCode?{reasonCode:e.reasonCode}:{},...e.wireMessage?{wireMessage:e.wireMessage}:{},...t!=null?{raw:t}:{}})}function q(e){if(typeof e!="object"||e===null)return null;let t=e,r=(typeof t.error=="object"&&t.error!==null?t.error.code:void 0)??t.code;return typeof r=="string"&&r.length>0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:L(e)})}function L(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var P=3e4,B=m*2,U="idempotency-key",H=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),V=/* @__PURE__ */Object.freeze({onEvent(){}}),K=/* @__PURE__ */Object.freeze({setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),now:()=>Date.now()});function Y(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??V,r=e.timers??K,n=e.rng??Math.random,a=e.sleep??((e,t)=>se(e,r,t)),o=e.maxAttempts??w,i=e.unaryTimeoutMs??P,l=e.newIdempotencyKey??$(),s=e=>{try{t.onEvent(e)}catch{}};async function d(t,d,u){let c=u?.maxAttempts,p=Math.max(1,c??o),f=u?.idempotent??H.has(d.method),h=u?.idempotencyKey===void 0?null:Y(u.idempotencyKey),v=f?h??l():null,b=W(d,v),_=0;for(;;){let o=e=>/* @__PURE__ */Object.freeze({call:t,method:d.method,path:d.path,attempt:_,...v?{idempotencyKey:v}:{},...e});s(o({phase:"attempt"}));let l=ie(i,r),u=le(l.signal,d.signal),f;try{f=await authedSend({...b,signal:u.signal},e.auth)}catch(e){f=err(networkError(e))}finally{u.dispose(),l.cancel()}if(f.ok)return s(o({phase:"settled",ok:true,reason:"ok"})),f;let h=f.error,y=Q(h,_,{maxAttempts:p,rng:n,now:r.now(),aborted:d.signal?.aborted===true,...c!==void 0?{perCallMaxAttempts:c}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),g={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(o({phase:"settled",...g})),err(h);if(s(o({phase:"retry",...g,delayMs:y.delayMs})),await a(y.delayMs,d.signal),d.signal?.aborted===true)return s(o({phase:"settled",...g,reason:"aborted"})),err(h);_+=1}}async function u(t){return withAuthHeaders(t,await oe(e.auth))}async function*c(t,r,n){s(