@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
|
@@ -1,8 +1,9 @@
|
|
|
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 { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
2
3
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
3
4
|
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.cjs';
|
|
4
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
5
|
-
import { A as AuthContext } from './identity.d-
|
|
5
|
+
import { R as RequestFunnel } from './requestFunnel.d-JoqddYSx.cjs';
|
|
6
|
+
import { A as AuthContext } from './identity.d-HbwYQ4-z.cjs';
|
|
6
7
|
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
7
8
|
|
|
8
9
|
/** Where a reason comes from. An unknown kind reads as `profile` (a fact about the pet). */
|
|
@@ -1,8 +1,9 @@
|
|
|
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 { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
2
3
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
3
4
|
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.js';
|
|
4
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
5
|
-
import { A as AuthContext } from './identity.d-
|
|
5
|
+
import { R as RequestFunnel } from './requestFunnel.d-YabU6G-Z.js';
|
|
6
|
+
import { A as AuthContext } from './identity.d-Be2Es9Td.js';
|
|
6
7
|
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-68yrE3BE.js';
|
|
7
8
|
|
|
8
9
|
/** Where a reason comes from. An unknown kind reads as `profile` (a fact about the pet). */
|
|
@@ -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"),records=require("@everfur/sdk/records");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 base3=face(theme,fallback);return base3.fontWeight===void 0||headingWeight===null?base3:{fontFamily:base3.fontFamily,fontWeight:headingWeight}}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function parseHealthPlanShadow(css){if(css.length>200||css.includes(",")&&!/rgba?\(|hsla?\(/i.test(css))return null;let color=/(rgba?\([^)]*\)|hsla?\([^)]*\)|#[0-9a-f]{3,8}\b|[a-z]+)\s*$/i.exec(css.trim())?.[1]??null;if(color===null)return null;let lengths=css.trim().slice(0,css.trim().length-color.length).trim().split(/\s+/).filter(Boolean);if(lengths.length<2||lengths.length>4)return null;let px=lengths.map(part=>part==="0"?0:/^-?\d*\.?\d+px$/.test(part)?Number(part.slice(0,-2)):Number.NaN);return px.some(n=>!Number.isFinite(n))?null:{color:color,offsetX:px[0]??0,offsetY:px[1]??0,blur:Math.max(0,px[2]??0)}}function healthPlanLength(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function healthPlanTitleOffset(titleGap,sectionGap){let gap=healthPlanLength(titleGap);return gap===null?0:gap-sectionGap}function isHealthPlanSessionRequired(error){return error!==null&&(error.reasonCode==="session_required"||error.code==="sessionRequired")}var DockContext=react.createContext(null);function HealthPlanCartScope({children:children}){let[dock,setDock]=react.useState(null),store=react.useMemo(()=>({dock:dock,publish:setDock}),[dock]);return react.createElement(DockContext.Provider,{value:store},children)}function useHealthPlanCartDock(){return react.useContext(DockContext)?.dock??null}function usePublishHealthPlanCart(enabled,cart,busy,petRef,plan,setInPlan){let publish=react.useContext(DockContext)?.publish,latest=react.useRef(setInPlan);react.useEffect(()=>{latest.current=setInPlan},[setInPlan]);let writes=react.useMemo(()=>healthPlanWrites(plan,(productId,inPlan)=>latest.current(productId,inPlan)),[plan]);react.useEffect(()=>{if(!(publish===void 0||!enabled))return publish(/* @__PURE__ */Object.freeze({cart:cart,busy:busy,petRef:petRef,plan:plan,...writes})),()=>publish(null)},[publish,enabled,cart,busy,petRef,plan,writes])}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(value,warning){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=react.createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=react.useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return react.useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=react.createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return react.createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=react.useContext(PlanPetContext),ctx=react.useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=react.useRef(null);react.useEffect(()=>{if(!drawn||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
@@ -132,7 +133,7 @@ return jsxRuntime.jsxs(reactNative.View,{style:bx("blanksRow"),testID:`health-pl
|
|
|
132
133
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[...bx("blanksNum"),gridCell(X.blanksRow,0)],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksNum"),children:String(i+1)})}),
|
|
133
134
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:gridCell(X.blanksRow,1),children:[
|
|
134
135
|
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:LINE,children:[r.lead===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.lead}),
|
|
135
|
-
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function healthPlanBlanksFacts(input,now){let asked=input.requests.filter(r=>r.source==="clinic_request").slice().sort((a,b)=>(dayMs(b.createdAt)??0)-(dayMs(a.createdAt)??0))[0];if(asked===void 0)return null;let clinicName=asked.clinicName?.trim()?asked.clinicName.trim():null;if(WAITING.has(asked.status))return{phase:"wait",requestId:String(asked.id),clinicName:clinicName,weightKg:null,nextShotsAt:null};if(asked.status!=="published"||input.record===null||input.record.isEmpty||input.record.withheld)return null;let today=Math.floor(now/864e5)*864e5;return{phase:"filled",requestId:String(asked.id),clinicName:clinicName,weightKg:healthPlanRecordsWeightKg(input.record),nextShotsAt:healthPlanNextShotsAt(input.record,today)}}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=react.useState(()=>Date.now()),first=react.useRef(true);return react.useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),react.useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}function RecordsProbe(props){let{status:status,requests:requests,record:record,refresh:refresh}=records.useEverfurRecords({petRef:props.petRef}),{onRead:onRead,petRef:petRef}=props,now=useCoarseNow(),blanks=react.useMemo(()=>healthPlanBlanksFacts({requests:requests,record:record},now),[requests,record,now]);react.useEffect(()=>{onRead({missing:status==="empty",blanks:blanks})},[status,blanks,onRead]);let reread=react.useRef(refresh);return reread.current=refresh,react.useEffect(()=>onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&reread.current()}),[petRef]),null}var LB_PER_KG2=2.20462262,ORDER_STEPS=["ordered","shipped","out_for_delivery","delivered"],TRACK_STEP={ordered:0,shipped:1,delivered:3};function hostOrderView(o){let step=Math.max(0,ORDER_STEPS.indexOf(o.status));return{key:o.key,number:o.number??null,step:step,dates:o.dates??[],everfur:false,steps:step===2?[0,1,2,3]:[0,1,3],productId:null,items:o.items.map(x=>({title:x.title,quantity:x.quantity,price:x.price,imageUrl:x.imageUrl??null,icon:x.icon??null})),total:Math.round(o.items.reduce((n,x)=>n+x.price,0)*100)/100,currency:o.currency,subscriptionBox:o.subscriptionBox===true,carrier:o.carrier??null,trackingNumber:o.trackingNumber??null,trackingTag:o.trackingTag??null,trackingUrl:o.trackingUrl??null}}function everfurOrderView(o,items){let it=items.find(x=>x.productId===o.productId),t=o.tracking,quantity=o.quantity??1,total=o.total??Math.round(o.price*quantity*100)/100,step=t===void 0?0:TRACK_STEP[t.status];return{key:o.orderId,number:t?.orderNumber??null,step:step,dates:t===void 0?[o.createdAt??null]:[o.createdAt??null,t.shippedAt,null,step===3?null:t.estimatedDelivery],steps:t===void 0?[0]:[0,1,3],everfur:true,productId:o.productId,items:[{title:o.title??it?.title??"",quantity:quantity,price:total,imageUrl:it?.imageUrl??null,icon:null}],total:total,currency:o.currency,subscriptionBox:false,carrier:t?.carrier??null,trackingNumber:t?.trackingNumber??null,trackingTag:null,trackingUrl:t?.trackingUrl??null}}function formatShopDay(iso,locale,now=/* @__PURE__ */new Date){if(iso==null)return null;let dateOnly=/^\d{4}-\d{2}-\d{2}$/.test(iso),d=new Date(dateOnly?`${iso}T00:00:00Z`:iso);if(Number.isNaN(d.getTime()))return null;let tz=dateOnly?"UTC":void 0,year=Number(new Intl.DateTimeFormat("en-US",{year:"numeric",...tz?{timeZone:tz}:{}}).format(d));try{return new Intl.DateTimeFormat(locale??"en-US",year!==now.getFullYear()?{month:"short",day:"numeric",year:"numeric",...tz?{timeZone:tz}:{}}:{weekday:"short",month:"short",day:"numeric",...tz?{timeZone:tz}:{}}).format(d)}catch{return iso}}function andList(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]??""}`}async function readOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:20,...cursor===null?{}:{cursor:cursor}});if(cursor!==null||repo.listOneBoxOrders===void 0)return{ok:true,value:{orders:[],nextCursor:null}};let res=await repo.listOneBoxOrders(petRef);return res.ok?{ok:true,value:{orders:res.value,nextCursor:null}}:res}function invalidCursor(error){if(error.httpStatus!==422)return false;let raw=error.raw!==null&&typeof error.raw=="object"?error.raw:null;return[error.reasonCode,error.wireMessage,raw?.detail,raw?.message].some(x=>x==="invalid_cursor")}var CHECKOUT_PARAM="everfur_checkout",CHECKOUT_CANCEL_PARAM="everfur_checkout_cancel",STRIPE_SESSION_ID="{CHECKOUT_SESSION_ID}",CHECKOUT_POLL_MS=2e3,CHECKOUT_POLL_TRIES=30;function validReturnUrl(url){return typeof url!="string"?false:/^https:\/\/[^/?#\s]+[^\s]*$/i.test(url.trim())}var PARAM_RE=new RegExp(`([?&])(?:${CHECKOUT_PARAM}|${CHECKOUT_CANCEL_PARAM})=[^&#]*&?`,"g");function checkoutReturnUrl(base3,name,value){let hashAt=base3.indexOf("#"),hash=hashAt===-1?"":base3.slice(hashAt),head=hashAt===-1?base3:base3.slice(0,hashAt);head=head.replace(PARAM_RE,"$1").replace(/[?&]$/,"");let sep=head.includes("?")?"&":"?";return`${head}${sep}${name}=${value}${hash}`}function readCheckoutReturn(url,base3){let strip=u=>u.split(/[?#]/)[0]?.replace(/\/+$/,"").toLowerCase()??"";if(strip(url)!==strip(base3))return null;let query=url.split("#")[0]?.split("?")[1]??"",params=/* @__PURE__ */new Map;for(let pair of query.split("&")){if(pair==="")continue;let at=pair.indexOf("="),key=at===-1?pair:pair.slice(0,at),value=at===-1?"":pair.slice(at+1);try{value=decodeURIComponent(value)}catch{}params.set(key,value)}if(params.has(CHECKOUT_CANCEL_PARAM))return{kind:"cancel"};let id=params.get(CHECKOUT_PARAM);return id===void 0?null:{kind:"return",sessionId:id===""||id===STRIPE_SESSION_ID?null:id}}function mintTapKey(){let c=globalThis.crypto;return c?.randomUUID?c.randomUUID():`tap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}var checkouts=/* @__PURE__ */new Map,carts=/* @__PURE__ */new Map;function rememberCheckout(petRef,checkoutId){checkouts.set(petRef,checkoutId)}function recallCheckout(petRef){return checkouts.get(petRef)??null}function forgetCheckout(petRef){checkouts.delete(petRef)}function readCart(petRef){return carts.get(petRef)??[]}function writeCart(petRef,lines){lines.length===0?carts.delete(petRef):carts.set(petRef,lines)}var CENTER={justifyContent:"center"},SHRINK2={flexShrink:1},thumb=(k,src,fallback="box")=>src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:k.S.shopImage,accessibilityIgnoresInvertColors:true}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k.S.shopImage,children:k.icon(fallback)}),inlineTag=(k,label,part)=>/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",
|
|
136
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsxRuntime.jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function latestClinicRequest(requests){return requests.filter(r=>r.source==="clinic_request").slice().sort((a,b)=>(dayMs(b.createdAt)??0)-(dayMs(a.createdAt)??0))[0]}function healthPlanRecordsHoldNoBlanks(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0||asked.status!=="published"||input.record===null||input.record.withheld)return false;let today=Math.floor(now/864e5)*864e5;return healthPlanRecordsWeightKg(input.record)===null&&healthPlanNextShotsAt(input.record,today)===null}function healthPlanBlanksFacts(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0)return null;let clinicName=asked.clinicName?.trim()?asked.clinicName.trim():null;if(WAITING.has(asked.status))return{phase:"wait",requestId:String(asked.id),clinicName:clinicName,weightKg:null,nextShotsAt:null};if(asked.status!=="published"||input.record===null||input.record.isEmpty||input.record.withheld)return null;let today=Math.floor(now/864e5)*864e5,weightKg=healthPlanRecordsWeightKg(input.record),nextShotsAt=healthPlanNextShotsAt(input.record,today);return weightKg===null&&nextShotsAt===null?null:{phase:"filled",requestId:String(asked.id),clinicName:clinicName,weightKg:weightKg,nextShotsAt:nextShotsAt}}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=react.useState(()=>Date.now()),first=react.useRef(true);return react.useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),react.useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}function RecordsProbe(props){let{status:status,requests:requests,record:record,refresh:refresh}=records.useEverfurRecords({petRef:props.petRef}),{onRead:onRead,petRef:petRef}=props,now=useCoarseNow(),blanks=react.useMemo(()=>healthPlanBlanksFacts({requests:requests,record:record},now),[requests,record,now]),heldNone=react.useMemo(()=>healthPlanRecordsHoldNoBlanks({requests:requests,record:record},now),[requests,record,now]);react.useEffect(()=>{onRead({missing:status==="empty"||heldNone,blanks:blanks})},[status,heldNone,blanks,onRead]);let reread=react.useRef(refresh);return reread.current=refresh,react.useEffect(()=>onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&reread.current()}),[petRef]),null}var LB_PER_KG2=2.20462262,ORDER_STEPS=["ordered","shipped","out_for_delivery","delivered"],TRACK_STEP={ordered:0,shipped:1,delivered:3};function hostOrderView(o){let step=Math.max(0,ORDER_STEPS.indexOf(o.status));return{key:o.key,number:o.number??null,step:step,dates:o.dates??[],everfur:false,steps:step===2?[0,1,2,3]:[0,1,3],productId:null,items:o.items.map(x=>({title:x.title,quantity:x.quantity,price:x.price,imageUrl:x.imageUrl??null,icon:x.icon??null})),total:Math.round(o.items.reduce((n,x)=>n+x.price,0)*100)/100,currency:o.currency,subscriptionBox:o.subscriptionBox===true,carrier:o.carrier??null,trackingNumber:o.trackingNumber??null,trackingTag:o.trackingTag??null,trackingUrl:o.trackingUrl??null}}function everfurOrderView(o,items){let it=items.find(x=>x.productId===o.productId),t=o.tracking,quantity=o.quantity??1,total=o.total??Math.round(o.price*quantity*100)/100,step=t===void 0?0:TRACK_STEP[t.status];return{key:o.orderId,number:t?.orderNumber??null,step:step,dates:t===void 0?[o.createdAt??null]:[o.createdAt??null,t.shippedAt,null,step===3?null:t.estimatedDelivery],steps:t===void 0?[0]:[0,1,3],everfur:true,productId:o.productId,items:[{title:o.title??it?.title??"",quantity:quantity,price:total,imageUrl:it?.imageUrl??null,icon:null}],total:total,currency:o.currency,subscriptionBox:false,carrier:t?.carrier??null,trackingNumber:t?.trackingNumber??null,trackingTag:null,trackingUrl:t?.trackingUrl??null}}function formatShopDay(iso,locale,now=/* @__PURE__ */new Date){if(iso==null)return null;let dateOnly=/^\d{4}-\d{2}-\d{2}$/.test(iso),d=new Date(dateOnly?`${iso}T00:00:00Z`:iso);if(Number.isNaN(d.getTime()))return null;let tz=dateOnly?"UTC":void 0,year=Number(new Intl.DateTimeFormat("en-US",{year:"numeric",...tz?{timeZone:tz}:{}}).format(d));try{return new Intl.DateTimeFormat(locale??"en-US",year!==now.getFullYear()?{month:"short",day:"numeric",year:"numeric",...tz?{timeZone:tz}:{}}:{weekday:"short",month:"short",day:"numeric",...tz?{timeZone:tz}:{}}).format(d)}catch{return iso}}function andList(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]??""}`}async function readOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:20,...cursor===null?{}:{cursor:cursor}});if(cursor!==null||repo.listOneBoxOrders===void 0)return{ok:true,value:{orders:[],nextCursor:null}};let res=await repo.listOneBoxOrders(petRef);return res.ok?{ok:true,value:{orders:res.value,nextCursor:null}}:res}function invalidCursor(error){if(error.httpStatus!==422)return false;let raw=error.raw!==null&&typeof error.raw=="object"?error.raw:null;return[error.reasonCode,error.wireMessage,raw?.detail,raw?.message].some(x=>x==="invalid_cursor")}var CHECKOUT_PARAM="everfur_checkout",CHECKOUT_CANCEL_PARAM="everfur_checkout_cancel",STRIPE_SESSION_ID="{CHECKOUT_SESSION_ID}",CHECKOUT_POLL_MS=2e3,CHECKOUT_POLL_TRIES=30;function validReturnUrl(url){return typeof url!="string"?false:/^https:\/\/[^/?#\s]+[^\s]*$/i.test(url.trim())}var PARAM_RE=new RegExp(`([?&])(?:${CHECKOUT_PARAM}|${CHECKOUT_CANCEL_PARAM})=[^&#]*&?`,"g");function checkoutReturnUrl(base3,name,value){let hashAt=base3.indexOf("#"),hash=hashAt===-1?"":base3.slice(hashAt),head=hashAt===-1?base3:base3.slice(0,hashAt);head=head.replace(PARAM_RE,"$1").replace(/[?&]$/,"");let sep=head.includes("?")?"&":"?";return`${head}${sep}${name}=${value}${hash}`}function readCheckoutReturn(url,base3){let strip=u=>u.split(/[?#]/)[0]?.replace(/\/+$/,"").toLowerCase()??"";if(strip(url)!==strip(base3))return null;let query=url.split("#")[0]?.split("?")[1]??"",params=/* @__PURE__ */new Map;for(let pair of query.split("&")){if(pair==="")continue;let at=pair.indexOf("="),key=at===-1?pair:pair.slice(0,at),value=at===-1?"":pair.slice(at+1);try{value=decodeURIComponent(value)}catch{}params.set(key,value)}if(params.has(CHECKOUT_CANCEL_PARAM))return{kind:"cancel"};let id=params.get(CHECKOUT_PARAM);return id===void 0?null:{kind:"return",sessionId:id===""||id===STRIPE_SESSION_ID?null:id}}function mintTapKey(){let c=globalThis.crypto;return c?.randomUUID?c.randomUUID():`tap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}var checkouts=/* @__PURE__ */new Map,carts=/* @__PURE__ */new Map;function rememberCheckout(petRef,checkoutId){checkouts.set(petRef,checkoutId)}function recallCheckout(petRef){return checkouts.get(petRef)??null}function forgetCheckout(petRef){checkouts.delete(petRef)}function readCart(petRef){return carts.get(petRef)??[]}function writeCart(petRef,lines){lines.length===0?carts.delete(petRef):carts.set(petRef,lines)}var CENTER={justifyContent:"center"},SHRINK2={flexShrink:1},thumb=(k,src,fallback="box")=>src?/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:{uri:src},style:k.S.shopImage,accessibilityIgnoresInvertColors:true}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k.S.shopImage,children:k.icon(fallback)}),inlineTag=(k,label,part)=>/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[" ",
|
|
136
137
|
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k.S.D.bx(part),children:/* @__PURE__ */jsxRuntime.jsx(Text,{style:k.S.D.tx(part),children:label})})]});function shopButton(k,label,onPress,opts={}){let{S:S}=k,{bx:bx,tx:tx}=S.D,disabled=opts.disabled===true,part=opts.part??"button";/* @__PURE__ */
|
|
137
138
|
return jsxRuntime.jsx(reactNative.Pressable,{onPress:disabled?void 0:onPress,disabled:disabled,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{disabled:disabled},style:pressScale(opts.ghost?[S.buttonGhost,disabled?S.disabled:null]:bx(part,disabled&&"buttonDisabled"),PLAN_PRESS_SCALE.button,disabled),...opts.testID?{testID:opts.testID}:{},children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:opts.ghost?S.buttonGhostText:tx(part),children:label})})}function shopLink(k,label,onPress,testID){let{bx:bx,tx:tx}=k.S.D;/* @__PURE__ */
|
|
138
139
|
return jsxRuntime.jsx(reactNative.Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityLabel:label,style:[...bx("shopLink"),CENTER],...testID?{testID:testID}:{},children:/* @__PURE__ */jsxRuntime.jsx(Text,{tier:"control",style:tx("shopLink"),children:label})})}function shopRows(k,rows){return rows.length===0?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:k.S.summary,testID:"health-plan-checkout-rows",children:rows.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:k.S.summaryRow,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
|
import { ReactNode } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { a as CapabilityDecision } from '../resolve.d-CoQWUy1Y.cjs';
|
|
@@ -5,20 +6,20 @@ import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
|
5
6
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.cjs';
|
|
6
7
|
import { P as PetRef } from '../ids.d-B2GAAifq.cjs';
|
|
7
8
|
export { B as Brand, C as ConversationId, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.cjs';
|
|
8
|
-
import { c as HealthPlanFocusCopy, e as HealthPlanFocusIcon, b as HealthPlanFocusDesign, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from '../focus.d-
|
|
9
|
-
export { s as HEALTH_PLAN_FOCUS_COPY, t as HEALTH_PLAN_REASON_KINDS, m as HealthPlan, u as HealthPlanCartCheckoutRequest, v as HealthPlanCheckoutItem, w as HealthPlanCheckoutRefusal, x as HealthPlanCheckoutRequest, y as HealthPlanCheckoutSession, z as HealthPlanCheckoutState, A as HealthPlanCheckoutStatus, B as HealthPlanFocusExtra, C as HealthPlanFocusPrices, D as HealthPlanFocusReasonRow, E as HealthPlanFocusReview, F as HealthPlanFocusSign, G as HealthPlanFocusStep, I as HealthPlanFocusWait, J as HealthPlanOneBoxOffer, K as HealthPlanOneBoxOrderPage, L as HealthPlanOneBoxOrderPageOptions, M as HealthPlanOrderStatus, N as HealthPlanOrderTracking, O as HealthPlanOrderTrackingStatus, H as HealthPlanPage, r as HealthPlanPagePet, P as HealthPlanPurchase, Q as HealthPlanReason, o as HealthPlanReasonKind, n as HealthPlanRepository, R as HealthPlanRepositoryDeps, S as HealthPlanRuntime, q as HealthPlanSubscriptionQuote, T as HealthPlanSubscriptionRenewal, U as HealthPlanSubscriptionStatus, V as HealthPlanSubscriptionStep, W as HealthPlanSubscriptionSupply, X as HealthPlanTrackStep, Y as createHealthPlanPageRepository, Z as createHealthPlanPageRepositoryOver, _ as createHealthPlanRepository, $ as createHealthPlanRepositoryOver, a2 as formatHealthPlanDay, a3 as healthPlanCheckoutRefusal, a4 as healthPlanCheckoutSessionFromWire, a5 as healthPlanCheckoutStateFromWire, a7 as healthPlanFocusDesignFromWire, a8 as healthPlanFromWire, ac as healthPlanPageFromWire } from '../focus.d-
|
|
9
|
+
import { c as HealthPlanFocusCopy, e as HealthPlanFocusIcon, b as HealthPlanFocusDesign, 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';
|
|
10
|
+
export { s as HEALTH_PLAN_FOCUS_COPY, t as HEALTH_PLAN_REASON_KINDS, m as HealthPlan, u as HealthPlanCartCheckoutRequest, v as HealthPlanCheckoutItem, w as HealthPlanCheckoutRefusal, x as HealthPlanCheckoutRequest, y as HealthPlanCheckoutSession, z as HealthPlanCheckoutState, A as HealthPlanCheckoutStatus, B as HealthPlanFocusExtra, C as HealthPlanFocusPrices, D as HealthPlanFocusReasonRow, E as HealthPlanFocusReview, F as HealthPlanFocusSign, G as HealthPlanFocusStep, I as HealthPlanFocusWait, J as HealthPlanOneBoxOffer, K as HealthPlanOneBoxOrderPage, L as HealthPlanOneBoxOrderPageOptions, M as HealthPlanOrderStatus, N as HealthPlanOrderTracking, O as HealthPlanOrderTrackingStatus, H as HealthPlanPage, r as HealthPlanPagePet, P as HealthPlanPurchase, Q as HealthPlanReason, o as HealthPlanReasonKind, n as HealthPlanRepository, R as HealthPlanRepositoryDeps, S as HealthPlanRuntime, q as HealthPlanSubscriptionQuote, T as HealthPlanSubscriptionRenewal, U as HealthPlanSubscriptionStatus, V as HealthPlanSubscriptionStep, W as HealthPlanSubscriptionSupply, X as HealthPlanTrackStep, Y as createHealthPlanPageRepository, Z as createHealthPlanPageRepositoryOver, _ as createHealthPlanRepository, $ as createHealthPlanRepositoryOver, a2 as formatHealthPlanDay, a3 as healthPlanCheckoutRefusal, a4 as healthPlanCheckoutSessionFromWire, a5 as healthPlanCheckoutStateFromWire, a7 as healthPlanFocusDesignFromWire, a8 as healthPlanFromWire, ac as healthPlanPageFromWire } from '../focus.d-BHm_QtQ9.cjs';
|
|
10
11
|
import { i as EverfurPresentationInput } from '../presentation.d-vy8kTGfR.cjs';
|
|
11
12
|
export { E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, j as EverfurSafetyDisclaimerPlacement } from '../presentation.d-vy8kTGfR.cjs';
|
|
12
|
-
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, e as HealthPlanCardOptions, f as HealthPlanImageVariant, g as HealthPlanReasonVariant, d as HealthPlanCart } from '../usePresentation.d-
|
|
13
|
-
export { E as EverfurHealthPlanOptions, h as EverfurHealthPlanState, i as EverfurHealthPlanStatus, j as HEALTH_PLAN_COPY, k as HEALTH_PLAN_COPY_PLACEHOLDERS, l as HEALTH_PLAN_LAYOUT_DEFAULTS, m as HEALTH_PLAN_REASON_LABELS, n as HEALTH_PLAN_TEMPLATES, o as HealthPlanAddButtonSize, p as HealthPlanAddedVariant, q as HealthPlanBlanksPhase, r as HealthPlanCardShadow, s as HealthPlanCartBarPlacement, t as HealthPlanCartBarVisibility, u as HealthPlanCategoryVariant, v as HealthPlanFontWeight, w as HealthPlanHeaderContext, x as HealthPlanPageContext, y as HealthPlanShadow, z as formatHealthPlanPrice, A as formatHealthPlanPriceWith, B as healthPlanBlanksFacts, C as healthPlanCart, D as healthPlanNextShotsAt, F as healthPlanRecordsWeightKg, G as isHealthPlanSessionRequired, I as showHealthPlanCartBar, J as useEverfurHealthPlan, K as useEverfurHealthPlanRepository, L as useEverfurPresentation } from '../usePresentation.d-
|
|
13
|
+
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, e as HealthPlanCardOptions, f as HealthPlanImageVariant, g as HealthPlanReasonVariant, d as HealthPlanCart } from '../usePresentation.d-BcdCIuEU.cjs';
|
|
14
|
+
export { E as EverfurHealthPlanOptions, h as EverfurHealthPlanState, i as EverfurHealthPlanStatus, j as HEALTH_PLAN_COPY, k as HEALTH_PLAN_COPY_PLACEHOLDERS, l as HEALTH_PLAN_LAYOUT_DEFAULTS, m as HEALTH_PLAN_REASON_LABELS, n as HEALTH_PLAN_TEMPLATES, o as HealthPlanAddButtonSize, p as HealthPlanAddedVariant, q as HealthPlanBlanksPhase, r as HealthPlanCardShadow, s as HealthPlanCartBarPlacement, t as HealthPlanCartBarVisibility, u as HealthPlanCategoryVariant, v as HealthPlanFontWeight, w as HealthPlanHeaderContext, x as HealthPlanPageContext, y as HealthPlanShadow, z as formatHealthPlanPrice, A as formatHealthPlanPriceWith, B as healthPlanBlanksFacts, C as healthPlanCart, D as healthPlanNextShotsAt, F as healthPlanRecordsWeightKg, G as isHealthPlanSessionRequired, I as showHealthPlanCartBar, J as useEverfurHealthPlan, K as useEverfurHealthPlanRepository, L as useEverfurPresentation } from '../usePresentation.d-BcdCIuEU.cjs';
|
|
14
15
|
import { L as LifecyclePort } from '../LifecyclePort.d-Cr1p33a7.cjs';
|
|
15
16
|
import { E as EverfurResult } from '../EverfurResult.d-BFH-3s6E.cjs';
|
|
16
17
|
import { R as RecordsRecordWire } from '../ports.d-BX4f4UsB.cjs';
|
|
17
|
-
export { H as HealthPlanCartDock, a as HealthPlanCartScope, b as HealthPlanCartScopeProps, c as HealthPlanController, d as HealthPlanNoVetListener, e as HealthPlanPageOptions, f as HealthPlanPagePhase, g as HealthPlanPageState, h as HealthPlanPhase, i as HealthPlanRecordsLandedListener, j as HealthPlanRecordsLandedSource, k as HealthPlanSnapshot, l as healthPlanNoVet, n as notifyHealthPlanRecordsLanded, o as onHealthPlanNoVet, m as onHealthPlanRecordsLanded, s as setHealthPlanNoVet, u as useHealthPlanCartDock, p as useHealthPlanPage, q as useHealthPlanPageRepository } from '../planSignals.d-
|
|
18
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
19
|
-
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-
|
|
18
|
+
export { H as HealthPlanCartDock, a as HealthPlanCartScope, b as HealthPlanCartScopeProps, c as HealthPlanController, d as HealthPlanNoVetListener, e as HealthPlanPageOptions, f as HealthPlanPagePhase, g as HealthPlanPageState, h as HealthPlanPhase, i as HealthPlanRecordsLandedListener, j as HealthPlanRecordsLandedSource, k as HealthPlanSnapshot, l as healthPlanNoVet, n as notifyHealthPlanRecordsLanded, o as onHealthPlanNoVet, m as onHealthPlanRecordsLanded, s as setHealthPlanNoVet, u as useHealthPlanCartDock, p as useHealthPlanPage, q as useHealthPlanPageRepository } from '../planSignals.d-Dha2CMDF.cjs';
|
|
19
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-HbwYQ4-z.cjs';
|
|
20
|
+
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';
|
|
20
21
|
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
21
|
-
import '../requestFunnel.d-
|
|
22
|
+
import '../requestFunnel.d-JoqddYSx.cjs';
|
|
22
23
|
import '../models.d-BSqvbTE1.cjs';
|
|
23
24
|
|
|
24
25
|
/** The pet facts the words are sized to. */
|
|
@@ -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 { ReactNode } from 'react';
|
|
2
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
4
|
import { a as CapabilityDecision } from '../resolve.d-CoQWUy1Y.js';
|
|
@@ -5,20 +6,20 @@ import { E as EverfurError } from '../EverfurError.d-8NHtlgzA.js';
|
|
|
5
6
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../EverfurError.d-8NHtlgzA.js';
|
|
6
7
|
import { P as PetRef } from '../ids.d-B2GAAifq.js';
|
|
7
8
|
export { B as Brand, C as ConversationId, R as RecordsRequestId, U as UserRef, _ as __brand } from '../ids.d-B2GAAifq.js';
|
|
8
|
-
import { c as HealthPlanFocusCopy, e as HealthPlanFocusIcon, b as HealthPlanFocusDesign, f as HealthPlanItem, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder, i as HealthPlanSubscriptionRepository, j as HealthPlanPageRepository, k as HealthPlanShopOrder, l as HealthPlanCheckoutProvider } from '../focus.d-
|
|
9
|
-
export { s as HEALTH_PLAN_FOCUS_COPY, t as HEALTH_PLAN_REASON_KINDS, m as HealthPlan, u as HealthPlanCartCheckoutRequest, v as HealthPlanCheckoutItem, w as HealthPlanCheckoutRefusal, x as HealthPlanCheckoutRequest, y as HealthPlanCheckoutSession, z as HealthPlanCheckoutState, A as HealthPlanCheckoutStatus, B as HealthPlanFocusExtra, C as HealthPlanFocusPrices, D as HealthPlanFocusReasonRow, E as HealthPlanFocusReview, F as HealthPlanFocusSign, G as HealthPlanFocusStep, I as HealthPlanFocusWait, J as HealthPlanOneBoxOffer, K as HealthPlanOneBoxOrderPage, L as HealthPlanOneBoxOrderPageOptions, M as HealthPlanOrderStatus, N as HealthPlanOrderTracking, O as HealthPlanOrderTrackingStatus, H as HealthPlanPage, r as HealthPlanPagePet, P as HealthPlanPurchase, Q as HealthPlanReason, o as HealthPlanReasonKind, n as HealthPlanRepository, R as HealthPlanRepositoryDeps, S as HealthPlanRuntime, q as HealthPlanSubscriptionQuote, T as HealthPlanSubscriptionRenewal, U as HealthPlanSubscriptionStatus, V as HealthPlanSubscriptionStep, W as HealthPlanSubscriptionSupply, X as HealthPlanTrackStep, Y as createHealthPlanPageRepository, Z as createHealthPlanPageRepositoryOver, _ as createHealthPlanRepository, $ as createHealthPlanRepositoryOver, a2 as formatHealthPlanDay, a3 as healthPlanCheckoutRefusal, a4 as healthPlanCheckoutSessionFromWire, a5 as healthPlanCheckoutStateFromWire, a7 as healthPlanFocusDesignFromWire, a8 as healthPlanFromWire, ac as healthPlanPageFromWire } from '../focus.d-
|
|
9
|
+
import { c as HealthPlanFocusCopy, e as HealthPlanFocusIcon, b as HealthPlanFocusDesign, 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';
|
|
10
|
+
export { s as HEALTH_PLAN_FOCUS_COPY, t as HEALTH_PLAN_REASON_KINDS, m as HealthPlan, u as HealthPlanCartCheckoutRequest, v as HealthPlanCheckoutItem, w as HealthPlanCheckoutRefusal, x as HealthPlanCheckoutRequest, y as HealthPlanCheckoutSession, z as HealthPlanCheckoutState, A as HealthPlanCheckoutStatus, B as HealthPlanFocusExtra, C as HealthPlanFocusPrices, D as HealthPlanFocusReasonRow, E as HealthPlanFocusReview, F as HealthPlanFocusSign, G as HealthPlanFocusStep, I as HealthPlanFocusWait, J as HealthPlanOneBoxOffer, K as HealthPlanOneBoxOrderPage, L as HealthPlanOneBoxOrderPageOptions, M as HealthPlanOrderStatus, N as HealthPlanOrderTracking, O as HealthPlanOrderTrackingStatus, H as HealthPlanPage, r as HealthPlanPagePet, P as HealthPlanPurchase, Q as HealthPlanReason, o as HealthPlanReasonKind, n as HealthPlanRepository, R as HealthPlanRepositoryDeps, S as HealthPlanRuntime, q as HealthPlanSubscriptionQuote, T as HealthPlanSubscriptionRenewal, U as HealthPlanSubscriptionStatus, V as HealthPlanSubscriptionStep, W as HealthPlanSubscriptionSupply, X as HealthPlanTrackStep, Y as createHealthPlanPageRepository, Z as createHealthPlanPageRepositoryOver, _ as createHealthPlanRepository, $ as createHealthPlanRepositoryOver, a2 as formatHealthPlanDay, a3 as healthPlanCheckoutRefusal, a4 as healthPlanCheckoutSessionFromWire, a5 as healthPlanCheckoutStateFromWire, a7 as healthPlanFocusDesignFromWire, a8 as healthPlanFromWire, ac as healthPlanPageFromWire } from '../focus.d-CjL6Cj0m.js';
|
|
10
11
|
import { i as EverfurPresentationInput } from '../presentation.d-vy8kTGfR.js';
|
|
11
12
|
export { E as EverfurChatAnswerStyle, a as EverfurChatComposerPlaceholder, b as EverfurChatComposerStyle, c as EverfurChatHistoryBarSetting, d as EverfurChatHistoryStyle, e as EverfurChatSendButtonSetting, f as EverfurChatTopCardSetting, g as EverfurHealthPlanLayout, h as EverfurPresentation, j as EverfurSafetyDisclaimerPlacement } from '../presentation.d-vy8kTGfR.js';
|
|
12
|
-
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, e as HealthPlanCardOptions, f as HealthPlanImageVariant, g as HealthPlanReasonVariant, d as HealthPlanCart } from '../usePresentation.d-
|
|
13
|
-
export { E as EverfurHealthPlanOptions, h as EverfurHealthPlanState, i as EverfurHealthPlanStatus, j as HEALTH_PLAN_COPY, k as HEALTH_PLAN_COPY_PLACEHOLDERS, l as HEALTH_PLAN_LAYOUT_DEFAULTS, m as HEALTH_PLAN_REASON_LABELS, n as HEALTH_PLAN_TEMPLATES, o as HealthPlanAddButtonSize, p as HealthPlanAddedVariant, q as HealthPlanBlanksPhase, r as HealthPlanCardShadow, s as HealthPlanCartBarPlacement, t as HealthPlanCartBarVisibility, u as HealthPlanCategoryVariant, v as HealthPlanFontWeight, w as HealthPlanHeaderContext, x as HealthPlanPageContext, y as HealthPlanShadow, z as formatHealthPlanPrice, A as formatHealthPlanPriceWith, B as healthPlanBlanksFacts, C as healthPlanCart, D as healthPlanNextShotsAt, F as healthPlanRecordsWeightKg, G as isHealthPlanSessionRequired, I as showHealthPlanCartBar, J as useEverfurHealthPlan, K as useEverfurHealthPlanRepository, L as useEverfurPresentation } from '../usePresentation.d-
|
|
13
|
+
import { H as HealthPlanBlanksFacts, a as HealthPlanPriceFormat, b as HealthPlanLayoutProps, e as HealthPlanCardOptions, f as HealthPlanImageVariant, g as HealthPlanReasonVariant, d as HealthPlanCart } from '../usePresentation.d-Bne14SlX.js';
|
|
14
|
+
export { E as EverfurHealthPlanOptions, h as EverfurHealthPlanState, i as EverfurHealthPlanStatus, j as HEALTH_PLAN_COPY, k as HEALTH_PLAN_COPY_PLACEHOLDERS, l as HEALTH_PLAN_LAYOUT_DEFAULTS, m as HEALTH_PLAN_REASON_LABELS, n as HEALTH_PLAN_TEMPLATES, o as HealthPlanAddButtonSize, p as HealthPlanAddedVariant, q as HealthPlanBlanksPhase, r as HealthPlanCardShadow, s as HealthPlanCartBarPlacement, t as HealthPlanCartBarVisibility, u as HealthPlanCategoryVariant, v as HealthPlanFontWeight, w as HealthPlanHeaderContext, x as HealthPlanPageContext, y as HealthPlanShadow, z as formatHealthPlanPrice, A as formatHealthPlanPriceWith, B as healthPlanBlanksFacts, C as healthPlanCart, D as healthPlanNextShotsAt, F as healthPlanRecordsWeightKg, G as isHealthPlanSessionRequired, I as showHealthPlanCartBar, J as useEverfurHealthPlan, K as useEverfurHealthPlanRepository, L as useEverfurPresentation } from '../usePresentation.d-Bne14SlX.js';
|
|
14
15
|
import { L as LifecyclePort } from '../LifecyclePort.d-Cr1p33a7.js';
|
|
15
16
|
import { E as EverfurResult } from '../EverfurResult.d-D_-254ZY.js';
|
|
16
17
|
import { R as RecordsRecordWire } from '../ports.d-BX4f4UsB.js';
|
|
17
|
-
export { H as HealthPlanCartDock, a as HealthPlanCartScope, b as HealthPlanCartScopeProps, c as HealthPlanController, d as HealthPlanNoVetListener, e as HealthPlanPageOptions, f as HealthPlanPagePhase, g as HealthPlanPageState, h as HealthPlanPhase, i as HealthPlanRecordsLandedListener, j as HealthPlanRecordsLandedSource, k as HealthPlanSnapshot, l as healthPlanNoVet, n as notifyHealthPlanRecordsLanded, o as onHealthPlanNoVet, m as onHealthPlanRecordsLanded, s as setHealthPlanNoVet, u as useHealthPlanCartDock, p as useHealthPlanPage, q as useHealthPlanPageRepository } from '../planSignals.d-
|
|
18
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-
|
|
19
|
-
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-
|
|
18
|
+
export { H as HealthPlanCartDock, a as HealthPlanCartScope, b as HealthPlanCartScopeProps, c as HealthPlanController, d as HealthPlanNoVetListener, e as HealthPlanPageOptions, f as HealthPlanPagePhase, g as HealthPlanPageState, h as HealthPlanPhase, i as HealthPlanRecordsLandedListener, j as HealthPlanRecordsLandedSource, k as HealthPlanSnapshot, l as healthPlanNoVet, n as notifyHealthPlanRecordsLanded, o as onHealthPlanNoVet, m as onHealthPlanRecordsLanded, s as setHealthPlanNoVet, u as useHealthPlanCartDock, p as useHealthPlanPage, q as useHealthPlanPageRepository } from '../planSignals.d-CON9gTvJ.js';
|
|
19
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../identity.d-Be2Es9Td.js';
|
|
20
|
+
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';
|
|
20
21
|
export { E as ErrorPolicyPort } from '../ErrorPolicyPort.d-68yrE3BE.js';
|
|
21
|
-
import '../requestFunnel.d-
|
|
22
|
+
import '../requestFunnel.d-YabU6G-Z.js';
|
|
22
23
|
import '../models.d-DOwnr8fi.js';
|
|
23
24
|
|
|
24
25
|
/** The pet facts the words are sized to. */
|
|
@@ -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,useState,useMemo,useContext,useEffect,useSyncExternalStore,useCallback,useRef,Fragment,useLayoutEffect,Component}from"react";import{TextInput,View,Pressable,StyleSheet,Animated,useWindowDimensions,Easing,ScrollView,Image,Modal,Text as Text$1,Linking,AppState,ActivityIndicator}from"react-native";import{jsxs,jsx,Fragment as Fragment$1}from"react/jsx-runtime";import{useEverfurRecords}from"@everfur/sdk/records";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 base3=face(theme,fallback);return base3.fontWeight===void 0||headingWeight===null?base3:{fontFamily:base3.fontFamily,fontWeight:headingWeight}}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function parseHealthPlanShadow(css){if(css.length>200||css.includes(",")&&!/rgba?\(|hsla?\(/i.test(css))return null;let color=/(rgba?\([^)]*\)|hsla?\([^)]*\)|#[0-9a-f]{3,8}\b|[a-z]+)\s*$/i.exec(css.trim())?.[1]??null;if(color===null)return null;let lengths=css.trim().slice(0,css.trim().length-color.length).trim().split(/\s+/).filter(Boolean);if(lengths.length<2||lengths.length>4)return null;let px=lengths.map(part=>part==="0"?0:/^-?\d*\.?\d+px$/.test(part)?Number(part.slice(0,-2)):Number.NaN);return px.some(n=>!Number.isFinite(n))?null:{color:color,offsetX:px[0]??0,offsetY:px[1]??0,blur:Math.max(0,px[2]??0)}}function healthPlanLength(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function healthPlanTitleOffset(titleGap,sectionGap){let gap=healthPlanLength(titleGap);return gap===null?0:gap-sectionGap}function isHealthPlanSessionRequired(error){return error!==null&&(error.reasonCode==="session_required"||error.code==="sessionRequired")}var DockContext=createContext(null);function HealthPlanCartScope({children:children}){let[dock,setDock]=useState(null),store=useMemo(()=>({dock:dock,publish:setDock}),[dock]);return createElement(DockContext.Provider,{value:store},children)}function useHealthPlanCartDock(){return useContext(DockContext)?.dock??null}function usePublishHealthPlanCart(enabled,cart,busy,petRef,plan,setInPlan){let publish=useContext(DockContext)?.publish,latest=useRef(setInPlan);useEffect(()=>{latest.current=setInPlan},[setInPlan]);let writes=useMemo(()=>healthPlanWrites(plan,(productId,inPlan)=>latest.current(productId,inPlan)),[plan]);useEffect(()=>{if(!(publish===void 0||!enabled))return publish(/* @__PURE__ */Object.freeze({cart:cart,busy:busy,petRef:petRef,plan:plan,...writes})),()=>publish(null)},[publish,enabled,cart,busy,petRef,plan,writes])}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(value,warning){/* @__PURE__ */
|
|
2
3
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
3
4
|
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=useContext(PlanPetContext),ctx=useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=useRef(null);useEffect(()=>{if(!drawn||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze([
|
|
@@ -132,7 +133,7 @@ return jsxs(View,{style:bx("blanksRow"),testID:`health-plan-blank-${r.key}`,chil
|
|
|
132
133
|
/* @__PURE__ */jsx(View,{style:[...bx("blanksNum"),gridCell(X.blanksRow,0)],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsx(Text,{style:tx("blanksNum"),children:String(i+1)})}),
|
|
133
134
|
/* @__PURE__ */jsxs(View,{style:gridCell(X.blanksRow,1),children:[
|
|
134
135
|
/* @__PURE__ */jsxs(View,{style:LINE,children:[r.lead===""?null:/* @__PURE__ */jsx(Text,{style:tx("blanksText"),children:r.lead}),
|
|
135
|
-
/* @__PURE__ */jsxs(Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function
|
|
136
|
+
/* @__PURE__ */jsxs(Animated.View,{style:[...bx("blank",width,filledLook&&"blankFilled"),!filledLook&&value!==null?HOLDS_VALUE:null,flashBg===null?null:{backgroundColor:flashBg}],...value===null?{accessible:true,accessibilityLabel:props.blankLabel}:{},testID:value===null?`health-plan-blank-${r.key}-empty`:`health-plan-blank-${r.key}-value`,children:[inner("blank",filledLook&&"blankFilled"),value===null?null:/* @__PURE__ */jsx(Text,{style:tx("blank"),children:value})]}),r.trail===""?null:/* @__PURE__ */jsx(Text,{style:tx("blanksText"),children:r.trail})]}),r.source===""?null:/* @__PURE__ */jsx(Text,{style:tb("blanksSource"),children:r.source})]})]},r.key)})})]})}var WAITING=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review"]),VACCINE=/vaccin|rabies|dhpp|booster|bordetella|lepto|lyme|parvo|distemper/i,LB_PER_KG=2.20462262;function dayMs(value){if(value==null||value.length===0)return null;let ms=Date.parse(/^\d{4}-\d{2}-\d{2}$/.test(value)?`${value}T00:00:00Z`:value);return Number.isNaN(ms)?null:ms}function kilograms(value,unit){return value===null||!Number.isFinite(value)||value<=0||unit===null?null:/^\s*kg|kilo/i.test(unit)?value:/^\s*(lb|lbs|pound)/i.test(unit)?value/LB_PER_KG:null}function healthPlanRecordsWeightKg(record){if(record===null||record.isEmpty||record.withheld)return null;let readings=[];for(let series of record.entitySeries)if(series.key.startsWith("body_weight"))for(let point of series.points){if(point.origin==="owner_reported")continue;let at=dayMs(point.at),unit=point.display?.replace(/^[\d.,\s]+/,"")??null,kg=kilograms(point.value,unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}for(let entity of record.entities){if(entity.category!=="body_weight"||entity.origin==="owner_reported")continue;let at=dayMs(entity.observedAt),kg=kilograms(entity.value===null?null:Number.parseFloat(entity.value),entity.unit);at!==null&&kg!==null&&readings.push({at:at,kg:kg})}return readings.length===0?null:(readings.sort((a,b)=>b.at-a.at),readings[0]?.kg??null)}function healthPlanNextShotsAt(record,today){if(record===null||record.isEmpty||record.withheld)return null;let next=null;for(let item of record.forwardLooking){if(!VACCINE.test(item.title))continue;let due=dayMs(item.dueAt);due===null||due<today||(next===null||due<next)&&(next=due)}return next}function latestClinicRequest(requests){return requests.filter(r=>r.source==="clinic_request").slice().sort((a,b)=>(dayMs(b.createdAt)??0)-(dayMs(a.createdAt)??0))[0]}function healthPlanRecordsHoldNoBlanks(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0||asked.status!=="published"||input.record===null||input.record.withheld)return false;let today=Math.floor(now/864e5)*864e5;return healthPlanRecordsWeightKg(input.record)===null&&healthPlanNextShotsAt(input.record,today)===null}function healthPlanBlanksFacts(input,now){let asked=latestClinicRequest(input.requests);if(asked===void 0)return null;let clinicName=asked.clinicName?.trim()?asked.clinicName.trim():null;if(WAITING.has(asked.status))return{phase:"wait",requestId:String(asked.id),clinicName:clinicName,weightKg:null,nextShotsAt:null};if(asked.status!=="published"||input.record===null||input.record.isEmpty||input.record.withheld)return null;let today=Math.floor(now/864e5)*864e5,weightKg=healthPlanRecordsWeightKg(input.record),nextShotsAt=healthPlanNextShotsAt(input.record,today);return weightKg===null&&nextShotsAt===null?null:{phase:"filled",requestId:String(asked.id),clinicName:clinicName,weightKg:weightKg,nextShotsAt:nextShotsAt}}var COARSE_NOW_TICK_MS=3600*1e3;function useCoarseNow(fixed,shown=true){let[now,setNow]=useState(()=>Date.now()),first=useRef(true);return useEffect(()=>{if(first.current){first.current=false;return}shown&&setNow(Date.now())},[fixed,shown]),useEffect(()=>{if(!shown)return;let tick=setInterval(()=>setNow(Date.now()),COARSE_NOW_TICK_MS),onVisible=()=>{document.visibilityState==="visible"&&setNow(Date.now())},doc=typeof document<"u"&&typeof document.addEventListener=="function"?document:null;return doc?.addEventListener("visibilitychange",onVisible),()=>{clearInterval(tick),doc?.removeEventListener("visibilitychange",onVisible)}},[fixed,shown]),now}function RecordsProbe(props){let{status:status,requests:requests,record:record,refresh:refresh}=useEverfurRecords({petRef:props.petRef}),{onRead:onRead,petRef:petRef}=props,now=useCoarseNow(),blanks=useMemo(()=>healthPlanBlanksFacts({requests:requests,record:record},now),[requests,record,now]),heldNone=useMemo(()=>healthPlanRecordsHoldNoBlanks({requests:requests,record:record},now),[requests,record,now]);useEffect(()=>{onRead({missing:status==="empty"||heldNone,blanks:blanks})},[status,heldNone,blanks,onRead]);let reread=useRef(refresh);return reread.current=refresh,useEffect(()=>onHealthPlanRecordsLanded((pet,source)=>{pet===petRef&&source==="host"&&reread.current()}),[petRef]),null}var LB_PER_KG2=2.20462262,ORDER_STEPS=["ordered","shipped","out_for_delivery","delivered"],TRACK_STEP={ordered:0,shipped:1,delivered:3};function hostOrderView(o){let step=Math.max(0,ORDER_STEPS.indexOf(o.status));return{key:o.key,number:o.number??null,step:step,dates:o.dates??[],everfur:false,steps:step===2?[0,1,2,3]:[0,1,3],productId:null,items:o.items.map(x=>({title:x.title,quantity:x.quantity,price:x.price,imageUrl:x.imageUrl??null,icon:x.icon??null})),total:Math.round(o.items.reduce((n,x)=>n+x.price,0)*100)/100,currency:o.currency,subscriptionBox:o.subscriptionBox===true,carrier:o.carrier??null,trackingNumber:o.trackingNumber??null,trackingTag:o.trackingTag??null,trackingUrl:o.trackingUrl??null}}function everfurOrderView(o,items){let it=items.find(x=>x.productId===o.productId),t=o.tracking,quantity=o.quantity??1,total=o.total??Math.round(o.price*quantity*100)/100,step=t===void 0?0:TRACK_STEP[t.status];return{key:o.orderId,number:t?.orderNumber??null,step:step,dates:t===void 0?[o.createdAt??null]:[o.createdAt??null,t.shippedAt,null,step===3?null:t.estimatedDelivery],steps:t===void 0?[0]:[0,1,3],everfur:true,productId:o.productId,items:[{title:o.title??it?.title??"",quantity:quantity,price:total,imageUrl:it?.imageUrl??null,icon:null}],total:total,currency:o.currency,subscriptionBox:false,carrier:t?.carrier??null,trackingNumber:t?.trackingNumber??null,trackingTag:null,trackingUrl:t?.trackingUrl??null}}function formatShopDay(iso,locale,now=/* @__PURE__ */new Date){if(iso==null)return null;let dateOnly=/^\d{4}-\d{2}-\d{2}$/.test(iso),d=new Date(dateOnly?`${iso}T00:00:00Z`:iso);if(Number.isNaN(d.getTime()))return null;let tz=dateOnly?"UTC":void 0,year=Number(new Intl.DateTimeFormat("en-US",{year:"numeric",...tz?{timeZone:tz}:{}}).format(d));try{return new Intl.DateTimeFormat(locale??"en-US",year!==now.getFullYear()?{month:"short",day:"numeric",year:"numeric",...tz?{timeZone:tz}:{}}:{weekday:"short",month:"short",day:"numeric",...tz?{timeZone:tz}:{}}).format(d)}catch{return iso}}function andList(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]??""}`}async function readOrders(repo,petRef,cursor){if(repo.listOneBoxOrderPage!==void 0)return repo.listOneBoxOrderPage(petRef,{limit:20,...cursor===null?{}:{cursor:cursor}});if(cursor!==null||repo.listOneBoxOrders===void 0)return{ok:true,value:{orders:[],nextCursor:null}};let res=await repo.listOneBoxOrders(petRef);return res.ok?{ok:true,value:{orders:res.value,nextCursor:null}}:res}function invalidCursor(error){if(error.httpStatus!==422)return false;let raw=error.raw!==null&&typeof error.raw=="object"?error.raw:null;return[error.reasonCode,error.wireMessage,raw?.detail,raw?.message].some(x=>x==="invalid_cursor")}var CHECKOUT_PARAM="everfur_checkout",CHECKOUT_CANCEL_PARAM="everfur_checkout_cancel",STRIPE_SESSION_ID="{CHECKOUT_SESSION_ID}",CHECKOUT_POLL_MS=2e3,CHECKOUT_POLL_TRIES=30;function validReturnUrl(url){return typeof url!="string"?false:/^https:\/\/[^/?#\s]+[^\s]*$/i.test(url.trim())}var PARAM_RE=new RegExp(`([?&])(?:${CHECKOUT_PARAM}|${CHECKOUT_CANCEL_PARAM})=[^&#]*&?`,"g");function checkoutReturnUrl(base3,name,value){let hashAt=base3.indexOf("#"),hash=hashAt===-1?"":base3.slice(hashAt),head=hashAt===-1?base3:base3.slice(0,hashAt);head=head.replace(PARAM_RE,"$1").replace(/[?&]$/,"");let sep=head.includes("?")?"&":"?";return`${head}${sep}${name}=${value}${hash}`}function readCheckoutReturn(url,base3){let strip=u=>u.split(/[?#]/)[0]?.replace(/\/+$/,"").toLowerCase()??"";if(strip(url)!==strip(base3))return null;let query=url.split("#")[0]?.split("?")[1]??"",params=/* @__PURE__ */new Map;for(let pair of query.split("&")){if(pair==="")continue;let at=pair.indexOf("="),key=at===-1?pair:pair.slice(0,at),value=at===-1?"":pair.slice(at+1);try{value=decodeURIComponent(value)}catch{}params.set(key,value)}if(params.has(CHECKOUT_CANCEL_PARAM))return{kind:"cancel"};let id=params.get(CHECKOUT_PARAM);return id===void 0?null:{kind:"return",sessionId:id===""||id===STRIPE_SESSION_ID?null:id}}function mintTapKey(){let c=globalThis.crypto;return c?.randomUUID?c.randomUUID():`tap-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,12)}`}var checkouts=/* @__PURE__ */new Map,carts=/* @__PURE__ */new Map;function rememberCheckout(petRef,checkoutId){checkouts.set(petRef,checkoutId)}function recallCheckout(petRef){return checkouts.get(petRef)??null}function forgetCheckout(petRef){checkouts.delete(petRef)}function readCart(petRef){return carts.get(petRef)??[]}function writeCart(petRef,lines){lines.length===0?carts.delete(petRef):carts.set(petRef,lines)}var CENTER={justifyContent:"center"},SHRINK2={flexShrink:1},thumb=(k,src,fallback="box")=>src?/* @__PURE__ */jsx(Image,{source:{uri:src},style:k.S.shopImage,accessibilityIgnoresInvertColors:true}):/* @__PURE__ */jsx(View,{style:k.S.shopImage,children:k.icon(fallback)}),inlineTag=(k,label,part)=>/* @__PURE__ */jsxs(Fragment$1,{children:[" ",
|
|
136
137
|
/* @__PURE__ */jsx(View,{style:k.S.D.bx(part),children:/* @__PURE__ */jsx(Text,{style:k.S.D.tx(part),children:label})})]});function shopButton(k,label,onPress,opts={}){let{S:S}=k,{bx:bx,tx:tx}=S.D,disabled=opts.disabled===true,part=opts.part??"button";/* @__PURE__ */
|
|
137
138
|
return jsx(Pressable,{onPress:disabled?void 0:onPress,disabled:disabled,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{disabled:disabled},style:pressScale(opts.ghost?[S.buttonGhost,disabled?S.disabled:null]:bx(part,disabled&&"buttonDisabled"),PLAN_PRESS_SCALE.button,disabled),...opts.testID?{testID:opts.testID}:{},children:/* @__PURE__ */jsx(Text,{tier:"control",style:opts.ghost?S.buttonGhostText:tx(part),children:label})})}function shopLink(k,label,onPress,testID){let{bx:bx,tx:tx}=k.S.D;/* @__PURE__ */
|
|
138
139
|
return jsx(Pressable,{onPress:onPress,accessibilityRole:"button",accessibilityLabel:label,style:[...bx("shopLink"),CENTER],...testID?{testID:testID}:{},children:/* @__PURE__ */jsx(Text,{tier:"control",style:tx("shopLink"),children:label})})}function shopRows(k,rows){return rows.length===0?null:/* @__PURE__ */jsx(View,{style:k.S.summary,testID:"health-plan-checkout-rows",children:rows.map(r=>/* @__PURE__ */jsxs(View,{style:k.S.summaryRow,children:[
|
|
@@ -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 { j as FetchLike } from './config.d-BQgrIDdu.cjs';
|
|
2
3
|
|
|
3
4
|
type OmsError =
|
|
4
5
|
/** 404: hidden. The shop, the gate, the record, or the account is not available to this viewer. */
|
|
@@ -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 { j as FetchLike } from './config.d-XSMThgVj.js';
|
|
2
3
|
|
|
3
4
|
type OmsError =
|
|
4
5
|
/** 404: hidden. The shop, the gate, the record, or the account is not available to this viewer. */
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
2
3
|
import { U as UserRef } from './ids.d-B2GAAifq.js';
|
|
3
|
-
import { T as TransportPort, d as EverfurRequest } from './config.d-
|
|
4
|
+
import { T as TransportPort, d as EverfurRequest } from './config.d-XSMThgVj.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A minted session token with the expiry the minter knows. `expiresAt` is what `mintPartnerSession` returns
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
2
3
|
import { U as UserRef } from './ids.d-B2GAAifq.cjs';
|
|
3
|
-
import { T as TransportPort, d as EverfurRequest } from './config.d-
|
|
4
|
+
import { T as TransportPort, d as EverfurRequest } from './config.d-BQgrIDdu.cjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A minted session token with the expiry the minter knows. `expiresAt` is what `mintPartnerSession` returns
|
|
@@ -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
|
/** Compile-time-only brand. Zero runtime cost; a raw string cannot flow into an id slot. */
|
|
2
3
|
declare const __brand: unique symbol;
|
|
3
4
|
type Brand<T, B extends string> = T & {
|
package/dist/ids.d-B2GAAifq.d.ts
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
|
/** Compile-time-only brand. Zero runtime cost; a raw string cannot flow into an id slot. */
|
|
2
3
|
declare const __brand: unique symbol;
|
|
3
4
|
type Brand<T, B extends string> = T & {
|