@everfur/sdk 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +160 -0
- package/LICENSE.md +1 -0
- package/README.md +12 -5
- package/SDK-LICENSE.txt +130 -0
- package/THIRD_PARTY_NOTICES +9 -0
- package/dist/CameraPort.d-Cv31Pz7g.d.cts +1 -0
- package/dist/CameraPort.d-Cv31Pz7g.d.ts +1 -0
- package/dist/{DepthViews.d-dXWL6ToG.d.cts → DepthViews.d-A7S-XYiI.d.ts} +2 -1
- package/dist/{DepthViews.d-DbJejGm3.d.ts → DepthViews.d-C4TIZDfz.d.cts} +2 -1
- package/dist/{DepthViews.d-CuBElgEc.d.ts → DepthViews.d-CNjaHLAS.d.ts} +2 -1
- package/dist/{DepthViews.d-BqMnWSMu.d.cts → DepthViews.d-DapfRz1S.d.cts} +2 -1
- package/dist/ErrorPolicyPort.d-68yrE3BE.d.ts +1 -0
- package/dist/ErrorPolicyPort.d-DirW9hgO.d.cts +1 -0
- package/dist/EverfurError.d-8NHtlgzA.d.cts +1 -0
- package/dist/EverfurError.d-8NHtlgzA.d.ts +1 -0
- package/dist/EverfurResult.d-BFH-3s6E.d.cts +1 -0
- package/dist/EverfurResult.d-D_-254ZY.d.ts +1 -0
- package/dist/IntakeMedia.d-4a89XrP7.d.ts +1 -0
- package/dist/IntakeMedia.d-DGxrhgIW.d.ts +1 -0
- package/dist/IntakeMedia.d-DUPR4lVM.d.cts +1 -0
- package/dist/IntakeMedia.d-JJCUvQu7.d.cts +1 -0
- package/dist/LICENSE.md +1 -0
- package/dist/LifecyclePort.d-Cr1p33a7.d.cts +1 -0
- package/dist/LifecyclePort.d-Cr1p33a7.d.ts +1 -0
- package/dist/PhotoController.d-BzCJOE7e.d.cts +1 -0
- package/dist/PhotoController.d-D0XiUUOl.d.ts +1 -0
- package/dist/{RecordsPage.d-DKrZ9rHX.d.ts → RecordsPage.d-6WMbieaV.d.ts} +2 -1
- package/dist/{RecordsPage.d-DRPdUAo4.d.cts → RecordsPage.d-B2gLf8RH.d.cts} +2 -1
- package/dist/SDK-LICENSE.txt +130 -0
- package/dist/THIRD_PARTY_NOTICES +9 -0
- package/dist/TelemetryPort.d-BDNr00hu.d.cts +1 -0
- package/dist/TelemetryPort.d-BDNr00hu.d.ts +1 -0
- package/dist/animations/index.cjs +2 -1
- package/dist/animations/index.d.cts +24 -23
- package/dist/animations/index.d.ts +24 -23
- package/dist/animations/index.js +2 -1
- package/dist/{Chat.d-a7Ksz7NZ.d.ts → appStateLifecycle.d-B7L427MF.d.ts} +73 -141
- package/dist/{Chat.d-CtfANk3A.d.cts → appStateLifecycle.d-CWedOJq4.d.cts} +73 -141
- package/dist/{attachments.d-CpaOfi2g.d.cts → attachments.d-BARh-PrJ.d.cts} +26 -7
- package/dist/{attachments.d-BGn2_knv.d.ts → attachments.d-CB0R1_vK.d.ts} +26 -7
- package/dist/{attachments.d-CoQhXrP9.d.ts → attachments.d-CPgp4_W-.d.ts} +3 -2
- package/dist/{attachments.d-CqHMGoER.d.cts → attachments.d-DeoaCEMD.d.cts} +3 -2
- package/dist/{bookingCopy.d-BwCOCZUj.d.ts → bookingCopy.d-BakTjvWw.d.ts} +3 -2
- package/dist/{bookingCopy.d-Bnq2zk0F.d.cts → bookingCopy.d-CVmpuk9C.d.cts} +3 -2
- package/dist/branding.d-Bbc6p1XY.d.cts +1 -0
- package/dist/branding.d-y6c0UwhE.d.ts +1 -0
- package/dist/cacheEpoch.d-DknKn3S0.d.cts +1 -0
- package/dist/cacheEpoch.d-DknKn3S0.d.ts +1 -0
- package/dist/callCopy.d-Bw6oZT54.d.cts +1 -0
- package/dist/callCopy.d-Bw6oZT54.d.ts +1 -0
- package/dist/callRoom.d-B1DoYdJe.d.cts +1 -0
- package/dist/callRoom.d-Dqm1rUqT.d.ts +1 -0
- package/dist/{casesRepository.d-DG83Ggbq.d.ts → casesRepository.d-CuokarTU.d.ts} +2 -1
- package/dist/{casesRepository.d-CsUJ2Oyb.d.cts → casesRepository.d-DKRLtYb8.d.cts} +2 -1
- package/dist/chat/index.cjs +229 -214
- package/dist/chat/index.d.cts +12 -9
- package/dist/chat/index.d.ts +12 -9
- package/dist/chat/index.js +230 -215
- package/dist/client/index.cjs +2 -1
- package/dist/client/index.d.cts +7 -6
- package/dist/client/index.d.ts +7 -6
- package/dist/client/index.js +2 -1
- package/dist/{clinicBatch.d-Byjx4y_W.d.ts → clinicBatch.d-BP_Rpvcy.d.ts} +3 -2
- package/dist/{clinicBatch.d-BLpbpS51.d.cts → clinicBatch.d-BTDdhMQ2.d.cts} +3 -2
- package/dist/clinicModels.d-BXgKZqDb.d.cts +1 -0
- package/dist/clinicModels.d-CaS64-P-.d.ts +1 -0
- package/dist/clinicRequestProps.d-1dCtouGA.d.cts +1 -0
- package/dist/clinicRequestProps.d-CjsMg_OD.d.ts +1 -0
- package/dist/{config.d-C0WgjutL.d.cts → config.d-84fNJFv9.d.cts} +2 -1
- package/dist/{config.d-zd2eTb2L.d.ts → config.d-B4-Mrwq2.d.ts} +2 -1
- package/dist/consent/index.cjs +1 -0
- package/dist/consent/index.d.cts +6 -5
- package/dist/consent/index.d.ts +6 -5
- package/dist/consent/index.js +1 -0
- package/dist/{context.d-Du_UPxa1.d.cts → context.d-87MMrNm6.d.cts} +6 -5
- package/dist/{context.d-BBjmV0rz.d.ts → context.d-rNGMZH8T.d.ts} +6 -5
- package/dist/{copy.d-Da_PP2K3.d.cts → copy.d-CJOLhJac.d.cts} +3 -2
- package/dist/{copy.d-D_VVj01o.d.ts → copy.d-DbwWriBp.d.ts} +3 -2
- package/dist/core/index.cjs +2 -1
- package/dist/core/index.d.cts +14 -13
- package/dist/core/index.d.ts +14 -13
- package/dist/core/index.js +2 -1
- package/dist/{depth.d-RTV61QNf.d.cts → depth.d-CXpPxNSK.d.cts} +3 -2
- package/dist/{depth.d-BEedifOR.d.ts → depth.d-Dca1T_RH.d.ts} +3 -2
- package/dist/{entitlementRepository.d-BwThmh3V.d.ts → entitlementRepository.d-BBRYTUlp.d.ts} +3 -2
- package/dist/{entitlementRepository.d-C-stdRyA.d.cts → entitlementRepository.d-DBhzBQjZ.d.cts} +3 -2
- package/dist/features.d-DrQxTw3-.d.cts +1 -0
- package/dist/features.d-DrQxTw3-.d.ts +1 -0
- package/dist/{focus.d-Dsm39DjO.d.cts → focus.d-BQnOVAql.d.cts} +4 -3
- package/dist/{focus.d-CtotIyEt.d.ts → focus.d-BZ2sEpbU.d.ts} +4 -3
- package/dist/health-plan/index.cjs +135 -131
- package/dist/health-plan/index.d.cts +78 -24
- package/dist/health-plan/index.d.ts +78 -24
- package/dist/health-plan/index.js +135 -131
- package/dist/{idempotency.d-Cv-B7SfC.d.ts → idempotency.d-9wNNohIA.d.cts} +2 -1
- package/dist/{idempotency.d-Bfm7oIxS.d.cts → idempotency.d-BdB17veP.d.ts} +2 -1
- package/dist/{identity.d-BksOEa6m.d.ts → identity.d-DxNvhj3a.d.ts} +2 -1
- package/dist/{identity.d-CioQhZrq.d.cts → identity.d-nRZBzkG2.d.cts} +2 -1
- package/dist/ids.d-B2GAAifq.d.cts +1 -0
- package/dist/ids.d-B2GAAifq.d.ts +1 -0
- package/dist/index.cjs +234 -219
- package/dist/index.d.cts +15 -12
- package/dist/index.d.ts +15 -12
- package/dist/index.js +235 -220
- package/dist/{introEvents.d-fAZitxMA.d.cts → introEvents.d-CQeiUeLn.d.cts} +2 -1
- package/dist/{introEvents.d-tOi4o3F4.d.ts → introEvents.d-bkIxpIKr.d.ts} +2 -1
- package/dist/introEvents.d-dS3fJCH1.d.cts +1 -0
- package/dist/introEvents.d-dS3fJCH1.d.ts +1 -0
- package/dist/models.d-BSqvbTE1.d.cts +1 -0
- package/dist/models.d-DOwnr8fi.d.ts +1 -0
- package/dist/notifications/index.cjs +1 -0
- package/dist/notifications/index.d.cts +5 -4
- package/dist/notifications/index.d.ts +5 -4
- package/dist/notifications/index.js +1 -0
- package/dist/{optInView.d-BkNSv4Gk.d.cts → optInView.d-BbVUUeoG.d.cts} +15 -2
- package/dist/{optInView.d-B8zTORO2.d.ts → optInView.d-DVJcB4Gp.d.ts} +15 -2
- package/dist/optionalModule.d-DbJmsq5f.d.cts +1 -0
- package/dist/optionalModule.d-DbJmsq5f.d.ts +1 -0
- package/dist/{parse.d-B5JHS6Pr.d.ts → parse.d-CGeJrcAC.d.ts} +2 -1
- package/dist/{parse.d-BgjO82mY.d.cts → parse.d-Dk0BasyK.d.cts} +2 -1
- package/dist/{pets.d-OWxskXCP.d.ts → pets.d-DBopbeRe.d.ts} +2 -1
- package/dist/{pets.d-B_LoizOv.d.cts → pets.d-DVptPgi0.d.cts} +2 -1
- package/dist/{petsRepository.d-Ba3xhJcj.d.ts → petsRepository.d-BtuooSOW.d.ts} +2 -1
- package/dist/{petsRepository.d-B5DWzU7C.d.cts → petsRepository.d-Daef7u0o.d.cts} +2 -1
- package/dist/photo/index.cjs +1 -0
- package/dist/photo/index.d.cts +1 -0
- package/dist/photo/index.d.ts +1 -0
- package/dist/photo/index.js +1 -0
- package/dist/ports.d-BX4f4UsB.d.cts +1 -0
- package/dist/ports.d-BX4f4UsB.d.ts +1 -0
- package/dist/{ports.d-BDtwHxmW.d.ts → ports.d-BxCVSbSi.d.ts} +5 -4
- package/dist/{ports.d-gZNTn8Qf.d.cts → ports.d-CAT70bVD.d.cts} +5 -4
- package/dist/presentation.d-vy8kTGfR.d.cts +1 -0
- package/dist/presentation.d-vy8kTGfR.d.ts +1 -0
- package/dist/profile.d-CSs1wlXT.d.cts +1 -0
- package/dist/profile.d-CSs1wlXT.d.ts +1 -0
- package/dist/projection.d-CeIUsbSk.d.cts +1 -0
- package/dist/projection.d-CeIUsbSk.d.ts +1 -0
- package/dist/quickPrompts.d-NM_81Jc1.d.cts +1 -0
- package/dist/quickPrompts.d-NM_81Jc1.d.ts +1 -0
- package/dist/records/depth/index.cjs +2 -1
- package/dist/records/depth/index.d.cts +10 -9
- package/dist/records/depth/index.d.ts +10 -9
- package/dist/records/depth/index.js +2 -1
- package/dist/records/index.cjs +243 -200
- package/dist/records/index.d.cts +170 -73
- package/dist/records/index.d.ts +170 -73
- package/dist/records/index.js +244 -201
- package/dist/recordsAsk.d-C5CGSi3j.d.cts +1 -0
- package/dist/recordsAsk.d-C5CGSi3j.d.ts +1 -0
- package/dist/{requestFunnel.d-DFf9C__p.d.ts → requestFunnel.d-Cxt0JqYx.d.ts} +3 -2
- package/dist/{requestFunnel.d-CR4akGCY.d.cts → requestFunnel.d-mEu6B-n8.d.cts} +3 -2
- package/dist/resolve.d-CoQWUy1Y.d.cts +1 -0
- package/dist/resolve.d-CoQWUy1Y.d.ts +1 -0
- package/dist/{runtimeTypes.d-BqBOrZxa.d.ts → runtimeTypes.d-Bkcj_XQy.d.ts} +5 -4
- package/dist/{runtimeTypes.d-CHdH-y2c.d.cts → runtimeTypes.d-D_qHJROH.d.cts} +5 -4
- package/dist/{screenProps.d-B1dIANI0.d.cts → screenProps.d-CR1lrpzR.d.cts} +3 -2
- package/dist/{screenProps.d-CVqFJw-J.d.ts → screenProps.d-D9n-ancr.d.ts} +3 -2
- package/dist/server/events/index.cjs +2 -1
- package/dist/server/events/index.d.cts +3 -2
- package/dist/server/events/index.d.ts +3 -2
- package/dist/server/events/index.js +2 -1
- package/dist/server/index.cjs +2 -1
- package/dist/server/index.d.cts +4 -3
- package/dist/server/index.d.ts +4 -3
- package/dist/server/index.js +2 -1
- package/dist/sheetCopy.d-CAhLOxjc.d.cts +1 -0
- package/dist/sheetCopy.d-CAhLOxjc.d.ts +1 -0
- package/dist/sheetSeam.d-B09jf4YC.d.ts +1 -0
- package/dist/sheetSeam.d-BBuEIVsa.d.cts +1 -0
- package/dist/shop/index.cjs +17 -16
- package/dist/shop/index.d.cts +13 -3
- package/dist/shop/index.d.ts +13 -3
- package/dist/shop/index.js +17 -16
- package/dist/species.d-BXAIMh7I.d.cts +1 -0
- package/dist/species.d-BXAIMh7I.d.ts +1 -0
- package/dist/tabs/index.cjs +5 -4
- package/dist/tabs/index.d.cts +35 -15
- package/dist/tabs/index.d.ts +35 -15
- package/dist/tabs/index.js +6 -5
- package/dist/tabsModel.d-B7QMug1u.d.cts +16 -0
- package/dist/tabsModel.d-B7QMug1u.d.ts +16 -0
- package/dist/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +7 -6
- package/dist/televet/booking/index.d.ts +7 -6
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +1 -0
- package/dist/televet/call/index.d.ts +1 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -0
- package/dist/televet/index.d.cts +1 -0
- package/dist/televet/index.d.ts +1 -0
- package/dist/televet/index.js +1 -0
- package/dist/televetGlobal.d-CC-DrqkQ.d.ts +1 -0
- package/dist/televetGlobal.d-CKwDCbmN.d.cts +1 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.d.cts +2 -1
- package/dist/testing/index.d.ts +2 -1
- package/dist/testing/index.js +1 -0
- package/dist/testing/rn/index.cjs +2 -2
- package/dist/testing/rn/index.d.cts +11 -9
- package/dist/testing/rn/index.d.ts +11 -9
- package/dist/testing/rn/index.js +2 -2
- package/dist/testing/web/index.cjs +1 -0
- package/dist/testing/web/index.d.cts +8 -7
- package/dist/testing/web/index.d.ts +8 -7
- package/dist/testing/web/index.js +1 -0
- package/dist/texting/index.cjs +23 -17
- package/dist/texting/index.d.cts +9 -6
- package/dist/texting/index.d.ts +9 -6
- package/dist/texting/index.js +24 -18
- package/dist/threadOptions.d-6hfQS1x7.d.cts +55 -0
- package/dist/threadOptions.d-6hfQS1x7.d.ts +55 -0
- package/dist/threadOptions.d-BEG-LZrC.d.cts +147 -0
- package/dist/threadOptions.d-BerQM1Ql.d.ts +147 -0
- package/dist/{threadOptions.d-DZ0AoQGk.d.ts → threadOptions.d-BgBvSIw8.d.ts} +7 -40
- package/dist/{threadOptions.d-CnSfFVMr.d.cts → threadOptions.d-P9v7I7va.d.cts} +7 -40
- package/dist/{timelineRows.d-CF1KvLcQ.d.cts → timelineRows.d-C04lp_Vj.d.cts} +2 -1
- package/dist/{timelineRows.d-CtL0y7y1.d.ts → timelineRows.d-_7JemrY-.d.ts} +2 -1
- package/dist/tokens.d-BUVqme2D.d.cts +1 -0
- package/dist/tokens.d-BUVqme2D.d.ts +1 -0
- package/dist/typeStyle.d-B3Kdtjie.d.ts +1 -0
- package/dist/typeStyle.d-DmlwyJq-.d.cts +1 -0
- package/dist/uploadTransport.d-CWL7CdWP.d.cts +1 -0
- package/dist/uploadTransport.d-EGoUl7gX.d.ts +1 -0
- package/dist/{planSignals.d-DtxZoWGM.d.ts → useHealthPlanSubscription.d-CUbHE6eK.d.ts} +82 -3
- package/dist/{planSignals.d-Cl6n5QpS.d.cts → useHealthPlanSubscription.d-OhLZpn-n.d.cts} +82 -3
- package/dist/useIntroSeen.d-CTWFUthO.d.cts +1 -0
- package/dist/useIntroSeen.d-CTWFUthO.d.ts +1 -0
- package/dist/{usePresentation.d-BsR08Wxt.d.ts → usePresentation.d-CBtBx38t.d.ts} +41 -40
- package/dist/{usePresentation.d-CZS0qlLI.d.cts → usePresentation.d-YkJeq9mf.d.cts} +41 -40
- package/dist/useRecords.d-BYNX01El.d.cts +1 -0
- package/dist/useRecords.d-DWk61a4c.d.ts +1 -0
- package/dist/{useRecordsDepth.d-k-zYIHTe.d.cts → useRecordsDepth.d-FTImzp6T.d.cts} +2 -1
- package/dist/{useRecordsDepth.d-DTAxFf5s.d.ts → useRecordsDepth.d-_rqDIvoq.d.ts} +2 -1
- package/dist/useVetVisit.d-BtdwhmgD.d.cts +1 -0
- package/dist/useVetVisit.d-DoYQimyt.d.ts +1 -0
- package/dist/video/index.cjs +1 -0
- package/dist/video/index.d.cts +1 -0
- package/dist/video/index.d.ts +1 -0
- package/dist/video/index.js +1 -0
- package/dist/{view.d-CAWQjcY_.d.cts → view.d-Dd6AfMvG.d.cts} +4 -3
- package/dist/{view.d-BE7VOlsB.d.ts → view.d-gmYinlac.d.ts} +4 -3
- package/dist/visitIntent.d-D7_yVp1I.d.cts +1 -0
- package/dist/visitIntent.d-D7_yVp1I.d.ts +1 -0
- package/dist/web/consent/index.cjs +1 -0
- package/dist/web/consent/index.d.cts +6 -5
- package/dist/web/consent/index.d.ts +6 -5
- package/dist/web/consent/index.js +1 -0
- package/dist/web/health-plan/index.cjs +3 -2
- package/dist/web/health-plan/index.d.cts +16 -69
- package/dist/web/health-plan/index.d.ts +16 -69
- package/dist/web/health-plan/index.js +3 -2
- package/dist/web/index.cjs +20 -17
- package/dist/web/index.d.cts +35 -43
- package/dist/web/index.d.ts +35 -43
- package/dist/web/index.js +20 -17
- package/dist/web/intro/index.cjs +1 -0
- package/dist/web/intro/index.d.cts +7 -6
- package/dist/web/intro/index.d.ts +7 -6
- package/dist/web/intro/index.js +1 -0
- package/dist/web/notifications/index.cjs +1 -0
- package/dist/web/notifications/index.d.cts +4 -3
- package/dist/web/notifications/index.d.ts +4 -3
- package/dist/web/notifications/index.js +1 -0
- package/dist/web/records/depth/index.cjs +1 -0
- package/dist/web/records/depth/index.d.cts +10 -9
- package/dist/web/records/depth/index.d.ts +10 -9
- package/dist/web/records/depth/index.js +1 -0
- package/dist/web/records/index.cjs +1 -0
- package/dist/web/records/index.d.cts +12 -11
- package/dist/web/records/index.d.ts +12 -11
- package/dist/web/records/index.js +1 -0
- package/dist/web/records/upload/index.cjs +1 -0
- package/dist/web/records/upload/index.d.cts +1 -0
- package/dist/web/records/upload/index.d.ts +1 -0
- package/dist/web/records/upload/index.js +1 -0
- package/dist/web/records-sheet/index.cjs +12 -11
- package/dist/web/records-sheet/index.d.cts +1 -0
- package/dist/web/records-sheet/index.d.ts +1 -0
- package/dist/web/records-sheet/index.js +12 -11
- package/dist/web/shop/index.cjs +12 -11
- package/dist/web/shop/index.d.cts +4 -3
- package/dist/web/shop/index.d.ts +4 -3
- package/dist/web/shop/index.js +12 -11
- package/dist/web/televet/booking/index.cjs +1 -0
- package/dist/web/televet/booking/index.d.cts +7 -6
- package/dist/web/televet/booking/index.d.ts +7 -6
- package/dist/web/televet/booking/index.js +1 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +1 -0
- package/dist/web/televet/call/index.d.ts +1 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -0
- package/dist/web/televet/index.d.cts +1 -0
- package/dist/web/televet/index.d.ts +1 -0
- package/dist/web/televet/index.js +1 -0
- package/dist/web/texting/index.cjs +2 -1
- package/dist/web/texting/index.d.cts +9 -6
- package/dist/web/texting/index.d.ts +9 -6
- package/dist/web/texting/index.js +2 -1
- package/package.json +15 -6
- package/LICENSE +0 -21
- package/dist/tabsModel.d-BfIQg6yS.d.cts +0 -31
- package/dist/tabsModel.d-BfIQg6yS.d.ts +0 -31
package/dist/tabs/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import{EverfurChat}from"@everfur/sdk/chat";import{useHealthPlanPage,HealthPlanScrollScope,EverfurHealthPlan,useEverfurHealthPlan}from"@everfur/sdk/health-plan";import{useEverfurRecordsClinic,EverfurRecords,EverfurRecordsConsent,useEverfurRecords}from"@everfur/sdk/records";import{createContext,forwardRef,createElement,useRef,useState,useMemo,useEffect,useCallback,useContext,useLayoutEffect,useSyncExternalStore}from"react";import{TextInput as TextInput$1,StyleSheet,View,Pressable,Easing,Platform,Text as Text$1,Image,Animated,PanResponder,Modal,KeyboardAvoidingView,ScrollView,Dimensions,AccessibilityInfo,AppState}from"react-native";import{jsx,jsxs,Fragment}from"react/jsx-runtime";var SIGNALS_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#HealthPlanSignals@v1"),signalHost=globalThis;function isSignalState(value){if(typeof value!="object"||value===null)return false;let v=value;return v.landed instanceof Set&&v.noVet instanceof Set&&v.noVetByPet instanceof Map}var stored=signalHost[SIGNALS_SYMBOL],fresh=()=>({landed:/* @__PURE__ */new Set,noVet:/* @__PURE__ */new Set,noVetByPet:/* @__PURE__ */new Map}),state=isSignalState(stored)?stored:signalHost[SIGNALS_SYMBOL]=fresh(),landedListeners=state.landed,noVetListeners=state.noVet,noVetByPet=state.noVetByPet;function notifyHealthPlanRecordsLanded(petRef,source="host"){for(let listener of[...landedListeners])try{listener(petRef,source)}catch{}}function onHealthPlanRecordsLanded(listener){return landedListeners.add(listener),()=>{landedListeners.delete(listener)}}function setHealthPlanNoVet(petRef,noVet){if((noVetByPet.get(petRef)??false)!==noVet){noVet?noVetByPet.set(petRef,true):noVetByPet.delete(petRef);for(let listener of[...noVetListeners])try{listener(petRef,noVet)}catch{}}}function healthPlanNoVet(petRef){return noVetByPet.get(petRef)??false}function onHealthPlanNoVet(listener){return noVetListeners.add(listener),()=>{noVetListeners.delete(listener)}}var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
2
3
|
/* @__PURE__ */Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),
|
|
3
4
|
/* @__PURE__ */Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),
|
|
4
5
|
/* @__PURE__ */Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),
|
|
@@ -96,7 +97,7 @@ return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
|
96
97
|
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
|
|
97
98
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
98
99
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
99
|
-
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var INTRO_PATH="/widget/v1/me/intro";function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response was not the documented shape`})}function introStateFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw;if(!("seen_at"in o))return null;let at=o.seen_at;return at===null?/* @__PURE__ */Object.freeze({seenAt:null}):typeof at!="string"||at.length===0||at.length>64||Number.isNaN(Date.parse(at))?null:/* @__PURE__ */Object.freeze({seenAt:at})}function createIntroRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createIntroRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},gone=verb=>Promise.resolve(err(disposed(verb)));return{read:opts=>runtime.isDisposed?gone("read"):over().read(opts),markSeen:()=>runtime.isDisposed?gone("markSeen"):over().markSeen()}}function createIntroRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),call=async(name,req,opts)=>{let res=await funnel.send(name,req,opts);if(!res.ok)return err(res.error);let state3=introStateFromWire(res.value);return state3===null?err(malformed(name)):ok(state3)};return{read(opts){let req=opts?.signal?{method:"GET",path:INTRO_PATH,signal:opts.signal}:{method:"GET",path:INTRO_PATH};return call("intro.read",req,{maxAttempts:1})},markSeen(){return call("intro.markSeen",{method:"PUT",path:INTRO_PATH,body:{seen:true}})}}}var INTRO_SEEN_KV_PREFIX="everfur.intro.seen.v1:",keyFor=userRef=>`${INTRO_SEEN_KV_PREFIX}${userRef}`;async function readIntroSeenLocally(kv,userRef){try{return await kv.getItem(keyFor(userRef))!==null}catch{return false}}async function keepIntroSeenLocally(kv,userRef,at){try{await kv.setItem(keyFor(userRef),at)}catch{}}async function shouldPlayIntro(deps){let{repo:repo,kv:kv,userRef:userRef,signal:signal}=deps;if(userRef===null||await readIntroSeenLocally(kv,userRef))return false;let read;try{read=await repo.read(signal?{signal:signal}:void 0)}catch{return false}return signal?.aborted===true||!read.ok?false:read.value.seenAt!==null?(await keepIntroSeenLocally(kv,userRef,read.value.seenAt),false):true}async function markIntroSeen(deps){let{repo:repo,kv:kv,userRef:userRef}=deps;if(userRef!==null){await keepIntroSeenLocally(kv,userRef,(deps.now?.()??/* @__PURE__ */new Date).toISOString());try{await repo.markSeen()}catch{}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`});return copy}healthPlanFocusCopyFor({sex:"female"});var EVERFUR_INTRO_COPY=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(name,sex){let words=healthPlanPetWords(name,sex);return{...words,subj:sex==="female"?"she":sex==="male"?"he":words.name}}var NUMBER_WORDS=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(n){return Number.isInteger(n)&&n>=1&&n<=10?NUMBER_WORDS[n]??null:null}var cap=s=>s===""?s:s.charAt(0).toUpperCase()+s.slice(1);function defaultIntroBlanks(p){return[{before:`Keep ${p.obj} at `,after:" lb",source:`From ${p.poss} vet visits`},{before:`${p.Poss} next shots are due `,after:"",source:`From ${p.poss} clinic`,width:"l"}]}function introFacts(page,petName){let name=page?.pet.name??petName??null,design=page?.page??null,byline=design?.byline?.name?.trim()??"";return{pet:introPetWords(name,page?.pet.sex??null),planTitle:design?.title.trim()??"",vetName:page?.vetReviewed===true&&byline!==""?byline:null,tips:design?.routine?.steps.length??0}}function introText(input){let{facts:facts,copy:copy,resultsPending:resultsPending}=input,p=facts.pet,n=numberWord(input.blanks),tips=numberWord(facts.tips),topic=copy.planTopic.trim(),vet=facts.vetName===null?null:facts.vetName.replace(/ /g," "),planFor=topic===""?"":`One plan for ${p.poss} ${topic}${vet===null?"":`, built with ${vet}`}.`,tipsLine=tips===null?"":`${cap(tips)} tips, one thing to add.`,planRow=resultsPending?`${p.Poss} plan arrives with ${p.poss} results.`:[planFor,tipsLine].filter(s=>s!=="").join(" "),recordsRow=[`What could go wrong for ${p.name}, and what's changed.`,copy.recordsRowMore.trim()].filter(s=>s!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${p.Name}'s tab`,records:`Request ${p.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:copy.eyebrow,title:`${p.Name}'s health, in three tabs.`,lede:resultsPending?copy.pendingLede:copy.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${p.name} any hour (the 2 am ones too).`,plan:planRow,records:recordsRow,next:"Next",seePlan:`See ${p.poss} plan`},ask:{title:copy.askTitle,lede:n===null?"":`${p.Poss} plan has ${n} blanks only ${p.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${input.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${p.poss} vet`,fine:`We send ${p.poss} clinic a secure request and read every page they send back.`,noVet:`${p.Name} doesn't have a vet yet`},clinic:{title:`Where does ${p.name} see ${p.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${p.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${p.subj} sees most.`,request:`Request ${p.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${p.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${p.Poss} records request`,sentStep:"Request sent",sentTo:clinic=>`Today, to ${clinic}`,clinicStep:`${p.Poss} clinic sends ${p.poss} records`,clinicEta:copy.clinicEta,blanksStep:n===null?"":`${p.Poss} ${n} blanks fill in`,blanksDetail:copy.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${p.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:copy.sentFine},noVet:{title:copy.noVetTitle,lede:n===null?"":`When ${p.subj} does, connect ${p.poss} vet in Records and ${p.poss} ${n} blanks fill in.`,seePlan:`See ${p.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${p.name}'s records are in.`,off:`Requested. ${p.Name}'s records will show up here when they're in.`,landed:`${p.Poss} records are in. ${p.Poss} plan now uses ${p.poss} weight and ${p.poss} visits.`},banner:{app:copy.appName,now:"now",title:`${p.Name}'s records are in`,body:copy.bannerBody}}}var INTRO_OPEN_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#IntroOpen@v1"),host=globalThis;function isIntroOpenState(value){if(typeof value!="object"||value===null)return false;let v=value;return v.holds instanceof Set&&v.listeners instanceof Set}var stored2=host[INTRO_OPEN_SYMBOL],fresh2=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state2=isIntroOpenState(stored2)?stored2:host[INTRO_OPEN_SYMBOL]=fresh2();function notify(){for(let listener of[...state2.listeners])try{listener()}catch{}}function holdIntroOpen(){let token={};return state2.holds.add(token),state2.holds.size===1&¬ify(),()=>{state2.holds.delete(token)&&state2.holds.size===0&¬ify()}}function useIntroOpenHold(held){useEffect(()=>held?holdIntroOpen():void 0,[held])}var KEY=/* @__PURE__ */Symbol.for("everfur.sdk.rn.askHome");function shared(){let g=globalThis,hit=g[KEY];if(hit!==void 0)return hit;let fresh3={factory:createContext(null),home:createContext(null)};return g[KEY]=fresh3,fresh3}var AskHomeFactoryContext=shared().factory;shared().home;function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}var EVERFUR_TABS_COPY=/* @__PURE__ */Object.freeze({ask:"Ask",plan:"Health Plan",records:"Records",listAll:"Ask, Health Plan and Records",listNoPlan:"Ask and Records"}),ALL=/* @__PURE__ */Object.freeze(["ask","plan","records"]),NO_PLAN=/* @__PURE__ */Object.freeze(["ask","records"]);function tabsFor(planHidden){return planHidden?NO_PLAN:ALL}function resolveTab(wanted,planHidden){return wanted==="plan"&&planHidden?"ask":wanted}function landingTab(opened,planHidden){return opened.via==="link"?resolveTab(opened.ask!==void 0?"ask":opened.tab,planHidden):resolveTab("plan",planHidden)}function openedKey(opened){let key=opened.key===void 0?"":String(opened.key);return opened.via==="link"?`link:${opened.tab}:${opened.ask?.prompt??""}:${key}`:`plain:${key}`}var PLAN_STALE_MS=6e4;function isPlanReadStale(lastReadAt,now,staleMs=PLAN_STALE_MS){return lastReadAt!==null&&now-lastReadAt>=staleMs}function isPlanReturnReadDue(read){return read.pageVisible&&read.watching&&isPlanReadStale(read.lastReadAt,read.now)}function stableJson(value){return JSON.stringify(value,(_key,field)=>{if(field===null||typeof field!="object"||Array.isArray(field))return field;let sorted={};for(let key of Object.keys(field).sort())sorted[key]=field[key];return sorted})}function planSignature(plan){if(plan===null)return"";let items=plan.items.map(item=>[item.productId,item.partnerSku,item.title,item.description,item.category,item.price,item.currency,item.imageUrl,item.url,item.sample]).sort((a,b)=>a[0]<b[0]?-1:a[0]>b[0]?1:0);return JSON.stringify([plan.headline,items])}function pageSignature(page){return page===null?"":stableJson([page.checkout,page.page])}function readSignature(plan,page){return JSON.stringify([planSignature(plan),pageSignature(page)])}function isPlanReadSettled(planStatus,pagePhase){return planStatus!=="empty"&&planStatus!=="ready"?false:pagePhase==="ready"||pagePhase==="failed"||pagePhase==="idle"}function isPlanReadEmpty(planStatus,page){return planStatus==="empty"&&!healthPlanPageDrawsWithoutItems(page?.page)}function nextPlanVerdict(previous,read){return previous===void 0?{empty:read.empty,signature:read.signature,epoch:0}:previous.empty===read.empty&&previous.signature===read.signature?previous:{empty:read.empty,signature:read.signature,epoch:previous.signature===read.signature?previous.epoch:previous.epoch+1}}var INTRO_WAIT_MS=5e3;function introWantStep(state3){return state3.sameOpen?state3.plan===void 0?state3.planFailed?"drop":"wait":state3.plan.empty?"drop":state3.recordsPending?"wait":"play":"drop"}function createPaneShownSignal(){let listeners=/* @__PURE__ */new Set;return{listen(listener){let entry=()=>listener();return listeners.add(entry),()=>{listeners.delete(entry)}},fire(){for(let listener of[...listeners])try{listener()}catch{}}}}function withPaneShown(base,shown){return{...{onForeground(listener){let stopBase=base.onForeground(listener),stopShown=shown.listen(listener);return()=>{stopShown(),stopBase()}}},...base.onOnline===void 0?{}:{onOnline:base.onOnline.bind(base)},...base.onAnnounced===void 0?{}:{onAnnounced:base.onAnnounced.bind(base)},...base.isOffline===void 0?{}:{isOffline:base.isOffline.bind(base)}}}function isPaneShownEdge(wasShown,shown){return!wasShown&&shown}var REQUIRES=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(name){return REQUIRES[name]}function decideCapability(name,decisions,opts){let keys=requires(name),byResource=/* @__PURE__ */new Map;for(let decision of decisions)byResource.set(decision.resource,decision);if(opts?.isPending===true&&keys.some(key=>!byResource.has(key)))return freezeDecision({name:name,enabled:false,isPending:true,limits:{}});let limits=mergeLimits(keys,byResource);return keys.filter(key=>byResource.get(key)?.granted!==true).length===0?freezeDecision({name:name,enabled:true,isPending:false,limits:limits}):freezeDecision({name:name,enabled:false,isPending:false,limits:limits,disabled:disabledFor(keys,byResource)})}function mergeLimits(keys,byResource){let out={};for(let key of keys){let decisionLimits=byResource.get(key)?.limits;if(decisionLimits)for(let[limitKey,limitValue]of Object.entries(decisionLimits)){let existing=out[limitKey];out[limitKey]=existing===void 0?limitValue:Math.min(existing,limitValue)}}return out}function disabledFor(keys,byResource){for(let key of keys){let explicit=byResource.get(key)?.disabled;if(explicit)/* @__PURE__ */
|
|
100
|
+
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop2=()=>{};if(!caller)return{signal:deadline,dispose:noop2};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop2};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}var INTRO_PATH="/widget/v1/me/intro";function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response was not the documented shape`})}function introStateFromWire(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw;if(!("seen_at"in o))return null;let at=o.seen_at;return at===null?/* @__PURE__ */Object.freeze({seenAt:null}):typeof at!="string"||at.length===0||at.length>64||Number.isNaN(Date.parse(at))?null:/* @__PURE__ */Object.freeze({seenAt:at})}function createIntroRepository(runtime){let over=()=>{let{services:services}=runtime.registry;return createIntroRepositoryOver({auth:services.authFor(null),...services.errorPolicy?{errorPolicy:services.errorPolicy}:{}})},gone=verb=>Promise.resolve(err(disposed(verb)));return{read:opts=>runtime.isDisposed?gone("read"):over().read(opts),markSeen:()=>runtime.isDisposed?gone("markSeen"):over().markSeen()}}function createIntroRepositoryOver(deps){let funnel=deps.funnel??createRequestFunnel({auth:deps.auth,...deps.errorPolicy?{errorPolicy:deps.errorPolicy}:{}}),call=async(name,req,opts)=>{let res=await funnel.send(name,req,opts);if(!res.ok)return err(res.error);let state3=introStateFromWire(res.value);return state3===null?err(malformed(name)):ok(state3)};return{read(opts){let req=opts?.signal?{method:"GET",path:INTRO_PATH,signal:opts.signal}:{method:"GET",path:INTRO_PATH};return call("intro.read",req,{maxAttempts:1})},markSeen(){return call("intro.markSeen",{method:"PUT",path:INTRO_PATH,body:{seen:true}})}}}var INTRO_SEEN_KV_PREFIX="everfur.intro.seen.v1:",keyFor=userRef=>`${INTRO_SEEN_KV_PREFIX}${userRef}`;async function readIntroSeenLocally(kv,userRef){try{return await kv.getItem(keyFor(userRef))!==null}catch{return false}}async function keepIntroSeenLocally(kv,userRef,at){try{await kv.setItem(keyFor(userRef),at)}catch{}}async function shouldPlayIntro(deps){let{repo:repo,kv:kv,userRef:userRef,signal:signal}=deps;if(userRef===null||await readIntroSeenLocally(kv,userRef))return false;let read;try{read=await repo.read(signal?{signal:signal}:void 0)}catch{return false}return signal?.aborted===true||!read.ok?false:read.value.seenAt!==null?(await keepIntroSeenLocally(kv,userRef,read.value.seenAt),false):true}async function markIntroSeen(deps){let{repo:repo,kv:kv,userRef:userRef}=deps;if(userRef!==null){await keepIntroSeenLocally(kv,userRef,(deps.now?.()??/* @__PURE__ */new Date).toISOString());try{await repo.markSeen()}catch{}}}var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`;function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`});return copy}healthPlanFocusCopyFor({sex:"female"});var EVERFUR_INTRO_COPY=/* @__PURE__ */Object.freeze({eyebrow:"",lede:"",pendingLede:"",recordsRowMore:"",planTopic:"",askTitle:"",noVetTitle:"",sentFine:"",clinicEta:"",blanksDetail:"",bannerBody:"",appName:""});function introPetWords(name,sex){let words=healthPlanPetWords(name,sex);return{...words,subj:sex==="female"?"she":sex==="male"?"he":words.name}}var NUMBER_WORDS=["","one","two","three","four","five","six","seven","eight","nine","ten"];function numberWord(n){return Number.isInteger(n)&&n>=1&&n<=10?NUMBER_WORDS[n]??null:null}var cap=s=>s===""?s:s.charAt(0).toUpperCase()+s.slice(1);function defaultIntroBlanks(p){return[{before:`Keep ${p.obj} at `,after:" lb",source:`From ${p.poss} vet visits`},{before:`${p.Poss} next shots are due `,after:"",source:`From ${p.poss} clinic`,width:"l"}]}function introFacts(page,petName){let name=page?.pet.name??petName??null,design=page?.page??null,byline=design?.byline?.name?.trim()??"";return{pet:introPetWords(name,page?.pet.sex??null),planTitle:design?.title.trim()??"",vetName:page?.vetReviewed===true&&byline!==""?byline:null,tips:design?.routine?.steps.length??0}}function introText(input){let{facts:facts,copy:copy,resultsPending:resultsPending}=input,p=facts.pet,n=numberWord(input.blanks),tips=numberWord(facts.tips),topic=copy.planTopic.trim(),vet=facts.vetName===null?null:facts.vetName.replace(/ /g," "),planFor=topic===""?"":`One plan for ${p.poss} ${topic}${vet===null?"":`, built with ${vet}`}.`,tipsLine=tips===null?"":`${cap(tips)} tips, one thing to add.`,planRow=resultsPending?`${p.Poss} plan arrives with ${p.poss} results.`:[planFor,tipsLine].filter(s=>s!=="").join(" "),recordsRow=[`What could go wrong for ${p.name}, and what's changed.`,copy.recordsRowMore.trim()].filter(s=>s!=="").join(" ");return{sheetLabel:{intro:`Welcome to ${p.Name}'s tab`,records:`Request ${p.poss} records`},back:"Back",skip:"Skip",close:"Close",poweredBy:"powered by",tabs:{eyebrow:copy.eyebrow,title:`${p.Name}'s health, in three tabs.`,lede:resultsPending?copy.pendingLede:copy.lede,ask:`Trained on 50,000+ peer-reviewed vet publications. Ask about ${p.name} any hour (the 2 am ones too).`,plan:planRow,records:recordsRow,next:"Next",seePlan:`See ${p.poss} plan`},ask:{title:copy.askTitle,lede:n===null?"":`${p.Poss} plan has ${n} blanks only ${p.poss} vet can fill (we ask the clinic for you).`,blanksPill:`${input.blanks} blanks`,blankLabel:"blank",later:"Later",connect:`Connect ${p.poss} vet`,fine:`We send ${p.poss} clinic a secure request and read every page they send back.`,noVet:`${p.Name} doesn't have a vet yet`},clinic:{title:`Where does ${p.name} see ${p.poss} vet?`,search:"Clinic name, city or zip",searchLabel:`Search for ${p.poss} clinic`,list:"Clinics",more:`Sees more than one? Start with the one ${p.subj} sees most.`,request:`Request ${p.poss} records`,upload:"Upload a PDF or a photo instead",add:`Add ${p.poss} clinic`},sent:{eyebrow:"Request sent",title:"Sent. Now it's the clinic's turn.",track:`${p.Poss} records request`,sentStep:"Request sent",sentTo:clinic=>`Today, to ${clinic}`,clinicStep:`${p.Poss} clinic sends ${p.poss} records`,clinicEta:copy.clinicEta,blanksStep:n===null?"":`${p.Poss} ${n} blanks fill in`,blanksDetail:copy.blanksDetail,lede:`Turn on notifications and we'll tell you the minute ${p.name}'s records are in.`,notify:"Turn on notifications",notNow:"Not now",fine:copy.sentFine},noVet:{title:copy.noVetTitle,lede:n===null?"":`When ${p.subj} does, connect ${p.poss} vet in Records and ${p.poss} ${n} blanks fill in.`,seePlan:`See ${p.poss} plan`},toast:{on:`Notifications on. We'll tell you the minute ${p.name}'s records are in.`,off:`Requested. ${p.Name}'s records will show up here when they're in.`,landed:`${p.Poss} records are in. ${p.Poss} plan now uses ${p.poss} weight and ${p.poss} visits.`},banner:{app:copy.appName,now:"now",title:`${p.Name}'s records are in`,body:copy.bannerBody}}}var INTRO_OPEN_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#IntroOpen@v1"),host=globalThis;function isIntroOpenState(value){if(typeof value!="object"||value===null)return false;let v=value;return v.holds instanceof Set&&v.listeners instanceof Set}var stored2=host[INTRO_OPEN_SYMBOL],fresh2=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state2=isIntroOpenState(stored2)?stored2:host[INTRO_OPEN_SYMBOL]=fresh2();function notify(){for(let listener of[...state2.listeners])try{listener()}catch{}}function holdIntroOpen(){let token={};return state2.holds.add(token),state2.holds.size===1&¬ify(),()=>{state2.holds.delete(token)&&state2.holds.size===0&¬ify()}}function useIntroOpenHold(held){useEffect(()=>held?holdIntroOpen():void 0,[held])}function definedProps(props){let out={};if(props==null)return out;for(let key of Object.keys(props))props[key]!==void 0&&(out[key]=props[key]);return out}var KEY=/* @__PURE__ */Symbol.for("everfur.sdk.rn.askHome");function shared(){let g=globalThis,hit=g[KEY];if(hit!==void 0)return hit;let fresh3={factory:createContext(null),home:createContext(null)};return g[KEY]=fresh3,fresh3}var AskHomeFactoryContext=shared().factory;shared().home;var noop=()=>{};function createAppStateLifecycle(){return{onForeground(listener){let subscription;try{let away=AppState.currentState==="background";subscription=AppState.addEventListener("change",next=>{next==="background"?away=!0:next==="active"&&away&&(away=!1,listener())})}catch{return noop}return()=>subscription.remove()}}}var KEY2=/* @__PURE__ */Symbol.for("everfur.sdk.rn.chatPaneShown");function shared2(){let g=globalThis,existing=g[KEY2];if(existing!==void 0)return existing;let fresh3=createContext(true);return g[KEY2]=fresh3,fresh3}var ChatPaneShownContext=shared2();function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}var EVERFUR_TABS_COPY=/* @__PURE__ */Object.freeze({ask:"Ask",plan:"Health Plan",records:"Records",listAll:"Ask, Health Plan and Records",listNoPlan:"Ask and Records"}),ALL=/* @__PURE__ */Object.freeze(["ask","plan","records"]),NO_PLAN=/* @__PURE__ */Object.freeze(["ask","records"]);function tabsFor(planHidden){return planHidden?NO_PLAN:ALL}function resolveTab(wanted,planHidden){return wanted==="plan"&&planHidden?"ask":wanted}function landingTab(opened,planHidden){return opened.via==="link"?resolveTab(opened.ask!==void 0?"ask":opened.tab,planHidden):resolveTab("plan",planHidden)}function openedKey(opened){let key=opened.key===void 0?"":String(opened.key);return opened.via==="link"?`link:${opened.tab}:${opened.ask?.prompt??""}:${key}`:`plain:${key}`}var PLAN_STALE_MS=6e4;function isPlanReadStale(lastReadAt,now,staleMs=PLAN_STALE_MS){return lastReadAt!==null&&now-lastReadAt>=staleMs}function isPlanReturnReadDue(read){return read.pageVisible&&read.watching&&isPlanReadStale(read.lastReadAt,read.now)}function stableJson(value){return JSON.stringify(value,(_key,field)=>{if(field===null||typeof field!="object"||Array.isArray(field))return field;let sorted={};for(let key of Object.keys(field).sort())sorted[key]=field[key];return sorted})}function planSignature(plan){if(plan===null)return"";let items=plan.items.map(item=>[item.productId,item.partnerSku,item.title,item.description,item.category,item.price,item.currency,item.imageUrl,item.url,item.sample]).sort((a,b)=>a[0]<b[0]?-1:a[0]>b[0]?1:0);return JSON.stringify([plan.headline,items])}function pageSignature(page){return page===null?"":stableJson([page.checkout,page.page])}function readSignature(plan,page){return JSON.stringify([planSignature(plan),pageSignature(page)])}function isPlanReadSettled(planStatus,pagePhase){return planStatus!=="empty"&&planStatus!=="ready"?false:pagePhase==="ready"||pagePhase==="failed"||pagePhase==="idle"}function isPlanReadEmpty(planStatus,page){return planStatus==="empty"&&!healthPlanPageDrawsWithoutItems(page?.page)}function nextPlanVerdict(previous,read){return previous===void 0?{empty:read.empty,signature:read.signature,epoch:0}:previous.empty===read.empty&&previous.signature===read.signature?previous:{empty:read.empty,signature:read.signature,epoch:previous.signature===read.signature?previous.epoch:previous.epoch+1}}var INTRO_WAIT_MS=5e3;function introWantStep(state3){return state3.sameOpen?state3.plan===void 0?state3.planFailed?"drop":"wait":state3.plan.empty?"drop":state3.recordsPending?"wait":"play":"drop"}function createPaneShownSignal(){let listeners=/* @__PURE__ */new Set;return{listen(listener){let entry=()=>listener();return listeners.add(entry),()=>{listeners.delete(entry)}},fire(){for(let listener of[...listeners])try{listener()}catch{}}}}function withPaneShown(base,shown){return{...{onForeground(listener){let stopBase=base.onForeground(listener),stopShown=shown.listen(listener);return()=>{stopShown(),stopBase()}}},...base.onOnline===void 0?{}:{onOnline:base.onOnline.bind(base)},...base.onAnnounced===void 0?{}:{onAnnounced:base.onAnnounced.bind(base)},...base.isOffline===void 0?{}:{isOffline:base.isOffline.bind(base)}}}function foregroundWhileShown(base,isShown){return{...{onForeground(listener){return base.onForeground(()=>{isShown()&&listener()})}},...base.onOnline===void 0?{}:{onOnline:base.onOnline.bind(base)},...base.onAnnounced===void 0?{}:{onAnnounced:base.onAnnounced.bind(base)},...base.isOffline===void 0?{}:{isOffline:base.isOffline.bind(base)}}}function isPaneShownEdge(wasShown,shown){return!wasShown&&shown}var REQUIRES=/* @__PURE__ */Object.freeze({chat:/* @__PURE__ */Object.freeze(["chat.message.create"]),records:/* @__PURE__ */Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:/* @__PURE__ */Object.freeze(["records.clinic.create"]),video:/* @__PURE__ */Object.freeze(["video.gait.execute"]),photo:/* @__PURE__ */Object.freeze(["photo.checkup.execute"]),animations:/* @__PURE__ */Object.freeze(["animations.state.read"]),televet:/* @__PURE__ */Object.freeze(["televet.visit.create"]),texting:/* @__PURE__ */Object.freeze(["sms.identity.read","sms.identity.update"]),healthPlan:/* @__PURE__ */Object.freeze(["shop.plan.read","shop.plan.update"])});function requires(name){return REQUIRES[name]}function decideCapability(name,decisions,opts){let keys=requires(name),byResource=/* @__PURE__ */new Map;for(let decision of decisions)byResource.set(decision.resource,decision);if(opts?.isPending===true&&keys.some(key=>!byResource.has(key)))return freezeDecision({name:name,enabled:false,isPending:true,limits:{}});let limits=mergeLimits(keys,byResource);return keys.filter(key=>byResource.get(key)?.granted!==true).length===0?freezeDecision({name:name,enabled:true,isPending:false,limits:limits}):freezeDecision({name:name,enabled:false,isPending:false,limits:limits,disabled:disabledFor(keys,byResource)})}function mergeLimits(keys,byResource){let out={};for(let key of keys){let decisionLimits=byResource.get(key)?.limits;if(decisionLimits)for(let[limitKey,limitValue]of Object.entries(decisionLimits)){let existing=out[limitKey];out[limitKey]=existing===void 0?limitValue:Math.min(existing,limitValue)}}return out}function disabledFor(keys,byResource){for(let key of keys){let explicit=byResource.get(key)?.disabled;if(explicit)/* @__PURE__ */
|
|
100
101
|
return Object.freeze({reason:explicit.reason,level:explicit.level,recoverable:explicit.recoverable})}/* @__PURE__ */
|
|
101
102
|
return Object.freeze({reason:userFacingError("accessDenied"),level:"user_entitlement",recoverable:false})}function freezeDecision(d){let base={name:d.name,enabled:d.enabled,isPending:d.isPending,limits:/* @__PURE__ */Object.freeze({...d.limits})};return d.disabled!==void 0&&(base.disabled=d.disabled),/* @__PURE__ */Object.freeze(base)}function useCapabilityEnabled(name){let{runtime:runtime}=useEverfurContext(),store=runtime.entitlements,subscribe=useCallback(onChange=>store===void 0?()=>{}:store.subscribe(onChange),[store]),read=useCallback(()=>{if(store===void 0)return false;let snapshot=store.getSnapshot();return decideCapability(name,snapshot.decisions,{isPending:snapshot.isPending}).enabled},[store,name]);return useSyncExternalStore(subscribe,read,read)}var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap2=type.scaleCaps[tier];return cap2>0?cap2:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap2=tierMultiplier(type,tier);return createElement(Text$1,cap2===void 0?props:{maxFontSizeMultiplier:cap2,...props})}var TextInput=forwardRef(function(props,ref){return createElement(TextInput$1,{...props,...ref===null?{}:{ref:ref}})});var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int=Math.trunc(n)>>>0,a=int>>>24&255;return{r:int>>>16&255,g:int>>>8&255,b:int&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix2=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix2(fg.r,bg.r),g:mix2(fg.g,bg.g),b:mix2(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}function withAlpha(color,alpha){let rgba=toRgba(color);if(rgba===null)return null;let a=Math.min(1,Math.max(0,alpha));return`rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${a})`}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix2=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix2(from.r,to.r),mix2(from.g,to.g),mix2(from.b,to.b));if(reads(candidate))return candidate}return pole}var RAPH_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...RAPH_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill)=>contrastRatio(ink,fill)>=V3_TEXT_CONTRAST?ink:legibleOn(fill,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;function v3InkOn(fill,inks){for(let ink of inks)if(contrastRatio(ink,fill)>=V3_TEXT_CONTRAST)return ink;return legibleOn(fill,V3_TEXT_CONTRAST)}function mix(color,share,ground){let over=withAlpha(color,share);return(over===null?null:flattenOnto(over,ground))??ground}function askIntroColors(theme){let v=v3Palette(theme),c=theme.color,card=v.card;return{ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:card,onInk:v.dark?c.background:"#FFFFFF",primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,onAccent:v3InkOn(v.accent,[v.ink,v.onAccent]),accent2:mix(v.accent,.75,card),accent4:mix(v.accent,.17,card),accentChip:mix(v.accent,.47,card),link:v.link,linkChip:mix(v.link,.2,card),riskDot:v.riskDot,riskChip:v.dark?c.badgeBgCritical:"#FFD8D6",clearBg:v.clearBg,clearInk:v.clearInk,clearChip:v.dark?c.badgeBgPositive:"#DDEFC4",byInk:c.brandInk}}var TEXT_KEYS=/* @__PURE__ */new Set(["color","fontSize","fontWeight","fontStyle","lh","ls","family","textAlign","textTransform","textDecorationLine"]),RUNTIME_KEYS=/* @__PURE__ */new Set(["dur","delay","stagger","ease","tint","k","cols","nowrap"]),PAD=["paddingTop","paddingRight","paddingBottom","paddingLeft"],ROOT_SIZE=17,ROOT_LH=1.5,ROOT_WEIGHT=400,BOLD_WEIGHT=700;function faceKeyFor(weight){return weight<=450?"regular":weight<=650?"medium":"bold"}function asWeight(value){let clamped=Math.min(900,Math.max(100,Math.round(value/100)*100));return String(clamped)}function raphFace(theme,family,weight){if(family==="$mono"){let mono=weight<=450?"mono":weight<=650?"monoMedium":"monoBold",f2=face(theme,mono);return f2.fontWeight===void 0?{fontFamily:f2.fontFamily}:{fontFamily:f2.fontFamily,fontWeight:asWeight(weight)}}let f=family==="$serif"?headingFace(theme,faceKeyFor(weight)):face(theme,faceKeyFor(weight));return f.fontWeight===void 0?{fontFamily:f.fontFamily}:{fontFamily:f.fontFamily,fontWeight:asWeight(weight)}}function createRaphKit(theme,table,reducedTable={}){let colors=askIntroColors(theme),dark=theme.brightness==="dark",reduced=theme.motion.reducedMotion,fill=value=>{if(typeof value=="string"&&value.startsWith("$")){let key=value.slice(1);return key.startsWith("n_")?dark?colors.line??value:`#${key.slice(2)}`:key==="sans"||key==="serif"||key==="mono"?value:colors[key]??value}return Array.isArray(value)?value.map(v=>fill(v)):value},merged=/* @__PURE__ */new Map,merge=selectors=>{let keys=selectors.filter(s=>typeof s=="string"&&s!==""),id=keys.join("|"),hit=merged.get(id);if(hit!==void 0)return hit;let out={},put=rule=>{if(rule!==void 0)for(let[k,v]of Object.entries(rule))out[k]=fill(v)};for(let key of keys)put(table[key]),reduced&&put(reducedTable[key]);let frozen=/* @__PURE__ */Object.freeze(out);return merged.set(id,frozen),frozen},viewCache=/* @__PURE__ */new Map,view=(...selectors)=>{let id=selectors.filter(Boolean).join("|"),hit=viewCache.get(id);if(hit!==void 0)return hit;let r=merge(selectors),out={};for(let[k,v]of Object.entries(r))TEXT_KEYS.has(k)||RUNTIME_KEYS.has(k)||k==="ring"||k==="edge"||k==="shadow"||k==="round"||k==="zIndex"&&typeof v=="number"&&v<0||v!==null&&(out[k]=v);let ring=r.ring;if(Array.isArray(ring)){let[w,color]=ring;out.borderWidth=w,out.borderColor=color;for(let side of PAD){let p=out[side];typeof p=="number"&&(out[side]=Math.max(0,p-w))}}let edge=r.edge;if(Array.isArray(edge)){let[w,color]=edge;out.borderBottomWidth=w,out.borderBottomColor=color}let shadow=r.shadow;if(Array.isArray(shadow)){let[x,y,blur,color]=shadow;out.shadowColor=color,out.shadowOffset={width:x,height:y},out.shadowOpacity=1,out.shadowRadius=blur/2}if(r.round===1){let size=typeof r.width=="number"?r.width:typeof r.height=="number"?r.height:999;out.borderRadius=size/2}let style=/* @__PURE__ */Object.freeze(out);return viewCache.set(id,style),style},textCache=/* @__PURE__ */new Map,textOf=(base,selectors)=>{let id=`${base}|${selectors.filter(Boolean).join("|")}`,hit=textCache.get(id);if(hit!==void 0)return hit;let r=merge(selectors),size=typeof r.fontSize=="number"?r.fontSize:ROOT_SIZE,lh=typeof r.lh=="number"?r.lh:ROOT_LH,weight=typeof r.fontWeight=="string"?Number(r.fontWeight):base,family=typeof r.family=="string"?r.family:"$sans",out={...raphFace(theme,family,weight),fontSize:size,lineHeight:Math.round(size*lh*100)/100,color:typeof r.color=="string"?r.color:colors.ink};typeof r.ls=="number"&&(out.letterSpacing=Math.round(r.ls*size*100)/100);for(let k of["fontStyle","textAlign","textTransform","textDecorationLine"])typeof r[k]=="string"&&(out[k]=r[k]);let style=/* @__PURE__ */Object.freeze(out);return textCache.set(id,style),style};return{reduced:reduced,colors:colors,view:view,text:(...selectors)=>textOf(ROOT_WEIGHT,selectors),strong:(...selectors)=>textOf(BOLD_WEIGHT,selectors),icon:(...selectors)=>{let r=merge(selectors),out={tintColor:typeof r.color=="string"?r.color:colors.ink};for(let k of["width","height","opacity"])typeof r[k]=="number"&&(out[k]=r[k]);return out},col:(selector,index)=>{let cols=merge([selector]).cols;if(!Array.isArray(cols))return{};let c=cols[Math.min(index,cols.length-1)];if(typeof c=="number")return{width:c,flexShrink:0};let share=typeof c=="string"?Number.parseFloat(c):1;return{flex:Number.isFinite(share)?share:1,minWidth:0}},motion:(...selectors)=>{let r=merge(selectors),ease=r.ease;return{dur:typeof r.dur=="number"?r.dur:0,delay:typeof r.delay=="number"?r.delay:0,stagger:typeof r.stagger=="number"?r.stagger:0,ease:Array.isArray(ease)&&ease.length===4?ease:null}},raw:(key,...selectors)=>merge(selectors)[key]}}var ASK_HOME_RN={".serif":{family:"$serif",fontWeight:"800",ls:-.01},".emb-btn":{flexDirection:"row",alignItems:"center",justifyContent:"center",minHeight:48,paddingTop:0,paddingRight:22,paddingBottom:0,paddingLeft:22,borderRadius:999,backgroundColor:"$primary",color:"$onPrimary",fontWeight:"700",fontSize:16,textDecorationLine:"none",dur:160,ease:[.23,1,.32,1],gap:8},".emb-btn--sm":{minHeight:40,paddingTop:0,paddingRight:16,paddingBottom:0,paddingLeft:16,fontSize:15},".dot":{width:9,height:9,round:1,flexGrow:0,flexShrink:0},".dot--risk":{backgroundColor:"$riskDot"},".ask-chips":{flexDirection:"column",alignItems:"center",marginTop:22,gap:10},".chip":{paddingTop:10,paddingRight:16,paddingBottom:10,paddingLeft:16,borderRadius:999,fontSize:15,fontWeight:"600",lh:1.3,textAlign:"center",dur:160,ease:[.23,1,.32,1]},".ask-empty":{minHeight:"100%",flexDirection:"column",alignItems:"center",paddingTop:14,paddingRight:16,paddingBottom:22,paddingLeft:16,textAlign:"center"},".ask-empty h2":{fontSize:23,lh:1.12},".ask-start":{width:"100%",marginTop:"auto",marginRight:0,marginBottom:"auto",marginLeft:0,paddingTop:18,paddingRight:0,paddingBottom:18,paddingLeft:0,flexDirection:"column",alignItems:"center"},".ask-empty .ask-chips":{marginTop:14,alignSelf:"center",alignItems:"stretch",width:"100%",maxWidth:340},".hp-need__k":{flexDirection:"row",alignItems:"center",fontSize:15,fontWeight:"800",gap:8},".hp-srcs":{marginLeft:"auto",flexDirection:"row",gap:4},".hp-src":{height:24,paddingTop:0,paddingRight:9,paddingBottom:0,paddingLeft:9,borderRadius:999,backgroundColor:"$tile",color:"$ink2",fontSize:12,fontWeight:"700",flexDirection:"row",alignItems:"center",nowrap:1},".hp-src--dna":{backgroundColor:"$n_E0FDFF",color:"$link"},".hp-need__s":{alignItems:"baseline",marginTop:6,fontSize:15,lh:1.45,color:"$ink2",flexDirection:"row",cols:[9,"1fr"],gap:9},".hp-need__s b":{color:"$ink",fontWeight:"800"},".ask-focus":{width:"100%",paddingTop:14,paddingRight:16,paddingBottom:16,paddingLeft:16,borderRadius:20,backgroundColor:"$card",textAlign:"left",shadow:[0,1,3,"rgba(38, 37, 35, .07)"]},".ask-focus h3":{marginTop:10,fontSize:18,fontWeight:"800",lh:1.22},".ask-focus__x":{width:36,height:36,marginTop:-8,marginRight:-10,marginBottom:-8,marginLeft:-2,alignItems:"center",justifyContent:"center",round:1,color:"$ink2"},".ask-focus__x svg":{width:18,height:18},".ask-focus-pill":{marginLeft:"auto",flexDirection:"row",alignItems:"center",minHeight:36,paddingTop:0,paddingRight:14,paddingBottom:0,paddingLeft:14,borderRadius:999,backgroundColor:"$n_FFE3E1",color:"$n_B0231B",fontSize:15,fontWeight:"800",gap:7},".ask-focus-pill i":{width:8,height:8,round:1,backgroundColor:"$riskDot"},".ask-focus .hp-need__s":{fontSize:14.5},".ask-focus__acts":{flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginTop:12,rowGap:4,columnGap:16},".ask-focus__q":{minHeight:36,fontSize:14.5,fontWeight:"700",color:"$link",textDecorationLine:"underline"},".ask-top":{alignSelf:"stretch",flexDirection:"row",marginTop:-8,marginRight:0,marginBottom:6,marginLeft:0},".thread__hist":{flexDirection:"row",alignItems:"center",minHeight:36,paddingTop:0,paddingRight:4,paddingBottom:0,paddingLeft:4,fontSize:15,fontWeight:"700",color:"$link",gap:6},".thread__hist svg":{width:18,height:18},".thread__count":{minWidth:22,height:20,paddingTop:0,paddingRight:6,paddingBottom:0,paddingLeft:6,borderRadius:999,backgroundColor:"$card",color:"$ink2",fontSize:12,fontWeight:"800",alignItems:"center",justifyContent:"center",ring:[1,"$line"]}},ASK_HOME_TITLE_CH=16;var PROBE_ROOM=4e3,HALF=.5;function linesAt(words,space,width){let lines=1,line=-1;for(let w of words)line<0?line=w:line+space+w<=width?line+=space+w:(lines+=1,line=w);return lines}function balancedWidth(words,space,measure){if(words.length===0)return measure;let lines=linesAt(words,space,measure),widths=[];for(let i=0;i<words.length;i+=1){let run=0;for(let j=i;j<words.length;j+=1)run+=(j>i?space:0)+words[j],run<=measure&&widths.push(run)}widths.sort((a,b)=>a-b);let slack=HALF*words.length+1;for(let w of widths)if(linesAt(words,space,w)<=lines)return Math.min(measure,w+slack);return measure}function BalancedTitle({text:text,style:style,measureCh:measureCh}){let words=useMemo(()=>text.split(/\s+/).filter(w=>w!==""),[text]),flat=StyleSheet.flatten(style),key=[text,flat.fontFamily,flat.fontSize,flat.fontWeight,flat.letterSpacing].join("|"),sizes=useRef({key:"",ch:null,line:null,words:[]});sizes.current.key!==key&&(sizes.current={key:key,ch:null,line:null,words:words.map(()=>null)});let[width,setWidth]=useState(null),capped=width!==null&&width.key===key?width.value:null,settle=()=>{let s=sizes.current;if(s.ch===null||s.line===null||s.words.some(w=>w===null))return;let ws=s.words,sum=ws.reduce((a,b)=>a+b,0),space=ws.length>1?Math.max(0,(s.line-sum)/(ws.length-1)):0,value=balancedWidth(ws,space,(s.ch+HALF)*measureCh);setWidth(previous=>previous!==null&&previous.key===s.key&&previous.value===value?previous:{key:s.key,value:value})},measure=set=>event=>{sizes.current.key===key&&(set(sizes.current,event.nativeEvent.layout.width),settle())};/* @__PURE__ */
|
|
102
103
|
return jsxs(View,{style:styles.wrap,children:[
|
|
@@ -179,13 +180,13 @@ return jsx(Animated.View,{pointerEvents:"box-none",style:[{position:position,lef
|
|
|
179
180
|
/* @__PURE__ */jsxs(View,{style:kit.col(".ph-banner",1),children:[
|
|
180
181
|
/* @__PURE__ */jsxs(View,{style:kit.view(".ph-banner__meta"),children:[text.app===""?/* @__PURE__ */jsx(View,{}):/* @__PURE__ */jsx(Text,{tier:"compact",style:kit.text(".ph-banner__meta",".ph-banner__meta strong"),children:text.app}),
|
|
181
182
|
/* @__PURE__ */jsx(Text,{tier:"compact",style:kit.text(".ph-banner__meta"),children:text.now})]}),
|
|
182
|
-
/* @__PURE__ */jsx(Text,{style:[kit.view(".ph-banner__txt > strong"),kit.text(".ph-banner__txt > strong")],children:text.title}),text.body===""?null:/* @__PURE__ */jsx(Text,{style:kit.text(".ph-banner__txt > span:last-child"),children:text.body})]})]})})}var TabsContext=/* @__PURE__ */createContext(null);function useEverfurTabs(){return useContext(TabsContext)}var INTRO_QUIET_MS=200,TOAST_INTO_BAR=4,TOAST_MS=2600,DEFAULT_INTRO_MAX_WIDTH=600,CSS_EASE2=Easing.bezier(.25,.1,.25,1),NATIVE3=Platform.OS!=="web",NO_LIFECYCLE={onForeground:()=>()=>{}};function EverfurTabs(props){let{petRef:petRef,opened:opened,onTabChange:onTabChange,onRecordsRequested:onRecordsRequested,onRecordsLanded:onRecordsLanded,onToast:onToast}=props,visible=props.visible??true,theme=useEverfurTheme(),kit=useMemo(()=>createIntroKit(theme),[theme]),copy=useMemo(()=>({...EVERFUR_TABS_COPY,...props.copy}),[props.copy]),{runtime:runtime,userRef:userRef}=useEverfurContext(),planEnabled=useCapabilityEnabled("healthPlan"),recordsEnabled=useCapabilityEnabled("records"),clinicEnabled=useCapabilityEnabled("recordsClinic"),[planVerdicts,setPlanVerdicts]=useState(()=>/* @__PURE__ */new Map),[planFailed,setPlanFailed]=useState(()=>/* @__PURE__ */new Set),onPlanRead=useCallback((ref,read)=>{setPlanVerdicts(previous=>{let before=previous.get(ref),next=nextPlanVerdict(before,read);return next===before?previous:new Map(previous).set(ref,next)}),setPlanFailed(previous=>previous.has(ref)?new Set([...previous].filter(pet=>pet!==ref)):previous)},[]),onPlanFailed=useCallback(ref=>{setPlanFailed(previous=>previous.has(ref)?previous:new Set(previous).add(ref))},[]),planVerdict=petRef===null?void 0:planVerdicts.get(petRef),planHidden=!planEnabled||planVerdict?.empty===true,planKey=`${petRef??"none"}:${planVerdict?.epoch??0}`,tabs=tabsFor(planHidden),planHiddenRef=useRef(planHidden);planHiddenRef.current=planHidden;let page=useHealthPlanPage({petRef:petRef,enabled:planEnabled&&petRef!==null}),[sub,setSub]=useState(()=>landingTab(opened,false)),[openedPanes,setOpenedPanes]=useState(()=>/* @__PURE__ */new Set(["ask",landingTab(opened,false)])),open=useCallback(wanted=>{let next=resolveTab(wanted,planHiddenRef.current);setSub(next),setOpenedPanes(previous=>previous.has(next)?previous:new Set(previous).add(next))},[]);useEffect(()=>{planHidden&&sub==="plan"&&setSub("ask")},[planHidden,sub]);let tabChange=useRef(onTabChange);tabChange.current=onTabChange,useEffect(()=>{tabChange.current?.(sub)},[sub]);let[asked,setAsked]=useState(null),ask=useCallback(prompt=>{prompt!==""&&setAsked(previous=>({id:(previous?.id??0)+1,prompt:prompt,petRef:petRef})),open("ask")},[petRef,open]),chatAsk=asked===null||asked.petRef!==petRef?null:asked,key=openedKey(opened),handledKey=useRef(null),[plainOpen,setPlainOpen]=useState(null);useEffect(()=>{handledKey.current!==key&&(handledKey.current=key,opened.via==="link"&&opened.ask!==void 0?ask(opened.ask.prompt):open(landingTab(opened,planHiddenRef.current)),setPlainOpen(opened.via==="plain"?key:null))},[key,opened,ask,open]);let paneShown=useMemo(()=>createPaneShownSignal(),[]),hostLifecycle=props.chat?.lifecycle,chatLifecycle=useMemo(()=>withPaneShown(hostLifecycle??NO_LIFECYCLE,paneShown),[hostLifecycle,paneShown]),askShown=visible&&sub==="ask",wasAskShown=useRef(askShown);useEffect(()=>{let edge=isPaneShownEdge(wasAskShown.current,askShown);wasAskShown.current=askShown,edge&&paneShown.fire()},[askShown,paneShown]);let[toast,setToast]=useState(null),say=useCallback(text=>{text!==""&&(onToast!==void 0?onToast(text):setToast(previous=>({id:(previous?.id??0)+1,text:text})))},[onToast]),introOptions=props.intro===false?null:props.intro??{},[run,setRun]=useState(null),[introFrame,setIntroFrame]=useState(null),[wants,setWants]=useState(null),[requested,setRequested]=useState(null),[recordsVerdicts,setRecordsVerdicts]=useState(()=>/* @__PURE__ */new Map),[banner,setBanner]=useState(false),[noVet,setNoVet]=useState(false),introFrameRef=useRef(null),[barBox,setBarBox]=useState(null),barRef=useRef(null),repo=useMemo(()=>createIntroRepository(runtime),[runtime]),kv=runtime.registry.services.kv,maxWidth=introOptions?.maxWidth??DEFAULT_INTRO_MAX_WIDTH,introAllowed=introOptions!==null&&planEnabled,introAsks=introAllowed&&plainOpen!==null&&visible&&userRef!==null&&petRef!==null,[decided,setDecided]=useState(null);useEffect(()=>{if(!introAsks)return;let forKey=plainOpen;if(Dimensions.get("window").width>=maxWidth){setDecided(forKey);return}let control=new AbortController,forPet=petRef;return shouldPlayIntro({repo:repo,kv:kv,userRef:userRef,signal:control.signal}).then(play=>{control.signal.aborted||(setDecided(forKey),play&&setWants({key:forKey,petRef:forPet}))},()=>{control.signal.aborted||setDecided(forKey)}),()=>control.abort()},[introAsks,plainOpen,userRef,petRef,repo,kv,maxWidth]);let refsPending=introAllowed&&plainOpen!==null&&visible&&(userRef===null||petRef===null)&&Dimensions.get("window").width<maxWidth,[refsWaitOver,setRefsWaitOver]=useState(null);useEffect(()=>{if(!refsPending)return;let forKey=plainOpen,timer=setTimeout(()=>setRefsWaitOver(forKey),INTRO_WAIT_MS);return()=>clearTimeout(timer)},[refsPending,plainOpen]),useIntroOpenHold(refsPending&&refsWaitOver!==plainOpen||introAsks&&decided!==plainOpen||wants!==null||run!==null);let onRecordsVerdict=useCallback((ref,verdict)=>{setRecordsVerdicts(previous=>previous.get(ref)===verdict?previous:new Map(previous).set(ref,verdict))},[]),recordsVerdict=petRef===null?void 0:recordsVerdicts.get(petRef),recordsConnected=recordsVerdict==="some";useEffect(()=>{petRef!==null&&recordsConnected&&setHealthPlanNoVet(petRef,false)},[petRef,recordsConnected]);let measureBar=useCallback(()=>{let node=barRef.current;node===null||typeof node.measureInWindow!="function"||node.measureInWindow((_x,y,_w,h)=>{Number.isFinite(y)&&h>0&&setBarBox({top:Math.round(y),height:Math.round(h)})})},[]);useEffect(()=>{if(wants===null||run!==null)return;let step=introWantStep({sameOpen:wants.key===plainOpen&&wants.petRef===petRef,plan:planVerdict,planFailed:planFailed.has(wants.petRef),recordsPending:recordsEnabled&&recordsVerdict===void 0});if(step==="drop"&&setWants(null),step!=="play")return;open("ask"),measureBar();let timer=setTimeout(()=>{setWants(null),setRun(previous=>({mode:"intro",id:(previous?.id??0)+1}))},INTRO_QUIET_MS);return()=>clearTimeout(timer)},[wants,run,plainOpen,petRef,planVerdict,planFailed,recordsEnabled,recordsVerdict,open,measureBar]),useEffect(()=>{if(wants===null)return;let timer=setTimeout(()=>setWants(current=>current===wants?null:current),INTRO_WAIT_MS);return()=>clearTimeout(timer)},[wants]);let requestRecords=useCallback(()=>{petRef!==null&&(measureBar(),setRun(previous=>({mode:"records",id:(previous?.id??0)+1})))},[petRef,measureBar]),onIntroClose=useCallback(close=>{(run?.mode??"intro")==="intro"&&markIntroSeen({repo:repo,kv:kv,userRef:userRef}),introFrameRef.current==="novet"&&petRef!==null&&setHealthPlanNoVet(petRef,true),close.exit==="plan"?open("plan"):close.exit==="ask"&&open("ask"),close.notifications!==null&&setRequested(previous=>previous===null?previous:{...previous,notified:close.notifications}),close.toast!==null&&say(close.toast)},[run,repo,kv,userRef,petRef,open,say]),onIntroClosed=useCallback(()=>setRun(null),[]),onRequested=useCallback(event=>{setRequested({petRef:event.petRef,notified:null}),setHealthPlanNoVet(event.petRef,false),onRecordsRequested?.(event)},[onRecordsRequested]),onFrame=useCallback(frame=>{frame!==null&&(introFrameRef.current=frame),setIntroFrame(frame)},[]);useEffect(()=>{if(petRef===null){setNoVet(false);return}return setNoVet(healthPlanNoVet(petRef)),onHealthPlanNoVet((pet,none)=>{pet===petRef&&setNoVet(none)})},[petRef]),useEffect(()=>onHealthPlanRecordsLanded(pet=>setHealthPlanNoVet(pet,false)),[]);let introCopy=introOptions?.copy,landedText=useCallback(()=>introText({facts:introFacts(page.page,props.petName),copy:{...EVERFUR_INTRO_COPY,...introCopy},blanks:0,resultsPending:false}),[page.page,props.petName,introCopy]),landedFrom=useRef(void 0),land=useCallback(()=>{setBanner(false),open("plan"),petRef!==null&&say(landedText().toast.landed)},[open,petRef,say,landedText]);useEffect(()=>{let before=landedFrom.current;if(landedFrom.current=recordsVerdict,requested===null||petRef===null||requested.petRef!==petRef||before!=="none"||recordsVerdict!=="some")return;let event={petRef:petRef,at:/* @__PURE__ */(new Date).toISOString()};onRecordsLanded?.(event),notifyHealthPlanRecordsLanded(petRef),setRequested(null),requested.notified===true?setBanner(true):land()},[recordsVerdict,requested,petRef,onRecordsLanded,land]);let chat=props.chat,pending=props.resultsPending??page.page?.page?.wait!==void 0,chatPresentation=useMemo(()=>pending?{...chat?.presentation,chatTopCard:"none"}:chat?.presentation,[pending,chat?.presentation]),openPlan=useCallback(()=>open("plan"),[open]),openRecords=useCallback(()=>open("records"),[open]),openAsk=useCallback(()=>open("ask"),[open]),plan=props.plan,planFocus=useMemo(()=>plan?.focus===void 0?void 0:{...plan.focus,onConnectRecords:plan.focus.onConnectRecords??openRecords,onWaitAction:plan.focus.onWaitAction??openAsk},[plan?.focus,openRecords,openAsk]),petName=props.petName??page.page?.pet.name??"",records=props.records,hostSheet=records?.sheet,shellSheet={onRequestFromClinic:useCallback(()=>{requestRecords()},[requestRecords]),noVet:noVet,onOpenPlan:openPlan,active:visible&&sub==="records"},sheet=hostSheet===false?false:{...shellSheet,...typeof hostSheet=="object"?hostSheet:{}},recordsPage=petRef===null?null:/* @__PURE__ */jsx(EverfurRecords,{...records,sheet:sheet,petRef:petRef,...petName===""?{}:{petName:petName},onAsk:records?.onAsk??(prompt=>ask(prompt)),style:[{flex:1},records?.style]},petRef),handle=useMemo(()=>({tab:sub,open:open,ask:ask,requestRecords:requestRecords}),[sub,open,ask,requestRecords]),tabsRef=props.tabsRef;useLayoutEffect(()=>{if(tabsRef!==void 0)return tabsRef.current=handle,()=>{tabsRef.current===handle&&(tabsRef.current=null)}},[tabsRef,handle]);let lit=introFrame==="tabs",pane=id=>sub===id?{flex:1,minHeight:0}:{display:"none"};/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */jsx(Text,{style:[kit.view(".ph-banner__txt > strong"),kit.text(".ph-banner__txt > strong")],children:text.title}),text.body===""?null:/* @__PURE__ */jsx(Text,{style:kit.text(".ph-banner__txt > span:last-child"),children:text.body})]})]})})}var TabsContext=/* @__PURE__ */createContext(null);function useEverfurTabs(){return useContext(TabsContext)}var INTRO_QUIET_MS=200,TOAST_INTO_BAR=4,TOAST_MS=2600,DEFAULT_INTRO_MAX_WIDTH=600,CSS_EASE2=Easing.bezier(.25,.1,.25,1),NATIVE3=Platform.OS!=="web";function EverfurTabs(props){let{petRef:petRef,opened:opened,onTabChange:onTabChange,onRecordsRequested:onRecordsRequested,onRecordsLanded:onRecordsLanded,onToast:onToast}=props,visible=props.visible??true,theme=useEverfurTheme(),kit=useMemo(()=>createIntroKit(theme),[theme]),copy=useMemo(()=>({...EVERFUR_TABS_COPY,...props.copy}),[props.copy]),{runtime:runtime,userRef:userRef}=useEverfurContext(),planEnabled=useCapabilityEnabled("healthPlan"),recordsEnabled=useCapabilityEnabled("records"),clinicEnabled=useCapabilityEnabled("recordsClinic"),[planVerdicts,setPlanVerdicts]=useState(()=>/* @__PURE__ */new Map),[planFailed,setPlanFailed]=useState(()=>/* @__PURE__ */new Set),onPlanRead=useCallback((ref,read)=>{setPlanVerdicts(previous=>{let before=previous.get(ref),next=nextPlanVerdict(before,read);return next===before?previous:new Map(previous).set(ref,next)}),setPlanFailed(previous=>previous.has(ref)?new Set([...previous].filter(pet=>pet!==ref)):previous)},[]),onPlanFailed=useCallback(ref=>{setPlanFailed(previous=>previous.has(ref)?previous:new Set(previous).add(ref))},[]),planVerdict=petRef===null?void 0:planVerdicts.get(petRef),planHidden=!planEnabled||planVerdict?.empty===true,planKey=`${petRef??"none"}:${planVerdict?.epoch??0}`,tabs=tabsFor(planHidden),planHiddenRef=useRef(planHidden);planHiddenRef.current=planHidden;let page=useHealthPlanPage({petRef:petRef,enabled:planEnabled&&petRef!==null}),[sub,setSub]=useState(()=>landingTab(opened,false)),[openedPanes,setOpenedPanes]=useState(()=>/* @__PURE__ */new Set(["ask",landingTab(opened,false)])),open=useCallback(wanted=>{let next=resolveTab(wanted,planHiddenRef.current);setSub(next),setOpenedPanes(previous=>previous.has(next)?previous:new Set(previous).add(next))},[]);useEffect(()=>{planHidden&&sub==="plan"&&setSub("ask")},[planHidden,sub]);let tabChange=useRef(onTabChange);tabChange.current=onTabChange,useEffect(()=>{tabChange.current?.(sub)},[sub]);let[asked,setAsked]=useState(null),ask=useCallback((prompt,card)=>{prompt!==""&&setAsked(previous=>({id:(previous?.id??0)+1,prompt:prompt,petRef:petRef,...card===void 0?{}:{card:card}})),open("ask")},[petRef,open]),chatAsk=asked===null||asked.petRef!==petRef?null:asked,key=openedKey(opened),handledKey=useRef(null),[plainOpen,setPlainOpen]=useState(null);useEffect(()=>{handledKey.current!==key&&(handledKey.current=key,opened.via==="link"&&opened.ask!==void 0?ask(opened.ask.prompt,opened.ask.card):open(landingTab(opened,planHiddenRef.current)),setPlainOpen(opened.via==="plain"?key:null))},[key,opened,ask,open]);let paneShown=useMemo(()=>createPaneShownSignal(),[]),askShown=visible&&sub==="ask",askShownRef=useRef(askShown);askShownRef.current=askShown;let hostLifecycle=props.chat?.lifecycle,chatLifecycle=useMemo(()=>hostLifecycle===null?null:withPaneShown(foregroundWhileShown(hostLifecycle??createAppStateLifecycle(),()=>askShownRef.current),paneShown),[hostLifecycle,paneShown]),wasAskShown=useRef(askShown);useEffect(()=>{let edge=isPaneShownEdge(wasAskShown.current,askShown);wasAskShown.current=askShown,edge&&paneShown.fire()},[askShown,paneShown]);let[toast,setToast]=useState(null),say=useCallback(text=>{text!==""&&(onToast!==void 0?onToast(text):setToast(previous=>({id:(previous?.id??0)+1,text:text})))},[onToast]),introOptions=props.intro===false?null:props.intro??{},[run,setRun]=useState(null),[introFrame,setIntroFrame]=useState(null),[wants,setWants]=useState(null),[requested,setRequested]=useState(null),[recordsVerdicts,setRecordsVerdicts]=useState(()=>/* @__PURE__ */new Map),[banner,setBanner]=useState(false),[noVet,setNoVet]=useState(false),introFrameRef=useRef(null),[barBox,setBarBox]=useState(null),barRef=useRef(null),planScrollRef=useRef(null),repo=useMemo(()=>createIntroRepository(runtime),[runtime]),kv=runtime.registry.services.kv,maxWidth=introOptions?.maxWidth??DEFAULT_INTRO_MAX_WIDTH,introAllowed=introOptions!==null&&planEnabled,introAsks=introAllowed&&plainOpen!==null&&visible&&userRef!==null&&petRef!==null,[decided,setDecided]=useState(null);useEffect(()=>{if(!introAsks)return;let forKey=plainOpen;if(Dimensions.get("window").width>=maxWidth){setDecided(forKey);return}let control=new AbortController,forPet=petRef;return shouldPlayIntro({repo:repo,kv:kv,userRef:userRef,signal:control.signal}).then(play=>{control.signal.aborted||(setDecided(forKey),play&&setWants({key:forKey,petRef:forPet}))},()=>{control.signal.aborted||setDecided(forKey)}),()=>control.abort()},[introAsks,plainOpen,userRef,petRef,repo,kv,maxWidth]);let refsPending=introAllowed&&plainOpen!==null&&visible&&(userRef===null||petRef===null)&&Dimensions.get("window").width<maxWidth,[refsWaitOver,setRefsWaitOver]=useState(null);useEffect(()=>{if(!refsPending)return;let forKey=plainOpen,timer=setTimeout(()=>setRefsWaitOver(forKey),INTRO_WAIT_MS);return()=>clearTimeout(timer)},[refsPending,plainOpen]),useIntroOpenHold(refsPending&&refsWaitOver!==plainOpen||introAsks&&decided!==plainOpen||wants!==null||run!==null);let onRecordsVerdict=useCallback((ref,verdict)=>{setRecordsVerdicts(previous=>previous.get(ref)===verdict?previous:new Map(previous).set(ref,verdict))},[]),recordsVerdict=petRef===null?void 0:recordsVerdicts.get(petRef),recordsConnected=recordsVerdict==="some";useEffect(()=>{petRef!==null&&recordsConnected&&setHealthPlanNoVet(petRef,false)},[petRef,recordsConnected]);let measureBar=useCallback(()=>{let node=barRef.current;node===null||typeof node.measureInWindow!="function"||node.measureInWindow((_x,y,_w,h)=>{Number.isFinite(y)&&h>0&&setBarBox({top:Math.round(y),height:Math.round(h)})})},[]);useEffect(()=>{if(wants===null||run!==null)return;let step=introWantStep({sameOpen:wants.key===plainOpen&&wants.petRef===petRef,plan:planVerdict,planFailed:planFailed.has(wants.petRef),recordsPending:recordsEnabled&&recordsVerdict===void 0});if(step==="drop"&&setWants(null),step!=="play")return;open("ask"),measureBar();let timer=setTimeout(()=>{setWants(null),setRun(previous=>({mode:"intro",id:(previous?.id??0)+1}))},INTRO_QUIET_MS);return()=>clearTimeout(timer)},[wants,run,plainOpen,petRef,planVerdict,planFailed,recordsEnabled,recordsVerdict,open,measureBar]),useEffect(()=>{if(wants===null)return;let timer=setTimeout(()=>setWants(current=>current===wants?null:current),INTRO_WAIT_MS);return()=>clearTimeout(timer)},[wants]);let requestRecords=useCallback(()=>{petRef!==null&&(measureBar(),setRun(previous=>({mode:"records",id:(previous?.id??0)+1})))},[petRef,measureBar]),onIntroClose=useCallback(close=>{(run?.mode??"intro")==="intro"&&markIntroSeen({repo:repo,kv:kv,userRef:userRef}),introFrameRef.current==="novet"&&petRef!==null&&setHealthPlanNoVet(petRef,true),close.exit==="plan"?open("plan"):close.exit==="ask"&&open("ask"),close.notifications!==null&&setRequested(previous=>previous===null?previous:{...previous,notified:close.notifications}),close.toast!==null&&say(close.toast)},[run,repo,kv,userRef,petRef,open,say]),onIntroClosed=useCallback(()=>setRun(null),[]),onRequested=useCallback(event=>{setRequested({petRef:event.petRef,notified:null}),setHealthPlanNoVet(event.petRef,false),onRecordsRequested?.(event)},[onRecordsRequested]),onFrame=useCallback(frame=>{frame!==null&&(introFrameRef.current=frame),setIntroFrame(frame)},[]);useEffect(()=>{if(petRef===null){setNoVet(false);return}return setNoVet(healthPlanNoVet(petRef)),onHealthPlanNoVet((pet,none)=>{pet===petRef&&setNoVet(none)})},[petRef]),useEffect(()=>onHealthPlanRecordsLanded(pet=>setHealthPlanNoVet(pet,false)),[]);let introCopy=introOptions?.copy,landedText=useCallback(()=>introText({facts:introFacts(page.page,props.petName),copy:{...EVERFUR_INTRO_COPY,...introCopy},blanks:0,resultsPending:false}),[page.page,props.petName,introCopy]),landedFrom=useRef(void 0),land=useCallback(()=>{setBanner(false),open("plan"),petRef!==null&&say(landedText().toast.landed)},[open,petRef,say,landedText]);useEffect(()=>{let before=landedFrom.current;if(landedFrom.current=recordsVerdict,requested===null||petRef===null||requested.petRef!==petRef||before!=="none"||recordsVerdict!=="some")return;let event={petRef:petRef,at:/* @__PURE__ */(new Date).toISOString()};onRecordsLanded?.(event),notifyHealthPlanRecordsLanded(petRef),setRequested(null),requested.notified===true?setBanner(true):land()},[recordsVerdict,requested,petRef,onRecordsLanded,land]);let chat=props.chat,pending=props.resultsPending??page.page?.page?.wait!==void 0,chatPresentation=useMemo(()=>pending?{...chat?.presentation,chatTopCard:"none"}:chat?.presentation,[pending,chat?.presentation]),openPlan=useCallback(()=>open("plan"),[open]),openRecords=useCallback(()=>open("records"),[open]),openAsk=useCallback(()=>open("ask"),[open]),plan=props.plan,planFocus=useMemo(()=>plan?.focus===void 0?void 0:{...plan.focus,onConnectRecords:plan.focus.onConnectRecords??openRecords,onWaitAction:plan.focus.onWaitAction??openAsk},[plan?.focus,openRecords,openAsk]),petName=props.petName??page.page?.pet.name??"",records=props.records,hostSheet=records?.sheet,requestFromClinic=useCallback(()=>{requestRecords()},[requestRecords]),shellSheet={active:visible&&sub==="records"},shellTop={onRequestFromClinic:requestFromClinic,noVet:noVet,onOpenPlan:openPlan},hostRecords=definedProps(records),sheet=hostSheet===false?false:{...shellSheet,...typeof hostSheet=="object"?definedProps(hostSheet):{}},recordsPage=petRef===null?null:/* @__PURE__ */jsx(EverfurRecords,{...shellTop,...hostRecords,sheet:sheet,petRef:petRef,...petName===""?{}:{petName:petName},onAsk:records?.onAsk??(prompt=>ask(prompt)),style:[{flex:1},records?.style]},petRef),handle=useMemo(()=>({tab:sub,open:open,ask:ask,requestRecords:requestRecords}),[sub,open,ask,requestRecords]),tabsRef=props.tabsRef;useLayoutEffect(()=>{if(tabsRef!==void 0)return tabsRef.current=handle,()=>{tabsRef.current===handle&&(tabsRef.current=null)}},[tabsRef,handle]);let lit=introFrame==="tabs",pane=id=>sub===id?{flex:1,minHeight:0}:{display:"none"};/* @__PURE__ */
|
|
183
184
|
return jsx(TabsContext.Provider,{value:handle,children:/* @__PURE__ */jsxs(View,{style:[{flex:1,minHeight:0,position:"relative"},props.style],testID:props.testID??"everfur-tabs",children:[
|
|
184
185
|
/* @__PURE__ */jsx(TabBar,{kit:kit,barRef:barRef,tabs:tabs,sub:sub,lit:lit,copy:copy,planHidden:planHidden,onOpen:open}),petRef===null||!planEnabled?null:/* @__PURE__ */jsx(PlanProbe,{petRef:petRef,pagePhase:page.phase,page:page.page,refreshPage:page.refresh,watching:visible&&(sub==="plan"||planHidden),onPlan:onPlanRead,onPlanFailed:onPlanFailed}),petRef!==null&&recordsEnabled&&(wants!==null||run!==null||requested!==null)?/* @__PURE__ */jsx(RecordsProbe,{petRef:petRef,onRecords:onRecordsVerdict}):null,
|
|
185
186
|
/* @__PURE__ */jsxs(View,{style:{flex:1,minHeight:0},children:[
|
|
186
187
|
/* @__PURE__ */jsxs(View,{style:pane("ask"),testID:"everfur-pane-ask",children:[
|
|
187
|
-
/* @__PURE__ */jsx(View,{style:{flex:1,minHeight:0},children:/* @__PURE__ */jsx(AskHomeFactoryContext.Provider,{value:createAskHome,children:/* @__PURE__ */jsx(EverfurChat,{...chat,style:[{flex:1,paddingTop:0},chat?.style],...chatPresentation===void 0?{}:{presentation:chatPresentation},...pending&&props.pendingStarterPrompts!==void 0?{starterPrompts:props.pendingStarterPrompts}:{},...petRef===null?{}:{petRef:petRef},lifecycle:chatLifecycle,onOpenHealthPlan:openPlan,...chatAsk===null?{}:{initialAsk:chatAsk.prompt,initialAskKey:chatAsk.id}})})},petRef??"none"),props.paneFooter?.ask]}),openedPanes.has("plan")&&!planHidden?/* @__PURE__ */jsxs(View,{style:pane("plan"),testID:"everfur-pane-plan",children:[
|
|
188
|
-
/* @__PURE__ */jsx(ScrollView,{style:{flex:1},children:/* @__PURE__ */jsx(EverfurHealthPlan,{...plan,...planFocus===void 0?{}:{focus:planFocus},petRef:petRef},planKey)},petRef??"none"),props.paneFooter?.plan]}):null,openedPanes.has("records")?/* @__PURE__ */jsxs(View,{style:pane("records"),testID:"everfur-pane-records",children:[
|
|
188
|
+
/* @__PURE__ */jsx(View,{style:{flex:1,minHeight:0},children:/* @__PURE__ */jsx(ChatPaneShownContext.Provider,{value:askShown,children:/* @__PURE__ */jsx(AskHomeFactoryContext.Provider,{value:createAskHome,children:/* @__PURE__ */jsx(EverfurChat,{...chat,style:[{flex:1,paddingTop:0},chat?.style],...chatPresentation===void 0?{}:{presentation:chatPresentation},...pending&&props.pendingStarterPrompts!==void 0?{starterPrompts:props.pendingStarterPrompts}:{},...petRef===null?{}:{petRef:petRef},lifecycle:chatLifecycle,onOpenHealthPlan:openPlan,...chatAsk===null?{}:{initialAsk:chatAsk.prompt,initialAskKey:chatAsk.id,...chatAsk.card===void 0?{}:{initialAskCard:chatAsk.card}}})})})},petRef??"none"),props.paneFooter?.ask]}),openedPanes.has("plan")&&!planHidden?/* @__PURE__ */jsxs(View,{style:pane("plan"),testID:"everfur-pane-plan",children:[
|
|
189
|
+
/* @__PURE__ */jsx(ScrollView,{ref:planScrollRef,style:{flex:1},children:/* @__PURE__ */jsx(HealthPlanScrollScope,{scrollRef:planScrollRef,children:/* @__PURE__ */jsx(EverfurHealthPlan,{...plan,...planFocus===void 0?{}:{focus:planFocus},petRef:petRef},planKey)})},petRef??"none"),props.paneFooter?.plan]}):null,openedPanes.has("records")?/* @__PURE__ */jsxs(View,{style:pane("records"),testID:"everfur-pane-records",children:[
|
|
189
190
|
/* @__PURE__ */jsx(View,{style:{flex:1,minHeight:0},children:props.renderRecords===void 0?recordsPage:props.renderRecords(recordsPage)},petRef??"none"),props.paneFooter?.records]}):null]}),toast===null||onToast!==void 0?null:/* @__PURE__ */jsx(Toast,{kit:kit,text:toast.text},`toast-${toast.id}`),banner?/* @__PURE__ */jsx(EverfurRecordsLandedBanner,{text:landedText().banner,...introOptions?.bannerIcon===void 0?{}:{icon:introOptions.bannerIcon},onLand:land}):null,run===null||petRef===null?null:/* @__PURE__ */jsx(EverfurIntro,{petRef:petRef,mode:run.mode,page:page.page,petName:props.petName??null,recordsConnected:run.mode==="intro"&&(recordsConnected||!clinicEnabled),resultsPending:pending,...introOptions?.copy===void 0?{}:{copy:introOptions.copy},...introOptions?.blanks===void 0?{}:{blanks:introOptions.blanks},tabBar:barBox,tabLabels:{ask:copy.ask,plan:copy.plan,records:copy.records},onFrame:onFrame,onClose:onIntroClose,onClosed:onIntroClosed,onRequested:onRequested,...introOptions?.onEnableNotifications===void 0?{}:{onEnableNotifications:introOptions.onEnableNotifications},onUpload:introOptions?.onUpload??openRecords,...introOptions?.ownerName===void 0?{}:{ownerName:introOptions.ownerName},...introOptions?.onCaptureSignature===void 0?{}:{onCaptureSignature:introOptions.onCaptureSignature}},`intro-${run.id}`)]})})}function TabBar({kit:kit,barRef:barRef,tabs:tabs,sub:sub,lit:lit,copy:copy,planHidden:planHidden,onOpen:onOpen}){let{borderBottomWidth:edgeWidth=0,borderBottomColor:edgeColor,...bar}=kit.view(".ph-sub");/* @__PURE__ */
|
|
190
191
|
return jsxs(View,{ref:barRef,accessibilityRole:"tablist",accessibilityLabel:planHidden?copy.listNoPlan:copy.listAll,style:bar,testID:"everfur-tabs-bar",children:[edgeWidth>0?/* @__PURE__ */jsx(View,{pointerEvents:"none",style:{position:"absolute",left:0,right:0,bottom:0,height:edgeWidth,backgroundColor:edgeColor},testID:"everfur-tabs-edge"}):null,tabs.map((id,i)=>{let selected=sub===id,rules=[".ph-sub button",`.ph-sub [data-sub="${id}"]`,selected&&'.ph-sub button[aria-selected="true"]',lit&&'#ph[data-in-frame="tabs"] .ph-sub button'];/* @__PURE__ */
|
|
191
192
|
return jsxs(Pressable,{accessibilityRole:"tab",accessibilityState:{selected:selected},onPress:()=>onOpen(id),style:[kit.view(...rules),kit.col(".ph-sub",i),{alignItems:"center",justifyContent:"center"}],testID:`everfur-tab-${id}`,children:[
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
/** The three tabs, in Raph's order. */
|
|
3
|
+
type EverfurTabId = 'ask' | 'plan' | 'records';
|
|
4
|
+
/** The labels the tab bar draws. */
|
|
5
|
+
interface EverfurTabsCopy {
|
|
6
|
+
readonly ask: string;
|
|
7
|
+
readonly plan: string;
|
|
8
|
+
readonly records: string;
|
|
9
|
+
/** The tab list's accessible name with all three tabs. */
|
|
10
|
+
readonly listAll: string;
|
|
11
|
+
/** The tab list's accessible name when the Health Plan tab is hidden. */
|
|
12
|
+
readonly listNoPlan: string;
|
|
13
|
+
}
|
|
14
|
+
declare const EVERFUR_TABS_COPY: EverfurTabsCopy;
|
|
15
|
+
|
|
16
|
+
export { type EverfurTabId as E, type EverfurTabsCopy as a, EVERFUR_TABS_COPY as b };
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
/** The three tabs, in Raph's order. */
|
|
3
|
+
type EverfurTabId = 'ask' | 'plan' | 'records';
|
|
4
|
+
/** The labels the tab bar draws. */
|
|
5
|
+
interface EverfurTabsCopy {
|
|
6
|
+
readonly ask: string;
|
|
7
|
+
readonly plan: string;
|
|
8
|
+
readonly records: string;
|
|
9
|
+
/** The tab list's accessible name with all three tabs. */
|
|
10
|
+
readonly listAll: string;
|
|
11
|
+
/** The tab list's accessible name when the Health Plan tab is hidden. */
|
|
12
|
+
readonly listNoPlan: string;
|
|
13
|
+
}
|
|
14
|
+
declare const EVERFUR_TABS_COPY: EverfurTabsCopy;
|
|
15
|
+
|
|
16
|
+
export { type EverfurTabId as E, type EverfurTabsCopy as a, EVERFUR_TABS_COPY as b };
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
"use strict";var react=require("react"),reactNative=require("react-native"),zod=require("zod"),jsxRuntime=require("react/jsx-runtime"),callModule=require("@everfur/sdk/televet/call"),reactNativeSafeAreaContext=require("react-native-safe-area-context");function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=="default"){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}})}})}n.default=e;return Object.freeze(n)}var callModule__namespace=/*#__PURE__*/_interopNamespace(callModule);function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}var CONSULT_STATUSES=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],TERMINAL_CONSULT_STATUSES=/* @__PURE__ */new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),LIVE_CONSULT_STATUSES=/* @__PURE__ */new Set(["scheduled","in_progress","awaiting_summary"]);function isLiveConsult(consult){return LIVE_CONSULT_STATUSES.has(consult.status)}var CONSULT_KINDS=["wellness","prescription"],SLOT_MINUTES_MAX=60;function televetSlotMinutes(slot){let starts=Date.parse(slot.startsAt),ends=Date.parse(slot.endsAt);if(Number.isNaN(starts)||Number.isNaN(ends))return null;let minutes=Math.round((ends-starts)/6e4);return minutes>0?Math.min(minutes,SLOT_MINUTES_MAX):null}var CANCELLATION_POLICY_VERSION_MAX=64,REASON_TEXT_MAX=2e3,MEDIA_REFS_MAX=10;function isWellFormedStateCode(state){return typeof state=="string"&&/^[A-Za-z]{2}$/.test(state.trim())}function row(value){return typeof value=="object"&&value!==null?value:null}function str(value){return typeof value=="string"&&value.length>0?value:null}function trimmedOrNull(value){return typeof value=="string"&&value.trim().length>0?value.trim():null}function bool(value,fallback){return typeof value=="boolean"?value:fallback}function num(value){return typeof value=="number"&&Number.isFinite(value)?value:null}function closed(set,value){return typeof value=="string"&&set.includes(value)?value:"unknown"}function parseList(wire,parseRow){if(!Array.isArray(wire))/* @__PURE__ */return Object.freeze([]);let out=[];for(let item of wire){let parsed=parseRow(item);parsed!==null&&out.push(parsed)}/* @__PURE__ */
|
|
3
4
|
return Object.freeze(out)}function parseStatePolicy(wire,askedFor){let r=row(wire);return r===null?null:/* @__PURE__ */Object.freeze({state:str(r.state)??askedFor,wellnessAvailable:bool(r.wellness_available,false),prescriptionsAvailable:bool(r.prescriptions_available,false),cancellationPolicyText:trimmedOrNull(r.cancellation_policy_text)})}function parseCancellationPolicy(wire){let r=row(wire);if(r===null)return null;let summary=trimmedOrNull(r.summary),version=trimmedOrNull(r.version);return summary===null||version===null?null:/* @__PURE__ */Object.freeze({summary:summary,version:version})}function parseClinician(wire){let r=row(wire);if(r===null)return null;let clinicianId=str(r.clinician_id),displayName=str(r.display_name);return clinicianId===null||displayName===null?null:/* @__PURE__ */Object.freeze({clinicianId:clinicianId,displayName:displayName,credentials:trimmedOrNull(r.credentials_text),rating:num(r.rating),ratingCount:num(r.rating_count),bio:trimmedOrNull(r.bio),photoRef:str(r.photo_ref),licensedStates:parseList(r.licensed_states,item=>{let l=row(item),state=l===null?null:str(l.state);return state===null?null:/* @__PURE__ */Object.freeze({state:state,canPrescribe:bool(l?.can_prescribe,false)})})})}function parseSlot(wire){let r=row(wire);if(r===null)return null;let slotId=str(r.slot_id),startsAt=str(r.starts_at);return slotId===null||startsAt===null?null:/* @__PURE__ */Object.freeze({slotId:slotId,startsAt:startsAt,endsAt:str(r.ends_at)??startsAt})}function parseTriageVerdict(wire){let r=row(wire);if(r===null)return null;let isEmergency=r.is_emergency===true,fallback=r.fallback===true;return isEmergency||fallback?/* @__PURE__ */Object.freeze({isEmergency:isEmergency,fallback:fallback}):r.is_emergency===false&&r.fallback===false?/* @__PURE__ */Object.freeze({isEmergency:false,fallback:false}):null}function parseSlotHold(wire){let r=row(wire);if(r===null)return null;let slotId=str(r.slot_id),expiresAt=str(r.hold_expires_at);return slotId===null||expiresAt===null?null:/* @__PURE__ */Object.freeze({slotId:slotId,expiresAt:expiresAt})}function parseConsult(wire){let r=row(wire);if(r===null)return null;let consultId=str(r.consult_id),scheduledAt=str(r.scheduled_at);return consultId===null||scheduledAt===null?null:/* @__PURE__ */Object.freeze({consultId:consultId,petId:str(r.pet_id)??"",clinicianId:str(r.clinician_id)??"",clinicianName:trimmedOrNull(r.display_name),reasonText:trimmedOrNull(r.reason_text),mediaRefs:parseList(r.media_refs,item=>str(item)),status:closed(CONSULT_STATUSES,r.status),kind:closed(CONSULT_KINDS,r.kind),scheduledAt:scheduledAt,emergencyFlagged:bool(r.emergency_flagged,false),hasRoom:str(r.meeting_url)!==null})}function parseBookingEntitlement(wire){let r=row(wire);/* @__PURE__ */
|
|
@@ -1,9 +1,10 @@
|
|
|
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 */
|
|
1
2
|
import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
|
|
4
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
|
|
5
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-
|
|
6
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-
|
|
6
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-CVmpuk9C.cjs';
|
|
7
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-CVmpuk9C.cjs';
|
|
7
8
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-CKwDCbmN.cjs';
|
|
8
9
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-CKwDCbmN.cjs';
|
|
9
10
|
import { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.cjs';
|
|
@@ -12,11 +13,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
12
13
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom.d-B1DoYdJe.cjs';
|
|
13
14
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
|
|
14
15
|
export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
15
|
-
export { W as WidgetPet } from '../../petsRepository.d-
|
|
16
|
-
import '../../requestFunnel.d-
|
|
16
|
+
export { W as WidgetPet } from '../../petsRepository.d-Daef7u0o.cjs';
|
|
17
|
+
import '../../requestFunnel.d-mEu6B-n8.cjs';
|
|
17
18
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
18
|
-
import '../../config.d-
|
|
19
|
-
import '../../identity.d-
|
|
19
|
+
import '../../config.d-84fNJFv9.cjs';
|
|
20
|
+
import '../../identity.d-nRZBzkG2.cjs';
|
|
20
21
|
import '../../TelemetryPort.d-BDNr00hu.cjs';
|
|
21
22
|
import '../../profile.d-CSs1wlXT.cjs';
|
|
22
23
|
|
|
@@ -1,9 +1,10 @@
|
|
|
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 */
|
|
1
2
|
import { ReactNode, ComponentType, ReactElement } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.js';
|
|
4
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.js';
|
|
5
|
-
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-
|
|
6
|
-
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-
|
|
6
|
+
import { T as TelevetEmptyRosterCause, a as TelevetStateInterestAction$1, b as TelevetMediaShortfall, c as TelevetBookingStep, d as TelevetBookingContext, e as TelevetBookingController, f as TelevetTriageRead, g as TelevetStateInterestWrite, h as TelevetVetThreadTarget, i as TelevetDayPeriod } from '../../bookingCopy.d-BakTjvWw.js';
|
|
7
|
+
export { C as CONSULT_MINUTES, N as NO_MEDIA_SHORTFALL, j as TELEVET_BOOKING_BASE, k as TELEVET_BOOKING_COPY, l as TELEVET_BOOKING_STEPS, m as TELEVET_CONSULT_PAGE_LIMIT, n as TELEVET_JOIN_CLOSES_MINUTES_AFTER, o as TELEVET_JOIN_OPENS_MINUTES_BEFORE, p as TELEVET_MESSAGE_THREADS_PATH, q as TelevetAttachmentMeta, r as TelevetAttachmentPolicy, s as TelevetBookingAction, t as TelevetBookingControllerDeps, u as TelevetBookingCopy, v as TelevetBookingDraft, w as TelevetBookingFailure, x as TelevetBookingRefusal, y as TelevetBookingState, z as TelevetEarlyTriage, A as TelevetEmptyRosterView, B as TelevetJoinReadiness, D as TelevetJoinState, E as TelevetMediaRefusal, F as TelevetRead, G as TelevetStateInterestReason, H as TelevetWrite, U as UpcomingTelevetVisitState, I as UseVetThreadOptions, V as VET_MESSAGES_COPY, J as VET_MESSAGE_CONTENT_MAX, K as VET_MESSAGE_PAGE_DEFAULT, L as VET_MESSAGE_PAGE_MAX, M as VetMessage, O as VetMessagePage, P as VetMessageRole, Q as VetMessagesAvailability, R as VetSendFailure, S as VetThread, W as VetThreadState, X as VetThreadsState, Y as VisitSummary, Z as VisitSummaryMedication, _ as VisitSummaryState, $ as attestation, a0 as canConfirm, a1 as canManageTelevetVisit, a2 as createTelevetBookingController, a3 as currentStep, a4 as emptyTelevetDraft, a5 as formatVisitRange, a6 as formatWhen, a7 as formatWhenWithDay, a8 as hasPreviousStep, a9 as initialTelevetBookingState, aa as isHoldExpired, ab as isMediaShortfallEmpty, ac as isSkipped, ad as isTelevetBookingCopyReady, ae as isVetMessagesDark, af as isVetThreadVetFirst, ag as mediaShortfallFromUnsentPicks, ah as splitTelevetVisits, ai as televetBookingKey, aj as televetBookingReducer, ak as televetBookingRefusal, al as televetCancelCall, am as televetConsultCall, an as televetEmptyRosterCause, ao as televetEmptyRosterView, ap as televetHoldCall, aq as televetJoinCall, ar as televetJoinOpensAtMs, as as televetJoinReadiness, at as televetMediaShortfallLines, au as televetRescheduleCall, av as televetThreadMessagesCall, aw as televetThreadReadCall, ax as televetVisitSummaryCall, ay as useEarlyTriage, az as useStateInterest, aA as useTelevetBookConsult, aB as useTelevetBookingAvailable, aC as useTelevetBookingController, aD as useTelevetBookingEntitlement, aE as useTelevetCancellationPolicy, aF as useTelevetClinicians, aG as useTelevetHoldSlot, aH as useTelevetJoin, aI as useTelevetNextSlot, aJ as useTelevetRescheduleConsult, aK as useTelevetSlots, aL as useTelevetStatePolicy, aM as useUpcomingTelevetVisit, aN as useVetThread, aO as useVetThreads, aP as useVisitSummary, aQ as validateBookingBody, aR as vetThreadPetRef, aS as withUnsentPicks } from '../../bookingCopy.d-BakTjvWw.js';
|
|
7
8
|
import { T as TelevetConsult, E as EverfurTelevetFlowRequest, b as TelevetCancelReceipt, c as TelevetSlot } from '../../televetGlobal.d-CC-DrqkQ.js';
|
|
8
9
|
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CANCEL_REASON_MAX, e as CONSULT_KINDS, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TERMINAL_CONSULT_STATUSES, j as TelevetBookingBody, k as TelevetBookingEntitlement, l as TelevetCancellationPolicy, m as TelevetClinician, n as TelevetSlotHold, o as TelevetStatePolicy, p as TelevetTriageVerdict, q as isWellFormedStateCode } from '../../televetGlobal.d-CC-DrqkQ.js';
|
|
9
10
|
import { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.js';
|
|
@@ -12,11 +13,11 @@ export { e as TelevetBookedScreen, f as TelevetBookedScreenProps, c as TelevetCa
|
|
|
12
13
|
export { b as VetCallCredential, c as VetCallJoinRefusal, d as VetCallLimits, p as parseVetCallCredential, v as vetCallJoinReason, e as vetCallJoinRefusal } from '../../callRoom.d-Dqm1rUqT.js';
|
|
13
14
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
|
|
14
15
|
export { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
15
|
-
export { W as WidgetPet } from '../../petsRepository.d-
|
|
16
|
-
import '../../requestFunnel.d-
|
|
16
|
+
export { W as WidgetPet } from '../../petsRepository.d-BtuooSOW.js';
|
|
17
|
+
import '../../requestFunnel.d-Cxt0JqYx.js';
|
|
17
18
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
18
|
-
import '../../config.d-
|
|
19
|
-
import '../../identity.d-
|
|
19
|
+
import '../../config.d-B4-Mrwq2.js';
|
|
20
|
+
import '../../identity.d-DxNvhj3a.js';
|
|
20
21
|
import '../../TelemetryPort.d-BDNr00hu.js';
|
|
21
22
|
import '../../profile.d-CSs1wlXT.js';
|
|
22
23
|
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
import{createContext,forwardRef,createElement,useMemo,useState,useRef,useEffect,useCallback,useReducer,useContext,useSyncExternalStore,Component}from"react";import{TextInput as TextInput$1,StyleSheet,View,Pressable,Linking,Animated,Alert,BackHandler,Image,ActivityIndicator,ScrollView,Platform,KeyboardAvoidingView,Modal,StatusBar,Text as Text$1,Dimensions}from"react-native";import{z}from"zod";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import*as callModule from"@everfur/sdk/televet/call";import{useSafeAreaInsets}from"react-native-safe-area-context";function assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}var CONSULT_STATUSES=["scheduled","in_progress","awaiting_summary","completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"],TERMINAL_CONSULT_STATUSES=/* @__PURE__ */new Set(["completed","cancelled_owner","cancelled_ops","no_show_owner","no_show_vet"]),LIVE_CONSULT_STATUSES=/* @__PURE__ */new Set(["scheduled","in_progress","awaiting_summary"]);function isLiveConsult(consult){return LIVE_CONSULT_STATUSES.has(consult.status)}var CONSULT_KINDS=["wellness","prescription"],SLOT_MINUTES_MAX=60;function televetSlotMinutes(slot){let starts=Date.parse(slot.startsAt),ends=Date.parse(slot.endsAt);if(Number.isNaN(starts)||Number.isNaN(ends))return null;let minutes=Math.round((ends-starts)/6e4);return minutes>0?Math.min(minutes,SLOT_MINUTES_MAX):null}var CANCELLATION_POLICY_VERSION_MAX=64,REASON_TEXT_MAX=2e3,MEDIA_REFS_MAX=10;function isWellFormedStateCode(state){return typeof state=="string"&&/^[A-Za-z]{2}$/.test(state.trim())}function row(value){return typeof value=="object"&&value!==null?value:null}function str(value){return typeof value=="string"&&value.length>0?value:null}function trimmedOrNull(value){return typeof value=="string"&&value.trim().length>0?value.trim():null}function bool(value,fallback){return typeof value=="boolean"?value:fallback}function num(value){return typeof value=="number"&&Number.isFinite(value)?value:null}function closed(set,value){return typeof value=="string"&&set.includes(value)?value:"unknown"}function parseList(wire,parseRow){if(!Array.isArray(wire))/* @__PURE__ */return Object.freeze([]);let out=[];for(let item of wire){let parsed=parseRow(item);parsed!==null&&out.push(parsed)}/* @__PURE__ */
|
|
3
4
|
return Object.freeze(out)}function parseStatePolicy(wire,askedFor){let r=row(wire);return r===null?null:/* @__PURE__ */Object.freeze({state:str(r.state)??askedFor,wellnessAvailable:bool(r.wellness_available,false),prescriptionsAvailable:bool(r.prescriptions_available,false),cancellationPolicyText:trimmedOrNull(r.cancellation_policy_text)})}function parseCancellationPolicy(wire){let r=row(wire);if(r===null)return null;let summary=trimmedOrNull(r.summary),version=trimmedOrNull(r.version);return summary===null||version===null?null:/* @__PURE__ */Object.freeze({summary:summary,version:version})}function parseClinician(wire){let r=row(wire);if(r===null)return null;let clinicianId=str(r.clinician_id),displayName=str(r.display_name);return clinicianId===null||displayName===null?null:/* @__PURE__ */Object.freeze({clinicianId:clinicianId,displayName:displayName,credentials:trimmedOrNull(r.credentials_text),rating:num(r.rating),ratingCount:num(r.rating_count),bio:trimmedOrNull(r.bio),photoRef:str(r.photo_ref),licensedStates:parseList(r.licensed_states,item=>{let l=row(item),state=l===null?null:str(l.state);return state===null?null:/* @__PURE__ */Object.freeze({state:state,canPrescribe:bool(l?.can_prescribe,false)})})})}function parseSlot(wire){let r=row(wire);if(r===null)return null;let slotId=str(r.slot_id),startsAt=str(r.starts_at);return slotId===null||startsAt===null?null:/* @__PURE__ */Object.freeze({slotId:slotId,startsAt:startsAt,endsAt:str(r.ends_at)??startsAt})}function parseTriageVerdict(wire){let r=row(wire);if(r===null)return null;let isEmergency=r.is_emergency===true,fallback=r.fallback===true;return isEmergency||fallback?/* @__PURE__ */Object.freeze({isEmergency:isEmergency,fallback:fallback}):r.is_emergency===false&&r.fallback===false?/* @__PURE__ */Object.freeze({isEmergency:false,fallback:false}):null}function parseSlotHold(wire){let r=row(wire);if(r===null)return null;let slotId=str(r.slot_id),expiresAt=str(r.hold_expires_at);return slotId===null||expiresAt===null?null:/* @__PURE__ */Object.freeze({slotId:slotId,expiresAt:expiresAt})}function parseConsult(wire){let r=row(wire);if(r===null)return null;let consultId=str(r.consult_id),scheduledAt=str(r.scheduled_at);return consultId===null||scheduledAt===null?null:/* @__PURE__ */Object.freeze({consultId:consultId,petId:str(r.pet_id)??"",clinicianId:str(r.clinician_id)??"",clinicianName:trimmedOrNull(r.display_name),reasonText:trimmedOrNull(r.reason_text),mediaRefs:parseList(r.media_refs,item=>str(item)),status:closed(CONSULT_STATUSES,r.status),kind:closed(CONSULT_KINDS,r.kind),scheduledAt:scheduledAt,emergencyFlagged:bool(r.emergency_flagged,false),hasRoom:str(r.meeting_url)!==null})}function parseBookingEntitlement(wire){let r=row(wire);/* @__PURE__ */
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
"use strict";var react=require("react"),reactNative=require("react-native"),reactNativeSafeAreaContext=require("react-native-safe-area-context"),jsxRuntime=require("react/jsx-runtime");var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function formatElapsed(ms){let total=Math.max(0,Math.floor(ms/1e3)),seconds=String(total%60).padStart(2,"0"),minutes=Math.floor(total%3600/60),hours=Math.floor(total/3600);return hours>0?`${hours}:${String(minutes).padStart(2,"0")}:${seconds}`:`${minutes}:${seconds}`}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=react.createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return react.useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return react.createElement(reactNative.Text,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}react.forwardRef(function(props,ref){return react.createElement(reactNative.TextInput,{...props,...ref===null?{}:{ref:ref}})});function optionalModule(name,load,validate){let candidate;try{candidate=load()}catch(cause){return frozenUnavailable(`optional peer '${name}' is not installed: ${describe(cause)}`)}let resolved=unwrapDefault(candidate);return resolved==null?frozenUnavailable(`optional peer '${name}' resolved to no module`):validate&&!validate(resolved)?frozenUnavailable(`optional peer '${name}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:resolved})}function unwrapDefault(candidate){return typeof candidate=="object"&&candidate!==null&&"default"in candidate&&Object.keys(candidate).length<=2?candidate.default:candidate}function frozenUnavailable(reason){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({available:false,module:null,reason:reason})}function describe(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"unknown load error"}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}var EVERFUR_DAILY_SETUP=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,DAILY_PEER="@daily-co/react-native-daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function isDailyBox(candidate){return isRecordLike(candidate)&&"box"in candidate}function normalizeDailyModule(candidate){let inner=candidate.default,fallback=isRecordLike(inner)||typeof inner=="function"?inner:{},owner=typeof candidate.createCallObject=="function"?candidate:fallback,factory=owner.createCallObject,merged={createCallObject:typeof factory=="function"?factory.bind(owner):factory,DailyMediaView:candidate.DailyMediaView??fallback.DailyMediaView};return isEverfurDailyModule(merged)?merged:null}function isEverfurDailyModule(candidate){if(!isRecordLike(candidate)||typeof candidate.createCallObject!="function")return false;let view=candidate.DailyMediaView;return typeof view=="function"||typeof view=="object"&&view!==null}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({available:false,module:null,reason:reason})}function registerEverfurDaily(next){loader=next,memo=null,markEverfurDailyRegistered(next!==null)}function loadEverfurDaily(){if(memo!==null)return memo;let load=loader;if(load===null)return memo=unavailable(NOT_REGISTERED),memo;let raw=optionalModule(DAILY_PEER,()=>({box:load()}),isDailyBox);if(!raw.available)return memo=unavailable(raw.reason),memo;let inner=raw.module.box;if(!isRecordLike(inner))return memo=unavailable(WRONG_SHAPE),memo;let normalized=normalizeDailyModule(inner);return memo=normalized===null?unavailable(WRONG_SHAPE):/* @__PURE__ */Object.freeze({available:true,module:normalized}),memo}function CallControl({label:label,glyph:glyph,onPress:onPress,testID:testID,muted:muted=false,style:style}){/* @__PURE__ */
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
import { ComponentType, ReactNode } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { T as TelemetryPort } from '../../TelemetryPort.d-BDNr00hu.cjs';
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
import { ComponentType, ReactNode } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { T as TelemetryPort } from '../../TelemetryPort.d-BDNr00hu.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
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 */
|
|
1
2
|
import{createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from"react";import{TextInput,StyleSheet,useWindowDimensions,View,Pressable,Text as Text$1,Animated}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{jsxs,jsx,Fragment}from"react/jsx-runtime";var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function formatElapsed(ms){let total=Math.max(0,Math.floor(ms/1e3)),seconds=String(total%60).padStart(2,"0"),minutes=Math.floor(total%3600/60),hours=Math.floor(total/3600);return hours>0?`${hours}:${String(minutes).padStart(2,"0")}:${seconds}`:`${minutes}:${seconds}`}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return createElement(Text$1,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}forwardRef(function(props,ref){return createElement(TextInput,{...props,...ref===null?{}:{ref:ref}})});function optionalModule(name,load,validate){let candidate;try{candidate=load()}catch(cause){return frozenUnavailable(`optional peer '${name}' is not installed: ${describe(cause)}`)}let resolved=unwrapDefault(candidate);return resolved==null?frozenUnavailable(`optional peer '${name}' resolved to no module`):validate&&!validate(resolved)?frozenUnavailable(`optional peer '${name}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:resolved})}function unwrapDefault(candidate){return typeof candidate=="object"&&candidate!==null&&"default"in candidate&&Object.keys(candidate).length<=2?candidate.default:candidate}function frozenUnavailable(reason){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({available:false,module:null,reason:reason})}function describe(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"unknown load error"}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}var EVERFUR_DAILY_SETUP=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,DAILY_PEER="@daily-co/react-native-daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function isDailyBox(candidate){return isRecordLike(candidate)&&"box"in candidate}function normalizeDailyModule(candidate){let inner=candidate.default,fallback=isRecordLike(inner)||typeof inner=="function"?inner:{},owner=typeof candidate.createCallObject=="function"?candidate:fallback,factory=owner.createCallObject,merged={createCallObject:typeof factory=="function"?factory.bind(owner):factory,DailyMediaView:candidate.DailyMediaView??fallback.DailyMediaView};return isEverfurDailyModule(merged)?merged:null}function isEverfurDailyModule(candidate){if(!isRecordLike(candidate)||typeof candidate.createCallObject!="function")return false;let view=candidate.DailyMediaView;return typeof view=="function"||typeof view=="object"&&view!==null}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({available:false,module:null,reason:reason})}function registerEverfurDaily(next){loader=next,memo=null,markEverfurDailyRegistered(next!==null)}function loadEverfurDaily(){if(memo!==null)return memo;let load=loader;if(load===null)return memo=unavailable(NOT_REGISTERED),memo;let raw=optionalModule(DAILY_PEER,()=>({box:load()}),isDailyBox);if(!raw.available)return memo=unavailable(raw.reason),memo;let inner=raw.module.box;if(!isRecordLike(inner))return memo=unavailable(WRONG_SHAPE),memo;let normalized=normalizeDailyModule(inner);return memo=normalized===null?unavailable(WRONG_SHAPE):/* @__PURE__ */Object.freeze({available:true,module:normalized}),memo}function CallControl({label:label,glyph:glyph,onPress:onPress,testID:testID,muted:muted=false,style:style}){/* @__PURE__ */
|