@everfur/sdk 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -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/{Chat.d-CtfANk3A.d.cts → Chat.d-BO5iJsR2.d.cts} +12 -3
- package/dist/{Chat.d-a7Ksz7NZ.d.ts → Chat.d-BlsnQwCQ.d.ts} +12 -3
- package/dist/{DepthViews.d-DbJejGm3.d.ts → DepthViews.d--1daZblh.d.cts} +2 -1
- package/dist/{DepthViews.d-dXWL6ToG.d.cts → DepthViews.d-BuEWI6Ln.d.ts} +2 -1
- package/dist/{DepthViews.d-CuBElgEc.d.ts → DepthViews.d-CKTnEeUo.d.ts} +2 -1
- package/dist/{DepthViews.d-BqMnWSMu.d.cts → DepthViews.d-PuBGdAYk.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-CBB8sfoY.d.ts} +2 -1
- package/dist/{RecordsPage.d-DRPdUAo4.d.cts → RecordsPage.d-Dq5gpQG0.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 +22 -21
- package/dist/animations/index.d.ts +22 -21
- package/dist/animations/index.js +2 -1
- package/dist/{attachments.d-CoQhXrP9.d.ts → attachments.d-C2nkIyDB.d.ts} +3 -2
- package/dist/{attachments.d-BGn2_knv.d.ts → attachments.d-DFP9yvz9.d.ts} +7 -6
- package/dist/{attachments.d-CpaOfi2g.d.cts → attachments.d-DRHsJkni.d.cts} +7 -6
- package/dist/{attachments.d-CqHMGoER.d.cts → attachments.d-DRUC35Ti.d.cts} +3 -2
- package/dist/{bookingCopy.d-BwCOCZUj.d.ts → bookingCopy.d-CFL-1Be2.d.ts} +3 -2
- package/dist/{bookingCopy.d-Bnq2zk0F.d.cts → bookingCopy.d-bF_QknDC.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-CsUJ2Oyb.d.cts → casesRepository.d-BMOnT1fg.d.cts} +2 -1
- package/dist/{casesRepository.d-DG83Ggbq.d.ts → casesRepository.d-C__BnffJ.d.ts} +2 -1
- package/dist/chat/index.cjs +13 -12
- package/dist/chat/index.d.cts +10 -9
- package/dist/chat/index.d.ts +10 -9
- package/dist/chat/index.js +13 -12
- 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-BLpbpS51.d.cts → clinicBatch.d-C5deJ4xY.d.cts} +3 -2
- package/dist/{clinicBatch.d-Byjx4y_W.d.ts → clinicBatch.d-D68RYvc3.d.ts} +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-BQgrIDdu.d.cts} +2 -1
- package/dist/{config.d-zd2eTb2L.d.ts → config.d-XSMThgVj.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-Ba8YyJpk.d.cts} +6 -5
- package/dist/{context.d-BBjmV0rz.d.ts → context.d-xoh5vmxS.d.ts} +6 -5
- package/dist/{copy.d-Da_PP2K3.d.cts → copy.d-Cq-s-UUv.d.cts} +3 -2
- package/dist/{copy.d-D_VVj01o.d.ts → copy.d-HV9fU5kh.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-BEedifOR.d.ts → depth.d-D7kKiYl7.d.ts} +3 -2
- package/dist/{depth.d-RTV61QNf.d.cts → depth.d-DYnkz8Re.d.cts} +3 -2
- package/dist/{entitlementRepository.d-C-stdRyA.d.cts → entitlementRepository.d-B_kEPLhz.d.cts} +3 -2
- package/dist/{entitlementRepository.d-BwThmh3V.d.ts → entitlementRepository.d-DmnUZLl_.d.ts} +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-BHm_QtQ9.d.cts} +3 -2
- package/dist/{focus.d-CtotIyEt.d.ts → focus.d-CjL6Cj0m.d.ts} +3 -2
- package/dist/health-plan/index.cjs +2 -1
- package/dist/health-plan/index.d.cts +9 -8
- package/dist/health-plan/index.d.ts +9 -8
- package/dist/health-plan/index.js +2 -1
- package/dist/{idempotency.d-Cv-B7SfC.d.ts → idempotency.d-BSRK8od4.d.cts} +2 -1
- package/dist/{idempotency.d-Bfm7oIxS.d.cts → idempotency.d-CFc4CCc9.d.ts} +2 -1
- package/dist/{identity.d-BksOEa6m.d.ts → identity.d-Be2Es9Td.d.ts} +2 -1
- package/dist/{identity.d-CioQhZrq.d.cts → identity.d-HbwYQ4-z.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 +14 -13
- package/dist/index.d.cts +13 -12
- package/dist/index.d.ts +13 -12
- package/dist/index.js +14 -13
- package/dist/{introEvents.d-tOi4o3F4.d.ts → introEvents.d-DflJ6J9H.d.ts} +2 -1
- package/dist/{introEvents.d-fAZitxMA.d.cts → introEvents.d-Dr34KIaD.d.cts} +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-B8zTORO2.d.ts → optInView.d-3mbj1mR6.d.ts} +15 -2
- package/dist/{optInView.d-BkNSv4Gk.d.cts → optInView.d-D23o1gtT.d.cts} +15 -2
- package/dist/optionalModule.d-DbJmsq5f.d.cts +1 -0
- package/dist/optionalModule.d-DbJmsq5f.d.ts +1 -0
- package/dist/{parse.d-BgjO82mY.d.cts → parse.d-4lUXdmvY.d.cts} +2 -1
- package/dist/{parse.d-B5JHS6Pr.d.ts → parse.d-BERabxHw.d.ts} +2 -1
- package/dist/{pets.d-B_LoizOv.d.cts → pets.d-CHU0UbXt.d.cts} +2 -1
- package/dist/{pets.d-OWxskXCP.d.ts → pets.d-D_ayuqjp.d.ts} +2 -1
- package/dist/{petsRepository.d-B5DWzU7C.d.cts → petsRepository.d-Bwfe8yuR.d.cts} +2 -1
- package/dist/{petsRepository.d-Ba3xhJcj.d.ts → petsRepository.d-DUaAWoTv.d.ts} +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/{planSignals.d-DtxZoWGM.d.ts → planSignals.d-CON9gTvJ.d.ts} +3 -2
- package/dist/{planSignals.d-Cl6n5QpS.d.cts → planSignals.d-Dha2CMDF.d.cts} +3 -2
- package/dist/ports.d-BX4f4UsB.d.cts +1 -0
- package/dist/ports.d-BX4f4UsB.d.ts +1 -0
- package/dist/{ports.d-gZNTn8Qf.d.cts → ports.d-ClbPRUtx.d.cts} +5 -4
- package/dist/{ports.d-BDtwHxmW.d.ts → ports.d-DzEJMVRs.d.ts} +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 +1 -0
- package/dist/records/depth/index.d.cts +10 -9
- package/dist/records/depth/index.d.ts +10 -9
- package/dist/records/depth/index.js +1 -0
- package/dist/records/index.cjs +3 -2
- package/dist/records/index.d.cts +11 -10
- package/dist/records/index.d.ts +11 -10
- package/dist/records/index.js +3 -2
- package/dist/recordsAsk.d-C5CGSi3j.d.cts +1 -0
- package/dist/recordsAsk.d-C5CGSi3j.d.ts +1 -0
- package/dist/{requestFunnel.d-CR4akGCY.d.cts → requestFunnel.d-JoqddYSx.d.cts} +3 -2
- package/dist/{requestFunnel.d-DFf9C__p.d.ts → requestFunnel.d-YabU6G-Z.d.ts} +3 -2
- package/dist/resolve.d-CoQWUy1Y.d.cts +1 -0
- package/dist/resolve.d-CoQWUy1Y.d.ts +1 -0
- package/dist/{runtimeTypes.d-CHdH-y2c.d.cts → runtimeTypes.d-Cv38YuzP.d.cts} +5 -4
- package/dist/{runtimeTypes.d-BqBOrZxa.d.ts → runtimeTypes.d-DQTBJAbk.d.ts} +5 -4
- package/dist/{screenProps.d-CVqFJw-J.d.ts → screenProps.d-BuJLzFkN.d.ts} +2 -1
- package/dist/{screenProps.d-B1dIANI0.d.cts → screenProps.d-C-AuHoyF.d.cts} +2 -1
- 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 +1 -0
- package/dist/shop/index.d.cts +4 -3
- package/dist/shop/index.d.ts +4 -3
- package/dist/shop/index.js +1 -0
- package/dist/species.d-BXAIMh7I.d.cts +1 -0
- package/dist/species.d-BXAIMh7I.d.ts +1 -0
- package/dist/tabs/index.cjs +1 -0
- package/dist/tabs/index.d.cts +7 -6
- package/dist/tabs/index.d.ts +7 -6
- package/dist/tabs/index.js +1 -0
- package/dist/tabsModel.d-BfIQg6yS.d.cts +1 -0
- package/dist/tabsModel.d-BfIQg6yS.d.ts +1 -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 +2 -1
- package/dist/texting/index.d.cts +9 -6
- package/dist/texting/index.d.ts +9 -6
- package/dist/texting/index.js +2 -1
- package/dist/{threadOptions.d-DZ0AoQGk.d.ts → threadOptions.d-8x_1evAr.d.ts} +3 -2
- package/dist/{threadOptions.d-CnSfFVMr.d.cts → threadOptions.d-DBrmOwmb.d.cts} +3 -2
- package/dist/{timelineRows.d-CF1KvLcQ.d.cts → timelineRows.d-B6lLC8Ud.d.cts} +2 -1
- package/dist/{timelineRows.d-CtL0y7y1.d.ts → timelineRows.d-Brlkti-G.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/useIntroSeen.d-CTWFUthO.d.cts +1 -0
- package/dist/useIntroSeen.d-CTWFUthO.d.ts +1 -0
- package/dist/{usePresentation.d-CZS0qlLI.d.cts → usePresentation.d-BcdCIuEU.d.cts} +2 -1
- package/dist/{usePresentation.d-BsR08Wxt.d.ts → usePresentation.d-Bne14SlX.d.ts} +2 -1
- package/dist/useRecords.d-BYNX01El.d.cts +1 -0
- package/dist/useRecords.d-DWk61a4c.d.ts +1 -0
- package/dist/{useRecordsDepth.d-DTAxFf5s.d.ts → useRecordsDepth.d-Cd6J03o5.d.ts} +2 -1
- package/dist/{useRecordsDepth.d-k-zYIHTe.d.cts → useRecordsDepth.d-DAa169VY.d.cts} +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-3d5_O7Xk.d.cts} +4 -3
- package/dist/{view.d-BE7VOlsB.d.ts → view.d-DkGM8GNA.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 +2 -1
- package/dist/web/health-plan/index.d.cts +11 -10
- package/dist/web/health-plan/index.d.ts +11 -10
- package/dist/web/health-plan/index.js +2 -1
- package/dist/web/index.cjs +16 -13
- package/dist/web/index.d.cts +31 -22
- package/dist/web/index.d.ts +31 -22
- package/dist/web/index.js +16 -13
- 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 +3 -2
- 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 +3 -2
- package/dist/web/shop/index.cjs +1 -0
- package/dist/web/shop/index.d.cts +4 -3
- package/dist/web/shop/index.d.ts +4 -3
- package/dist/web/shop/index.js +1 -0
- 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 +10 -5
- package/LICENSE +0 -21
package/dist/testing/rn/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createContext,forwardRef,createElement,useMemo,useState,useEffect,useRef,useContext}from"react";import{TextInput,Animated,Easing,View,StyleSheet,Text as Text$1}from"react-native";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{z}from"zod";var EMERGENCY_ER_LINE="Go to the nearest emergency vet now.";var CHAT_COPY=/* @__PURE__ */Object.freeze({placeholder:"Ask anything about {petName}…",placeholderFollowUpWeb:"Ask a follow-up…",placeholderUrgentWeb:"Tell us what’s happening…",composerLabel:"Message",attachPhotoOrFileNative:"Add a photo or file",footnoteNative:"Educational, not a diagnosis. Emergency? Call a vet.",footnoteWeb:"Everfur’s assistant isn’t a vet and doesn’t diagnose. Your vet makes the calls. Not for emergencies: if {petName} is in distress, go to the nearest emergency animal hospital now.",suggestions:"Suggestions",reading:"Reading {petName}’s records…",answered:"Everfur answered.",assistantName:"Everfur",followUpsHeadingNative:"Follow-up questions",turnFailedTitleWeb:"Everfur couldn’t answer that just now.",send:"Send",stop:"Stop",retry:"Try again",poweredBy:"powered by everfur",senderUser:"You",senderAssistant:"Assistant",senderVet:"Your vet",loading:"Loading",empty:"No messages yet",transcript:"Chat with Everfur",emptyTitle:"What can we help {petName} with today?",emptyTitlePetFallback:"your pet",copied:"Copied",copyUserMessage:"Copy your message",copyAssistantMessage:"Copy assistant message",feedbackHelpful:"Helpful",feedbackNeutral:"Neutral",feedbackNotHelpful:"Not helpful",feedbackTitle:"What went wrong?",feedbackSubtitle:"Your feedback helps make answers more reliable.",feedbackReasonInaccurate:"Inaccurate",feedbackReasonOutdated:"Out of date",feedbackReasonUnsafe:"Unsafe advice",feedbackReasonUnclear:"Confusing or unclear",feedbackReasonOther:"Something else",feedbackNotesPlaceholder:"Add details (optional)",feedbackSubmit:"Submit feedback",feedbackSkip:"Skip",feedbackSkipA11y:"Skip feedback",feedbackThanks:"Thanks for the feedback",feedbackFailed:"Couldn't send feedback. Please try again.",turnFailedTitle:"Message failed",turnRetry:"Retry",turnUnreachableTitle:"Couldn't reach this chat",turnStartNewChat:"Start a new chat",reconnecting:"Reconnecting…",turnStoppedTitle:"Response stopped",turnStoppedBody:"You stopped this response before it finished. Tap retry to try again.",sourceSingular:"source",sourcePlural:"sources",showSources:"Show",hideSources:"Hide",openSource:"Open source",urgencyGeneralReason:"Just general info about {petName}. Nothing here needs action right now.",findVet:"Find a vet",findVetA11y:"Find a vet near you",nearestEmergencyVet:"Nearest emergency vet",goToNearestEmergencyVet:EMERGENCY_ER_LINE,poisonControlWeb:"ASPCA Poison Control",poisonControlNative:"ASPCA Animal Poison Control, (888) 426-4435",showLatestVetAlert:"Show latest vet alert",dismissBanner:"Dismiss {label} banner",openHistoryNative:"Chats and vet messages",openHistoryWeb:"Chats",showChatsWeb:"Show chats",hideChatsWeb:"Hide chats",newReplySuffix:", a new reply",yourPets:"Your pets",yourPet:"Your pet",switchActivePet:"{name}. Switch pet",petCurrentlyActive:"{name}, currently active",switchToPet:"Switch to {name}",activePrefix:"Active · ",close:"Close",addAnotherPet:"Add a pet",addPet:"Add a pet",attachmentPhoto:"Photo",attachmentCamera:"Camera",closeAttachmentPicker:"Close attachment picker",addAttachment:"Add attachment, {used} of {total} used",attachmentsFull:"Attachments full, {used} of {total} used",retryUpload:"Retry uploading {filename}",removeAttachment:"Remove {filename}",previewAttachment:"Preview {filename}",closePreview:"Close preview",attachedImage:"Attached image: {filename}, opens a full-screen preview",attachmentTooLarge:"Files must be under {max}. {filename} is {size}.",attachmentTooMany:"You can attach up to {max} files per message.",attachmentUnsupported:"{filename} isn't a supported file type yet.",attachmentNetwork:"Couldn't reach the server. Check your connection and try again.",attachmentServer:"Upload failed{status}. Please try again.",attachmentCancelled:"Upload cancelled.",attachmentRateLimited:"Slow down. Please wait a moment and try again.",attachmentQuota:"Daily image limit reached. Try again tomorrow.",attachmentConflict:"Something went wrong. Tap to retry.",attachmentUnknown:"Something went wrong. Please try again.",attachmentsFailedBlocked:"Some attachments failed to upload. Remove or retry them before sending.",dictate:"Dictate a message",stopDictation:"Stop dictation",listening:"Listening",micBlocked:"Microphone access is blocked. Allow it in your browser settings to dictate.",noSpeech:"We didn't catch that. Tap the mic and try again.",dictationUnavailable:"Voice typing isn't available right now."});function fillCopy(template,values){return template.replace(/\{(\w+)\}/g,(match,key)=>{let value=values[key];return value===void 0?match:String(value)})}function petNameSlot(name){return name?.trim()||CHAT_COPY.emptyTitlePetFallback}function forPet(template,name){return fillCopy(template,{petName:petNameSlot(name)})}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 slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}var MIN_SURFACE_HEIGHT=120,MIN_TOUCH_TARGET=44,INPUT_MAX_HEIGHT=120,BUBBLE_MAX_WIDTH="88%",BUBBLE_MAX_WIDTH_CAP=520,HALF_STEP=2,BUBBLE_EDGE_WIDTH=.5,BUBBLE_LEAD_USER=1.5,BUBBLE_LEAD_ASSISTANT=1.6,PENDING_OPACITY=.6,COMPOSER_MIN_HEIGHT=56,COMPOSER_BORDER_WIDTH=1.5,COMPOSER_PADDING_RIGHT=5,COMPOSER_PADDING_VERTICAL=5,INPUT_MIN_HEIGHT=36,INPUT_LINE_HEIGHT=20,APP_BODY_SIZE=14,SEND_CONTROL_SIZE=MIN_TOUCH_TARGET;var SEND_DISABLED_OPACITY=.4,ATTACH_CONTROL_SIZE=MIN_TOUCH_TARGET;var ATTACH_DISABLED_OPACITY=.4,EMPTY_MIN_HEIGHT=480,FOLLOW_UP_HEADING_SIZE=12,FOLLOW_UP_HEADING_TRACKING=.72,FOLLOW_UP_ROW_MIN_HEIGHT=48,RULE_WIDTH=1,FOOTNOTE_SIZE=12,FOOTNOTE_LINE=18,EMPTY_PADDING_TOP="12%",ASSISTANT_AVATAR_SIZE=20;function useChatTheme(){let theme=useEverfurTheme(),styles=useMemo(()=>makeStyles(theme),[theme]);return{theme:theme,styles:styles}}function makeStyles(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,userLine=Math.round(t.size.body*BUBBLE_LEAD_USER),assistantLine=Math.round(t.size.body*BUBBLE_LEAD_ASSISTANT),inputLine=Math.round(INPUT_LINE_HEIGHT*t.size.body/APP_BODY_SIZE),rule=c.borderRingCream,slots=theme.slots;return StyleSheet.create({container:{flex:1,minHeight:MIN_SURFACE_HEIGHT,backgroundColor:c.chatGround},body:{flex:1},centered:{minHeight:MIN_SURFACE_HEIGHT,flexGrow:1,alignItems:"center",justifyContent:"center",padding:s.xl},homeEmpty:{flexGrow:1},emptyContent:{flexGrow:1,alignItems:"stretch",justifyContent:"flex-start",paddingTop:EMPTY_PADDING_TOP,paddingHorizontal:s.lg,paddingBottom:s.lg,minHeight:EMPTY_MIN_HEIGHT,gap:s.lg},errorText:{...face(theme,"regular"),fontSize:t.size.subtitle,lineHeight:t.size.subtitle*t.lineHeight.snug,color:c.danger,textAlign:"center",marginBottom:s.md},retryButton:{minHeight:MIN_TOUCH_TARGET,minWidth:MIN_TOUCH_TARGET,alignItems:"center",justifyContent:"center",paddingHorizontal:s.xl,paddingVertical:s.sm,borderRadius:r.pill,backgroundColor:c.brand,...slotBox(slots.primaryButton)},retryLabel:{...face(theme,"medium"),color:c.onPrimary,fontSize:t.size.body,...slotText(slots.primaryButton)},setupNotice:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,paddingHorizontal:s.lg,paddingVertical:s.sm,backgroundColor:c.surfaceCream},setupNoticeText:{...face(theme,"regular"),color:c.danger,fontSize:t.size.caption,flexShrink:1},turnNotice:{gap:s.xs,padding:s.md,borderRadius:r.lg,backgroundColor:c.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:c.brandBorder,alignItems:"flex-start",...slotBox(slots.card,StyleSheet.hairlineWidth)},turnNoticeError:{borderColor:c.danger},turnNoticeTitle:{...headingFace(theme,"bold"),color:c.text.primary,fontSize:t.size.body,...slotText(slots.card)},turnNoticeTitleError:{color:c.danger},turnNoticeBody:{...face(theme,"regular"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,...slotText(slots.card)},turnNoticeAction:{minHeight:MIN_TOUCH_TARGET,justifyContent:"center"},turnNoticeActionLabel:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.body},setupNoticeAction:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.caption},reconnectingCaption:{...face(theme,"medium"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,textTransform:"uppercase",letterSpacing:.5},readingLine:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.bodyTight,lineHeight:Math.round(t.size.bodyTight*t.lineHeight.relaxed)},list:{flex:1},listContent:{padding:s.lg,gap:s.xl},rowBlock:{gap:s.sm},rowBlockUser:{},rowBlockAssistant:{paddingRight:s.xl},row:{flexDirection:"row"},rowUser:{justifyContent:"flex-end"},rowAssistant:{justifyContent:"flex-start"},bubble:{maxWidth:BUBBLE_MAX_WIDTH,alignItems:"flex-start"},bubbleSideUser:{alignItems:"flex-end"},bubbleUser:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,backgroundColor:c.bubbleUser,...c.primaryEdge!==c.primary&&c.bubbleUser===c.primary?{borderWidth:BUBBLE_EDGE_WIDTH,borderColor:c.primaryEdge}:{},borderRadius:r.lg,borderBottomRightRadius:r.xs,...slotBox(slots.userBubble,BUBBLE_EDGE_WIDTH)},bubbleAssistant:slots.assistantBubble?.backgroundColor===void 0?{...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)}:{paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,borderRadius:r.lg,...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)},bubbleVet:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,backgroundColor:c.bubbleVet,borderRadius:r.lg,borderTopLeftRadius:r.xs,...slotBox(slots.vetBubble,BUBBLE_EDGE_WIDTH)},bubblePending:{opacity:PENDING_OPACITY},bubbleTextUser:{...face(theme,"regular"),color:c.onPrimary,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.userBubble)},bubbleTextAssistant:{...face(theme,"regular"),color:c.text.primary,fontSize:t.size.body,lineHeight:assistantLine,...slotText(slots.assistantBubble)},bubbleTextVet:{...face(theme,"regular"),color:c.onBubbleVet,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.vetBubble)},assistantName:{...face(theme,"bold"),color:c.brandInk,fontSize:t.size.bodyTight,marginBottom:s.xs},assistantSender:{flexDirection:"row",alignItems:"center",gap:s.sm,marginBottom:s.xs},assistantAvatar:{width:ASSISTANT_AVATAR_SIZE,height:ASSISTANT_AVATAR_SIZE,borderRadius:ASSISTANT_AVATAR_SIZE/2},assistantNameInRow:{marginBottom:0},vetHeader:{flexDirection:"row",alignItems:"baseline",gap:s.sm,marginBottom:s.xs},vetSender:{...face(theme,"bold"),color:c.text.primary,fontSize:t.size.bodyTight},vetTime:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.caption},bubbleBold:face(theme,"bold"),bubbleItalic:{fontStyle:"italic"},bubbleCode:face(theme,"mono"),followUps:{alignSelf:"stretch",marginTop:s.md},followUpsHeading:{...face(theme,"monoBold"),color:c.text.muted,fontSize:FOLLOW_UP_HEADING_SIZE,textTransform:"uppercase",letterSpacing:FOLLOW_UP_HEADING_TRACKING,paddingBottom:s.sm,borderBottomWidth:RULE_WIDTH,borderBottomColor:rule},followUpSlot:{alignSelf:"stretch"},followUpSlotRuled:{borderTopWidth:RULE_WIDTH,borderTopColor:rule},followUpRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.md,minHeight:FOLLOW_UP_ROW_MIN_HEIGHT,paddingVertical:s.sm+HALF_STEP,...slots.chip?.backgroundColor!==void 0||slots.chip?.borderColor!==void 0?{paddingHorizontal:s.md}:{},...slotBox(slots.chip)},followUpText:{...face(theme,"bold"),flex:1,color:c.brandInk,fontSize:t.size.bodyTight,...slotText(slots.chip)},composerOuter:{position:"relative"},askEntry:{marginHorizontal:s.md,marginTop:s.xs},composer:{marginHorizontal:s.md,marginTop:s.xs,minHeight:COMPOSER_MIN_HEIGHT,justifyContent:"center",paddingLeft:s.sm,paddingRight:COMPOSER_PADDING_RIGHT,paddingVertical:COMPOSER_PADDING_VERTICAL,backgroundColor:c.composerFill,borderWidth:COMPOSER_BORDER_WIDTH,borderColor:c.composerBorder,borderRadius:r.pill,...slotBox(slots.composerInput,COMPOSER_BORDER_WIDTH)},composerRow:{flexDirection:"row",alignItems:"center",gap:s.xs,minHeight:INPUT_MIN_HEIGHT},attachControl:{width:ATTACH_CONTROL_SIZE,height:ATTACH_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},attachControlDisabled:{opacity:ATTACH_DISABLED_OPACITY},input:{flex:1,minHeight:INPUT_MIN_HEIGHT,maxHeight:INPUT_MAX_HEIGHT,paddingHorizontal:0,paddingVertical:0,...face(theme,"regular"),fontSize:t.size.body,lineHeight:inputLine,color:c.text.primary,...slotText(slots.composerInput)},sendControl:{minHeight:SEND_CONTROL_SIZE,minWidth:SEND_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},sendDisc:{width:SEND_CONTROL_SIZE,height:SEND_CONTROL_SIZE,borderRadius:SEND_CONTROL_SIZE/2,alignItems:"center",justifyContent:"center",...slotBox(slots.sendButton)},sendControlDisabled:{opacity:SEND_DISABLED_OPACITY},footnote:{...face(theme,"regular"),color:c.text.muted,fontSize:FOOTNOTE_SIZE,lineHeight:FOOTNOTE_LINE,textAlign:"center",marginTop:s.sm,marginBottom:s.xs,paddingHorizontal:s.lg},poweredBy:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.micro,textAlign:"center",paddingBottom:s.xs}})}function TypingIndicator({petName:petName=null}){let{styles:styles}=useChatTheme(),line=forPet(CHAT_COPY.reading,petName);/* @__PURE__ */
|
|
2
|
-
return jsx(Text,{tier:"compact",style:styles.readingLine,accessibilityRole:"text",accessibilityLabel:line,accessibilityLiveRegion:"polite",accessibilityState:{busy:true},children:line})}var ROTATION_PERIOD_MS=1400,REVEAL_DELAY_MS=300;function AnalyzingIndicator(){let theme=useEverfurTheme(),styles=useMemo(()=>makeStyles2(theme),[theme]),reduced=theme.motion.reducedMotion,[visible,setVisible]=useState(false);useEffect(()=>{let id=setTimeout(()=>setVisible(true),REVEAL_DELAY_MS);return()=>clearTimeout(id)},[]);let spin=useRef(new Animated.Value(0)).current;useEffect(()=>{if(reduced||!visible)return;let loop=Animated.loop(Animated.timing(spin,{toValue:1,duration:ROTATION_PERIOD_MS,easing:Easing.linear,useNativeDriver:true}));return loop.start(),()=>loop.stop()},[reduced,visible,spin]);let arcMotionStyle=reduced?null:{transform:[{rotate:spin.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]})}]};/* @__PURE__ */
|
|
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{createContext,forwardRef,createElement,useRef,useEffect,useMemo,useState,useContext}from"react";import{TextInput,Animated,View,Easing,StyleSheet,Text as Text$1}from"react-native";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{z}from"zod";var EMERGENCY_ER_LINE="Go to the nearest emergency vet now.";var CHAT_COPY=/* @__PURE__ */Object.freeze({placeholder:"Ask anything about {petName}…",placeholderFollowUpWeb:"Ask a follow-up…",placeholderUrgentWeb:"Tell us what’s happening…",composerLabel:"Message",attachPhotoOrFileNative:"Add a photo or file",footnoteNative:"Educational, not a diagnosis. Emergency? Call a vet.",footnoteWeb:"Everfur’s assistant isn’t a vet and doesn’t diagnose. Your vet makes the calls. Not for emergencies: if {petName} is in distress, go to the nearest emergency animal hospital now.",suggestions:"Suggestions",reading:"Reading {petName}’s records…",answered:"Everfur answered.",assistantName:"Everfur",followUpsHeadingNative:"Follow-up questions",turnFailedTitleWeb:"Everfur couldn’t answer that just now.",send:"Send",stop:"Stop",retry:"Try again",poweredBy:"powered by everfur",senderUser:"You",senderAssistant:"Assistant",senderVet:"Your vet",loading:"Loading",empty:"No messages yet",transcript:"Chat with Everfur",emptyTitle:"What can we help {petName} with today?",emptyTitlePetFallback:"your pet",copied:"Copied",copyUserMessage:"Copy your message",copyAssistantMessage:"Copy assistant message",feedbackHelpful:"Helpful",feedbackNeutral:"Neutral",feedbackNotHelpful:"Not helpful",feedbackTitle:"What went wrong?",feedbackSubtitle:"Your feedback helps make answers more reliable.",feedbackReasonInaccurate:"Inaccurate",feedbackReasonOutdated:"Out of date",feedbackReasonUnsafe:"Unsafe advice",feedbackReasonUnclear:"Confusing or unclear",feedbackReasonOther:"Something else",feedbackNotesPlaceholder:"Add details (optional)",feedbackSubmit:"Submit feedback",feedbackSkip:"Skip",feedbackSkipA11y:"Skip feedback",feedbackThanks:"Thanks for the feedback",feedbackFailed:"Couldn't send feedback. Please try again.",turnFailedTitle:"Message failed",turnRetry:"Retry",turnUnreachableTitle:"Couldn't reach this chat",turnStartNewChat:"Start a new chat",reconnecting:"Reconnecting…",turnStoppedTitle:"Response stopped",turnStoppedBody:"You stopped this response before it finished. Tap retry to try again.",sourceSingular:"source",sourcePlural:"sources",showSources:"Show",hideSources:"Hide",openSource:"Open source",urgencyGeneralReason:"Just general info about {petName}. Nothing here needs action right now.",findVet:"Find a vet",findVetA11y:"Find a vet near you",nearestEmergencyVet:"Nearest emergency vet",goToNearestEmergencyVet:EMERGENCY_ER_LINE,poisonControlWeb:"ASPCA Poison Control",poisonControlNative:"ASPCA Animal Poison Control, (888) 426-4435",showLatestVetAlert:"Show latest vet alert",dismissBanner:"Dismiss {label} banner",openHistoryNative:"Chats and vet messages",openHistoryWeb:"Chats",showChatsWeb:"Show chats",hideChatsWeb:"Hide chats",newReplySuffix:", a new reply",yourPets:"Your pets",yourPet:"Your pet",switchActivePet:"{name}. Switch pet",petCurrentlyActive:"{name}, currently active",switchToPet:"Switch to {name}",activePrefix:"Active · ",close:"Close",addAnotherPet:"Add a pet",addPet:"Add a pet",attachmentPhoto:"Photo",attachmentCamera:"Camera",closeAttachmentPicker:"Close attachment picker",addAttachment:"Add attachment, {used} of {total} used",attachmentsFull:"Attachments full, {used} of {total} used",retryUpload:"Retry uploading {filename}",removeAttachment:"Remove {filename}",previewAttachment:"Preview {filename}",closePreview:"Close preview",attachedImage:"Attached image: {filename}, opens a full-screen preview",attachmentTooLarge:"Files must be under {max}. {filename} is {size}.",attachmentTooMany:"You can attach up to {max} files per message.",attachmentUnsupported:"{filename} isn't a supported file type yet.",attachmentNetwork:"Couldn't reach the server. Check your connection and try again.",attachmentServer:"Upload failed{status}. Please try again.",attachmentCancelled:"Upload cancelled.",attachmentRateLimited:"Slow down. Please wait a moment and try again.",attachmentQuota:"Daily image limit reached. Try again tomorrow.",attachmentConflict:"Something went wrong. Tap to retry.",attachmentUnknown:"Something went wrong. Please try again.",attachmentsFailedBlocked:"Some attachments failed to upload. Remove or retry them before sending.",dictate:"Dictate a message",stopDictation:"Stop dictation",listening:"Listening",micBlocked:"Microphone access is blocked. Allow it in your browser settings to dictate.",noSpeech:"We didn't catch that. Tap the mic and try again.",dictationUnavailable:"Voice typing isn't available right now."});function fillCopy(template,values){return template.replace(/\{(\w+)\}/g,(match,key)=>{let value=values[key];return value===void 0?match:String(value)})}function petNameSlot(name){return name?.trim()||CHAT_COPY.emptyTitlePetFallback}function forPet(template,name){return fillCopy(template,{petName:petNameSlot(name)})}function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}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)}var MIN_SURFACE_HEIGHT=120,MIN_TOUCH_TARGET=44,INPUT_MAX_HEIGHT=120,BUBBLE_MAX_WIDTH="88%",BUBBLE_MAX_WIDTH_CAP=520,HALF_STEP=2,BUBBLE_EDGE_WIDTH=.5,BUBBLE_LEAD_USER=1.5,BUBBLE_LEAD_ASSISTANT=1.6,PENDING_OPACITY=.6,COMPOSER_MIN_HEIGHT=56,COMPOSER_BORDER_WIDTH=1.5,COMPOSER_PADDING_RIGHT=5,COMPOSER_PADDING_VERTICAL=5,INPUT_MIN_HEIGHT=36,INPUT_LINE_HEIGHT=20,APP_BODY_SIZE=14,SEND_CONTROL_SIZE=MIN_TOUCH_TARGET;var SEND_DISABLED_OPACITY=.4,ATTACH_CONTROL_SIZE=MIN_TOUCH_TARGET;var ATTACH_DISABLED_OPACITY=.4,EMPTY_MIN_HEIGHT=480,FOLLOW_UP_HEADING_SIZE=12,FOLLOW_UP_HEADING_TRACKING=.72,FOLLOW_UP_ROW_MIN_HEIGHT=48,RULE_WIDTH=1,FOOTNOTE_SIZE=12,FOOTNOTE_LINE=18,EMPTY_PADDING_TOP="12%",ASSISTANT_AVATAR_SIZE=20;function useChatTheme(){let theme=useEverfurTheme(),styles=useMemo(()=>makeStyles(theme),[theme]);return{theme:theme,styles:styles}}function makeStyles(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,userLine=Math.round(t.size.body*BUBBLE_LEAD_USER),assistantLine=Math.round(t.size.body*BUBBLE_LEAD_ASSISTANT),inputLine=Math.round(INPUT_LINE_HEIGHT*t.size.body/APP_BODY_SIZE),rule=c.borderRingCream,slots=theme.slots;return StyleSheet.create({container:{flex:1,minHeight:MIN_SURFACE_HEIGHT,backgroundColor:c.chatGround},body:{flex:1},centered:{minHeight:MIN_SURFACE_HEIGHT,flexGrow:1,alignItems:"center",justifyContent:"center",padding:s.xl},homeEmpty:{flexGrow:1},emptyContent:{flexGrow:1,alignItems:"stretch",justifyContent:"flex-start",paddingTop:EMPTY_PADDING_TOP,paddingHorizontal:s.lg,paddingBottom:s.lg,minHeight:EMPTY_MIN_HEIGHT,gap:s.lg},errorText:{...face(theme,"regular"),fontSize:t.size.subtitle,lineHeight:t.size.subtitle*t.lineHeight.snug,color:c.danger,textAlign:"center",marginBottom:s.md},retryButton:{minHeight:MIN_TOUCH_TARGET,minWidth:MIN_TOUCH_TARGET,alignItems:"center",justifyContent:"center",paddingHorizontal:s.xl,paddingVertical:s.sm,borderRadius:r.pill,backgroundColor:c.brand,...slotBox(slots.primaryButton)},retryLabel:{...face(theme,"medium"),color:c.onPrimary,fontSize:t.size.body,...slotText(slots.primaryButton)},setupNotice:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,paddingHorizontal:s.lg,paddingVertical:s.sm,backgroundColor:c.surfaceCream},setupNoticeText:{...face(theme,"regular"),color:c.danger,fontSize:t.size.caption,flexShrink:1},turnNotice:{gap:s.xs,padding:s.md,borderRadius:r.lg,backgroundColor:c.surfaceCream,borderWidth:StyleSheet.hairlineWidth,borderColor:c.brandBorder,alignItems:"flex-start",...slotBox(slots.card,StyleSheet.hairlineWidth)},turnNoticeError:{borderColor:c.danger},turnNoticeTitle:{...headingFace(theme,"bold"),color:c.text.primary,fontSize:t.size.body,...slotText(slots.card)},turnNoticeTitleError:{color:c.danger},turnNoticeBody:{...face(theme,"regular"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,...slotText(slots.card)},turnNoticeAction:{minHeight:MIN_TOUCH_TARGET,justifyContent:"center"},turnNoticeActionLabel:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.body},setupNoticeAction:{...face(theme,"medium"),color:c.brandInk,fontSize:t.size.caption},reconnectingCaption:{...face(theme,"medium"),color:c.text.secondary,fontSize:t.size.caption,lineHeight:t.size.caption*t.lineHeight.normal,textTransform:"uppercase",letterSpacing:.5},readingBox:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:s.xs,paddingVertical:s.md,paddingHorizontal:s.md+s.xs/2,backgroundColor:c.surfaceSubtle,borderRadius:r.md},readingDot:{width:6,height:6,borderRadius:r.pill,backgroundColor:c.brandInk},list:{flex:1},listContent:{padding:s.lg,gap:s.xl},rowBlock:{gap:s.sm},rowBlockUser:{},rowBlockAssistant:{paddingRight:s.xl},row:{flexDirection:"row"},rowUser:{justifyContent:"flex-end"},rowAssistant:{justifyContent:"flex-start"},bubble:{maxWidth:BUBBLE_MAX_WIDTH,alignItems:"flex-start"},bubbleSideUser:{alignItems:"flex-end"},bubbleUser:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,backgroundColor:c.bubbleUser,...c.primaryEdge!==c.primary&&c.bubbleUser===c.primary?{borderWidth:BUBBLE_EDGE_WIDTH,borderColor:c.primaryEdge}:{},borderRadius:r.lg,borderBottomRightRadius:r.xs,...slotBox(slots.userBubble,BUBBLE_EDGE_WIDTH)},bubbleAssistant:slots.assistantBubble?.backgroundColor===void 0?{...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)}:{paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,borderRadius:r.lg,...slotBox(slots.assistantBubble,BUBBLE_EDGE_WIDTH)},bubbleVet:{maxWidth:BUBBLE_MAX_WIDTH_CAP,paddingVertical:s.md,paddingHorizontal:s.lg+HALF_STEP,backgroundColor:c.bubbleVet,borderRadius:r.lg,borderTopLeftRadius:r.xs,...slotBox(slots.vetBubble,BUBBLE_EDGE_WIDTH)},bubblePending:{opacity:PENDING_OPACITY},bubbleTextUser:{...face(theme,"regular"),color:c.onPrimary,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.userBubble)},bubbleTextAssistant:{...face(theme,"regular"),color:c.text.primary,fontSize:t.size.body,lineHeight:assistantLine,...slotText(slots.assistantBubble)},bubbleTextVet:{...face(theme,"regular"),color:c.onBubbleVet,fontSize:t.size.body,lineHeight:userLine,...slotText(slots.vetBubble)},assistantName:{...face(theme,"bold"),color:c.brandInk,fontSize:t.size.bodyTight,marginBottom:s.xs},assistantSender:{flexDirection:"row",alignItems:"center",gap:s.sm,marginBottom:s.xs},assistantAvatar:{width:ASSISTANT_AVATAR_SIZE,height:ASSISTANT_AVATAR_SIZE,borderRadius:ASSISTANT_AVATAR_SIZE/2},assistantNameInRow:{marginBottom:0},vetHeader:{flexDirection:"row",alignItems:"baseline",gap:s.sm,marginBottom:s.xs},vetSender:{...face(theme,"bold"),color:c.text.primary,fontSize:t.size.bodyTight},vetTime:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.caption},bubbleBold:face(theme,"bold"),bubbleItalic:{fontStyle:"italic"},bubbleCode:face(theme,"mono"),followUps:{alignSelf:"stretch",marginTop:s.md},followUpsHeading:{...face(theme,"monoBold"),color:c.text.muted,fontSize:FOLLOW_UP_HEADING_SIZE,textTransform:"uppercase",letterSpacing:FOLLOW_UP_HEADING_TRACKING,paddingBottom:s.sm,borderBottomWidth:RULE_WIDTH,borderBottomColor:rule},followUpSlot:{alignSelf:"stretch"},followUpSlotRuled:{borderTopWidth:RULE_WIDTH,borderTopColor:rule},followUpRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.md,minHeight:FOLLOW_UP_ROW_MIN_HEIGHT,paddingVertical:s.sm+HALF_STEP,...slots.chip?.backgroundColor!==void 0||slots.chip?.borderColor!==void 0?{paddingHorizontal:s.md}:{},...slotBox(slots.chip)},followUpText:{...face(theme,"bold"),flex:1,color:c.brandInk,fontSize:t.size.bodyTight,...slotText(slots.chip)},composerOuter:{position:"relative"},askEntry:{marginHorizontal:s.md,marginTop:s.xs},composer:{marginHorizontal:s.md,marginTop:s.xs,minHeight:COMPOSER_MIN_HEIGHT,justifyContent:"center",paddingLeft:s.sm,paddingRight:COMPOSER_PADDING_RIGHT,paddingVertical:COMPOSER_PADDING_VERTICAL,backgroundColor:c.composerFill,borderWidth:COMPOSER_BORDER_WIDTH,borderColor:c.composerBorder,borderRadius:r.pill,...slotBox(slots.composerInput,COMPOSER_BORDER_WIDTH)},composerRow:{flexDirection:"row",alignItems:"center",gap:s.xs,minHeight:INPUT_MIN_HEIGHT},attachControl:{width:ATTACH_CONTROL_SIZE,height:ATTACH_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},attachControlDisabled:{opacity:ATTACH_DISABLED_OPACITY},input:{flex:1,minHeight:INPUT_MIN_HEIGHT,maxHeight:INPUT_MAX_HEIGHT,paddingHorizontal:0,paddingVertical:0,...face(theme,"regular"),fontSize:t.size.body,lineHeight:inputLine,color:c.text.primary,...slotText(slots.composerInput)},sendControl:{minHeight:SEND_CONTROL_SIZE,minWidth:SEND_CONTROL_SIZE,alignItems:"center",justifyContent:"center"},sendDisc:{width:SEND_CONTROL_SIZE,height:SEND_CONTROL_SIZE,borderRadius:SEND_CONTROL_SIZE/2,alignItems:"center",justifyContent:"center",...slotBox(slots.sendButton)},sendControlDisabled:{opacity:SEND_DISABLED_OPACITY},footnote:{...face(theme,"regular"),color:c.text.muted,fontSize:FOOTNOTE_SIZE,lineHeight:FOOTNOTE_LINE,textAlign:"center",marginTop:s.sm,marginBottom:s.xs,paddingHorizontal:s.lg},poweredBy:{...face(theme,"regular"),color:c.text.muted,fontSize:t.size.micro,textAlign:"center",paddingBottom:s.xs}})}var LOOP_MS=1e3,STAGGER_MS=150,OPACITY_REST=.25,OPACITY_STATIC=.5,DOT_COUNT=3;function TypingIndicator({petName:petName=null}){let{theme:theme,styles:styles}=useChatTheme(),reducedMotion=theme.motion.reducedMotion,line=forPet(CHAT_COPY.reading,petName),values=useRef(Array.from({length:DOT_COUNT},()=>new Animated.Value(0))).current;return useEffect(()=>{if(reducedMotion)return;let loops=values.map((value,index)=>Animated.loop(Animated.sequence([Animated.delay(index*STAGGER_MS),Animated.timing(value,{toValue:1,duration:LOOP_MS*.4,useNativeDriver:true}),Animated.timing(value,{toValue:0,duration:LOOP_MS*.6,useNativeDriver:true}),Animated.delay((DOT_COUNT-index-1)*STAGGER_MS)])));for(let loop of loops)loop.start();return()=>{for(let loop of loops)loop.stop()}},[reducedMotion,values]),/* @__PURE__ */jsx(View,{style:styles.readingBox,accessible:true,accessibilityRole:"text",accessibilityLabel:line,accessibilityLiveRegion:"polite",accessibilityState:{busy:true},children:values.map((value,index)=>/* @__PURE__ */jsx(Animated.View,{accessibilityElementsHidden:true,importantForAccessibility:"no",style:[styles.readingDot,reducedMotion?{opacity:OPACITY_STATIC}:{opacity:value.interpolate({inputRange:[0,1],outputRange:[OPACITY_REST,1]}),transform:[{translateY:value.interpolate({inputRange:[0,1],outputRange:[0,-3]})}]}]},index))})}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}})});var ROTATION_PERIOD_MS=1400,REVEAL_DELAY_MS=300;function AnalyzingIndicator(){let theme=useEverfurTheme(),styles=useMemo(()=>makeStyles2(theme),[theme]),reduced=theme.motion.reducedMotion,[visible,setVisible]=useState(false);useEffect(()=>{let id=setTimeout(()=>setVisible(true),REVEAL_DELAY_MS);return()=>clearTimeout(id)},[]);let spin=useRef(new Animated.Value(0)).current;useEffect(()=>{if(reduced||!visible)return;let loop=Animated.loop(Animated.timing(spin,{toValue:1,duration:ROTATION_PERIOD_MS,easing:Easing.linear,useNativeDriver:true}));return loop.start(),()=>loop.stop()},[reduced,visible,spin]);let arcMotionStyle=reduced?null:{transform:[{rotate:spin.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]})}]};/* @__PURE__ */
|
|
3
3
|
return jsx(View,{style:styles.wrap,accessible:true,accessibilityState:{busy:true},accessibilityLabel:"Analyzing photo",children:visible?/* @__PURE__ */jsxs(Fragment,{children:[
|
|
4
4
|
/* @__PURE__ */jsx(Animated.View,{style:[styles.ring,arcMotionStyle]}),
|
|
5
5
|
/* @__PURE__ */jsx(Text,{style:styles.statusLine,children:"Analyzing"})]}):null})}function makeStyles2(theme){let{color:color,space:space,radius:radius,type:type}=theme,medium=type.weight.medium,ringSize=space.xxl*2,ringThickness=space.xs;return StyleSheet.create({wrap:{flexGrow:1,alignItems:"center",justifyContent:"center",padding:space.xl,gap:space.md},ring:{width:ringSize,height:ringSize,borderRadius:radius.pill,borderWidth:ringThickness,borderTopColor:color.success,borderRightColor:color.success,borderBottomColor:color.borderRingCream,borderLeftColor:color.borderRingCream},statusLine:{color:color.text.secondary,fontFamily:type.family,fontSize:type.size.subtitle,lineHeight:type.size.subtitle*type.lineHeight.snug,fontWeight:medium,letterSpacing:type.letterSpacing.tight,textAlign:"center"}})}var PULSE_PERIOD_MS=1100,PULSE_MAX_SCALE=1.6,PULSE_START_OPACITY=.35;function toneSpec(theme,tier){let{color:color}=theme;switch(tier){case"low_risk":return{accent:color.success,wash:color.badgeBgPositive,label:"Low risk",pulse:false};case"concern":return{accent:color.cautionAccent,wash:color.badgeBgCaution,label:"Concern",pulse:true};case"uncertain":return{accent:color.text.muted,wash:color.badgeBgNeutral,label:"Uncertain",pulse:false}}}function SeverityBadge({riskTier:riskTier}){let theme=useEverfurTheme(),styles=useMemo(()=>makeStyles3(theme),[theme]),pulse=useRef(new Animated.Value(0)).current,spec=riskTier===null?null:toneSpec(theme,riskTier),shouldPulse=spec!==null&&spec.pulse&&!theme.motion.reducedMotion;return useEffect(()=>{if(!shouldPulse)return;let loop=Animated.loop(Animated.timing(pulse,{toValue:1,duration:PULSE_PERIOD_MS,easing:Easing.out(Easing.quad),useNativeDriver:true}));return loop.start(),()=>loop.stop()},[shouldPulse,pulse]),spec===null?null:/* @__PURE__ */jsxs(View,{style:[styles.pill,{backgroundColor:spec.wash}],accessible:true,accessibilityRole:"text",accessibilityLabel:spec.label,children:[
|
|
@@ -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 client";
|
|
2
3
|
"use strict";var react=require("react"),zod=require("zod");function ok(value,warning){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
@@ -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 { f as EntitlementSnapshot } from '../../runtimeTypes.d-Cv38YuzP.cjs';
|
|
2
3
|
import { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
3
4
|
import { R as RecordsRequestId, P as PetRef } from '../../ids.d-B2GAAifq.cjs';
|
|
4
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
|
|
@@ -8,15 +9,15 @@ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } f
|
|
|
8
9
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens.d-BUVqme2D.cjs';
|
|
9
10
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding.d-Bbc6p1XY.cjs';
|
|
10
11
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve.d-CoQWUy1Y.cjs';
|
|
11
|
-
import '../../petsRepository.d-
|
|
12
|
-
import '../../identity.d-
|
|
13
|
-
import '../../config.d-
|
|
12
|
+
import '../../petsRepository.d-Bwfe8yuR.cjs';
|
|
13
|
+
import '../../identity.d-HbwYQ4-z.cjs';
|
|
14
|
+
import '../../config.d-BQgrIDdu.cjs';
|
|
14
15
|
import '../../profile.d-CSs1wlXT.cjs';
|
|
15
16
|
import '../../cacheEpoch.d-DknKn3S0.cjs';
|
|
16
17
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
17
|
-
import '../../ports.d-
|
|
18
|
-
import '../../casesRepository.d-
|
|
19
|
-
import '../../requestFunnel.d-
|
|
18
|
+
import '../../ports.d-ClbPRUtx.cjs';
|
|
19
|
+
import '../../casesRepository.d-BMOnT1fg.cjs';
|
|
20
|
+
import '../../requestFunnel.d-JoqddYSx.cjs';
|
|
20
21
|
import '../../TelemetryPort.d-BDNr00hu.cjs';
|
|
21
22
|
import '../../ports.d-BX4f4UsB.cjs';
|
|
22
23
|
import '../../CameraPort.d-Cv31Pz7g.cjs';
|
|
@@ -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 { f as EntitlementSnapshot } from '../../runtimeTypes.d-DQTBJAbk.js';
|
|
2
3
|
import { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
3
4
|
import { R as RecordsRequestId, P as PetRef } from '../../ids.d-B2GAAifq.js';
|
|
4
5
|
export { B as Brand, _ as __brand } from '../../ids.d-B2GAAifq.js';
|
|
@@ -8,15 +9,15 @@ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } f
|
|
|
8
9
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens.d-BUVqme2D.js';
|
|
9
10
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding.d-y6c0UwhE.js';
|
|
10
11
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve.d-CoQWUy1Y.js';
|
|
11
|
-
import '../../petsRepository.d-
|
|
12
|
-
import '../../identity.d-
|
|
13
|
-
import '../../config.d-
|
|
12
|
+
import '../../petsRepository.d-DUaAWoTv.js';
|
|
13
|
+
import '../../identity.d-Be2Es9Td.js';
|
|
14
|
+
import '../../config.d-XSMThgVj.js';
|
|
14
15
|
import '../../profile.d-CSs1wlXT.js';
|
|
15
16
|
import '../../cacheEpoch.d-DknKn3S0.js';
|
|
16
17
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
17
|
-
import '../../ports.d-
|
|
18
|
-
import '../../casesRepository.d-
|
|
19
|
-
import '../../requestFunnel.d-
|
|
18
|
+
import '../../ports.d-DzEJMVRs.js';
|
|
19
|
+
import '../../casesRepository.d-C__BnffJ.js';
|
|
20
|
+
import '../../requestFunnel.d-YabU6G-Z.js';
|
|
20
21
|
import '../../TelemetryPort.d-BDNr00hu.js';
|
|
21
22
|
import '../../ports.d-BX4f4UsB.js';
|
|
22
23
|
import '../../CameraPort.d-Cv31Pz7g.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
|
"use client";
|
|
2
3
|
import{createContext,useMemo,useContext}from"react";import{z}from"zod";function ok(value,warning){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
package/dist/texting/index.cjs
CHANGED
|
@@ -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"),jsxRuntime=require("react/jsx-runtime");function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function 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 HostRenderBoundary=class extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state2){return Object.is(props.resetKey,state2.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return react.createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:react.createElement(RenderHost,{render:render})})}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}),
|
|
@@ -155,7 +156,7 @@ return jsxRuntime.jsxs(reactNative.View,{style:styles.petRow,children:[
|
|
|
155
156
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:styles.chips,accessibilityRole:"radiogroup",accessibilityLabel:copy.defaultPetLabel,children:pets.map(pet=>{let picked=pet.petRef===value;/* @__PURE__ */
|
|
156
157
|
return jsxRuntime.jsx(reactNative.Pressable,{onPress:()=>onChoose(pet.petRef),disabled:saving,accessibilityRole:"radio",accessibilityState:{checked:picked,disabled:saving},accessibilityLabel:pet.name??pet.petRef,style:[styles.chip,picked?styles.chipPicked:null],children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"compact",style:[styles.chipLabel,picked?styles.chipLabelPicked:null],children:pet.name??pet.petRef})},pet.petRef)})}),
|
|
157
158
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.links,children:[
|
|
158
|
-
/* @__PURE__ */jsxRuntime.jsx(Button,{label:saving?copy.savingPet:copy.savePet,kind:"secondary",busy:saving,disabled:!changed,styles:styles,onPress:()=>{value!==null&&onSave(value)},testID:"texting-pet-save"}),saved&&!changed?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.footnote,children:copy.petSaved}):null]})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text3=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.card?.textColor;return reactNative.StyleSheet.create({card:{gap:space.md,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1)},title:text3(type.size.subtitle,cardInk??color.text.primary,"bold"),subtitle:text3(type.size.body,cardInk??color.text.primary,"bold"),body:text3(type.size.body,cardInk??color.text.secondary,"regular"),footnote:text3(type.size.caption,color.text.muted,"regular"),phone:text3(type.size.body,cardInk??color.text.primary,"bold"),label:text3(type.size.caption,cardInk??color.text.primary,"bold"),input:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.md,borderWidth:1,borderColor:color.controlEdge,backgroundColor:color.surface,...text3(type.size.body,color.text.primary,"regular"),...slotBox(slots.input,1),...slotText(slots.input)},consentRow:{flexDirection:"row",alignItems:"flex-start",gap:space.sm,minHeight:44},box:{width:24,height:24,borderRadius:radius.xs,borderWidth:2,borderColor:color.controlEdge,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},boxChecked:{backgroundColor:color.brand,borderColor:color.brandInk},tick:{...text3(type.size.caption,color.text.onBrand,"bold")},consentText:{flex:1,...text3(type.size.caption,cardInk??color.text.secondary,"regular")},primary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},primaryLabel:{...text3(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},secondary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},secondaryLabel:text3(type.size.caption,color.brandInk,"bold"),link:{minHeight:44,justifyContent:"center",alignSelf:"flex-start"},linkLabel:{...text3(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},links:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:space.md},notice:{gap:space.xs},noticeText:text3(type.size.caption,color.errorRed,"regular"),confirm:{gap:space.sm,padding:space.md,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},petRow:{gap:space.xs},chips:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,justifyContent:"center",...slotBox(slots.chip,1)},chipPicked:{backgroundColor:color.brandSoft,borderColor:color.brandInk},chipLabel:{...text3(type.size.caption,color.text.primary,"regular"),...slotText(slots.chip)},chipLabelPicked:{...face(theme,"bold"),color:color.brandInk}})}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 stored=host[INTRO_OPEN_SYMBOL],fresh=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state=isIntroOpenState(stored)?stored:host[INTRO_OPEN_SYMBOL]=fresh();function isIntroOpen(){return state.holds.size>0}function subscribe(listener){return state.listeners.add(listener),()=>{state.listeners.delete(listener)}}function useIntroOpen(){return react.useSyncExternalStore(subscribe,isIntroOpen,isIntroOpen)}function resolveTextingAskDue(input){let readEnabled=input.enabled&&input.capabilityGranted&&input.hasProfile&&input.signedIn&&input.scheduleEligible&&!input.offeredThisSession,due=readEnabled&&input.identity==="none"&&input.surfaceReady;return{readEnabled:readEnabled,due:due}}var URGENT_LEVELS=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(chat){if(chat.isBootstrapping===true||chat.isLoadingHistory===true||chat.isStreaming===true||chat.status==="error"||chat.stopped===true)return false;let last=chat.messages[chat.messages.length-1];return last===void 0||last.role!=="assistant"||last.pending===true||last.checkin!==void 0||last.text.trim().length===0?false:!(typeof last.urgencyLevel=="string"&&URGENT_LEVELS.has(last.urgencyLevel))}var IN_MEMORY_KVS=/* @__PURE__ */new WeakSet;function isInMemoryKv(kv){return IN_MEMORY_KVS.has(kv)}var TEXTING_ASK_SCHEDULE_KEY="everfur.texting.askSchedule.v1",TEXTING_ASK_SNOOZE_MS=2880*60*1e3,TEXTING_ASK_MAX_ASKS=3,EMPTY_TEXTING_ASK_ENTRY=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(read,now){if(read.status!=="ok")return false;let{entry:entry}=read;return entry.completed||entry.askCount>=TEXTING_ASK_MAX_ASKS?false:entry.nextAskAt===null||now>=entry.nextAskAt}function applyTextingAsk(entry,now){return{askCount:Math.min(entry.askCount+1,TEXTING_ASK_MAX_ASKS),nextAskAt:now+TEXTING_ASK_SNOOZE_MS,completed:entry.completed}}function applyTextingAskSnooze(entry,now){return{...entry,nextAskAt:now+TEXTING_ASK_SNOOZE_MS}}function applyTextingAskCompleted(entry){return{...entry,completed:true}}function nextTextingAskNumber(entry){return entry.askCount<=0?1:entry.askCount===1?2:3}function entryOf(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw,{askCount:askCount,nextAskAt:nextAskAt,completed:completed}=o;return typeof askCount!="number"||!Number.isInteger(askCount)||askCount<0||nextAskAt!==null&&(typeof nextAskAt!="number"||!Number.isFinite(nextAskAt))||typeof completed!="boolean"?null:{askCount:Math.min(askCount,TEXTING_ASK_MAX_ASKS),nextAskAt:nextAskAt,completed:completed}}function parseTextingAskMap(raw){let value;try{value=JSON.parse(raw)}catch{return null}if(value===null||typeof value!="object"||Array.isArray(value))return null;let out={};for(let[key,item]of Object.entries(value)){let entry=entryOf(item);if(entry===null)return null;out[key]=entry}return out}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function shared(){let host2=globalThis,state2=host2[SLOT];return state2===void 0&&(state2={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},host2[SLOT]=state2),state2.sessionListeners===void 0&&(state2.sessionListeners=/* @__PURE__ */new Set),state2}async function load(kv){if(isInMemoryKv(kv))return{status:"unreadable"};let raw;try{raw=await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)}catch{return{status:"unreadable"}}if(raw===null)try{return await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,"{}"),await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let map=parseTextingAskMap(raw);if(map!==null)return{status:"ok",map:map};try{await kv.removeItem(TEXTING_ASK_SCHEDULE_KEY)}catch{}return{status:"unreadable"}}function subscribeTextingAskSchedule(listener){let{listeners:listeners2}=shared();return listeners2.add(listener),()=>{listeners2.delete(listener)}}function update(kv,userRef,change){let state2=shared(),run=async()=>{let loaded=await load(kv);if(loaded.status!=="ok")return;let current=loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY;try{await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,JSON.stringify({...loaded.map,[userRef]:change(current)}))}catch{return}for(let listener of[...state2.listeners])listener()},next=state2.writeChain.then(run,run);return state2.writeChain=next.catch(()=>{}),next}async function readTextingAskSchedule(kv,userRef){let loaded=await load(kv);return loaded.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY}}function recordTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAsk(entry,now))}function snoozeTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAskSnooze(entry,now))}function markTextingAskCompleted(kv,userRef){return update(kv,userRef,applyTextingAskCompleted)}function textingAskSession(userRef){return shared().sessions.get(userRef)??null}function setTextingAskSession(userRef,entry){let state2=shared();state2.sessions.set(userRef,entry);for(let listener of[...state2.sessionListeners])listener()}function subscribeTextingAskSessions(listener){let{sessionListeners:sessionListeners}=shared();return sessionListeners.add(listener),()=>{sessionListeners.delete(listener)}}var NO_SNAPSHOT=()=>null;function useTextingGranted(){let{runtime:runtime}=useEverfurContext(),source=runtime.entitlements??null,subscribe2=react.useCallback(listener=>source===null?()=>{}:source.subscribe(listener),[source]),read=source===null?NO_SNAPSHOT:source.getSnapshot,snapshot=react.useSyncExternalStore(subscribe2,read,read);return react.useMemo(()=>snapshot!==null&&decideCapability("texting",snapshot.decisions,{isPending:snapshot.isPending}).enabled,[snapshot])}var IDLE=/* @__PURE__ */Object.freeze({status:"idle"});function useAskSchedule(userRef){let{runtime:runtime}=useEverfurContext(),kv=runtime.registry.services.kv,[state2,setState]=react.useState({user:null,value:IDLE});return react.useEffect(()=>{if(userRef===null)return;let live=true,read=()=>{readTextingAskSchedule(kv,userRef).then(value=>{live&&setState({user:userRef,value:{status:"ready",read:value}})})};read();let unsubscribe=subscribeTextingAskSchedule(read);return()=>{live=false,unsubscribe()}},[kv,userRef]),state2.user===userRef?state2.value:IDLE}function identityOf(texting){switch(texting.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(options={}){let enabled=options.enabled!==false,ready=options.ready!==false,surface=options.surface??"prompt",{runtime:runtime,userRef:userRef}=useEverfurContext(),kv=runtime.registry.services.kv,granted=useTextingGranted(),schedule=useAskSchedule(enabled&&userRef!==null?userRef:null),readSession=react.useCallback(()=>userRef===null?null:textingAskSession(userRef),[userRef]),current=react.useSyncExternalStore(subscribeTextingAskSessions,readSession,readSession),update2=react.useCallback(entry=>{userRef!==null&&setTextingAskSession(userRef,entry)},[userRef]),mine=current!==null&¤t.surface===surface,handedOff=current!==null&¤t.fromPrompt===true,stage=mine?current.stage==="handoff"?"hidden":current.stage:surface==="prompt"&&handedOff?"dismissed":"hidden",now=Date.now(),scheduleEligible=schedule.status==="ready"&&isTextingAskEligible(schedule.read,now),[readFor,setReadFor]=react.useState(null),texting=useTextingState(userRef!==null&&readFor===userRef||stage!=="hidden"||mine),identity=identityOf(texting),{readEnabled:readEnabled,due:due}=resolveTextingAskDue({enabled:enabled,capabilityGranted:granted,hasProfile:texting.profile!==null,signedIn:userRef!==null,scheduleEligible:scheduleEligible,offeredThisSession:current!==null,identity:identity,surfaceReady:ready});react.useEffect(()=>{readEnabled&&userRef!==null&&setReadFor(userRef)},[readEnabled,userRef]);let askNumber=current?.askNumber??(schedule.status==="ready"&&schedule.read.status==="ok"?nextTextingAskNumber(schedule.read.entry):1);react.useEffect(()=>{!due||userRef===null||textingAskSession(userRef)!==null||update2({surface:surface,stage:"offered",answered:false,askNumber:askNumber})},[due,userRef,update2,askNumber,surface]),react.useEffect(()=>{!mine||current.stage!=="handoff"||enabled&&ready&&granted&&texting.profile!==null&&identity==="none"&&update2({...current,stage:"offered"})},[mine,current,enabled,ready,granted,texting.profile,identity,update2]);let completed=schedule.status==="ready"&&schedule.read.status==="ok"&&schedule.read.entry.completed;react.useEffect(()=>{userRef===null||identity!=="exists"||completed||schedule.status!=="ready"||markTextingAskCompleted(kv,userRef)},[identity,completed,schedule.status,kv,userRef]),react.useEffect(()=>{mine&¤t.stage==="enrolling"&&texting.status==="verified"&&update2({...current,stage:"verified"})},[mine,current,texting.status,update2]);let answer=react.useCallback(entry=>userRef===null||entry.answered?entry:(recordTextingAsk(kv,userRef),{...entry,answered:true}),[kv,userRef]),accept=react.useCallback(()=>{mine&¤t.stage==="offered"&&update2({...current,stage:"enrolling"})},[mine,current,update2]),close=react.useCallback(()=>{mine&¤t.stage==="enrolling"&&update2({...current,stage:"offered"})},[mine,current,update2]),dismiss=react.useCallback(()=>{if(!(!mine||current.stage!=="offered"&¤t.stage!=="enrolling")){if(surface==="prompt"){update2({...answer(current),surface:"chat",stage:"handoff",fromPrompt:true});return}current.fromPrompt===true&¤t.answered&&userRef!==null&&snoozeTextingAsk(kv,userRef),update2({...answer(current),stage:"dismissed"})}},[mine,current,surface,update2,answer,kv,userRef]),{start:startCode}=texting,start=react.useCallback(async phone=>!mine||current.stage!=="enrolling"?false:(current.answered||update2(answer(current)),startCode(phone)),[mine,current,update2,answer,startCode]),brand=texting.profile?.brandName??"";return react.useMemo(()=>({stage:userRef===null?"hidden":stage,brand:brand,askNumber:askNumber,texting:texting,accept:accept,dismiss:dismiss,close:close,start:start}),[userRef,stage,brand,askNumber,texting,accept,dismiss,close,start])}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});function ChatTextingAskController({enabled:enabled,ready:ready,onAsk:onAsk}){let ask=useTextingAsk({enabled:enabled,ready:ready,surface:"chat"});return react.useEffect(()=>{callHost(onAsk,ask)},[ask,onAsk]),null}function textingAskLines(ask){return{line:TEXTING_BRAND_COPY.chatAskLine(ask.brand),accept:TEXTING_COPY.promptAccept,dismiss:TEXTING_COPY.promptDismiss,verified:TEXTING_BRAND_COPY.chatAskVerified(ask.brand)}}function ChatTextingAskComposer({ask:ask}){let theme=useEverfurTheme(),styles=react.useMemo(()=>makeAskStyles(theme),[theme]);/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */jsxRuntime.jsx(Button,{label:saving?copy.savingPet:copy.savePet,kind:"secondary",busy:saving,disabled:!changed,styles:styles,onPress:()=>{value!==null&&onSave(value)},testID:"texting-pet-save"}),saved&&!changed?/* @__PURE__ */jsxRuntime.jsx(Text,{style:styles.footnote,children:copy.petSaved}):null]})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text3=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.card?.textColor;return reactNative.StyleSheet.create({card:{gap:space.md,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1)},title:text3(type.size.subtitle,cardInk??color.text.primary,"bold"),subtitle:text3(type.size.body,cardInk??color.text.primary,"bold"),body:text3(type.size.body,cardInk??color.text.secondary,"regular"),footnote:text3(type.size.caption,color.text.muted,"regular"),phone:text3(type.size.body,cardInk??color.text.primary,"bold"),label:text3(type.size.caption,cardInk??color.text.primary,"bold"),input:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.md,borderWidth:1,borderColor:color.controlEdge,backgroundColor:color.surface,...text3(type.size.body,color.text.primary,"regular"),...slotBox(slots.input,1),...slotText(slots.input)},consentRow:{flexDirection:"row",alignItems:"flex-start",gap:space.sm,minHeight:44},box:{width:24,height:24,borderRadius:radius.xs,borderWidth:2,borderColor:color.controlEdge,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},boxChecked:{backgroundColor:color.brand,borderColor:color.brandInk},tick:{...text3(type.size.caption,color.text.onBrand,"bold")},consentText:{flex:1,...text3(type.size.caption,cardInk??color.text.secondary,"regular")},primary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},primaryLabel:{...text3(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},secondary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},secondaryLabel:text3(type.size.caption,color.brandInk,"bold"),link:{minHeight:44,justifyContent:"center",alignSelf:"flex-start"},linkLabel:{...text3(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},links:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:space.md},notice:{gap:space.xs},noticeText:text3(type.size.caption,color.errorRed,"regular"),confirm:{gap:space.sm,padding:space.md,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},petRow:{gap:space.xs},chips:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,justifyContent:"center",...slotBox(slots.chip,1)},chipPicked:{backgroundColor:color.brandSoft,borderColor:color.brandInk},chipLabel:{...text3(type.size.caption,color.text.primary,"regular"),...slotText(slots.chip)},chipLabelPicked:{...face(theme,"bold"),color:color.brandInk}})}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 stored=host[INTRO_OPEN_SYMBOL],fresh=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state=isIntroOpenState(stored)?stored:host[INTRO_OPEN_SYMBOL]=fresh();function isIntroOpen(){return state.holds.size>0}function subscribe(listener){return state.listeners.add(listener),()=>{state.listeners.delete(listener)}}function useIntroOpen(){return react.useSyncExternalStore(subscribe,isIntroOpen,isIntroOpen)}function resolveTextingAskDue(input){let readEnabled=input.enabled&&input.capabilityGranted&&input.hasProfile&&input.signedIn&&input.scheduleEligible&&!input.offeredThisSession,due=readEnabled&&input.identity==="none"&&input.surfaceReady;return{readEnabled:readEnabled,due:due}}var URGENT_LEVELS=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(chat){if(chat.isBootstrapping===true||chat.isLoadingHistory===true||chat.isStreaming===true||chat.status==="error"||chat.stopped===true)return false;let last=chat.messages[chat.messages.length-1];return last===void 0||last.role!=="assistant"||last.pending===true||last.checkin!==void 0||last.text.trim().length===0?false:!(typeof last.urgencyLevel=="string"&&URGENT_LEVELS.has(last.urgencyLevel))}var IN_MEMORY_KVS=/* @__PURE__ */new WeakSet;function isInMemoryKv(kv){return IN_MEMORY_KVS.has(kv)}var TEXTING_ASK_SCHEDULE_KEY="everfur.texting.askSchedule.v1",TEXTING_ASK_SNOOZE_MS=2880*60*1e3,TEXTING_ASK_MAX_ASKS=3,EMPTY_TEXTING_ASK_ENTRY=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(read,now){if(read.status!=="ok")return false;let{entry:entry}=read;return entry.completed||entry.askCount>=TEXTING_ASK_MAX_ASKS?false:entry.nextAskAt===null||now>=entry.nextAskAt}function applyTextingAsk(entry,now){return{askCount:Math.min(entry.askCount+1,TEXTING_ASK_MAX_ASKS),nextAskAt:now+TEXTING_ASK_SNOOZE_MS,completed:entry.completed}}function applyTextingAskSnooze(entry,now){return{...entry,nextAskAt:now+TEXTING_ASK_SNOOZE_MS}}function applyTextingAskCompleted(entry){return{...entry,completed:true}}function nextTextingAskNumber(entry){return entry.askCount<=0?1:entry.askCount===1?2:3}function entryOf(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw,{askCount:askCount,nextAskAt:nextAskAt,completed:completed}=o;return typeof askCount!="number"||!Number.isInteger(askCount)||askCount<0||nextAskAt!==null&&(typeof nextAskAt!="number"||!Number.isFinite(nextAskAt))||typeof completed!="boolean"?null:{askCount:Math.min(askCount,TEXTING_ASK_MAX_ASKS),nextAskAt:nextAskAt,completed:completed}}function parseTextingAskMap(raw){let value;try{value=JSON.parse(raw)}catch{return null}if(value===null||typeof value!="object"||Array.isArray(value))return null;let out={};for(let[key,item]of Object.entries(value)){let entry=entryOf(item);if(entry===null)return null;out[key]=entry}return out}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function shared(){let host2=globalThis,state2=host2[SLOT];return state2===void 0&&(state2={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},host2[SLOT]=state2),state2.sessionListeners===void 0&&(state2.sessionListeners=/* @__PURE__ */new Set),state2}async function load(kv){if(isInMemoryKv(kv))return{status:"unreadable"};let raw;try{raw=await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)}catch{return{status:"unreadable"}}if(raw===null)try{return await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,"{}"),await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let map=parseTextingAskMap(raw);if(map!==null)return{status:"ok",map:map};try{await kv.removeItem(TEXTING_ASK_SCHEDULE_KEY)}catch{}return{status:"unreadable"}}function subscribeTextingAskSchedule(listener){let{listeners:listeners2}=shared();return listeners2.add(listener),()=>{listeners2.delete(listener)}}function update(kv,userRef,change){let state2=shared(),run=async()=>{let loaded=await load(kv);if(loaded.status!=="ok")return;let current=loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY;try{await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,JSON.stringify({...loaded.map,[userRef]:change(current)}))}catch{return}for(let listener of[...state2.listeners])listener()},next=state2.writeChain.then(run,run);return state2.writeChain=next.catch(()=>{}),next}async function readTextingAskSchedule(kv,userRef){let loaded=await load(kv);return loaded.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY}}function recordTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAsk(entry,now))}function snoozeTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAskSnooze(entry,now))}function markTextingAskCompleted(kv,userRef){return update(kv,userRef,applyTextingAskCompleted)}function textingAskSession(userRef){return shared().sessions.get(userRef)??null}function setTextingAskSession(userRef,entry){let state2=shared();state2.sessions.set(userRef,entry);for(let listener of[...state2.sessionListeners])listener()}function subscribeTextingAskSessions(listener){let{sessionListeners:sessionListeners}=shared();return sessionListeners.add(listener),()=>{sessionListeners.delete(listener)}}var NO_SNAPSHOT=()=>null;function useTextingGranted(){let{runtime:runtime}=useEverfurContext(),source=runtime.entitlements??null,subscribe2=react.useCallback(listener=>source===null?()=>{}:source.subscribe(listener),[source]),read=source===null?NO_SNAPSHOT:source.getSnapshot,snapshot=react.useSyncExternalStore(subscribe2,read,read);return react.useMemo(()=>snapshot!==null&&decideCapability("texting",snapshot.decisions,{isPending:snapshot.isPending}).enabled,[snapshot])}var IDLE=/* @__PURE__ */Object.freeze({status:"idle"});function useAskSchedule(userRef){let{runtime:runtime}=useEverfurContext(),kv=runtime.registry.services.kv,[state2,setState]=react.useState({user:null,value:IDLE});return react.useEffect(()=>{if(userRef===null)return;let live=true,read=()=>{readTextingAskSchedule(kv,userRef).then(value=>{live&&setState({user:userRef,value:{status:"ready",read:value}})})};read();let unsubscribe=subscribeTextingAskSchedule(read);return()=>{live=false,unsubscribe()}},[kv,userRef]),state2.user===userRef?state2.value:IDLE}function identityOf(texting){switch(texting.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(options={}){let enabled=options.enabled!==false,ready=options.ready!==false,surface=options.surface??"prompt",entryWanted=options.entry===true,{runtime:runtime,userRef:userRef}=useEverfurContext(),kv=runtime.registry.services.kv,granted=useTextingGranted(),schedule=useAskSchedule(enabled&&userRef!==null?userRef:null),readSession=react.useCallback(()=>userRef===null?null:textingAskSession(userRef),[userRef]),current=react.useSyncExternalStore(subscribeTextingAskSessions,readSession,readSession),update2=react.useCallback(entry=>{userRef!==null&&setTextingAskSession(userRef,entry)},[userRef]),mine=current!==null&¤t.surface===surface,handedOff=current!==null&¤t.fromPrompt===true,stage=mine?current.stage==="handoff"?"hidden":current.stage:surface==="prompt"&&handedOff?"dismissed":"hidden",now=Date.now(),scheduleEligible=schedule.status==="ready"&&isTextingAskEligible(schedule.read,now),[readFor,setReadFor]=react.useState(null),entryRead=entryWanted&&userRef!==null&&granted,texting=useTextingState(userRef!==null&&readFor===userRef||stage!=="hidden"||mine||entryRead),identity=identityOf(texting),{readEnabled:readEnabled,due:due}=resolveTextingAskDue({enabled:enabled,capabilityGranted:granted,hasProfile:texting.profile!==null,signedIn:userRef!==null,scheduleEligible:scheduleEligible,offeredThisSession:current!==null,identity:identity,surfaceReady:ready});react.useEffect(()=>{readEnabled&&userRef!==null&&setReadFor(userRef)},[readEnabled,userRef]);let askNumber=current?.askNumber??(schedule.status==="ready"&&schedule.read.status==="ok"?nextTextingAskNumber(schedule.read.entry):1);react.useEffect(()=>{!due||userRef===null||textingAskSession(userRef)!==null||update2({surface:surface,stage:"offered",answered:false,askNumber:askNumber})},[due,userRef,update2,askNumber,surface]),react.useEffect(()=>{!mine||current.stage!=="handoff"||enabled&&ready&&granted&&texting.profile!==null&&identity==="none"&&update2({...current,stage:"offered"})},[mine,current,enabled,ready,granted,texting.profile,identity,update2]);let completed=schedule.status==="ready"&&schedule.read.status==="ok"&&schedule.read.entry.completed;react.useEffect(()=>{userRef===null||identity!=="exists"||completed||schedule.status!=="ready"||markTextingAskCompleted(kv,userRef)},[identity,completed,schedule.status,kv,userRef]),react.useEffect(()=>{mine&¤t.stage==="enrolling"&&texting.status==="verified"&&update2({...current,stage:"verified"})},[mine,current,texting.status,update2]);let answer=react.useCallback(entry=>userRef===null||entry.answered?entry:(recordTextingAsk(kv,userRef),{...entry,answered:true}),[kv,userRef]),accept=react.useCallback(()=>{mine&¤t.stage==="offered"&&update2({...current,stage:"enrolling"})},[mine,current,update2]),close=react.useCallback(()=>{if(!mine||current.stage!=="enrolling")return;let{back:back,...rest}=current;update2({...rest,stage:back??"offered"})},[mine,current,update2]),dismiss=react.useCallback(()=>{if(!(!mine||current.stage!=="offered"&¤t.stage!=="enrolling")){if(surface==="prompt"){update2({...answer(current),surface:"chat",stage:"handoff",fromPrompt:true});return}current.fromPrompt===true&¤t.answered&&userRef!==null&&snoozeTextingAsk(kv,userRef),update2({...answer(current),stage:"dismissed"})}},[mine,current,surface,update2,answer,kv,userRef]),{start:startCode}=texting,start=react.useCallback(async phone=>!mine||current.stage!=="enrolling"?false:(current.answered||update2(answer(current)),startCode(phone)),[mine,current,update2,answer,startCode]),canOpen=entryRead&&texting.profile!==null&&identity==="none"&&stage!=="enrolling"&&stage!=="verified",open=react.useCallback(()=>{if(!canOpen||userRef===null)return;let was=mine?current:null;update2({surface:surface,stage:"enrolling",answered:was?.answered??false,askNumber:current?.askNumber??askNumber,...was?.fromPrompt===true?{fromPrompt:true}:{},back:was?.stage==="offered"?"offered":"dismissed"})},[canOpen,userRef,mine,current,update2,surface,askNumber]),brand=texting.profile?.brandName??"";return react.useMemo(()=>({stage:userRef===null?"hidden":stage,brand:brand,askNumber:askNumber,texting:texting,accept:accept,dismiss:dismiss,close:close,start:start,canOpen:canOpen,open:open}),[userRef,stage,brand,askNumber,texting,accept,dismiss,close,start,canOpen,open])}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});function ChatTextingAskController({enabled:enabled,ready:ready,onAsk:onAsk,entry:entry=false}){let ask=useTextingAsk({enabled:enabled,ready:ready,surface:"chat",entry:entry});return react.useEffect(()=>{callHost(onAsk,ask)},[ask,onAsk]),null}function textingAskLines(ask){return{line:TEXTING_BRAND_COPY.chatAskLine(ask.brand),accept:TEXTING_COPY.promptAccept,dismiss:TEXTING_COPY.promptDismiss,verified:TEXTING_BRAND_COPY.chatAskVerified(ask.brand)}}function ChatTextingAskComposer({ask:ask}){let theme=useEverfurTheme(),styles=react.useMemo(()=>makeAskStyles(theme),[theme]);/* @__PURE__ */
|
|
159
160
|
return jsxRuntime.jsx(AskEntry,{ask:ask,styles:styles})}function AskEntry({ask:ask,styles:styles}){let{texting:texting}=ask,{status:status,profile:profile,snapshot:snapshot}=texting,[phone,setPhone]=react.useState(""),[consented,setConsented]=react.useState(false),[code,setCode]=react.useState(""),[problem,setProblem]=react.useState(null),onNumber=status==="enroll"||status==="requesting"&&!snapshot.resending,onCode=status==="code"||status==="confirming"||status==="requesting";react.useEffect(()=>{setProblem(null)},[status]);let close=/* @__PURE__ */jsxRuntime.jsxs(reactNative.Pressable,{onPress:ask.close,accessibilityRole:"button",accessibilityLabel:TEXTING_COPY.close,hitSlop:8,style:styles.close,testID:"texting-ask-close",children:[
|
|
160
161
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[styles.closeBar,styles.closeBarA]}),
|
|
161
162
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[styles.closeBar,styles.closeBarB]})]}),refusal=snapshot.error===null?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:styles.notice,accessibilityRole:"alert",children:[
|
package/dist/texting/index.d.cts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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 } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { a as CapabilityDecision } from '../resolve.d-CoQWUy1Y.cjs';
|
|
4
5
|
import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
5
6
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
6
|
-
import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../optInView.d-
|
|
7
|
-
export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../optInView.d-
|
|
8
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
9
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-
|
|
7
|
+
import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../optInView.d-D23o1gtT.cjs';
|
|
8
|
+
export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../optInView.d-D23o1gtT.cjs';
|
|
9
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-HbwYQ4-z.cjs';
|
|
10
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-BQgrIDdu.cjs';
|
|
10
11
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.cjs';
|
|
11
12
|
export { E as EverfurResult } from '../EverfurResult.d-BFH-3s6E.cjs';
|
|
12
13
|
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
13
|
-
import '../requestFunnel.d-
|
|
14
|
+
import '../requestFunnel.d-JoqddYSx.cjs';
|
|
14
15
|
|
|
15
16
|
interface EverfurTextingOptInProps {
|
|
16
17
|
/** Called when the member's step changes (for example to `verified` or `optedOut`). A throw is swallowed. */
|
|
@@ -49,9 +50,11 @@ interface ChatTextingAskControllerProps {
|
|
|
49
50
|
readonly ready: boolean;
|
|
50
51
|
/** Called with the ask's state whenever it changes. */
|
|
51
52
|
readonly onAsk: (ask: TextingAsk) => void;
|
|
53
|
+
/** The chat header draws its always-visible entry to the number entry (`TextingAsk.canOpen` / `open`). Default false. */
|
|
54
|
+
readonly entry?: boolean;
|
|
52
55
|
}
|
|
53
56
|
/** Runs the ask for the chat and reports it; draws nothing. `EverfurChat` mounts it itself. */
|
|
54
|
-
declare function ChatTextingAskController({ enabled, ready, onAsk }: ChatTextingAskControllerProps): ReactNode;
|
|
57
|
+
declare function ChatTextingAskController({ enabled, ready, onAsk, entry }: ChatTextingAskControllerProps): ReactNode;
|
|
55
58
|
/** The words the chat's thread draws for the ask: the line, its two chips and the closing line. */
|
|
56
59
|
interface TextingAskLines {
|
|
57
60
|
readonly line: string;
|
package/dist/texting/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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 } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { a as CapabilityDecision } from '../resolve.d-CoQWUy1Y.js';
|
|
4
5
|
import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.js';
|
|
5
6
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.js';
|
|
6
|
-
import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../optInView.d-
|
|
7
|
-
export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../optInView.d-
|
|
8
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
9
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-
|
|
7
|
+
import { E as EverfurTextingViewStatus, T as TextingCopy, a as TextingBrandCopy, b as TextingAsk } from '../optInView.d-3mbj1mR6.js';
|
|
8
|
+
export { C as COPY_PLACEHOLDER_PREFIX, c as EVERFUR_TEXTING_STATUSES, d as EverfurTextingChallenge, e as EverfurTextingIdentity, f as EverfurTextingInputProblem, g as EverfurTextingProfile, h as EverfurTextingReason, i as EverfurTextingState, j as EverfurTextingStatus, k as EverfurTextingVerificationInput, l as TEXTING_ASK_MAX_ASKS, m as TEXTING_ASK_SCHEDULE_KEY, n as TEXTING_ASK_SNOOZE_MS, o as TEXTING_BRAND_COPY, p as TEXTING_CODE_PATTERN, q as TEXTING_COPY, r as TEXTING_COPY_PLACEHOLDERS, s as TEXTING_UI_CODE_LENGTH, t as TextingAction, u as TextingAskDue, v as TextingAskDueInput, w as TextingAskEntry, x as TextingAskIdentity, y as TextingAskOptions, z as TextingAskScheduleRead, A as TextingAskStage, B as TextingAskThreadMessage, D as TextingAskThreadState, F as TextingCodeRefusal, G as TextingController, H as TextingPhase, I as TextingRepository, J as TextingRepositoryDeps, K as TextingRuntime, L as TextingSnapshot, M as createTextingRepository, N as createTextingRepositoryOver, O as formatTextingPhone, P as isE164, Q as isTextingAskEligible, R as parseTextingProfile, S as resolveTextingAskDue, U as textingAskThreadReady, V as textingErrorText, W as textingIdentityFromWire, X as textingInputProblemText, Y as textingOptedOutBody, Z as textingReasonOf, _ as textingSupportText, $ as toTextingE164, a0 as useEverfurTexting, a1 as useEverfurTextingProfile, a2 as useEverfurTextingRepository, a3 as useTextingAsk, a4 as validateTextingCode, a5 as validateTextingEnroll } from '../optInView.d-3mbj1mR6.js';
|
|
9
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-Be2Es9Td.js';
|
|
10
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../config.d-XSMThgVj.js';
|
|
10
11
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.js';
|
|
11
12
|
export { E as EverfurResult } from '../EverfurResult.d-D_-254ZY.js';
|
|
12
13
|
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-68yrE3BE.js';
|
|
13
|
-
import '../requestFunnel.d-
|
|
14
|
+
import '../requestFunnel.d-YabU6G-Z.js';
|
|
14
15
|
|
|
15
16
|
interface EverfurTextingOptInProps {
|
|
16
17
|
/** Called when the member's step changes (for example to `verified` or `optedOut`). A throw is swallowed. */
|
|
@@ -49,9 +50,11 @@ interface ChatTextingAskControllerProps {
|
|
|
49
50
|
readonly ready: boolean;
|
|
50
51
|
/** Called with the ask's state whenever it changes. */
|
|
51
52
|
readonly onAsk: (ask: TextingAsk) => void;
|
|
53
|
+
/** The chat header draws its always-visible entry to the number entry (`TextingAsk.canOpen` / `open`). Default false. */
|
|
54
|
+
readonly entry?: boolean;
|
|
52
55
|
}
|
|
53
56
|
/** Runs the ask for the chat and reports it; draws nothing. `EverfurChat` mounts it itself. */
|
|
54
|
-
declare function ChatTextingAskController({ enabled, ready, onAsk }: ChatTextingAskControllerProps): ReactNode;
|
|
57
|
+
declare function ChatTextingAskController({ enabled, ready, onAsk, entry }: ChatTextingAskControllerProps): ReactNode;
|
|
55
58
|
/** The words the chat's thread draws for the ask: the line, its two chips and the closing line. */
|
|
56
59
|
interface TextingAskLines {
|
|
57
60
|
readonly line: string;
|
package/dist/texting/index.js
CHANGED
|
@@ -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,useSyncExternalStore,useCallback,useState,useContext,Component}from"react";import{TextInput as TextInput$1,View,ActivityIndicator,Pressable,StyleSheet,Modal,Text as Text$1}from"react-native";import{jsxs,jsx,Fragment}from"react/jsx-runtime";function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}function headingFace(theme,fallback="bold"){let{headingFamily:headingFamily,headingWeight:headingWeight}=theme.type;if(headingFamily===null&&headingWeight===null)return face(theme,fallback);if(headingFamily!==null)return{fontFamily:headingFamily,fontWeight:headingWeight??theme.type.weight[FACE_WEIGHT[fallback]]};let base=face(theme,fallback);return base.fontWeight===void 0||headingWeight===null?base:{fontFamily:base.fontFamily,fontWeight:headingWeight}}function 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 HostRenderBoundary=class extends Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey}}static getDerivedStateFromError(){return{failed:true}}static getDerivedStateFromProps(props,state2){return Object.is(props.resetKey,state2.key)?null:{failed:false,key:props.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};function RenderHost({render:render}){return render()}function HostRender({render:render,fallback:fallback,resetKey:resetKey}){return createElement(HostRenderBoundary,{fallback:fallback,resetKey:resetKey,children:createElement(RenderHost,{render:render})})}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}),
|
|
@@ -155,7 +156,7 @@ return jsxs(View,{style:styles.petRow,children:[
|
|
|
155
156
|
/* @__PURE__ */jsx(View,{style:styles.chips,accessibilityRole:"radiogroup",accessibilityLabel:copy.defaultPetLabel,children:pets.map(pet=>{let picked=pet.petRef===value;/* @__PURE__ */
|
|
156
157
|
return jsx(Pressable,{onPress:()=>onChoose(pet.petRef),disabled:saving,accessibilityRole:"radio",accessibilityState:{checked:picked,disabled:saving},accessibilityLabel:pet.name??pet.petRef,style:[styles.chip,picked?styles.chipPicked:null],children:/* @__PURE__ */jsx(Text,{tier:"compact",style:[styles.chipLabel,picked?styles.chipLabelPicked:null],children:pet.name??pet.petRef})},pet.petRef)})}),
|
|
157
158
|
/* @__PURE__ */jsxs(View,{style:styles.links,children:[
|
|
158
|
-
/* @__PURE__ */jsx(Button,{label:saving?copy.savingPet:copy.savePet,kind:"secondary",busy:saving,disabled:!changed,styles:styles,onPress:()=>{value!==null&&onSave(value)},testID:"texting-pet-save"}),saved&&!changed?/* @__PURE__ */jsx(Text,{style:styles.footnote,children:copy.petSaved}):null]})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text3=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.card?.textColor;return StyleSheet.create({card:{gap:space.md,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1)},title:text3(type.size.subtitle,cardInk??color.text.primary,"bold"),subtitle:text3(type.size.body,cardInk??color.text.primary,"bold"),body:text3(type.size.body,cardInk??color.text.secondary,"regular"),footnote:text3(type.size.caption,color.text.muted,"regular"),phone:text3(type.size.body,cardInk??color.text.primary,"bold"),label:text3(type.size.caption,cardInk??color.text.primary,"bold"),input:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.md,borderWidth:1,borderColor:color.controlEdge,backgroundColor:color.surface,...text3(type.size.body,color.text.primary,"regular"),...slotBox(slots.input,1),...slotText(slots.input)},consentRow:{flexDirection:"row",alignItems:"flex-start",gap:space.sm,minHeight:44},box:{width:24,height:24,borderRadius:radius.xs,borderWidth:2,borderColor:color.controlEdge,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},boxChecked:{backgroundColor:color.brand,borderColor:color.brandInk},tick:{...text3(type.size.caption,color.text.onBrand,"bold")},consentText:{flex:1,...text3(type.size.caption,cardInk??color.text.secondary,"regular")},primary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},primaryLabel:{...text3(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},secondary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},secondaryLabel:text3(type.size.caption,color.brandInk,"bold"),link:{minHeight:44,justifyContent:"center",alignSelf:"flex-start"},linkLabel:{...text3(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},links:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:space.md},notice:{gap:space.xs},noticeText:text3(type.size.caption,color.errorRed,"regular"),confirm:{gap:space.sm,padding:space.md,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},petRow:{gap:space.xs},chips:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,justifyContent:"center",...slotBox(slots.chip,1)},chipPicked:{backgroundColor:color.brandSoft,borderColor:color.brandInk},chipLabel:{...text3(type.size.caption,color.text.primary,"regular"),...slotText(slots.chip)},chipLabelPicked:{...face(theme,"bold"),color:color.brandInk}})}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 stored=host[INTRO_OPEN_SYMBOL],fresh=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state=isIntroOpenState(stored)?stored:host[INTRO_OPEN_SYMBOL]=fresh();function isIntroOpen(){return state.holds.size>0}function subscribe(listener){return state.listeners.add(listener),()=>{state.listeners.delete(listener)}}function useIntroOpen(){return useSyncExternalStore(subscribe,isIntroOpen,isIntroOpen)}function resolveTextingAskDue(input){let readEnabled=input.enabled&&input.capabilityGranted&&input.hasProfile&&input.signedIn&&input.scheduleEligible&&!input.offeredThisSession,due=readEnabled&&input.identity==="none"&&input.surfaceReady;return{readEnabled:readEnabled,due:due}}var URGENT_LEVELS=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(chat){if(chat.isBootstrapping===true||chat.isLoadingHistory===true||chat.isStreaming===true||chat.status==="error"||chat.stopped===true)return false;let last=chat.messages[chat.messages.length-1];return last===void 0||last.role!=="assistant"||last.pending===true||last.checkin!==void 0||last.text.trim().length===0?false:!(typeof last.urgencyLevel=="string"&&URGENT_LEVELS.has(last.urgencyLevel))}var IN_MEMORY_KVS=/* @__PURE__ */new WeakSet;function isInMemoryKv(kv){return IN_MEMORY_KVS.has(kv)}var TEXTING_ASK_SCHEDULE_KEY="everfur.texting.askSchedule.v1",TEXTING_ASK_SNOOZE_MS=2880*60*1e3,TEXTING_ASK_MAX_ASKS=3,EMPTY_TEXTING_ASK_ENTRY=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(read,now){if(read.status!=="ok")return false;let{entry:entry}=read;return entry.completed||entry.askCount>=TEXTING_ASK_MAX_ASKS?false:entry.nextAskAt===null||now>=entry.nextAskAt}function applyTextingAsk(entry,now){return{askCount:Math.min(entry.askCount+1,TEXTING_ASK_MAX_ASKS),nextAskAt:now+TEXTING_ASK_SNOOZE_MS,completed:entry.completed}}function applyTextingAskSnooze(entry,now){return{...entry,nextAskAt:now+TEXTING_ASK_SNOOZE_MS}}function applyTextingAskCompleted(entry){return{...entry,completed:true}}function nextTextingAskNumber(entry){return entry.askCount<=0?1:entry.askCount===1?2:3}function entryOf(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw,{askCount:askCount,nextAskAt:nextAskAt,completed:completed}=o;return typeof askCount!="number"||!Number.isInteger(askCount)||askCount<0||nextAskAt!==null&&(typeof nextAskAt!="number"||!Number.isFinite(nextAskAt))||typeof completed!="boolean"?null:{askCount:Math.min(askCount,TEXTING_ASK_MAX_ASKS),nextAskAt:nextAskAt,completed:completed}}function parseTextingAskMap(raw){let value;try{value=JSON.parse(raw)}catch{return null}if(value===null||typeof value!="object"||Array.isArray(value))return null;let out={};for(let[key,item]of Object.entries(value)){let entry=entryOf(item);if(entry===null)return null;out[key]=entry}return out}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function shared(){let host2=globalThis,state2=host2[SLOT];return state2===void 0&&(state2={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},host2[SLOT]=state2),state2.sessionListeners===void 0&&(state2.sessionListeners=/* @__PURE__ */new Set),state2}async function load(kv){if(isInMemoryKv(kv))return{status:"unreadable"};let raw;try{raw=await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)}catch{return{status:"unreadable"}}if(raw===null)try{return await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,"{}"),await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let map=parseTextingAskMap(raw);if(map!==null)return{status:"ok",map:map};try{await kv.removeItem(TEXTING_ASK_SCHEDULE_KEY)}catch{}return{status:"unreadable"}}function subscribeTextingAskSchedule(listener){let{listeners:listeners2}=shared();return listeners2.add(listener),()=>{listeners2.delete(listener)}}function update(kv,userRef,change){let state2=shared(),run=async()=>{let loaded=await load(kv);if(loaded.status!=="ok")return;let current=loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY;try{await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,JSON.stringify({...loaded.map,[userRef]:change(current)}))}catch{return}for(let listener of[...state2.listeners])listener()},next=state2.writeChain.then(run,run);return state2.writeChain=next.catch(()=>{}),next}async function readTextingAskSchedule(kv,userRef){let loaded=await load(kv);return loaded.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY}}function recordTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAsk(entry,now))}function snoozeTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAskSnooze(entry,now))}function markTextingAskCompleted(kv,userRef){return update(kv,userRef,applyTextingAskCompleted)}function textingAskSession(userRef){return shared().sessions.get(userRef)??null}function setTextingAskSession(userRef,entry){let state2=shared();state2.sessions.set(userRef,entry);for(let listener of[...state2.sessionListeners])listener()}function subscribeTextingAskSessions(listener){let{sessionListeners:sessionListeners}=shared();return sessionListeners.add(listener),()=>{sessionListeners.delete(listener)}}var NO_SNAPSHOT=()=>null;function useTextingGranted(){let{runtime:runtime}=useEverfurContext(),source=runtime.entitlements??null,subscribe2=useCallback(listener=>source===null?()=>{}:source.subscribe(listener),[source]),read=source===null?NO_SNAPSHOT:source.getSnapshot,snapshot=useSyncExternalStore(subscribe2,read,read);return useMemo(()=>snapshot!==null&&decideCapability("texting",snapshot.decisions,{isPending:snapshot.isPending}).enabled,[snapshot])}var IDLE=/* @__PURE__ */Object.freeze({status:"idle"});function useAskSchedule(userRef){let{runtime:runtime}=useEverfurContext(),kv=runtime.registry.services.kv,[state2,setState]=useState({user:null,value:IDLE});return useEffect(()=>{if(userRef===null)return;let live=true,read=()=>{readTextingAskSchedule(kv,userRef).then(value=>{live&&setState({user:userRef,value:{status:"ready",read:value}})})};read();let unsubscribe=subscribeTextingAskSchedule(read);return()=>{live=false,unsubscribe()}},[kv,userRef]),state2.user===userRef?state2.value:IDLE}function identityOf(texting){switch(texting.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(options={}){let enabled=options.enabled!==false,ready=options.ready!==false,surface=options.surface??"prompt",{runtime:runtime,userRef:userRef}=useEverfurContext(),kv=runtime.registry.services.kv,granted=useTextingGranted(),schedule=useAskSchedule(enabled&&userRef!==null?userRef:null),readSession=useCallback(()=>userRef===null?null:textingAskSession(userRef),[userRef]),current=useSyncExternalStore(subscribeTextingAskSessions,readSession,readSession),update2=useCallback(entry=>{userRef!==null&&setTextingAskSession(userRef,entry)},[userRef]),mine=current!==null&¤t.surface===surface,handedOff=current!==null&¤t.fromPrompt===true,stage=mine?current.stage==="handoff"?"hidden":current.stage:surface==="prompt"&&handedOff?"dismissed":"hidden",now=Date.now(),scheduleEligible=schedule.status==="ready"&&isTextingAskEligible(schedule.read,now),[readFor,setReadFor]=useState(null),texting=useTextingState(userRef!==null&&readFor===userRef||stage!=="hidden"||mine),identity=identityOf(texting),{readEnabled:readEnabled,due:due}=resolveTextingAskDue({enabled:enabled,capabilityGranted:granted,hasProfile:texting.profile!==null,signedIn:userRef!==null,scheduleEligible:scheduleEligible,offeredThisSession:current!==null,identity:identity,surfaceReady:ready});useEffect(()=>{readEnabled&&userRef!==null&&setReadFor(userRef)},[readEnabled,userRef]);let askNumber=current?.askNumber??(schedule.status==="ready"&&schedule.read.status==="ok"?nextTextingAskNumber(schedule.read.entry):1);useEffect(()=>{!due||userRef===null||textingAskSession(userRef)!==null||update2({surface:surface,stage:"offered",answered:false,askNumber:askNumber})},[due,userRef,update2,askNumber,surface]),useEffect(()=>{!mine||current.stage!=="handoff"||enabled&&ready&&granted&&texting.profile!==null&&identity==="none"&&update2({...current,stage:"offered"})},[mine,current,enabled,ready,granted,texting.profile,identity,update2]);let completed=schedule.status==="ready"&&schedule.read.status==="ok"&&schedule.read.entry.completed;useEffect(()=>{userRef===null||identity!=="exists"||completed||schedule.status!=="ready"||markTextingAskCompleted(kv,userRef)},[identity,completed,schedule.status,kv,userRef]),useEffect(()=>{mine&¤t.stage==="enrolling"&&texting.status==="verified"&&update2({...current,stage:"verified"})},[mine,current,texting.status,update2]);let answer=useCallback(entry=>userRef===null||entry.answered?entry:(recordTextingAsk(kv,userRef),{...entry,answered:true}),[kv,userRef]),accept=useCallback(()=>{mine&¤t.stage==="offered"&&update2({...current,stage:"enrolling"})},[mine,current,update2]),close=useCallback(()=>{mine&¤t.stage==="enrolling"&&update2({...current,stage:"offered"})},[mine,current,update2]),dismiss=useCallback(()=>{if(!(!mine||current.stage!=="offered"&¤t.stage!=="enrolling")){if(surface==="prompt"){update2({...answer(current),surface:"chat",stage:"handoff",fromPrompt:true});return}current.fromPrompt===true&¤t.answered&&userRef!==null&&snoozeTextingAsk(kv,userRef),update2({...answer(current),stage:"dismissed"})}},[mine,current,surface,update2,answer,kv,userRef]),{start:startCode}=texting,start=useCallback(async phone=>!mine||current.stage!=="enrolling"?false:(current.answered||update2(answer(current)),startCode(phone)),[mine,current,update2,answer,startCode]),brand=texting.profile?.brandName??"";return useMemo(()=>({stage:userRef===null?"hidden":stage,brand:brand,askNumber:askNumber,texting:texting,accept:accept,dismiss:dismiss,close:close,start:start}),[userRef,stage,brand,askNumber,texting,accept,dismiss,close,start])}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});function ChatTextingAskController({enabled:enabled,ready:ready,onAsk:onAsk}){let ask=useTextingAsk({enabled:enabled,ready:ready,surface:"chat"});return useEffect(()=>{callHost(onAsk,ask)},[ask,onAsk]),null}function textingAskLines(ask){return{line:TEXTING_BRAND_COPY.chatAskLine(ask.brand),accept:TEXTING_COPY.promptAccept,dismiss:TEXTING_COPY.promptDismiss,verified:TEXTING_BRAND_COPY.chatAskVerified(ask.brand)}}function ChatTextingAskComposer({ask:ask}){let theme=useEverfurTheme(),styles=useMemo(()=>makeAskStyles(theme),[theme]);/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */jsx(Button,{label:saving?copy.savingPet:copy.savePet,kind:"secondary",busy:saving,disabled:!changed,styles:styles,onPress:()=>{value!==null&&onSave(value)},testID:"texting-pet-save"}),saved&&!changed?/* @__PURE__ */jsx(Text,{style:styles.footnote,children:copy.petSaved}):null]})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,text3=(size,ink,weight)=>({...face(theme,weight),fontSize:size,lineHeight:Math.round(size*type.lineHeight.snug),color:ink}),cardInk=slots.card?.textColor;return StyleSheet.create({card:{gap:space.md,padding:space.lg,borderRadius:radius.lg,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,...slotBox(slots.card,1)},title:text3(type.size.subtitle,cardInk??color.text.primary,"bold"),subtitle:text3(type.size.body,cardInk??color.text.primary,"bold"),body:text3(type.size.body,cardInk??color.text.secondary,"regular"),footnote:text3(type.size.caption,color.text.muted,"regular"),phone:text3(type.size.body,cardInk??color.text.primary,"bold"),label:text3(type.size.caption,cardInk??color.text.primary,"bold"),input:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.md,borderWidth:1,borderColor:color.controlEdge,backgroundColor:color.surface,...text3(type.size.body,color.text.primary,"regular"),...slotBox(slots.input,1),...slotText(slots.input)},consentRow:{flexDirection:"row",alignItems:"flex-start",gap:space.sm,minHeight:44},box:{width:24,height:24,borderRadius:radius.xs,borderWidth:2,borderColor:color.controlEdge,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},boxChecked:{backgroundColor:color.brand,borderColor:color.brandInk},tick:{...text3(type.size.caption,color.text.onBrand,"bold")},consentText:{flex:1,...text3(type.size.caption,cardInk??color.text.secondary,"regular")},primary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,alignItems:"center",justifyContent:"center",backgroundColor:color.brand,...slotBox(slots.primaryButton)},primaryLabel:{...text3(type.size.body,color.text.onBrand,"bold"),...slotText(slots.primaryButton)},secondary:{minHeight:44,paddingHorizontal:space.lg,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,alignItems:"center",justifyContent:"center",backgroundColor:color.surface},secondaryLabel:text3(type.size.caption,color.brandInk,"bold"),link:{minHeight:44,justifyContent:"center",alignSelf:"flex-start"},linkLabel:{...text3(type.size.caption,color.linkInk,"bold"),...slotText(slots.link)},dimmed:{opacity:.5},links:{flexDirection:"row",flexWrap:"wrap",alignItems:"center",gap:space.md},notice:{gap:space.xs},noticeText:text3(type.size.caption,color.errorRed,"regular"),confirm:{gap:space.sm,padding:space.md,borderRadius:radius.md,backgroundColor:color.surfaceSubtle},petRow:{gap:space.xs},chips:{flexDirection:"row",flexWrap:"wrap",gap:space.sm},chip:{minHeight:44,paddingHorizontal:space.md,borderRadius:radius.pill,borderWidth:1,borderColor:color.brandBorder,backgroundColor:color.surface,justifyContent:"center",...slotBox(slots.chip,1)},chipPicked:{backgroundColor:color.brandSoft,borderColor:color.brandInk},chipLabel:{...text3(type.size.caption,color.text.primary,"regular"),...slotText(slots.chip)},chipLabelPicked:{...face(theme,"bold"),color:color.brandInk}})}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 stored=host[INTRO_OPEN_SYMBOL],fresh=()=>({holds:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set}),state=isIntroOpenState(stored)?stored:host[INTRO_OPEN_SYMBOL]=fresh();function isIntroOpen(){return state.holds.size>0}function subscribe(listener){return state.listeners.add(listener),()=>{state.listeners.delete(listener)}}function useIntroOpen(){return useSyncExternalStore(subscribe,isIntroOpen,isIntroOpen)}function resolveTextingAskDue(input){let readEnabled=input.enabled&&input.capabilityGranted&&input.hasProfile&&input.signedIn&&input.scheduleEligible&&!input.offeredThisSession,due=readEnabled&&input.identity==="none"&&input.surfaceReady;return{readEnabled:readEnabled,due:due}}var URGENT_LEVELS=/* @__PURE__ */new Set(["emergency","schedule_soon"]);function textingAskThreadReady(chat){if(chat.isBootstrapping===true||chat.isLoadingHistory===true||chat.isStreaming===true||chat.status==="error"||chat.stopped===true)return false;let last=chat.messages[chat.messages.length-1];return last===void 0||last.role!=="assistant"||last.pending===true||last.checkin!==void 0||last.text.trim().length===0?false:!(typeof last.urgencyLevel=="string"&&URGENT_LEVELS.has(last.urgencyLevel))}var IN_MEMORY_KVS=/* @__PURE__ */new WeakSet;function isInMemoryKv(kv){return IN_MEMORY_KVS.has(kv)}var TEXTING_ASK_SCHEDULE_KEY="everfur.texting.askSchedule.v1",TEXTING_ASK_SNOOZE_MS=2880*60*1e3,TEXTING_ASK_MAX_ASKS=3,EMPTY_TEXTING_ASK_ENTRY=/* @__PURE__ */Object.freeze({askCount:0,nextAskAt:null,completed:false});function isTextingAskEligible(read,now){if(read.status!=="ok")return false;let{entry:entry}=read;return entry.completed||entry.askCount>=TEXTING_ASK_MAX_ASKS?false:entry.nextAskAt===null||now>=entry.nextAskAt}function applyTextingAsk(entry,now){return{askCount:Math.min(entry.askCount+1,TEXTING_ASK_MAX_ASKS),nextAskAt:now+TEXTING_ASK_SNOOZE_MS,completed:entry.completed}}function applyTextingAskSnooze(entry,now){return{...entry,nextAskAt:now+TEXTING_ASK_SNOOZE_MS}}function applyTextingAskCompleted(entry){return{...entry,completed:true}}function nextTextingAskNumber(entry){return entry.askCount<=0?1:entry.askCount===1?2:3}function entryOf(raw){if(raw===null||typeof raw!="object"||Array.isArray(raw))return null;let o=raw,{askCount:askCount,nextAskAt:nextAskAt,completed:completed}=o;return typeof askCount!="number"||!Number.isInteger(askCount)||askCount<0||nextAskAt!==null&&(typeof nextAskAt!="number"||!Number.isFinite(nextAskAt))||typeof completed!="boolean"?null:{askCount:Math.min(askCount,TEXTING_ASK_MAX_ASKS),nextAskAt:nextAskAt,completed:completed}}function parseTextingAskMap(raw){let value;try{value=JSON.parse(raw)}catch{return null}if(value===null||typeof value!="object"||Array.isArray(value))return null;let out={};for(let[key,item]of Object.entries(value)){let entry=entryOf(item);if(entry===null)return null;out[key]=entry}return out}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/texting/ask-schedule@v1");function shared(){let host2=globalThis,state2=host2[SLOT];return state2===void 0&&(state2={sessions:/* @__PURE__ */new Map,sessionListeners:/* @__PURE__ */new Set,listeners:/* @__PURE__ */new Set,writeChain:Promise.resolve()},host2[SLOT]=state2),state2.sessionListeners===void 0&&(state2.sessionListeners=/* @__PURE__ */new Set),state2}async function load(kv){if(isInMemoryKv(kv))return{status:"unreadable"};let raw;try{raw=await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)}catch{return{status:"unreadable"}}if(raw===null)try{return await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,"{}"),await kv.getItem(TEXTING_ASK_SCHEDULE_KEY)===null?{status:"unreadable"}:{status:"ok",map:{}}}catch{return{status:"unreadable"}}let map=parseTextingAskMap(raw);if(map!==null)return{status:"ok",map:map};try{await kv.removeItem(TEXTING_ASK_SCHEDULE_KEY)}catch{}return{status:"unreadable"}}function subscribeTextingAskSchedule(listener){let{listeners:listeners2}=shared();return listeners2.add(listener),()=>{listeners2.delete(listener)}}function update(kv,userRef,change){let state2=shared(),run=async()=>{let loaded=await load(kv);if(loaded.status!=="ok")return;let current=loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY;try{await kv.setItem(TEXTING_ASK_SCHEDULE_KEY,JSON.stringify({...loaded.map,[userRef]:change(current)}))}catch{return}for(let listener of[...state2.listeners])listener()},next=state2.writeChain.then(run,run);return state2.writeChain=next.catch(()=>{}),next}async function readTextingAskSchedule(kv,userRef){let loaded=await load(kv);return loaded.status!=="ok"?{status:"unreadable"}:{status:"ok",entry:loaded.map[userRef]??EMPTY_TEXTING_ASK_ENTRY}}function recordTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAsk(entry,now))}function snoozeTextingAsk(kv,userRef,now=Date.now()){return update(kv,userRef,entry=>applyTextingAskSnooze(entry,now))}function markTextingAskCompleted(kv,userRef){return update(kv,userRef,applyTextingAskCompleted)}function textingAskSession(userRef){return shared().sessions.get(userRef)??null}function setTextingAskSession(userRef,entry){let state2=shared();state2.sessions.set(userRef,entry);for(let listener of[...state2.sessionListeners])listener()}function subscribeTextingAskSessions(listener){let{sessionListeners:sessionListeners}=shared();return sessionListeners.add(listener),()=>{sessionListeners.delete(listener)}}var NO_SNAPSHOT=()=>null;function useTextingGranted(){let{runtime:runtime}=useEverfurContext(),source=runtime.entitlements??null,subscribe2=useCallback(listener=>source===null?()=>{}:source.subscribe(listener),[source]),read=source===null?NO_SNAPSHOT:source.getSnapshot,snapshot=useSyncExternalStore(subscribe2,read,read);return useMemo(()=>snapshot!==null&&decideCapability("texting",snapshot.decisions,{isPending:snapshot.isPending}).enabled,[snapshot])}var IDLE=/* @__PURE__ */Object.freeze({status:"idle"});function useAskSchedule(userRef){let{runtime:runtime}=useEverfurContext(),kv=runtime.registry.services.kv,[state2,setState]=useState({user:null,value:IDLE});return useEffect(()=>{if(userRef===null)return;let live=true,read=()=>{readTextingAskSchedule(kv,userRef).then(value=>{live&&setState({user:userRef,value:{status:"ready",read:value}})})};read();let unsubscribe=subscribeTextingAskSchedule(read);return()=>{live=false,unsubscribe()}},[kv,userRef]),state2.user===userRef?state2.value:IDLE}function identityOf(texting){switch(texting.status){case"enroll":case"requesting":case"code":case"confirming":return"none";case"verified":case"optingOut":case"optedOut":return"exists";default:return"unknown"}}function useTextingAsk(options={}){let enabled=options.enabled!==false,ready=options.ready!==false,surface=options.surface??"prompt",entryWanted=options.entry===true,{runtime:runtime,userRef:userRef}=useEverfurContext(),kv=runtime.registry.services.kv,granted=useTextingGranted(),schedule=useAskSchedule(enabled&&userRef!==null?userRef:null),readSession=useCallback(()=>userRef===null?null:textingAskSession(userRef),[userRef]),current=useSyncExternalStore(subscribeTextingAskSessions,readSession,readSession),update2=useCallback(entry=>{userRef!==null&&setTextingAskSession(userRef,entry)},[userRef]),mine=current!==null&¤t.surface===surface,handedOff=current!==null&¤t.fromPrompt===true,stage=mine?current.stage==="handoff"?"hidden":current.stage:surface==="prompt"&&handedOff?"dismissed":"hidden",now=Date.now(),scheduleEligible=schedule.status==="ready"&&isTextingAskEligible(schedule.read,now),[readFor,setReadFor]=useState(null),entryRead=entryWanted&&userRef!==null&&granted,texting=useTextingState(userRef!==null&&readFor===userRef||stage!=="hidden"||mine||entryRead),identity=identityOf(texting),{readEnabled:readEnabled,due:due}=resolveTextingAskDue({enabled:enabled,capabilityGranted:granted,hasProfile:texting.profile!==null,signedIn:userRef!==null,scheduleEligible:scheduleEligible,offeredThisSession:current!==null,identity:identity,surfaceReady:ready});useEffect(()=>{readEnabled&&userRef!==null&&setReadFor(userRef)},[readEnabled,userRef]);let askNumber=current?.askNumber??(schedule.status==="ready"&&schedule.read.status==="ok"?nextTextingAskNumber(schedule.read.entry):1);useEffect(()=>{!due||userRef===null||textingAskSession(userRef)!==null||update2({surface:surface,stage:"offered",answered:false,askNumber:askNumber})},[due,userRef,update2,askNumber,surface]),useEffect(()=>{!mine||current.stage!=="handoff"||enabled&&ready&&granted&&texting.profile!==null&&identity==="none"&&update2({...current,stage:"offered"})},[mine,current,enabled,ready,granted,texting.profile,identity,update2]);let completed=schedule.status==="ready"&&schedule.read.status==="ok"&&schedule.read.entry.completed;useEffect(()=>{userRef===null||identity!=="exists"||completed||schedule.status!=="ready"||markTextingAskCompleted(kv,userRef)},[identity,completed,schedule.status,kv,userRef]),useEffect(()=>{mine&¤t.stage==="enrolling"&&texting.status==="verified"&&update2({...current,stage:"verified"})},[mine,current,texting.status,update2]);let answer=useCallback(entry=>userRef===null||entry.answered?entry:(recordTextingAsk(kv,userRef),{...entry,answered:true}),[kv,userRef]),accept=useCallback(()=>{mine&¤t.stage==="offered"&&update2({...current,stage:"enrolling"})},[mine,current,update2]),close=useCallback(()=>{if(!mine||current.stage!=="enrolling")return;let{back:back,...rest}=current;update2({...rest,stage:back??"offered"})},[mine,current,update2]),dismiss=useCallback(()=>{if(!(!mine||current.stage!=="offered"&¤t.stage!=="enrolling")){if(surface==="prompt"){update2({...answer(current),surface:"chat",stage:"handoff",fromPrompt:true});return}current.fromPrompt===true&¤t.answered&&userRef!==null&&snoozeTextingAsk(kv,userRef),update2({...answer(current),stage:"dismissed"})}},[mine,current,surface,update2,answer,kv,userRef]),{start:startCode}=texting,start=useCallback(async phone=>!mine||current.stage!=="enrolling"?false:(current.answered||update2(answer(current)),startCode(phone)),[mine,current,update2,answer,startCode]),canOpen=entryRead&&texting.profile!==null&&identity==="none"&&stage!=="enrolling"&&stage!=="verified",open=useCallback(()=>{if(!canOpen||userRef===null)return;let was=mine?current:null;update2({surface:surface,stage:"enrolling",answered:was?.answered??false,askNumber:current?.askNumber??askNumber,...was?.fromPrompt===true?{fromPrompt:true}:{},back:was?.stage==="offered"?"offered":"dismissed"})},[canOpen,userRef,mine,current,update2,surface,askNumber]),brand=texting.profile?.brandName??"";return useMemo(()=>({stage:userRef===null?"hidden":stage,brand:brand,askNumber:askNumber,texting:texting,accept:accept,dismiss:dismiss,close:close,start:start,canOpen:canOpen,open:open}),[userRef,stage,brand,askNumber,texting,accept,dismiss,close,start,canOpen,open])}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});function ChatTextingAskController({enabled:enabled,ready:ready,onAsk:onAsk,entry:entry=false}){let ask=useTextingAsk({enabled:enabled,ready:ready,surface:"chat",entry:entry});return useEffect(()=>{callHost(onAsk,ask)},[ask,onAsk]),null}function textingAskLines(ask){return{line:TEXTING_BRAND_COPY.chatAskLine(ask.brand),accept:TEXTING_COPY.promptAccept,dismiss:TEXTING_COPY.promptDismiss,verified:TEXTING_BRAND_COPY.chatAskVerified(ask.brand)}}function ChatTextingAskComposer({ask:ask}){let theme=useEverfurTheme(),styles=useMemo(()=>makeAskStyles(theme),[theme]);/* @__PURE__ */
|
|
159
160
|
return jsx(AskEntry,{ask:ask,styles:styles})}function AskEntry({ask:ask,styles:styles}){let{texting:texting}=ask,{status:status,profile:profile,snapshot:snapshot}=texting,[phone,setPhone]=useState(""),[consented,setConsented]=useState(false),[code,setCode]=useState(""),[problem,setProblem]=useState(null),onNumber=status==="enroll"||status==="requesting"&&!snapshot.resending,onCode=status==="code"||status==="confirming"||status==="requesting";useEffect(()=>{setProblem(null)},[status]);let close=/* @__PURE__ */jsxs(Pressable,{onPress:ask.close,accessibilityRole:"button",accessibilityLabel:TEXTING_COPY.close,hitSlop:8,style:styles.close,testID:"texting-ask-close",children:[
|
|
160
161
|
/* @__PURE__ */jsx(View,{style:[styles.closeBar,styles.closeBarA]}),
|
|
161
162
|
/* @__PURE__ */jsx(View,{style:[styles.closeBar,styles.closeBarB]})]}),refusal=snapshot.error===null?null:/* @__PURE__ */jsxs(View,{style:styles.notice,accessibilityRole:"alert",children:[
|
|
@@ -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, CSSProperties } from 'react';
|
|
2
3
|
import { a as CapabilityDecision } from './resolve.d-CoQWUy1Y.js';
|
|
3
4
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
4
5
|
import { P as PetRef } from './ids.d-B2GAAifq.js';
|
|
5
|
-
import { b as HealthPlanFocusDesign, c as HealthPlanFocusCopy, d as HealthPlanFocusClassNames, e as HealthPlanFocusIcon, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from './focus.d-
|
|
6
|
-
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, c as HealthPlanEmptyCopy } from './usePresentation.d-
|
|
6
|
+
import { b as HealthPlanFocusDesign, c as HealthPlanFocusCopy, d as HealthPlanFocusClassNames, e as HealthPlanFocusIcon, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from './focus.d-CjL6Cj0m.js';
|
|
7
|
+
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, c as HealthPlanEmptyCopy } from './usePresentation.d-Bne14SlX.js';
|
|
7
8
|
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
|
|
8
9
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
9
10
|
import { i as EverfurPresentationInput } from './presentation.d-vy8kTGfR.js';
|
|
@@ -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, CSSProperties } from 'react';
|
|
2
3
|
import { a as CapabilityDecision } from './resolve.d-CoQWUy1Y.cjs';
|
|
3
4
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
4
5
|
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
5
|
-
import { b as HealthPlanFocusDesign, c as HealthPlanFocusCopy, d as HealthPlanFocusClassNames, e as HealthPlanFocusIcon, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from './focus.d-
|
|
6
|
-
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, c as HealthPlanEmptyCopy } from './usePresentation.d-
|
|
6
|
+
import { b as HealthPlanFocusDesign, c as HealthPlanFocusCopy, d as HealthPlanFocusClassNames, e as HealthPlanFocusIcon, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from './focus.d-BHm_QtQ9.cjs';
|
|
7
|
+
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, c as HealthPlanEmptyCopy } from './usePresentation.d-BcdCIuEU.cjs';
|
|
7
8
|
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
|
|
8
9
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
9
10
|
import { i as EverfurPresentationInput } from './presentation.d-vy8kTGfR.cjs';
|
|
@@ -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 { p as RecordsTimelineView } from './depth.d-DYnkz8Re.cjs';
|
|
2
3
|
|
|
3
4
|
type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
|
|
4
5
|
interface TimelineRow {
|
|
@@ -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 { p as RecordsTimelineView } from './depth.d-D7kKiYl7.js';
|
|
2
3
|
|
|
3
4
|
type TimelineRowKind = 'visit' | 'vaccine' | 'weight' | 'medication';
|
|
4
5
|
interface TimelineRow {
|
|
@@ -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
|
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
2
3
|
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link", "header", "banner", "chip", "card", "input", "tab", "bookingStep", "dialog", "cartBar", "planCard", "planReasonLabel", "planWash", "planChip"];
|
|
3
4
|
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
@@ -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
|
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
2
3
|
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link", "header", "banner", "chip", "card", "input", "tab", "bookingStep", "dialog", "cartBar", "planCard", "planReasonLabel", "planWash", "planChip"];
|
|
3
4
|
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
@@ -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 { C as ClientBranding, E as EverfurThemeInput } from './branding.d-y6c0UwhE.js';
|
|
2
3
|
import { m as EverfurTheme, d as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens.d-BUVqme2D.js';
|
|
3
4
|
|
|
@@ -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 { C as ClientBranding, E as EverfurThemeInput } from './branding.d-Bbc6p1XY.cjs';
|
|
2
3
|
import { m as EverfurTheme, d as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens.d-BUVqme2D.cjs';
|
|
3
4
|
|
|
@@ -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 { F as FileHandle, U as UploadTransport } from './ports.d-BX4f4UsB.cjs';
|
|
2
3
|
|
|
3
4
|
/** The subset of `fetch` this adapter calls. */
|
|
@@ -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 { F as FileHandle, U as UploadTransport } from './ports.d-BX4f4UsB.js';
|
|
2
3
|
|
|
3
4
|
/** The subset of `fetch` this adapter calls. */
|
|
@@ -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
|
/** His drag (plan.src.html L5345-5368): out past 90px, or past 12px at more than 0.11 px/ms. */
|
|
2
3
|
declare function isIntroSwipeOut(dy: number, ms: number): boolean;
|
|
3
4
|
|