@everfur/sdk 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +174 -0
- package/README.md +2 -1
- package/dist/{Chat-BOG0SXKV.d.cts → Chat.d-DUNTfzqC.d.ts} +170 -8
- package/dist/{Chat-CIolBgjJ.d.ts → Chat.d-Dts8u_1a.d.cts} +170 -8
- package/dist/{DepthViews-BR6VQ3Ta.d.cts → DepthViews.d-BIp599lz.d.cts} +1 -1
- package/dist/{DepthViews-280t3BcQ.d.ts → DepthViews.d-BMU2jFPw.d.cts} +1 -1
- package/dist/{DepthViews-DlBuFsgN.d.ts → DepthViews.d-Ce2Zhnrb.d.ts} +1 -1
- package/dist/{DepthViews-BTbF_DJY.d.cts → DepthViews.d-CubkMPbU.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-10s3HJCt.d.cts → ErrorPolicyPort.d-68yrE3BE.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-C3nNSS_j.d.ts → ErrorPolicyPort.d-DirW9hgO.d.cts} +1 -1
- package/dist/{EverfurError-DeBqRpQV.d.cts → EverfurError.d-8NHtlgzA.d.cts} +11 -1
- package/dist/{EverfurError-DeBqRpQV.d.ts → EverfurError.d-8NHtlgzA.d.ts} +11 -1
- package/dist/{EverfurResult-ClPTS0P2.d.ts → EverfurResult.d-BFH-3s6E.d.cts} +1 -1
- package/dist/{EverfurResult-COlXj1wq.d.cts → EverfurResult.d-D_-254ZY.d.ts} +1 -1
- package/dist/{IntakeMedia-BH0fYDT2.d.cts → IntakeMedia.d-4a89XrP7.d.ts} +1 -1
- package/dist/{IntakeMedia-B-_vA9ZB.d.cts → IntakeMedia.d-DGxrhgIW.d.ts} +1 -1
- package/dist/{IntakeMedia-CIoTXAWs.d.ts → IntakeMedia.d-DUPR4lVM.d.cts} +1 -1
- package/dist/{IntakeMedia-Bavl7E4Z.d.ts → IntakeMedia.d-JJCUvQu7.d.cts} +1 -1
- package/dist/LifecyclePort.d-Cr1p33a7.d.cts +23 -0
- package/dist/LifecyclePort.d-Cr1p33a7.d.ts +23 -0
- package/dist/{PhotoController-vzY5bfY_.d.ts → PhotoController.d-BzCJOE7e.d.cts} +2 -2
- package/dist/{PhotoController-3l7MT9jA.d.cts → PhotoController.d-D0XiUUOl.d.ts} +2 -2
- package/dist/animations/index.cjs +5 -1
- package/dist/animations/index.d.cts +24 -24
- package/dist/animations/index.d.ts +24 -24
- package/dist/animations/index.js +5 -1
- package/dist/{attachments-CGxvnYu4.d.ts → attachments.d-Bp2qbHxn.d.cts} +22 -26
- package/dist/{attachments-CWNj1ZkM.d.ts → attachments.d-D1yhJjcZ.d.ts} +4 -4
- package/dist/{attachments-waXcJWCp.d.cts → attachments.d-DisnvB9R.d.cts} +4 -4
- package/dist/{attachments-B6h4cJU-.d.cts → attachments.d-Djy9z_0Z.d.ts} +22 -26
- package/dist/{bookingCopy-CjPKeg75.d.ts → bookingCopy.d-BJF6gd1A.d.ts} +24 -9
- package/dist/{bookingCopy-8aEU6ZmR.d.cts → bookingCopy.d-BlBmhAJc.d.cts} +24 -9
- package/dist/{branding-DJf4h12Q.d.ts → branding.d-DI8S400y.d.cts} +9 -2
- package/dist/{branding-BCfwLj0h.d.cts → branding.d-OIGLbQeM.d.ts} +9 -2
- package/dist/{callRoom-BhIdadyV.d.cts → callRoom.d-B1DoYdJe.d.cts} +1 -1
- package/dist/{callRoom-B92eH_ij.d.ts → callRoom.d-Dqm1rUqT.d.ts} +1 -1
- package/dist/{casesRepository-CGdhvzTu.d.cts → casesRepository.d-CT2LTicS.d.cts} +3 -3
- package/dist/{casesRepository-ZG9Sg0e4.d.ts → casesRepository.d-UsWOz9bv.d.ts} +3 -3
- package/dist/chat/index.cjs +132 -57
- package/dist/chat/index.d.cts +18 -16
- package/dist/chat/index.d.ts +18 -16
- package/dist/chat/index.js +133 -58
- package/dist/client/index.cjs +15 -10
- package/dist/client/index.d.cts +19 -18
- package/dist/client/index.d.ts +19 -18
- package/dist/client/index.js +15 -10
- package/dist/{config-B0p6Lygh.d.cts → config.d-BR3DT9ho.d.cts} +3 -3
- package/dist/{config-DmFAZJOx.d.ts → config.d-Dy6igYlH.d.ts} +3 -3
- package/dist/consent/index.cjs +5 -1
- package/dist/consent/index.d.cts +10 -10
- package/dist/consent/index.d.ts +10 -10
- package/dist/consent/index.js +5 -1
- package/dist/{context-BNreNLtL.d.ts → context.d-Cwks0p3C.d.cts} +15 -15
- package/dist/{context-BgS2a57J.d.cts → context.d-QcCgguzA.d.ts} +15 -15
- package/dist/{copy-DLJriGQS.d.ts → copy.d-CiMn2IIt.d.ts} +6 -6
- package/dist/{copy-lWp-Lkv5.d.cts → copy.d-DLJTyRfT.d.cts} +6 -6
- package/dist/core/index.cjs +17 -13
- package/dist/core/index.d.cts +33 -29
- package/dist/core/index.d.ts +33 -29
- package/dist/core/index.js +17 -13
- package/dist/{depth-BYb3RXoA.d.cts → depth.d-CjPGVPDL.d.cts} +9 -115
- package/dist/{depth-COz-sSG5.d.ts → depth.d-OSALbYM7.d.ts} +9 -115
- package/dist/{entitlementRepository-D-Lse67w.d.cts → entitlementRepository.d-CVQa1DA1.d.cts} +10 -5
- package/dist/{entitlementRepository-CrTOP_-o.d.ts → entitlementRepository.d-Cf3LbTwD.d.ts} +10 -5
- package/dist/features.d-fNsGcg0R.d.cts +108 -0
- package/dist/features.d-fNsGcg0R.d.ts +108 -0
- package/dist/focus.d-DMg2ngHI.d.ts +1178 -0
- package/dist/focus.d-az9cqUz3.d.cts +1178 -0
- package/dist/health-plan/index.cjs +370 -0
- package/dist/health-plan/index.d.cts +251 -0
- package/dist/health-plan/index.d.ts +251 -0
- package/dist/health-plan/index.js +370 -0
- package/dist/idempotency.d-D461_DPD.d.cts +910 -0
- package/dist/idempotency.d-WpXx9zQo.d.ts +910 -0
- package/dist/{identity-Cw07BKZp.d.ts → identity.d-60LeJt_s.d.cts} +3 -3
- package/dist/{identity-DFVGYn1o.d.cts → identity.d-DzTijonw.d.ts} +3 -3
- package/dist/index.cjs +141 -66
- package/dist/index.d.cts +31 -29
- package/dist/index.d.ts +31 -29
- package/dist/index.js +142 -67
- package/dist/{models-A4A5S7AG.d.cts → models.d-BagXhafD.d.ts} +8 -3
- package/dist/{models-CnXY5LuO.d.ts → models.d-BnLm3VAA.d.cts} +8 -3
- package/dist/notifications/index.cjs +5 -1
- package/dist/notifications/index.d.cts +9 -9
- package/dist/notifications/index.d.ts +9 -9
- package/dist/notifications/index.js +5 -1
- package/dist/optInView.d-CEyHR6PK.d.cts +325 -0
- package/dist/optInView.d-acKpV8V2.d.ts +325 -0
- package/dist/parse.d-C8CXyS58.d.ts +210 -0
- package/dist/parse.d-tEzufgJX.d.cts +210 -0
- package/dist/{pets-BYALZTSu.d.ts → pets.d-C_53_fzo.d.ts} +3 -3
- package/dist/{pets-CcyPQS-H.d.cts → pets.d-NbJvP_kh.d.cts} +3 -3
- package/dist/{petsRepository-B_Q1gFkE.d.cts → petsRepository.d-BuGHymNx.d.ts} +4 -4
- package/dist/{petsRepository-518QkPxH.d.ts → petsRepository.d-lp1BHRqM.d.cts} +4 -4
- package/dist/photo/index.cjs +6 -2
- package/dist/photo/index.d.cts +9 -9
- package/dist/photo/index.d.ts +9 -9
- package/dist/photo/index.js +6 -2
- package/dist/{ports-BN6RHF9W.d.ts → ports.d-BX4f4UsB.d.cts} +14 -1
- package/dist/{ports-BN6RHF9W.d.cts → ports.d-BX4f4UsB.d.ts} +14 -1
- package/dist/{ports-RuNJmBA-.d.cts → ports.d-CEROoqnA.d.cts} +16 -10
- package/dist/{ports-DmQeMArX.d.ts → ports.d-COIyN624.d.ts} +16 -10
- package/dist/presentation.d-DMbdad7G.d.cts +90 -0
- package/dist/presentation.d-DMbdad7G.d.ts +90 -0
- package/dist/records/depth/index.cjs +11 -7
- package/dist/records/depth/index.d.cts +14 -12
- package/dist/records/depth/index.d.ts +14 -12
- package/dist/records/depth/index.js +11 -7
- package/dist/records/index.cjs +225 -62
- package/dist/records/index.d.cts +159 -20
- package/dist/records/index.d.ts +159 -20
- package/dist/records/index.js +225 -62
- package/dist/recordsAsk.d-C5CGSi3j.d.cts +14 -0
- package/dist/recordsAsk.d-C5CGSi3j.d.ts +14 -0
- package/dist/{requestFunnel-B9fdXMi5.d.ts → requestFunnel.d-CXUMPw1K.d.ts} +5 -5
- package/dist/{requestFunnel-BBjNNwc9.d.cts → requestFunnel.d-DWQQpjFR.d.cts} +5 -5
- package/dist/{resolve-D4Ywz5OS.d.ts → resolve.d-jI8FmBj3.d.cts} +3 -3
- package/dist/{resolve-D4Ywz5OS.d.cts → resolve.d-jI8FmBj3.d.ts} +3 -3
- package/dist/{runtimeTypes-CstDBX8w.d.cts → runtimeTypes.d-4yFNNuYR.d.ts} +20 -13
- package/dist/{runtimeTypes-N_K4BVZB.d.ts → runtimeTypes.d-D6N_fhxx.d.cts} +20 -13
- package/dist/server/events/index.cjs +7 -3
- package/dist/server/events/index.d.cts +51 -9
- package/dist/server/events/index.d.ts +51 -9
- package/dist/server/events/index.js +7 -3
- package/dist/server/index.cjs +12 -6
- package/dist/server/index.d.cts +152 -8
- package/dist/server/index.d.ts +152 -8
- package/dist/server/index.js +12 -6
- package/dist/sheetCopy.d-CAhLOxjc.d.cts +4 -0
- package/dist/sheetCopy.d-CAhLOxjc.d.ts +4 -0
- package/dist/sheetSeam.d-Cviqk89n.d.ts +45 -0
- package/dist/sheetSeam.d-DCS3LW8g.d.cts +45 -0
- package/dist/shop/index.cjs +262 -0
- package/dist/shop/index.d.cts +193 -0
- package/dist/shop/index.d.ts +193 -0
- package/dist/shop/index.js +262 -0
- package/dist/televet/booking/index.cjs +16 -12
- package/dist/televet/booking/index.d.cts +36 -22
- package/dist/televet/booking/index.d.ts +36 -22
- package/dist/televet/booking/index.js +16 -12
- package/dist/televet/call/index.d.cts +5 -5
- package/dist/televet/call/index.d.ts +5 -5
- package/dist/televet/index.cjs +7 -3
- package/dist/televet/index.d.cts +12 -12
- package/dist/televet/index.d.ts +12 -12
- package/dist/televet/index.js +7 -3
- package/dist/{televetGlobal-C5dTUACe.d.cts → televetGlobal.d-CC-DrqkQ.d.ts} +7 -2
- package/dist/{televetGlobal-CnjrfhT4.d.ts → televetGlobal.d-CKwDCbmN.d.cts} +7 -2
- package/dist/testing/index.cjs +7 -3
- package/dist/testing/index.d.cts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +7 -3
- package/dist/testing/rn/index.cjs +5 -1
- package/dist/testing/rn/index.d.cts +23 -22
- package/dist/testing/rn/index.d.ts +23 -22
- package/dist/testing/rn/index.js +5 -1
- package/dist/testing/web/index.cjs +5 -1
- package/dist/testing/web/index.d.cts +23 -22
- package/dist/testing/web/index.d.ts +23 -22
- package/dist/testing/web/index.js +5 -1
- package/dist/texting/index.cjs +158 -0
- package/dist/texting/index.d.cts +36 -0
- package/dist/texting/index.d.ts +36 -0
- package/dist/texting/index.js +158 -0
- package/dist/threadOptions.d-B1pTMmDF.d.cts +260 -0
- package/dist/threadOptions.d-B1pTMmDF.d.ts +260 -0
- package/dist/{timelineRows-7yjHyh8i.d.ts → timelineRows.d-BNxgzYRW.d.cts} +1 -1
- package/dist/{timelineRows-WvnL-Lds.d.cts → timelineRows.d-CU5GvvLk.d.ts} +1 -1
- package/dist/{tokens-DLj8OnLH.d.cts → tokens.d-DarDaV39.d.cts} +10 -2
- package/dist/{tokens-DLj8OnLH.d.ts → tokens.d-DarDaV39.d.ts} +10 -2
- package/dist/{typeStyle-BxVyF71R.d.ts → typeStyle.d-Bl8pzbBy.d.cts} +2 -2
- package/dist/{typeStyle-DJedEu14.d.cts → typeStyle.d-C1HBRAI3.d.ts} +2 -2
- package/dist/{uploadTransport-BM_pnEWj.d.cts → uploadTransport.d-CWL7CdWP.d.cts} +1 -1
- package/dist/{uploadTransport-C6kGP1Kd.d.ts → uploadTransport.d-EGoUl7gX.d.ts} +1 -1
- package/dist/usePresentation.d-D6qsFzBz.d.cts +9 -0
- package/dist/usePresentation.d-DuGQe_Do.d.ts +9 -0
- package/dist/useRecords.d-Cb-36SF5.d.cts +121 -0
- package/dist/useRecords.d-aQTzQZoV.d.ts +121 -0
- package/dist/{useRecordsDepth-Bp6L4M5P.d.ts → useRecordsDepth.d-DFcCfiXm.d.ts} +8 -20
- package/dist/{useRecordsDepth-DPdAK_81.d.cts → useRecordsDepth.d-sAq2Qkhr.d.cts} +8 -20
- package/dist/{useVetVisit-DmWa7lt1.d.ts → useVetVisit.d-BtdwhmgD.d.cts} +15 -4
- package/dist/{useVetVisit-PtBjNwZr.d.cts → useVetVisit.d-DoYQimyt.d.ts} +15 -4
- package/dist/video/index.cjs +6 -2
- package/dist/video/index.d.cts +7 -7
- package/dist/video/index.d.ts +7 -7
- package/dist/video/index.js +6 -2
- package/dist/{view-C6go2uUt.d.ts → view.d-C-SNpDJX.d.ts} +10 -122
- package/dist/{view-CiF_HVFQ.d.cts → view.d-Dps5C8-s.d.cts} +10 -122
- package/dist/web/consent/index.cjs +5 -1
- package/dist/web/consent/index.d.cts +10 -10
- package/dist/web/consent/index.d.ts +10 -10
- package/dist/web/consent/index.js +5 -1
- package/dist/web/health-plan/index.cjs +414 -0
- package/dist/web/health-plan/index.d.cts +335 -0
- package/dist/web/health-plan/index.d.ts +335 -0
- package/dist/web/health-plan/index.js +414 -0
- package/dist/web/index.cjs +150 -82
- package/dist/web/index.d.cts +152 -38
- package/dist/web/index.d.ts +152 -38
- package/dist/web/index.js +150 -82
- package/dist/web/notifications/index.cjs +16 -3
- package/dist/web/notifications/index.d.cts +39 -209
- package/dist/web/notifications/index.d.ts +39 -209
- package/dist/web/notifications/index.js +16 -3
- package/dist/web/records/depth/index.cjs +11 -7
- package/dist/web/records/depth/index.d.cts +14 -12
- package/dist/web/records/depth/index.d.ts +14 -12
- package/dist/web/records/depth/index.js +11 -7
- package/dist/web/records/index.cjs +95 -68
- package/dist/web/records/index.d.cts +66 -21
- package/dist/web/records/index.d.ts +66 -21
- package/dist/web/records/index.js +95 -68
- package/dist/web/records/upload/index.d.cts +2 -2
- package/dist/web/records/upload/index.d.ts +2 -2
- package/dist/web/records-sheet/index.cjs +278 -0
- package/dist/web/records-sheet/index.d.cts +102 -0
- package/dist/web/records-sheet/index.d.ts +102 -0
- package/dist/web/records-sheet/index.js +278 -0
- package/dist/web/shop/index.cjs +301 -0
- package/dist/web/shop/index.d.cts +42 -0
- package/dist/web/shop/index.d.ts +42 -0
- package/dist/web/shop/index.js +301 -0
- package/dist/web/televet/booking/index.cjs +16 -12
- package/dist/web/televet/booking/index.d.cts +37 -23
- package/dist/web/televet/booking/index.d.ts +37 -23
- package/dist/web/televet/booking/index.js +16 -12
- package/dist/web/televet/call/index.d.cts +4 -4
- package/dist/web/televet/call/index.d.ts +4 -4
- package/dist/web/televet/index.cjs +7 -3
- package/dist/web/televet/index.d.cts +12 -12
- package/dist/web/televet/index.d.ts +12 -12
- package/dist/web/televet/index.js +7 -3
- package/dist/web/texting/index.cjs +157 -0
- package/dist/web/texting/index.d.cts +36 -0
- package/dist/web/texting/index.d.ts +36 -0
- package/dist/web/texting/index.js +157 -0
- package/health-plan/package.json +8 -0
- package/package.json +106 -4
- package/shop/package.json +8 -0
- package/texting/package.json +8 -0
- package/web/health-plan/native-blocked.cjs +12 -0
- package/web/health-plan/package.json +8 -0
- package/web/records-sheet/native-blocked.cjs +12 -0
- package/web/records-sheet/package.json +8 -0
- package/web/shop/native-blocked.cjs +12 -0
- package/web/shop/package.json +8 -0
- package/web/texting/native-blocked.cjs +12 -0
- package/web/texting/package.json +8 -0
- /package/dist/{CameraPort-Cv31Pz7g.d.cts → CameraPort.d-Cv31Pz7g.d.cts} +0 -0
- /package/dist/{CameraPort-Cv31Pz7g.d.ts → CameraPort.d-Cv31Pz7g.d.ts} +0 -0
- /package/dist/{TelemetryPort-BDNr00hu.d.cts → TelemetryPort.d-BDNr00hu.d.cts} +0 -0
- /package/dist/{TelemetryPort-BDNr00hu.d.ts → TelemetryPort.d-BDNr00hu.d.ts} +0 -0
- /package/dist/{cacheEpoch-DknKn3S0.d.cts → cacheEpoch.d-DknKn3S0.d.cts} +0 -0
- /package/dist/{cacheEpoch-DknKn3S0.d.ts → cacheEpoch.d-DknKn3S0.d.ts} +0 -0
- /package/dist/{callCopy-Bw6oZT54.d.cts → callCopy.d-Bw6oZT54.d.cts} +0 -0
- /package/dist/{callCopy-Bw6oZT54.d.ts → callCopy.d-Bw6oZT54.d.ts} +0 -0
- /package/dist/{ids-B2GAAifq.d.cts → ids.d-B2GAAifq.d.cts} +0 -0
- /package/dist/{ids-B2GAAifq.d.ts → ids.d-B2GAAifq.d.ts} +0 -0
- /package/dist/{optionalModule-DbJmsq5f.d.cts → optionalModule.d-DbJmsq5f.d.cts} +0 -0
- /package/dist/{optionalModule-DbJmsq5f.d.ts → optionalModule.d-DbJmsq5f.d.ts} +0 -0
- /package/dist/{profile-CSs1wlXT.d.cts → profile.d-CSs1wlXT.d.cts} +0 -0
- /package/dist/{profile-CSs1wlXT.d.ts → profile.d-CSs1wlXT.d.ts} +0 -0
- /package/dist/{projection-CeIUsbSk.d.cts → projection.d-CeIUsbSk.d.cts} +0 -0
- /package/dist/{projection-CeIUsbSk.d.ts → projection.d-CeIUsbSk.d.ts} +0 -0
- /package/dist/{species-BXAIMh7I.d.cts → species.d-BXAIMh7I.d.cts} +0 -0
- /package/dist/{species-BXAIMh7I.d.ts → species.d-BXAIMh7I.d.ts} +0 -0
- /package/dist/{visitIntent-D7_yVp1I.d.cts → visitIntent.d-D7_yVp1I.d.cts} +0 -0
- /package/dist/{visitIntent-D7_yVp1I.d.ts → visitIntent.d-D7_yVp1I.d.ts} +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";var react=require("react"),reactNative=require("react-native"),jsxRuntime=require("react/jsx-runtime");var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function omsOk(value){/* @__PURE__ */
|
|
2
|
+
return Object.freeze({ok:true,value:value})}function omsErr(error){/* @__PURE__ */
|
|
3
|
+
return Object.freeze({ok:false,error:/* @__PURE__ */Object.freeze(error)})}function isOmsRefusal(error,reasonCode){return error.kind==="refused"&&(reasonCode===void 0||error.reasonCode===reasonCode)}function isOmsUnavailable(error){return error.kind==="unavailable"}function isOmsRetryable(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="refused"&&error.reasonCode==="order_state_conflict"}var REASON=/^[a-z][a-z0-9_]{0,63}$/,MAX_MESSAGE=300;function cleanMessage(raw){if(typeof raw!="string")return null;let text=raw.replace(/[\u0000-\u001f\u007f]+/g," ").trim();return text.length===0||text.length>MAX_MESSAGE?null:text}function retryAfter(header){if(!header)return null;let seconds=Number(header);return Number.isFinite(seconds)&&seconds>=0?Math.min(Math.round(seconds),3600):null}function omsErrorFromStatus(status,body,headers){let requestId=headers.requestId,rid=requestId?{requestId:requestId}:{};if(status===404)return{kind:"unavailable",...rid};if(status===401)return{kind:"signedOut"};if(status===402||status===409||status===422){let envelope=body&&typeof body=="object"?body:{},reason=typeof envelope.reason_code=="string"&&REASON.test(envelope.reason_code)?envelope.reason_code:null;return{kind:"refused",status:status,reasonCode:reason,message:cleanMessage(envelope.message),...rid}}return status===400?{kind:"invalidRequest",...rid}:status===429?{kind:"rateLimited",retryAfterSeconds:retryAfter(headers.retryAfter??null),...rid}:status===503?{kind:"serviceUnavailable",...rid}:status===403?{kind:"unavailable",...rid}:{kind:"serverError",status:status,...rid}}function newIdempotencyKey(){let c=globalThis.crypto;if(c&&typeof c.randomUUID=="function")return c.randomUUID();if(c&&typeof c.getRandomValues=="function"){let b=c.getRandomValues(new Uint8Array(16));b[6]=b[6]&15|64,b[8]=b[8]&63|128;let h=Array.from(b,x=>x.toString(16).padStart(2,"0")).join("");return`${h.slice(0,8)}-${h.slice(8,12)}-${h.slice(12,16)}-${h.slice(16,20)}-${h.slice(20)}`}throw new EverfurConfigError("missing-peer-dependency","No secure random source: cannot make an idempotency key")}var MAX_ROUNDS=3,ShopActionKeys=class{constructor(make=newIdempotencyKey){this.make=make;this.keys=/* @__PURE__ */new Map}key(step){let k=this.keys.get(step);return k||(k=this.make(),this.keys.set(step,k)),k}next(step){let k=this.make();return this.keys.set(step,k),k}};async function confirmWithPayerActions(confirm,keys,payments,options={reconfirm:true}){let key=keys.key("confirm"),orderIds=[];for(let round=0;round<MAX_ROUNDS;round+=1){let res=await confirm(key);if(!res.ok)return{kind:"failed",error:res.error};orderIds=res.value.resale.map(r=>r.orderId);let pending=res.value.resale.filter(r=>r.outcome==="action_required"&&r.payerAction);if(pending.length===0)return{kind:"confirmed",orderIds:orderIds};if(!payments)return{kind:"needsPayerAction",orderIds:orderIds};for(let entry of pending){let stepResult=await payments.handleNextAction(entry.payerAction,{orderId:entry.orderId});if(!stepResult.ok)return stepResult.closed?{kind:"payerActionClosed",orderIds:orderIds}:{kind:"payerActionFailed",orderIds:orderIds,message:stepResult.message}}if(!options.reconfirm)return{kind:"confirmed",orderIds:orderIds};key=keys.next("confirm")}return{kind:"needsPayerAction",orderIds:orderIds}}var UNAVAILABLE_PACKAGE_SOURCE=/* @__PURE__ */Object.freeze({load:()=>Promise.resolve(omsErr({kind:"unavailable"})),removeLine:()=>Promise.resolve(omsErr({kind:"unavailable"})),skip:()=>Promise.resolve(omsErr({kind:"unavailable"})),approve:()=>Promise.resolve({kind:"failed",error:{kind:"unavailable"}})});async function offersFor(client,ids){let unique=[...new Set(ids)],read=await Promise.all(unique.map(id=>client.offer(id)));return new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null]))}function createOmsPackageSource(client){async function build(plan,review){let offers=await offersFor(client,review.lines.map(l=>l.offerId)),lines=review.lines.map(l=>({...l,offer:offers.get(l.offerId)??null})),draft=null;if(review.state==="open"&&lines.length>0){let d=await client.draftCycle(plan.planId,review.cycle);if(d.ok)draft=d.value;else if(d.error.kind!=="refused")return omsErr(d.error)}return omsOk({plan:plan,review:review,lines:lines,draft:draft})}return{async load(){let plans=await client.plans();if(!plans.ok)return omsErr(plans.error);let plan=plans.value.plans.find(p=>p.state==="active")??plans.value.plans.find(p=>p.state!=="cancelled");if(!plan)return omsOk(null);let review=await client.cycleReview(plan.planId);return review.ok?build(plan,review.value):omsErr(review.error)},async removeLine(pkg,index,keys){let rest=pkg.lines.filter((_,i)=>i!==index).map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),edited=await client.editCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key(`remove:${index}`),lines:rest});return edited.ok?build(pkg.plan,edited.value):omsErr(edited.error)},async skip(pkg,keys){let res=await client.skipCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:keys.key("skip")});return res.ok?omsOk(void 0):omsErr(res.error)},approve(pkg,keys,payments){let draft=pkg.draft;return draft?confirmWithPayerActions(idempotencyKey=>client.approveCycle(pkg.plan.planId,pkg.review.cycle,{idempotencyKey:idempotencyKey,checkoutId:draft.checkoutId,expectedTotal:draft.total}),keys,payments,{reconfirm:false}):Promise.resolve({kind:"failed",error:{kind:"invalidRequest"}})}}}function placeholder(key){return`[copy:shop.${key}]`}var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function possessive(name){return`${name}’s`}function listNames(names){return names.length<=1?names[0]??"":`${names.slice(0,-1).join(", ")} and ${names[names.length-1]}`}function asDate(iso){if(!iso)return null;let d=new Date(/^\d{4}-\d{2}-\d{2}$/.test(iso)?`${iso}T00:00:00Z`:iso);return Number.isNaN(d.getTime())?null:d}function formatDay(iso,opts={}){let d=asDate(iso);return d?d.toLocaleDateString("en-US",{timeZone:"UTC",...opts.weekday?{weekday:"short"}:{},month:"short",day:"numeric"}):null}function formatWhen(iso){let d=asDate(iso);if(!d)return null;let day=d.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),time=d.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});return`${day} · ${time}`}function monthOf(iso){let d=asDate(iso);return d?MONTHS[d.getUTCMonth()]:null}function formatCents(cents){let sign=cents<0?"-":"",abs=Math.abs(Math.round(cents));return`${sign}$${Math.floor(abs/100).toLocaleString("en-US")}.${String(abs%100).padStart(2,"0")}`}function cardLabel(brand,last4){return`${brand?brand.charAt(0).toUpperCase()+brand.slice(1):""} ending ${last4}`}var SHOP_COPY={tabsLabel:"Care",tabPackage:"Package",tabShop:"Shop",tabOrders:"Orders",tabPlan:"Plan",legal:"Prescription items need a valid prescription from a licensed vet, and are filled by a licensed partner pharmacy.",legalTracking:"Prescription items are filled by a licensed partner pharmacy.",loadFailed:thing=>`We couldn’t load ${thing}. Check your connection and try again.`,tryAgain:"Try again",actionFailed:"That didn’t go through. Try again.",saving:"Saving…",keepIt:"Keep it",close:"Close",thingPackage:placeholder("thing.package"),thingShop:placeholder("thing.shop"),thingProduct:placeholder("thing.product"),thingPlan:placeholder("thing.plan"),thingOrders:"your orders",thingOrder:"this order",packageTitle:month=>`${month} package`,packageSub:(names,reviewBy,arrives)=>{let s=[];return names.length>0&&s.push(`For ${listNames(names)}.`),reviewBy&&arrives&&s.push(`Approve by ${reviewBy} and it arrives ${arrives}.`),s.length?s.join(" "):null},inThisPackage:"In this package",reviewBy:day=>`Review by ${day}`,forPet:name=>`For ${name}`,details:"Details",remove:"Remove",removed:"Removed.",total:"Total",items:"Items",shipping:"Shipping",tax:"Tax",free:"Free",approveAndShip:"Approve and ship",itemCount:n=>n===1?placeholder("package.item_count_one"):`${n} items`,withTotal:(label,total)=>`${label} · ${total}`,approveRegion:"Approve",packageDetailsRegion:"Package details",deliveryPaymentRegion:"Delivery and payment",questionsRegion:"Questions",approving:"Approving…",skipThisMonth:"Skip this month",chargedWhenShips:card=>`Charged to ${card} when it ships.`,rxCheckedFirst:"Prescriptions are checked with the vet who wrote them first.",delivery:"Delivery",arrives:day=>`Arrives ${day}`,change:"Change",outOfStock:"Out of stock",packageOutOfStock:"Out of stock right now, so it won’t ship this month.",packageEmpty:month=>`Nothing in ${possessive(month)} package yet. Add something from the shop, or skip this month.`,itemNoLongerSold:placeholder("package.item_no_longer_sold"),reviewClosed:placeholder("package.review_closed"),approvalInProgress:placeholder("package.approval_in_progress"),priceChanged:placeholder("package.price_changed"),cardStepFailed:placeholder("package.card_step_failed"),cardStepClosed:placeholder("package.card_step_closed"),noCardOnFile:placeholder("package.no_card_on_file"),shopTitle:"Shop",searchLabel:"Search the shop",searchPlaceholder:"Search the shop…",filtersLabel:"Filter",filterAll:"All",refillSoon:"Refill soon",inMonthsPackage:month=>`In ${possessive(month)} package →`,forPets:names=>`For ${listNames(names)}`,allProducts:placeholder("shop.all_products_title"),rx:"Rx",hasPrescription:name=>`${name} has a prescription`,needsPrescription:"Needs a prescription",noMatches:q=>`Nothing in the shop matches ‘${q}’.`,nothingHereYet:"Nothing here yet.",photoToCome:"Photo to come",backToShop:"Shop",howOften:"How often",everyMonthIn:name=>`Every month, in ${possessive(name)} package`,skipOrStop:"Skip or stop any month",justOnce:"Just once",shipsWith:month=>`Ships with ${possessive(month)} package`,justOnceShipsNow:placeholder("product.just_once_meta"),oneFewer:"One fewer",oneMore:"One more",quantity:"Quantity",addToPackage:month=>`Add to ${possessive(month)} package`,refillInPackage:month=>`Refill in ${possessive(month)} package`,buyNow:placeholder("product.buy_now"),startPlan:placeholder("product.start_plan"),adding:"Adding…",outOfStockNow:"Out of stock right now.",prescription:"Prescription",noPrescriptionFor:name=>`No prescription for ${name} on file.`,bookVideoVisit:"Book a video visit",refillsLeft:n=>`${n} ${n===1?"refill":"refills"} left`,rxBeingPrepared:"This prescription is being prepared. You can order it soon.",rxTooSoon:placeholder("rx.too_soon"),rxRenew:placeholder("rx.needs_renewal"),rxPick:placeholder("rx.pick_pet"),educational:"Educational, not a diagnosis.",planTitle:"Your plan",whatRepeats:"What repeats",repeatsLabel:title=>`${title} repeats`,cadenceMonths:months=>months===1?"Every month":`Every ${months} months`,cadenceDays:placeholder("plan.cadence_days"),repeatsEmpty:"Nothing repeats yet. Pick Every month when you add something, and it shows up here.",nextPackage:"Next package",reviewByLabel:"Review by",ships:"Ships",reviewMonthsPackage:month=>`Review ${possessive(month)} package →`,deliveryAndPayment:"Delivery and payment",shipTo:"Ship to",payWith:"Pay with",needABreak:"Need a break?",skipMonth:month=>`Skip ${month}`,skipMonthAsk:month=>`Skip ${month}?`,skipMonthBody:"Nothing ships this month.",pausePlan:"Pause the plan",pausePlanAsk:"Pause the plan?",pausePlanBody:"Nothing ships until you turn it back on.",declined:month=>month?`Declined. Update your card so ${possessive(month)} package can ship.`:"Declined.",resumePlan:placeholder("plan.resume"),stopReason:reason=>placeholder(`plan.stop_reason.${reason}`),consentTitle:placeholder("plan.consent_title"),consentBody:placeholder("plan.consent_body"),consentTermsLink:placeholder("plan.consent_terms_link"),consentAgree:placeholder("plan.consent_agree"),ordersTitle:"Orders",ordersSub:names=>`Packages and one-off orders for ${listNames(names)}.`,allOrders:"All orders",placed:day=>`Placed ${day}`,ordersEmpty:"No orders yet. Your first package shows up here once you approve it.",paymentFailed:"Payment failed",backToCare:"Care",onItsWay:title=>`${title}, on its way`,shouldArrive:day=>`It should arrive ${day}.`,whereItStands:"Where it stands",stepApproved:"Approved",stepChecking:"Checking prescriptions…",stepFilled:"Filled by the pharmacy",stepShipped:"Shipped",stepDelivered:"Delivered",now:"Now",expected:day=>`Expected ${day}.`,inTheBox:"In the box",payment:"Payment",cancelOrder:placeholder("order.cancel"),payOrder:placeholder("order.pay"),trackPackage:placeholder("order.track"),orderStatus:{pending_placement:"Confirmed, sending to the pharmacy",placement_unknown:"Confirmed",placed:"With the pharmacy, in review",accepted:"Approved by the pharmacist",release_sent:"Approved, being prepared",release_unknown:"Approved, being prepared",released:"Being prepared",shipped:"Shipped",delivered:"Delivered",needs_support:"We’re looking into this order",rejected:placeholder("order.status.rejected"),cancelled:"Cancelled",pending_handoff:placeholder("order.status.pending_handoff")},addressTitle:placeholder("address.title"),addressLabel:placeholder("address.label"),addressRecipient:placeholder("address.recipient_name"),addressLine1:placeholder("address.line1"),addressLine2:placeholder("address.line2"),addressCity:placeholder("address.city"),addressRegion:placeholder("address.region"),addressPostal:placeholder("address.postal_code"),addressSave:placeholder("address.save"),addressNeeded:placeholder("address.needed"),cardTitle:placeholder("card.title"),cardBody:placeholder("card.body"),cardStart:placeholder("card.start"),cardUnavailable:placeholder("card.unavailable"),confirmTitle:placeholder("buy.confirm_title"),confirmPay:placeholder("buy.confirm_pay"),refusal:{operation_not_supported:"This action isn’t available for this order.",order_not_sellable:"We can’t ship this order as it is. Add items or contact us.",rx_being_prepared:"This prescription is being prepared. You can order it soon.",rx_not_dispensable:"We can’t send this prescription to the pharmacy yet. Contact us.",order_state_conflict:"This order changed. Refresh and try again.",payment_method_in_use:"A subscription or an order uses this card."},rateLimited:placeholder("error.rate_limited")},SHOP_COPY_PLACEHOLDERS=(()=>{let keys=/* @__PURE__ */new Set,visit=v=>{if(typeof v=="string"){let m=/^\[copy:(shop\.[a-z0-9_.]+)\]$/.exec(v);m&&keys.add(m[1])}else if(typeof v=="function")try{visit(v("x","x","x"))}catch{}else if(v&&typeof v=="object")for(let inner of Object.values(v))visit(inner)};return visit(SHOP_COPY),[...keys].sort()})();function shopCopy(overrides){return overrides?{...SHOP_COPY,...overrides}:SHOP_COPY}function refusalLine(copy,error){if(error.kind==="rateLimited")return copy.rateLimited;if(error.kind==="refused"){let own=error.reasonCode?copy.refusal[error.reasonCode]:void 0;if(own)return own;if(error.message)return error.message}return copy.actionFailed}var ShopContext=react.createContext(null);function ShopProvider(props){let{client:client,pets:pets,payments:payments,packageSource:packageSource,copy:copy,children:children}=props,value=react.useMemo(()=>{let list=pets??[],names=new Map(list.map(p=>[p.petId,p.name]));return{client:client,pets:list,petName:id=>id?names.get(id)??null:null,payments:payments??null,packageSource:packageSource??createOmsPackageSource(client),copy:shopCopy(copy)}},[client,pets,payments,packageSource,copy]);return react.createElement(ShopContext.Provider,{value:value},children)}function useShop(){let ctx=react.useContext(ShopContext);if(!ctx)throw new EverfurConfigError("not-initialized","useShop: wrap the shop in <ShopProvider>");return ctx}function useShopRead(key,read){let[state,setState]=react.useState({key:null,phase:"loading",value:null,error:null}),epoch=react.useRef(0),readRef=react.useRef(read);readRef.current=read;let load=react.useCallback(quiet=>{let mine=++epoch.current;key!==null&&(quiet||setState({key:key,phase:"loading",value:null,error:null}),readRef.current().then(res=>{mine===epoch.current&&(res.ok?setState({key:key,phase:"ready",value:res.value,error:null}):setState({key:key,phase:res.error.kind==="unavailable"?"unavailable":"failed",value:null,error:res.error}))}))},[key]);react.useEffect(()=>(load(false),()=>{epoch.current+=1}),[load]);let refresh=react.useCallback(()=>load(false),[load]);return state.key!==key?{phase:"loading",value:null,error:null,refresh:refresh}:{phase:state.phase,value:state.value,error:state.error,refresh:refresh}}function useShopConfig(){let{client:client}=useShop();return useShopRead("shop-config",()=>client.shopConfig())}function useOffers(query={}){let{client:client}=useShop(),text=query.text?.trim()??"",key=`offers:${text}:${query.requiresRx??""}`;return useShopRead(key,()=>client.offers({...text?{text:text}:{},...query.requiresRx!==void 0?{requiresRx:query.requiresRx}:{},limit:100}))}function useOffer(offerId){let{client:client}=useShop();return useShopRead(offerId?`offer:${offerId}`:null,()=>client.offer(offerId))}function usePrescriptions(){let{client:client}=useShop();return useShopRead("prescriptions",()=>client.prescriptions())}function useAddresses(){let{client:client}=useShop();return useShopRead("addresses",()=>client.addresses())}function useAddress(ref){let{client:client}=useShop();return useShopRead(ref?`address:${ref}`:null,()=>client.address(ref))}function usePaymentMethods(){let{client:client}=useShop();return useShopRead("payment-methods",()=>client.paymentMethods())}function useOrders(){let{client:client}=useShop();return useShopRead("orders",()=>client.orders({limit:50}))}function useOrder(orderId){let{client:client}=useShop();return useShopRead(orderId?`order:${orderId}`:null,()=>client.order(orderId))}function usePlans(){let{client:client}=useShop();return useShopRead("plans",()=>client.plans({limit:100}))}function usePackage(){let{packageSource:packageSource}=useShop();return useShopRead("package",()=>packageSource.load())}function useShopAction(act){let[busy,setBusy]=react.useState(false),[error,setError]=react.useState(null),keys=react.useRef(null),running=react.useRef(false),actRef=react.useRef(act);actRef.current=act;let mounted=react.useRef(true);react.useEffect(()=>(mounted.current=true,()=>{mounted.current=false}),[]);let run=react.useCallback(async(...args)=>{if(running.current)return null;running.current=true,keys.current??=new ShopActionKeys,setBusy(true),setError(null);try{let res=await actRef.current(keys.current,...args);return res.ok?keys.current=null:isRetryWithSameKey(res.error)||(keys.current=null),mounted.current&&setError(res.ok?null:res.error),res}finally{running.current=false,mounted.current&&setBusy(false)}},[]),reset=react.useCallback(()=>{keys.current=null,setError(null)},[]);return{busy:busy,error:error,run:run,reset:reset}}function isRetryWithSameKey(error){return error.kind==="network"||error.kind==="timeout"||error.kind==="serviceUnavailable"||error.kind==="serverError"}function distinct(xs){let out=[];for(let x of xs)x!==null&&!out.includes(x)&&out.push(x);return out}function tileFor(rx){return rx?{tone:"pink",icon:"pill"}:{tone:"yellow",icon:"leaf"}}function addressLine(a){return`${a.line2?`${a.line1}, ${a.line2}`:a.line1}, ${a.city}, ${a.region} ${a.postalCode}`}function rxPill(copy){return{label:copy.rx,tone:"rx"}}function refillsLeft(rx){return rx.fillsTotal!==null&&rx.fillsUsed!==null?Math.max(0,rx.fillsTotal-rx.fillsUsed):null}function toPackageView(i){let{pkg:pkg,copy:copy,petName:petName}=i,review=pkg.review,month=monthOf(review.shipsOn),names=distinct(pkg.lines.map(l=>petName(l.petId))),open=review.state==="open",priced=new Map(review.quoteLines.map(q=>[`${q.offerId}:${q.petId??""}`,q])),items=pkg.lines.map((line,index)=>{let offer=line.offer,q=priced.get(`${line.offerId}:${line.petId??""}`),rx=offer?.requiresRx??false,pills=[];return offer||pills.push({label:copy.outOfStock,tone:"later"}),{petId:line.petId,view:{key:`${line.offerId}:${line.petId??""}:${index}`,name:offer?.title??copy.itemNoLongerSold,rx:rx,meta:null,alert:offer?null:copy.packageOutOfStock,pills:pills,price:q&&offer?formatCents(q.unitPrice*q.quantity-q.discount):null,...tileFor(rx),details:offer?{label:copy.details,to:{name:"product",offerId:offer.offerId,...line.petId?{petId:line.petId}:{}}}:null,remove:open?{label:copy.remove,busy:i.removing===index,disabled:i.removing!==null,onPress:()=>i.onRemove(index)}:null}}}),groups=[];for(let it of items){let name=petName(it.petId),label=name?copy.forPet(name):null,existing=groups.find(g=>g.label===label);existing?existing.items.push(it.view):groups.push({label:label,items:[it.view]})}let sum=[],d=pkg.draft;d?(sum.push({k:copy.items,v:formatCents(d.total-d.shipping-d.tax)}),sum.push({k:copy.shipping,v:d.shipping===0?copy.free:formatCents(d.shipping)}),sum.push({k:copy.tax,v:formatCents(d.tax)}),sum.push({k:copy.total,v:formatCents(d.total)})):review.quoteLines.length>0&&sum.push({k:copy.items,v:formatCents(review.quoteLines.reduce((n,q)=>n+q.unitPrice*q.quantity-q.discount,0))});let card=i.card?cardLabel(i.card.brand,i.card.last4):null,anyRx=pkg.lines.some(l=>l.offer?.requiresRx),note=card?[copy.chargedWhenShips(card),anyRx?copy.rxCheckedFirst:null].filter(Boolean).join(" "):null,error=i.error;!error&&review.state==="approving"?error=copy.approvalInProgress:!error&&review.state!=="open"&&review.state!==null?error=copy.reviewClosed:!error&&open&&!i.card&&(error=copy.noCardOnFile);let approve=open&&d&&i.card?{label:copy.approveAndShip,busyLabel:copy.approving,busy:i.approving,disabled:i.approving||i.placed===true||i.removing!==null,onPress:i.onApprove}:null;return{title:month?copy.packageTitle(month):copy.tabPackage,sub:copy.packageSub(names,formatDay(review.approveBy,{weekday:true}),null),reviewPill:review.approveBy&&open?copy.reviewBy(formatDay(review.approveBy)):null,countPill:pkg.lines.length>0?copy.itemCount(pkg.lines.length):null,fine:null,groups:pkg.lines.length>0?groups:[],empty:pkg.lines.length===0?{line:month?copy.packageEmpty(month):copy.nothingHereYet,shop:{label:copy.tabShop,to:{name:"shop"}},skip:null}:null,add:null,sum:sum,approve:approve,skip:open?{label:copy.skipThisMonth,to:{name:"plan"}}:null,note:note,error:error,delivery:i.address?[{k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"package"}}}}]:[],legal:copy.legal}}function readyRxFor(offerId,prescriptions){return prescriptions.filter(p=>p.status==="ready"&&p.offerId===offerId)}function toTile(offer,prescriptions,copy,petName){let pills=[],meta=null,petId=null;if(offer.requiresRx){pills.push(rxPill(copy));let holder=readyRxFor(offer.offerId,prescriptions).find(p=>petName(p.petId));petId=holder?.petId??null,meta=holder?copy.hasPrescription(petName(holder.petId)):copy.needsPrescription}return{key:offer.offerId,to:{name:"product",offerId:offer.offerId,...petId?{petId:petId}:{}},name:offer.title,meta:meta,price:offer.price!==null?formatCents(offer.price):null,pills:pills,...tileFor(offer.requiresRx)}}function toShelves(i){let{copy:copy}=i,shelves=[],refill=i.searching?[]:i.offers.filter(o=>o.requiresRx&&readyRxFor(o.offerId,i.prescriptions).some(p=>i.petName(p.petId)));return refill.length>0&&shelves.push({key:"refill",title:copy.refillSoon,link:i.packageMonth?{label:copy.inMonthsPackage(i.packageMonth),to:{name:"package"}}:null,tiles:refill.map(o=>toTile(o,i.prescriptions,copy,i.petName))}),shelves.push({key:"all",title:i.petNames.length>0?copy.forPets(i.petNames):copy.allProducts,link:null,tiles:i.offers.map(o=>toTile(o,i.prescriptions,copy,i.petName))}),shelves}function toProductView(i){let{copy:copy,offer:offer}=i,monthly=i.plansOn&&i.petName!==null,choice=monthly?i.choice:"once",submitLabel=choice==="monthly"?i.packageMonth?copy.addToPackage(i.packageMonth):copy.startPlan:copy.buyNow,sellable=offer.price!==null;return{back:{label:copy.backToShop,to:{name:"shop"}},title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(false),source:null,stockLine:sellable?null:copy.outOfStockNow,choices:monthly?[{value:"monthly",title:copy.everyMonthIn(i.petName),meta:copy.skipOrStop},{value:"once",title:copy.justOnce,meta:copy.justOnceShipsNow}]:null,choice:monthly?choice:null,onChoice:v=>i.onChoice(v==="once"?"once":"monthly"),quantity:i.quantity,onQuantity:n=>i.onQuantity(Math.min(99,Math.max(1,n))),submit:sellable?{label:submitLabel,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:i.onSubmit}:{label:copy.outOfStock,disabled:true,onPress:()=>{}},error:i.error,facts:null,cards:[],aside:null,legal:copy.legal}}function toRxProductView(i){let{copy:copy,offer:offer}=i,ready=readyRxFor(offer.offerId,i.prescriptions).filter(p=>i.petName(p.petId)),rx=(i.petId?ready.find(p=>p.petId===i.petId):void 0)??ready[0]??null,sellable=offer.price!==null,script=null,submit=null;if(rx){let left=refillsLeft(rx);script={name:copy.hasPrescription(i.petName(rx.petId)),meta:left!==null&&left>0?copy.refillsLeft(left):null,directions:null},submit=sellable?{label:i.packageMonth?copy.refillInPackage(i.packageMonth):copy.buyNow,busyLabel:copy.adding,busy:i.busy,disabled:i.busy,onPress:()=>i.onSubmit(rx)}:{label:copy.outOfStock,disabled:true,onPress:()=>{}}}else{let who=(i.petId?i.petName(i.petId):null)??i.firstPetName;script=who?{name:copy.noPrescriptionFor(who),meta:null,directions:null}:null,submit=i.bookVisitHref?{label:copy.bookVideoVisit,href:i.bookVisitHref}:null}return{back:{label:copy.backToShop,to:{name:"shop"}},stepLabel:copy.prescription,title:offer.title,sub:null,price:sellable?formatCents(offer.price):null,priceUnit:null,...tileFor(true),script:script,stockLine:sellable?null:copy.outOfStockNow,submit:submit,note:null,error:i.error,cards:[],aside:null,legal:copy.legal}}function cadenceLine(days,copy){let months=Math.round(days/30.4);return months>=1&&Math.abs(days-months*30.4)<=2?copy.cadenceMonths(months):copy.cadenceDays}function toPlanView(i){let{copy:copy}=i,live=i.plans.filter(p=>p.state!=="cancelled"),rows=[];for(let plan of live)plan.lines.forEach((line,n)=>{let offer=i.offers.get(line.offerId)??null,pet=i.petName(line.petId),title=[offer?.title??copy.itemNoLongerSold,pet].filter(Boolean).join(" · "),stop=plan.stopReason,meta=stop==="payment_declined"?copy.declined(i.packageMonth):stop&&stop!=="customer"?copy.stopReason(stop):cadenceLine(plan.cadenceDays,copy);rows.push({key:`${plan.planId}:${n}`,title:title,meta:meta,alert:!!(stop&&stop!=="customer"),on:plan.state==="active",busy:i.busyPlan===plan.planId,onToggle:on=>i.onToggle(plan,on),error:i.rowError&&i.rowError.planId===plan.planId&&n===0?i.rowError.line:null})});let active=live.find(p=>p.state==="active")??null,sum=[],reviewBy=formatDay(i.reviewBy,{weekday:true});reviewBy&&sum.push({k:copy.reviewByLabel,v:reviewBy});let ships=formatDay(active?.nextRun??null,{weekday:true});ships&&sum.push({k:copy.ships,v:ships});let declined=live.some(p=>p.stopReason==="payment_declined"),delivery=[];i.address&&delivery.push({k:copy.shipTo,v:addressLine(i.address),change:{label:copy.change,to:{name:"address",then:{name:"plan"}}}}),i.card&&delivery.push({k:copy.payWith,v:cardLabel(i.card.brand,i.card.last4),alert:declined?copy.declined(i.packageMonth):null,change:{label:copy.change,to:{name:"card",then:{name:"plan"}}}});let month=i.packageMonth??monthOf(active?.nextRun??null);return{sub:null,rows:rows,emptyLine:rows.length===0?copy.repeatsEmpty:null,next:active&&sum.length>0?{sum:sum,link:i.packageMonth?{label:copy.reviewMonthsPackage(i.packageMonth),to:{name:"package"}}:null}:null,delivery:delivery,breakCard:active?{skip:month?{label:copy.skipMonth(month),ask:copy.skipMonthAsk(month),body:copy.skipMonthBody}:null,pause:{label:copy.pausePlan,ask:copy.pausePlanAsk,body:copy.pausePlanBody},busy:i.breakBusy,error:i.breakError,onConfirm:i.onBreak}:null,legal:copy.legal}}var IN_PROGRESS=/* @__PURE__ */new Set(["pending_placement","placement_unknown","placed","accepted","release_sent","release_unknown","released","shipped"]);function statusPill(status,copy){let label=copy.orderStatus[status];if(!label)return null;let tone="plain";return IN_PROGRESS.has(status)?tone="soon":status==="delivered"?tone="clear":(status==="rejected"||status==="needs_support")&&(tone="overdue"),{label:label,tone:tone}}function toOrderRow(o,copy){let placed=formatDay(o.placedAt);return{key:o.orderId,to:{name:"order",orderId:o.orderId},icon:"box",title:o.referenceNumber??copy.tabOrders,meta:[placed?copy.placed(placed):null,formatCents(o.total)].filter(Boolean).join(" · "),pill:statusPill(o.status,copy)}}var STEP_OF={pending_placement:1,placement_unknown:1,placed:1,accepted:2,release_sent:2,release_unknown:2,released:2,shipped:3,delivered:5};function toTrackingView(i){let{order:order,copy:copy}=i,s=order.summary,events=order.shipments.flatMap(sh=>sh.tracking),last=events[events.length-1]??null,deliveryBy=events.map(e=>e.deliveryBy).filter(Boolean).pop()??null,at=STEP_OF[s.status],tracker;if(at===void 0)tracker={kind:"ended",line:copy.orderStatus[s.status]??copy.actionFailed};else{let shippedText=last&&last.carrier&&last.trackingNumber?`${last.carrier} ${last.trackingNumber}`:null,delivered=formatDay(deliveryBy,{weekday:true});tracker={kind:"steps",steps:[{key:"approved",title:copy.stepApproved,when:formatWhen(s.placedAt),text:null},{key:"checking",title:copy.stepChecking,when:null,text:null},{key:"filled",title:copy.stepFilled,when:null,text:null},{key:"shipped",title:copy.stepShipped,when:null,text:shippedText},{key:"delivered",title:copy.stepDelivered,when:null,text:delivered&&s.status!=="delivered"?copy.expected(delivered):null}].map((d,n)=>({...d,state:n<at||at===5?"done":n===at?"now":"next"}))}}let arrive=formatDay(deliveryBy,{weekday:true});return{back:{label:copy.backToCare,to:{name:"orders"}},title:s.referenceNumber??copy.tabOrders,sub:arrive&&s.status!=="delivered"&&at!==void 0?copy.shouldArrive(arrive):null,tracker:tracker,items:order.lines.map(l=>({key:l.lineId,name:l.title,rx:l.requiresRx,meta:i.petName(l.petId),pill:null,...tileFor(l.requiresRx)})),sum:[{k:copy.total,v:formatCents(s.total)}],note:null,track:last?.trackingUrl?{label:last.carrier&&last.trackingNumber?`${last.carrier} ${last.trackingNumber}`:copy.trackPackage,href:last.trackingUrl}:null,actions:i.actions,error:i.error,allOrders:{label:copy.allOrders,to:{name:"orders"}},legal:copy.legalTracking}}var SharedContext=react.createContext(null),ShopSharedProvider=SharedContext.Provider;function useShopShared(){let s=react.useContext(SharedContext);if(!s)throw new EverfurConfigError("not-initialized","shop screens render inside EverfurShop");return s}function packageMonth(pkg){return pkg.phase==="ready"&&pkg.value?monthOf(pkg.value.review.shipsOn):null}function loadable(read,map){return read.phase==="ready"&&read.value!==null?{phase:"ready",value:map(read.value)}:read.phase==="loading"?{phase:"loading"}:{phase:"failed",retry:read.refresh}}function pickCard(cards,id){return!cards||cards.length===0?null:(id?cards.find(c=>c.paymentMethodId===id):void 0)??cards[0]??null}function useOffersById(ids){let{client:client}=useShop(),unique=[...new Set(ids)].sort();return useShopRead(`offers-by-id:${unique.join(",")}`,async()=>{let read=await Promise.all(unique.map(id=>client.offer(id)));return omsOk(new Map(unique.map((id,i)=>[id,read[i].ok?read[i].value:null])))})}function outcomeLine(copy,outcome){return outcome.kind==="confirmed"?null:outcome.kind==="needsPayerAction"?copy.cardStepFailed:outcome.kind==="payerActionFailed"?outcome.message??copy.cardStepFailed:outcome.kind==="payerActionClosed"?copy.cardStepClosed:outcome.error.kind==="refused"&&outcome.error.reasonCode==="price_changed"?copy.priceChanged:refusalLine(copy,outcome.error)}var orderNotices=/* @__PURE__ */new WeakMap;function leaveOrderNotice(client,orderId,line){let notices=orderNotices.get(client);notices||(notices=/* @__PURE__ */new Map,orderNotices.set(client,notices)),line?notices.set(orderId,line):notices.delete(orderId)}function peekOrderNotice(client,orderId){return orderNotices.get(client)?.get(orderId)??null}function dropOrderNotice(client,orderId){orderNotices.get(client)?.delete(orderId)}var CARD_PAGE_NOTICE="\0card";function usePackageScreen(go){let{copy:copy,petName:petName,packageSource:packageSource,payments:payments,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plan=pkg.phase==="ready"?pkg.value?.plan??null:null,cards=usePaymentMethods(),address=useAddress(plan?.destination??null),[removing,setRemoving]=react.useState(null),[error,setError]=react.useState(null),[approving,setApproving]=react.useState(false),[placed,setPlaced]=react.useState(false),remove=useShopAction((keys,p,index)=>packageSource.removeLine(p,index,keys));if(pkg.phase==="ready"&&pkg.value===null)return{tabs:tabs,view:{phase:"failed",retry:pkg.refresh}};let view=loadable(pkg,p=>toPackageView({pkg:p,card:pickCard(cards.value,p.plan.paymentMethodId),address:address.value?.address??null,copy:copy,petName:petName,removing:removing,approving:approving,placed:placed,error:error,onRemove:index=>{setRemoving(index),setError(null),remove.run(p,index).then(res=>{setRemoving(null),res&&res.ok?pkg.refresh():res&&setError(refusalLine(copy,res.error))})},onApprove:()=>{approving||placed||(setApproving(true),setError(null),(async()=>{let outcome=await approveOnce(packageSource,p,payments);setApproving(false);let line=outcomeLine(copy,outcome),orderId=outcome.kind!=="failed"?outcome.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,line),go({name:"order",orderId:orderId})):(setError(line),outcome.kind==="failed"&&outcome.error.kind==="refused"&&pkg.refresh())})())}}));return{tabs:tabs,view:view}}var approvalKeys=/* @__PURE__ */new WeakMap;async function approveOnce(source,p,payments){let keys=approvalKeys.get(p);keys||(keys=new ShopActionKeys,approvalKeys.set(p,keys));let out=await source.approve(p,keys,payments);return(out.kind!=="failed"||out.error.kind==="refused")&&approvalKeys.delete(p),out}function useDebounced(value,ms){let[v,setV]=react.useState(value);return react.useEffect(()=>{let t=setTimeout(()=>setV(value),ms);return()=>clearTimeout(t)},[value,ms]),v}function useShopScreen(initialQuery){let{copy:copy,petName:petName,pets:pets}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),[query,setQuery]=react.useState(initialQuery??""),text=useDebounced(query,250),offers=useOffers({text:text}),rx=usePrescriptions(),prescriptions=rx.value??[],names=pets.map(p=>p.name),month=packageMonth(pkg),shelves;offers.phase==="ready"&&offers.value?shelves={phase:"ready",value:toShelves({offers:offers.value.offers,prescriptions:prescriptions,copy:copy,petName:petName,petNames:names,packageMonth:month,searching:text.trim()!==""})}:offers.phase==="loading"||rx.phase==="loading"?shelves={phase:"loading"}:offers.phase==="unavailable"?shelves={phase:"ready",value:[]}:shelves={phase:"failed",retry:offers.refresh};let count=shelves.phase==="ready"?shelves.value.reduce((n,s)=>n+s.tiles.length,0):1,empty=shelves.phase==="ready"&&count===0?text.trim()?copy.noMatches(text.trim()):copy.nothingHereYet:null;return{tabs:tabs,view:{sub:null,query:query,onQuery:setQuery,filters:[],shelves:shelves,empty:empty,legal:copy.legal}}}function lineFor(offer,quantity,petId,rx){return{offerId:offer.offerId,quantity:rx?.packCount??quantity,...rx?.petId??petId?{petId:rx?.petId??petId}:{},...rx?{rxId:rx.rxId}:{}}}function routeFor(name,line){return{name:name,offerId:line.offerId,quantity:line.quantity,...line.petId?{petId:line.petId}:{},...line.rxId?{rxId:line.rxId}:{}}}function useProductScreen(offerId,petId,go){let{copy:copy,petName:petName,pets:pets,client:client}=useShop(),{config:config,pkg:pkg,bookVisitHref:bookVisitHref}=useShopShared(),offer=useOffer(offerId),rx=usePrescriptions(),[choice,setChoice]=react.useState("monthly"),[quantity,setQuantity]=react.useState(1),[error,setError]=react.useState(null),month=packageMonth(pkg),plans=usePlans(),plan=(pkg.phase==="ready"?pkg.value?.plan??null:null)??plans.value?.plans.find(p=>p.state==="active")??null,addToPlan=useShopAction((keys,p,line)=>client.updatePlan(p.planId,{idempotencyKey:keys.key("add"),lines:[...p.lines.map(l=>({offerId:l.offerId,quantity:l.quantity,...l.petId?{petId:l.petId}:{}})),line]})),submit=(line,monthly)=>{if(setError(null),!monthly)return go(routeFor("buy",line));if(!plan)return go(routeFor("consent",line));addToPlan.run(plan,line).then(res=>{res&&res.ok?(pkg.refresh(),go({name:"package"})):res&&setError(refusalLine(copy,res.error))})};if(offer.phase==="ready"&&offer.value?.requiresRx){let o=offer.value,base={offer:o,copy:copy,petId:petId??null,petName:petName,firstPetName:pets[0]?.name??null,packageMonth:month,error:error,bookVisitHref:bookVisitHref};return rx.phase==="unavailable"?{kind:"rx",view:{phase:"ready",value:toRxProductView({...base,prescriptions:[],busy:false,onSubmit:()=>{}})}}:{kind:"rx",view:loadable(rx,list=>toRxProductView({...base,prescriptions:list,busy:addToPlan.busy,onSubmit:p=>submit(lineFor(o,1,null,p),plan!==null)}))}}let petForChoice=(petId?petName(petId):null)??pets[0]?.name??null;return{kind:"product",view:loadable(offer,o=>toProductView({offer:o,copy:copy,petName:petForChoice,packageMonth:month,plansOn:config.recurringTermsVersion!==null,choice:choice,onChoice:setChoice,quantity:quantity,onQuantity:setQuantity,busy:addToPlan.busy,error:error,onSubmit:()=>submit(lineFor(o,quantity,petId??pets[0]?.petId??null,null),choice==="monthly"&&config.recurringTermsVersion!==null&&petForChoice!==null)}))}}function usePlanScreen(){let{copy:copy,petName:petName,client:client}=useShop(),{tabs:tabs,pkg:pkg}=useShopShared(),plans=usePlans(),cards=usePaymentMethods(),live=(plans.value?.plans??[]).filter(p=>p.state!=="cancelled"),active=live.find(p=>p.state==="active")??live[0]??null,address=useAddress(active?.destination??null),offers=useOffersById(live.flatMap(p=>p.lines.map(l=>l.offerId))),[busyPlan,setBusyPlan]=react.useState(null),[rowError,setRowError]=react.useState(null),[breakError,setBreakError]=react.useState(null),toggle=useShopAction((keys,p,on)=>client.planAction(p.planId,{idempotencyKey:keys.key(on?"resume":"pause"),operation:on?"resume":"pause"})),brk=useShopAction((keys,p,which)=>client.planAction(p.planId,{idempotencyKey:keys.key(which),operation:which})),month=packageMonth(pkg);if(plans.phase==="unavailable")return{tabs:tabs,view:{phase:"failed",retry:plans.refresh}};let view=loadable(plans,()=>toPlanView({plans:live,offers:offers.value??/* @__PURE__ */new Map,copy:copy,petName:petName,card:pickCard(cards.value,active?.paymentMethodId??null),address:address.value?.address??null,reviewBy:pkg.phase==="ready"?pkg.value?.review.approveBy??null:null,packageMonth:month,busyPlan:busyPlan,rowError:rowError,onToggle:(p,on)=>{setBusyPlan(p.planId),setRowError(null),toggle.run(p,on).then(res=>{setBusyPlan(null),toggle.reset(),res&&res.ok?plans.refresh():res&&setRowError({planId:p.planId,line:refusalLine(copy,res.error)})})},breakBusy:brk.busy,breakError:breakError,onBreak:async which=>{if(!active)return false;setBreakError(null);let res=await brk.run(active,which);return res&&res.ok?(brk.reset(),plans.refresh(),pkg.refresh(),true):(res&&setBreakError(refusalLine(copy,res.error)),false)}}));return{tabs:tabs,view:view}}function useOrdersScreen(){let{copy:copy,pets:pets}=useShop(),{tabs:tabs}=useShopShared(),orders=useOrders(),names=pets.map(p=>p.name),rows=loadable(orders,page=>page.orders.map(o=>toOrderRow(o,copy)));return{tabs:tabs,view:{sub:names.length>0?copy.ordersSub(names):null,rows:orders.phase==="unavailable"?{phase:"ready",value:[]}:rows,emptyLine:copy.ordersEmpty,more:null,legal:copy.legal}}}function useTrackingScreen(orderId){let{copy:copy,petName:petName,client:client,payments:payments}=useShop(),order=useOrder(orderId),[error,setError]=react.useState(()=>peekOrderNotice(client,orderId));react.useEffect(()=>dropOrderNotice(client,orderId),[client,orderId]);let cancel=useShopAction(keys=>client.cancelOrder(orderId,{idempotencyKey:keys.key("cancel"),reasonCode:"customer_request"})),pay=useShopAction(async keys=>{let key=keys.key("pay");for(let round=0;round<3;round+=1){let res=await client.payOrder(orderId,{idempotencyKey:key});if(!res.ok)return omsErr(res.error);if(res.value.outcome==="authorized")return omsOk({kind:"confirmed",orderIds:[orderId]});if(!payments||!res.value.payerAction)return omsOk({kind:"needsPayerAction",orderIds:[orderId]});let step=await payments.handleNextAction(res.value.payerAction,{orderId:orderId});if(!step.ok)return omsOk(step.closed?{kind:"payerActionClosed",orderIds:[orderId]}:{kind:"payerActionFailed",orderIds:[orderId],message:step.message});key=keys.next("pay")}return omsOk({kind:"needsPayerAction",orderIds:[orderId]})}),actions=[];return order.value?.canPay&&actions.push({label:copy.payOrder,busyLabel:copy.saving,busy:pay.busy,disabled:pay.busy||cancel.busy,onPress:()=>{setError(null),pay.run().then(res=>{res&&(res.ok?setError(outcomeLine(copy,res.value)):setError(refusalLine(copy,res.error)),order.refresh())})}}),order.value?.canCancel&&actions.push({label:copy.cancelOrder,busyLabel:copy.saving,busy:cancel.busy,disabled:pay.busy||cancel.busy,onPress:()=>{setError(null),cancel.run().then(res=>{res&&!res.ok&&setError(refusalLine(copy,res.error)),order.refresh()})}}),{view:loadable(order,o=>toTrackingView({order:o,copy:copy,petName:petName,actions:actions,error:error}))}}function useAddressStep(then,go){let{copy:copy,client:client}=useShop(),back=then??{name:"package"},save=useShopAction((_keys,input)=>client.addAddress(input));return{back:{label:copy.backToCare,to:back},busy:save.busy,error:save.error?refusalLine(copy,save.error):null,onSave:input=>{save.run(input).then(res=>{res&&res.ok&&go(back)})}}}function useCardStep(then,go,handoff){let{copy:copy,client:client,payments:payments}=useShop(),{config:config}=useShopShared(),back=then??{name:"plan"},[error,setError]=react.useState(()=>peekOrderNotice(client,CARD_PAGE_NOTICE));react.useEffect(()=>dropOrderNotice(client,CARD_PAGE_NOTICE),[client]);let setup=useShopAction(async()=>{if(handoff){let step2=await handoff();return step2.ok?omsOk(true):(setError(step2.closed?copy.cardStepClosed:step2.message??copy.cardStepFailed),omsOk(false))}let s=await client.setupPaymentMethod();if(!s.ok||!payments)return s.ok?omsErr({kind:"invalidRequest"}):omsErr(s.error);let step=await payments.confirmCardSetup(s.value.payerAction);return step.ok?omsOk(true):(setError(step.closed?copy.cardStepClosed:step.message??copy.cardStepFailed),omsOk(false))}),on=handoff?true:payments!==null&&config.stripePublishableKey!==null;return{back:{label:copy.backToCare,to:back},error:error??(setup.error?refusalLine(copy,setup.error):null),start:on?{label:copy.cardStart,busyLabel:copy.saving,busy:setup.busy,disabled:setup.busy,onPress:()=>{setError(null),setup.run().then(res=>{res&&res.ok&&res.value&&go(back)})}}:null}}function useCheckoutBasics(){let addresses=useAddresses(),cards=usePaymentMethods(),address=addresses.value?.find(a=>a.isDefault&&a.isComplete)??addresses.value?.find(a=>a.isComplete)??null,card=pickCard(cards.value,null);return{addresses:addresses,cards:cards,address:address,card:card}}function useBuyStep(route,go){let{copy:copy,client:client,payments:payments,petName:petName}=useShop(),offer=useOffer(route.offerId),{address:address,card:card}=useCheckoutBasics(),line=react.useMemo(()=>({offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}),[route.offerId,route.quantity,route.petId,route.rxId]),quote=useShopRead(address?`quote:${address.ref}:${JSON.stringify(line)}`:null,()=>client.quote({lines:[line],shipTo:address.ref})),[shown,setShown]=react.useState(null),[error,setError]=react.useState(null),[placed,setPlaced]=react.useState(false),buy=useShopAction(async keys=>{let draft=await client.createCheckout({idempotencyKey:keys.key("draft"),lines:[line],shipTo:address.ref});if(!draft.ok)return omsErr(draft.error);if((shown??quote.value?.total??null)!==draft.value.total)return setShown(draft.value.total),omsErr({kind:"refused",status:409,reasonCode:"price_changed",message:null});let out=await confirmWithPayerActions(idempotencyKey=>client.confirmCheckout(draft.value.checkoutId,{idempotencyKey:idempotencyKey,expectedTotal:draft.value.total,paymentMethodId:card.paymentMethodId}),keys,payments);return out.kind==="failed"?omsErr(out.error):omsOk(out)}),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]],q=quote.value,total=shown??q?.total??null;return{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},title:copy.confirmTitle,lines:offer.value?[{key:line.offerId,name:offer.value.title,meta:petName(line.petId),price:offer.value.price!==null?formatCents(offer.value.price*line.quantity):null}]:[],sum:q&&total!==null?[{k:copy.shipping,v:q.shipping===0?copy.free:formatCents(q.shipping)},{k:copy.tax,v:formatCents(q.tax)},{k:copy.total,v:formatCents(total)}]:null,needs:needs,pay:address&&card&&q?{label:copy.confirmPay,busyLabel:copy.saving,busy:buy.busy,disabled:buy.busy||placed,onPress:()=>{placed||(setError(null),buy.run().then(res=>{if(!res)return;let out=res.ok?res.value:{kind:"failed",error:res.error},orderId=out.kind!=="failed"?out.orderIds[0]:void 0;orderId?(setPlaced(true),leaveOrderNotice(client,orderId,outcomeLine(copy,out)),go({name:"order",orderId:orderId})):setError(outcomeLine(copy,out))}))}}:null,note:card?copy.chargedWhenShips(cardLabel(card.brand,card.last4)):null,error:error??(quote.phase==="failed"&"e.error?refusalLine(copy,quote.error):null)}}function useConsentStep(route,go){let{copy:copy,client:client}=useShop(),{config:config,pkg:pkg}=useShopShared(),{address:address,card:card}=useCheckoutBasics(),create=useShopAction(keys=>client.createPlan({idempotencyKey:keys.key("create"),cadenceDays:30,destination:address.ref,paymentMethodId:card.paymentMethodId,consentTermsVersion:config.recurringTermsVersion,lines:[{offerId:route.offerId,quantity:route.quantity,...route.petId?{petId:route.petId}:{},...route.rxId?{rxId:route.rxId}:{}}]})),needs=[...address?[]:[{label:copy.addressNeeded,to:{name:"address",then:route}}],...card?[]:[{label:copy.cardTitle,to:{name:"card",then:route}}]];return{back:{label:copy.backToShop,to:{name:"product",offerId:route.offerId}},terms:config.recurringTermsUrl?{label:copy.consentTermsLink,href:config.recurringTermsUrl}:null,needs:needs,error:create.error?refusalLine(copy,create.error):null,agree:address&&card&&config.recurringTermsVersion?{label:copy.consentAgree,busyLabel:copy.saving,busy:create.busy,disabled:create.busy,onPress:()=>{create.run().then(res=>{res&&res.ok&&(pkg.refresh(),go({name:"plan"}))})}}:null}}var NavContext=react.createContext({go:()=>{},openExternal:()=>{}});function ShopNativeNavProvider({value:value,children:children}){return react.createElement(NavContext.Provider,{value:value},children)}function useShopNativeNav(){return react.useContext(NavContext)}var PHONE_BOX={body:{paddingTop:8,paddingRight:16,paddingLeft:16},pushBody:{paddingRight:16,paddingLeft:16},subtabs:{backgroundColor:"#ffffff"},subtab:{minHeight:44,rowGap:6,columnGap:6},subtabCurrent:{minHeight:44,rowGap:6,columnGap:6},titleBlock:{paddingTop:4,rowGap:2,columnGap:2},screenTitle:{},screenMeta:{},stack:{marginTop:12,rowGap:12,columnGap:12},card:{paddingTop:16,paddingRight:16,paddingBottom:16,paddingLeft:16,borderWidth:1,borderColor:"#e4e4e4",borderRadius:20,backgroundColor:"#ffffff"},cardHead:{marginBottom:12,rowGap:8,columnGap:16},cardTitle:{marginBottom:12},cardTitleInHead:{},cardLink:{},cardLinkAfterNote:{marginTop:12,marginBottom:2.34},forLabel:{marginTop:4,marginBottom:8},forLabelNext:{marginTop:16,marginBottom:8},itemsLiFirst:{paddingBottom:16,rowGap:12,columnGap:12},itemsLiMid:{paddingTop:16,paddingBottom:16,borderTopWidth:1,borderTopColor:"#e4e4e4",rowGap:12,columnGap:12},itemsLiLast:{paddingTop:16,borderTopWidth:1,borderTopColor:"#e4e4e4",rowGap:12,columnGap:12},thumb:{borderRadius:10,backgroundColor:"#eaeef6",width:48,height:48},thumbIcon:{width:22,height:22},thumbPink:{borderRadius:10,backgroundColor:"#ffeae8"},thumbYellow:{borderRadius:10,backgroundColor:"#fcf0d6"},thumbSage:{borderRadius:10,backgroundColor:"#e6ece8"},itemsName:{rowGap:4,columnGap:8},itemsMeta:{marginTop:2},itemsActs:{marginTop:6,rowGap:16,columnGap:16},itemsActLink:{},itemsActButton:{},itemsEnd:{rowGap:4,columnGap:4},itemsPrice:{},pill:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#eaeef6",minHeight:24},pillSoon:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#ffffff",minHeight:24},btnRow:{paddingRight:14,paddingLeft:14,borderWidth:1,borderColor:"#10462e",borderRadius:999,minHeight:36,rowGap:8,columnGap:8},btnRowIcon:{width:17,height:17},btnRowLabel:{},sumTotal:{paddingRight:24,paddingLeft:24,borderWidth:1,borderColor:"#e4e4e4",borderRadius:20,backgroundColor:"#ffffff"},sumRowFirst:{paddingTop:14,paddingBottom:14,rowGap:2,columnGap:16},sumRowLast:{paddingTop:14,paddingBottom:14,rowGap:2,columnGap:16},sumDt:{},sumDd:{},sumDdTotal:{},noteAfterSum:{marginTop:12},rowsLiFirst:{paddingBottom:16,rowGap:8,columnGap:16},rowsLiNext:{paddingTop:16,borderTopWidth:1,borderTopColor:"#e4e4e4",rowGap:8,columnGap:16},rowsK:{},rowsV:{marginTop:2},rowsMeta:{marginTop:2},legal:{marginTop:32},legalText:{},traybar:{paddingTop:12,paddingRight:16,paddingBottom:8,paddingLeft:16,backgroundColor:"#ffffff",rowGap:6,columnGap:6},btnInk:{paddingRight:24,paddingLeft:24,borderWidth:1,borderColor:"#10462e",borderRadius:999,backgroundColor:"#10462e",minHeight:50,rowGap:8,columnGap:8},traybarFine:{},input:{paddingRight:16,paddingLeft:16,borderWidth:1,borderColor:"#e4e4e4",borderRadius:10,backgroundColor:"#ffffff",minHeight:52,rowGap:10,columnGap:10},inputIcon:{width:20,height:20},inputText:{paddingTop:1,paddingRight:2,paddingBottom:1,paddingLeft:2},inputPlaceholder:{},filters:{paddingBottom:2,rowGap:8,columnGap:8},filter:{paddingRight:14,paddingLeft:14,borderWidth:1,borderColor:"#e4e4e4",borderRadius:999,minHeight:36},filterCurrent:{paddingRight:14,paddingLeft:14,borderWidth:1,borderColor:"#10462e",borderRadius:999,backgroundColor:"#ffeae8",minHeight:36},sectionHead:{marginTop:8,rowGap:8,columnGap:12},prods:{rowGap:16,columnGap:12},prod:{rowGap:12,columnGap:12},prodImg:{borderRadius:10,backgroundColor:"#ffeae8",aspectRatio:1},prodIcon:{width:36,height:36},prodTags:{rowGap:6,columnGap:6,position:"absolute",top:8,left:8},prodBody:{rowGap:4,columnGap:4},prodName:{},prodMeta:{},prodPrice:{marginTop:4,rowGap:8,columnGap:8},pillClear:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#ffffff",minHeight:24},pillPlain:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#ffffff",minHeight:24},pillOverdue:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#ffffff",minHeight:24},hero:{borderRadius:20,backgroundColor:"#fcf0d6",aspectRatio:1.6},heroIcon:{width:56,height:56},source:{rowGap:8,columnGap:8},sourceIcon:{marginTop:2,width:16,height:16},sourceBold:{},sourceLink:{},choices:{rowGap:8,columnGap:8},choiceCurrent:{paddingTop:14,paddingRight:16,paddingBottom:14,paddingLeft:16,borderWidth:1,borderColor:"#10462e",borderRadius:10,backgroundColor:"#ffeae8",rowGap:12,columnGap:12},choice:{paddingTop:14,paddingRight:16,paddingBottom:14,paddingLeft:16,borderWidth:1,borderColor:"#e4e4e4",borderRadius:10,backgroundColor:"#ffffff",rowGap:12,columnGap:12},radioOn:{borderWidth:6,borderColor:"#10462e",borderRadius:10,backgroundColor:"#ffffff",width:20,height:20},radioOff:{borderWidth:1,borderColor:"#819d90",borderRadius:10,backgroundColor:"#ffffff",width:20,height:20},choiceText:{},choiceTitle:{},choiceMeta:{marginTop:2},facts:{marginTop:12,rowGap:8,columnGap:8},factsLi:{paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:12,borderRadius:10,backgroundColor:"#e6ece8",rowGap:4,columnGap:4},factsLiHer:{paddingTop:12,paddingRight:12,paddingBottom:12,paddingLeft:12,borderRadius:10,backgroundColor:"#fcf0d6",rowGap:4,columnGap:4},factsK:{},factsN:{},factsUnit:{},noteAfterFacts:{marginTop:12},cardLead:{marginBottom:12},person:{rowGap:12,columnGap:16},avatar:{borderRadius:18,backgroundColor:"#ffffff",width:36,height:36},personName:{},personMeta:{},sourceInCard:{marginTop:12,rowGap:8,columnGap:8},sourceInCardIcon:{marginTop:2,width:16,height:16},noteAfterSource:{marginTop:8},rxLead:{marginBottom:12},btnOutlineSm:{marginTop:12,paddingRight:16,paddingLeft:16,borderWidth:1,borderColor:"#10462e",borderRadius:999,minHeight:46,rowGap:8,columnGap:8},btnOutlineSmIcon:{width:20,height:20},noteStandalone:{},noteLink:{},sumPlain:{paddingRight:24,paddingLeft:24,borderWidth:1,borderColor:"#e4e4e4",borderRadius:20,backgroundColor:"#ffffff"},sumPlainRowFirst:{paddingTop:14,paddingBottom:14,rowGap:2,columnGap:16},sumPlainRowLast:{paddingTop:14,paddingBottom:14,rowGap:2,columnGap:16},sumPlainDd:{},planRowsLiFirst:{paddingTop:12,paddingBottom:12,rowGap:8,columnGap:16},planRowsLiNext:{paddingTop:12,paddingBottom:12,borderTopWidth:1,borderTopColor:"#e4e4e4",rowGap:8,columnGap:16},switch:{width:48,height:28},switchTrack:{borderRadius:999,backgroundColor:"#10462e",width:48,height:28},switchKnob:{borderRadius:11,backgroundColor:"#ffffff",position:"absolute",top:3,left:3,transform:[{translateX:20}],width:22,height:22},switchTrackOff:{borderRadius:999,backgroundColor:"#d0d6d3",width:48,height:28},switchKnobOff:{borderRadius:11,backgroundColor:"#ffffff",position:"absolute",top:3,left:3,width:22,height:22},breaks:{marginTop:12,rowGap:12,columnGap:24},btnSm:{paddingRight:16,paddingLeft:16,borderWidth:1,borderColor:"#10462e",borderRadius:999,minHeight:46,rowGap:8,columnGap:8},linkDanger:{},sheet:{borderTopLeftRadius:28,borderTopRightRadius:28,backgroundColor:"#ffffff"},sheetBackdrop:{backgroundColor:"rgba(0, 0, 0, 0.32)",position:"absolute"},sheetGrab:{height:20},sheetGrabBar:{borderRadius:3,backgroundColor:"#c9c9c9",width:36,height:5},sheetHead:{paddingTop:4,paddingRight:16,paddingBottom:12,paddingLeft:16,rowGap:12,columnGap:12},sheetClose:{paddingTop:1,paddingRight:6,paddingBottom:1,paddingLeft:6,borderRadius:18,backgroundColor:"#e6ece8",width:36,height:36},sheetCloseIcon:{width:20,height:20},sheetBody:{paddingRight:16,paddingBottom:24,paddingLeft:16,rowGap:12,columnGap:12},sheetText:{},sheetActions:{marginTop:16,rowGap:8,columnGap:8},btnDanger:{paddingRight:16,paddingLeft:16,borderWidth:1,borderColor:"#c03410",borderRadius:999,backgroundColor:"#ffffff",minHeight:46,rowGap:8,columnGap:8},btnOutline:{paddingRight:24,paddingLeft:24,borderWidth:1,borderColor:"#10462e",borderRadius:999,minHeight:52,rowGap:8,columnGap:8},rec:{marginRight:-8,marginLeft:-8,rowGap:4,columnGap:4},recRow:{paddingTop:10,paddingRight:8,paddingBottom:10,paddingLeft:8,borderRadius:10,rowGap:12,columnGap:12},recIcon:{width:20,height:20},recText:{rowGap:2,columnGap:2},recTitle:{},recMeta:{},recEnd:{rowGap:8,columnGap:8},trackerLi:{paddingBottom:24,rowGap:16,columnGap:16},trackerLiLast:{rowGap:16,columnGap:16},trackerLineDone:{borderRadius:1,backgroundColor:"#10462e",position:"absolute",top:30,left:13,bottom:2,width:2},trackerLine:{borderRadius:1,backgroundColor:"#e4e4e4",position:"absolute",top:30,left:13,bottom:2,width:2},dotDone:{borderWidth:2,borderColor:"#10462e",borderRadius:14,backgroundColor:"#10462e",width:28,height:28},dotDoneIcon:{width:16,height:16},dotNow:{borderWidth:2,borderColor:"#10462e",borderRadius:14,backgroundColor:"#ffffff",width:28,height:28},dotNowCore:{borderRadius:5,backgroundColor:"#07c168",width:10,height:10},dotNext:{borderWidth:2,borderColor:"#e4e4e4",borderRadius:14,backgroundColor:"#ffffff",width:28,height:28},trackerTitle:{paddingTop:3,rowGap:4,columnGap:8},trackerTitleNext:{paddingTop:3,rowGap:4,columnGap:8},trackerWhen:{marginTop:2},trackerText:{marginTop:2},pillStable:{paddingRight:10,paddingLeft:10,borderRadius:999,backgroundColor:"#dcf6ea",minHeight:24},trackItemsEnd:{rowGap:4,columnGap:4},trackItemsLiFirst:{paddingBottom:16,rowGap:12,columnGap:12},trackItemsLiLast:{paddingTop:16,borderTopWidth:1,borderTopColor:"#e4e4e4",rowGap:12,columnGap:12},noteAfterTotal:{marginTop:8},rowLink:{paddingTop:16,paddingRight:24,paddingBottom:16,paddingLeft:24,borderWidth:1,borderColor:"#e4e4e4",borderRadius:20,backgroundColor:"#ffffff",rowGap:12,columnGap:12},rowLinkIcon:{width:22,height:22},rowLinkChevron:{width:20,height:20},ghost:{marginTop:16,rowGap:10,columnGap:10},ghostBar:{borderRadius:999,backgroundColor:"#e6ece8",height:12},field:{rowGap:6,columnGap:6},fieldLabel:{},fieldInput:{paddingRight:16,paddingLeft:16,borderWidth:1,borderColor:"#e4e4e4",borderRadius:10,backgroundColor:"#ffffff",minHeight:52,rowGap:10,columnGap:10},fieldInputText:{paddingTop:1,paddingRight:2,paddingBottom:1,paddingLeft:2}},PHONE_TEXT={body:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},pushBody:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},subtabs:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},subtab:{color:"#6b6b6b",fontSize:15,fontWeight:"500",lineHeight:23.25},subtabCurrent:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:23.25},titleBlock:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},screenTitle:{color:"#10462e",fontSize:22,fontWeight:"500",lineHeight:26.390625,letterSpacing:-.33},screenMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.84375},stack:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},card:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},cardHead:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},cardTitle:{color:"#10462e",fontSize:18,fontWeight:"700",lineHeight:22.5,letterSpacing:-.36},cardTitleInHead:{color:"#10462e",fontSize:18,fontWeight:"700",lineHeight:22.5,letterSpacing:-.36},cardLink:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21},cardLinkAfterNote:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21},forLabel:{color:"#6b6b6b",fontSize:12,fontWeight:"700",lineHeight:16.796875,letterSpacing:.72,textTransform:"uppercase"},forLabelNext:{color:"#6b6b6b",fontSize:12,fontWeight:"700",lineHeight:16.796875,letterSpacing:.72,textTransform:"uppercase"},itemsLiFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},itemsLiMid:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},itemsLiLast:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},thumb:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},thumbIcon:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},thumbPink:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},thumbYellow:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},thumbSage:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},itemsName:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},itemsMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.84375},itemsActs:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},itemsActLink:{color:"#10462e",fontSize:13,fontWeight:"700",lineHeight:20.140625,textDecorationLine:"underline"},itemsActButton:{color:"#10462e",fontSize:13,fontWeight:"700",lineHeight:20.140625,textDecorationLine:"underline",textAlign:"center"},itemsEnd:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375,fontVariant:["tabular-nums"]},itemsPrice:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:26.34375,fontVariant:["tabular-nums"]},pill:{color:"#10462e",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},pillSoon:{color:"#10462e",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},btnRow:{color:"#10462e",fontSize:14,fontWeight:"400",lineHeight:14,textAlign:"center",fontVariant:["tabular-nums"]},btnRowIcon:{color:"#10462e",fontSize:14,fontWeight:"400",lineHeight:14,textAlign:"center",fontVariant:["tabular-nums"]},btnRowLabel:{color:"#10462e",fontSize:14,fontWeight:"400",lineHeight:14,textAlign:"center",fontVariant:["tabular-nums"]},sumTotal:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumRowFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumRowLast:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumDt:{color:"#6b6b6b",fontSize:15,fontWeight:"400",lineHeight:23.25},sumDd:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21,textAlign:"right"},sumDdTotal:{color:"#10462e",fontSize:20,fontWeight:"700",lineHeight:28,textAlign:"right"},noteAfterSum:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},rowsLiFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},rowsLiNext:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},rowsK:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},rowsV:{color:"#000000",fontSize:15,fontWeight:"400",lineHeight:21.75},rowsMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.84375},legal:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:20.796875,textAlign:"center"},legalText:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:20.796875,textAlign:"center"},traybar:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},btnInk:{color:"#ffffff",fontSize:17,fontWeight:"700",lineHeight:17,textAlign:"center"},traybarFine:{color:"#6b6b6b",fontSize:12,fontWeight:"400",lineHeight:15.59375,textAlign:"center"},input:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},inputIcon:{color:"#6b6b6b",fontSize:17,fontWeight:"400",lineHeight:26.34375},inputText:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},inputPlaceholder:{color:"#757575",fontSize:17,fontWeight:"400"},filters:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},filter:{color:"#10462e",fontSize:15,fontWeight:"400",lineHeight:18},filterCurrent:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:18},sectionHead:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},prods:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},prod:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},prodImg:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},prodIcon:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},prodTags:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},prodBody:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},prodName:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:19.5},prodMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.84375},prodPrice:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:23.25,fontVariant:["tabular-nums"]},pillClear:{color:"#07c168",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},pillPlain:{color:"#10462e",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},pillOverdue:{color:"#c03410",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},hero:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},heroIcon:{color:"#10462e",fontSize:17,fontWeight:"400",lineHeight:26.34375},source:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},sourceIcon:{color:"#819d90",fontSize:13,fontWeight:"400",lineHeight:19.5},sourceBold:{color:"#6b6b6b",fontSize:13,fontWeight:"700",lineHeight:19.5},sourceLink:{color:"#10462e",fontSize:13,fontWeight:"700",lineHeight:19.5,textDecorationLine:"underline"},choices:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},choiceCurrent:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},choice:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},radioOn:{color:"#000000",fontSize:13.333,fontWeight:"400"},radioOff:{color:"#000000",fontSize:13.333,fontWeight:"400"},choiceText:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},choiceTitle:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},choiceMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.1875},facts:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},factsLi:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},factsLiHer:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},factsK:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.1875},factsN:{color:"#10462e",fontSize:20,fontWeight:"700",lineHeight:22,letterSpacing:-.4,fontVariant:["tabular-nums"]},factsUnit:{color:"#6b6b6b",fontSize:13,fontWeight:"500",lineHeight:14.296875,letterSpacing:-.4,fontVariant:["tabular-nums"]},noteAfterFacts:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},cardLead:{color:"#000000",fontSize:15,fontWeight:"400",lineHeight:22.5},person:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},avatar:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},personName:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},personMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.84375},sourceInCard:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},sourceInCardIcon:{color:"#819d90",fontSize:13,fontWeight:"400",lineHeight:19.5},noteAfterSource:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},rxLead:{color:"#000000",fontSize:15,fontWeight:"400",lineHeight:22.5},btnOutlineSm:{color:"#10462e",fontSize:15,fontWeight:"400",lineHeight:15,textAlign:"center"},btnOutlineSmIcon:{color:"#10462e",fontSize:15,fontWeight:"400",lineHeight:15,textAlign:"center"},noteStandalone:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},noteLink:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21},sumPlain:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumPlainRowFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumPlainRowLast:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sumPlainDd:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21,textAlign:"right"},planRowsLiFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},planRowsLiNext:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},switch:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},switchTrack:{color:"#000000",fontSize:13.333,fontWeight:"400"},switchKnob:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},switchTrackOff:{color:"#000000",fontSize:13.333,fontWeight:"400"},switchKnobOff:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},breaks:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},btnSm:{color:"#10462e",fontSize:15,fontWeight:"400",lineHeight:15,textAlign:"center"},linkDanger:{color:"#c03410",fontSize:15,fontWeight:"700",lineHeight:23.25,textDecorationLine:"underline",textAlign:"center"},sheet:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetBackdrop:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetGrab:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetGrabBar:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetHead:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetClose:{color:"#10462e",fontSize:13.333,fontWeight:"400",textAlign:"center"},sheetCloseIcon:{color:"#10462e",fontSize:13.333,fontWeight:"400",textAlign:"center"},sheetBody:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},sheetText:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:25.5},sheetActions:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},btnDanger:{color:"#c03410",fontSize:15,fontWeight:"700",lineHeight:23.25,textAlign:"center"},btnOutline:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:17,textAlign:"center"},rec:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},recRow:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},recIcon:{color:"#6b6b6b",fontSize:17,fontWeight:"400",lineHeight:26.34375},recText:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},recTitle:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},recMeta:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.1875},recEnd:{color:"#6b6b6b",fontSize:15,fontWeight:"400",lineHeight:23.25},trackerLi:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},trackerLiLast:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},trackerLineDone:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},trackerLine:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},dotDone:{color:"#ffffff",fontSize:17,fontWeight:"400",lineHeight:26.34375},dotDoneIcon:{color:"#ffffff",fontSize:17,fontWeight:"400",lineHeight:26.34375},dotNow:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},dotNowCore:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},dotNext:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},trackerTitle:{color:"#10462e",fontSize:17,fontWeight:"700",lineHeight:22.09375},trackerTitleNext:{color:"#6b6b6b",fontSize:17,fontWeight:"700",lineHeight:22.09375},trackerWhen:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:18.1875},trackerText:{color:"#000000",fontSize:15,fontWeight:"400",lineHeight:22.5},pillStable:{color:"#10462e",fontSize:12,fontWeight:"700",lineHeight:12,letterSpacing:.72,textTransform:"uppercase"},trackItemsEnd:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375,fontVariant:["tabular-nums"]},trackItemsLiFirst:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},trackItemsLiLast:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},noteAfterTotal:{color:"#6b6b6b",fontSize:13,fontWeight:"400",lineHeight:19.5},rowLink:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:20.25},rowLinkIcon:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:20.25},rowLinkChevron:{color:"#819d90",fontSize:15,fontWeight:"700",lineHeight:20.25},ghost:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},ghostBar:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},field:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},fieldLabel:{color:"#10462e",fontSize:15,fontWeight:"700",lineHeight:21},fieldInput:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375},fieldInputText:{color:"#000000",fontSize:17,fontWeight:"400",lineHeight:26.34375}},PHONE_DECOR={body:{font:"sans"},pushBody:{font:"sans"},subtabs:{font:"sans",lineBottom:{width:1,color:"#e4e4e4"}},subtab:{font:"sans"},subtabCurrent:{font:"sans",insetBottom:{width:3,color:"#07c168"}},titleBlock:{font:"sans"},screenTitle:{font:"sans",wrap:"balance"},screenMeta:{font:"mono",wrap:"pretty"},stack:{font:"sans"},card:{font:"sans"},cardHead:{font:"sans"},cardTitle:{font:"sans"},cardTitleInHead:{font:"sans"},cardLink:{font:"sans"},cardLinkAfterNote:{font:"sans"},forLabel:{font:"mono"},forLabelNext:{font:"mono"},itemsLiFirst:{font:"sans"},itemsLiMid:{font:"sans"},itemsLiLast:{font:"sans"},thumb:{font:"sans"},thumbIcon:{font:"sans"},thumbPink:{font:"sans"},thumbYellow:{font:"sans"},thumbSage:{font:"sans"},itemsName:{font:"sans"},itemsMeta:{font:"sans"},itemsActs:{font:"sans"},itemsActLink:{font:"sans",underlineOffset:3},itemsActButton:{font:"sans",underlineOffset:3},itemsEnd:{font:"sans"},itemsPrice:{font:"sans"},pill:{font:"mono"},pillSoon:{font:"mono",ring:{width:1.25,color:"#f6d892"}},btnRow:{font:"sans"},btnRowIcon:{font:"sans"},btnRowLabel:{font:"sans"},sumTotal:{font:"sans"},sumRowFirst:{font:"sans"},sumRowLast:{font:"sans"},sumDt:{font:"sans"},sumDd:{font:"sans"},sumDdTotal:{font:"sans"},noteAfterSum:{font:"sans"},rowsLiFirst:{font:"sans"},rowsLiNext:{font:"sans"},rowsK:{font:"sans"},rowsV:{font:"sans"},rowsMeta:{font:"sans"},legal:{font:"sans"},legalText:{font:"sans"},traybar:{font:"sans",lineTop:{width:1,color:"#e4e4e4"}},btnInk:{font:"sans"},traybarFine:{font:"sans"},input:{font:"sans"},inputIcon:{font:"sans"},inputText:{font:"sans"},inputPlaceholder:{font:"sans"},filters:{font:"sans"},filter:{font:"sans"},filterCurrent:{font:"sans"},sectionHead:{font:"sans"},prods:{font:"sans"},prod:{font:"sans"},prodImg:{font:"sans"},prodIcon:{font:"sans"},prodTags:{font:"sans"},prodBody:{font:"sans"},prodName:{font:"sans"},prodMeta:{font:"sans"},prodPrice:{font:"sans"},pillClear:{font:"mono",ring:{width:1.5,color:"#07c168"}},pillPlain:{font:"mono",ring:{width:1.5,color:"rgba(16, 70, 46, 0.2)"}},pillOverdue:{font:"mono",ring:{width:1.25,color:"#c03410"}},hero:{font:"sans"},heroIcon:{font:"sans"},source:{font:"sans"},sourceIcon:{font:"sans"},sourceBold:{font:"sans"},sourceLink:{font:"sans",underlineOffset:3},choices:{font:"sans"},choiceCurrent:{font:"sans"},choice:{font:"sans"},radioOn:{font:"sans"},radioOff:{font:"sans"},choiceText:{font:"sans"},choiceTitle:{font:"sans"},choiceMeta:{font:"sans"},facts:{font:"sans"},factsLi:{font:"sans"},factsLiHer:{font:"sans"},factsK:{font:"sans"},factsN:{font:"sans"},factsUnit:{font:"sans"},noteAfterFacts:{font:"sans"},cardLead:{font:"sans"},person:{font:"sans"},avatar:{font:"sans",ring:{width:1,color:"#e4e4e4"}},personName:{font:"sans"},personMeta:{font:"sans"},sourceInCard:{font:"sans"},sourceInCardIcon:{font:"sans"},noteAfterSource:{font:"sans"},rxLead:{font:"sans"},btnOutlineSm:{font:"sans"},btnOutlineSmIcon:{font:"sans"},noteStandalone:{font:"sans"},noteLink:{font:"sans"},sumPlain:{font:"sans"},sumPlainRowFirst:{font:"sans"},sumPlainRowLast:{font:"sans"},sumPlainDd:{font:"sans"},planRowsLiFirst:{font:"sans"},planRowsLiNext:{font:"sans"},switch:{font:"sans"},switchTrack:{font:"sans"},switchKnob:{font:"sans",drop:{x:0,y:1,blur:2,spread:0,color:"rgba(16, 70, 46, 0.06)"}},switchTrackOff:{font:"sans"},switchKnobOff:{font:"sans",drop:{x:0,y:1,blur:2,spread:0,color:"rgba(16, 70, 46, 0.06)"}},breaks:{font:"sans"},btnSm:{font:"sans"},linkDanger:{font:"sans",underlineOffset:3},sheet:{font:"sans"},sheetBackdrop:{font:"sans"},sheetGrab:{font:"sans"},sheetGrabBar:{font:"sans"},sheetHead:{font:"sans"},sheetClose:{font:"sans"},sheetCloseIcon:{font:"sans"},sheetBody:{font:"sans"},sheetText:{font:"sans"},sheetActions:{font:"sans"},btnDanger:{font:"sans"},btnOutline:{font:"sans"},rec:{font:"sans"},recRow:{font:"sans"},recIcon:{font:"sans"},recText:{font:"sans"},recTitle:{font:"sans"},recMeta:{font:"sans"},recEnd:{font:"sans"},trackerLi:{font:"sans"},trackerLiLast:{font:"sans"},trackerLineDone:{font:"sans"},trackerLine:{font:"sans"},dotDone:{font:"sans"},dotDoneIcon:{font:"sans"},dotNow:{font:"sans"},dotNowCore:{font:"sans"},dotNext:{font:"sans"},trackerTitle:{font:"sans"},trackerTitleNext:{font:"sans"},trackerWhen:{font:"sans"},trackerText:{font:"sans"},pillStable:{font:"mono"},trackItemsEnd:{font:"sans"},trackItemsLiFirst:{font:"sans"},trackItemsLiLast:{font:"sans"},noteAfterTotal:{font:"sans"},rowLink:{font:"sans"},rowLinkIcon:{font:"sans"},rowLinkChevron:{font:"sans"},ghost:{font:"sans"},ghostBar:{font:"sans"},field:{font:"sans"},fieldLabel:{font:"sans"},fieldInput:{font:"sans"},fieldInputText:{font:"sans"}},PHONE_ICONS={shield:{size:56,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAACoCAQAAADeQm0/A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ntKapMH3OTXNosWONY5TrWNpF5yopeUTaC8mtztJMVYYZqbvO6zdnKus+2uGHOdrlMZBcrvfFP1UowtHnGzmTb4RDenONdxQsVY42LXK7NAJexiuqMU6z13uMkGk4z3V4r1qLMsU3aBSjnfVL1Uxxrfdq2KCFTOIFONU3n3+oY3VUigsv7azfZVOYud5wkVFKi00ERX2kH5rXa5n9qsogLVsL2rTJZRPltM989WqbhAtQz1PV+Tlb4tZrnMIlURqKZdXeo86brL5V5QNYFq29klzrGN0m12j3+xRFUFakF/k002SPE+cIu8ZaouUCu6OU2zv5XcIm1us05NCNSWYS40Vg/xfKxDm4fUkEDt2d7XTHCIwhab7jZvqDGBWrWHc403yGe9627T/VZNCtS2k41zgt5Ya7lXLPS4BzU0NDQ0NDQ0NNS7/wHT5oCZ4IWwBgAAAABJRU5ErkJggg=="},pill:{size:56,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAACoCAQAAADeQm0/AAALwUlEQVR4Ae3BDbBldUEA8N87ZzcGkHVwc4FizSBD01EhHB0D00A5IggNCGUl2UzloM85Z/E6V8WMkm7adc/BeaM2ZplSaqTIt5RYjFIHlbDxg3RSRiGWXUA5kgOLsds0TVP3vXfu+d/37se52/v9bNiwYcOGDRs2bAix4EB2vGMd4QhH2OaJjnKEQ/2b3Xbb7V677XaXzxmrBQei2Aud7SzbNXvIja5xre8aiwUHlkO81Nle5nCj2ad0jWt81TotOHAcaoc32GI9bnWRW6zDggPDJr/trY4wDtd6ozus0YL5t+CX/L5jjc8+l7vYXdZgwbw7Tc/xxm+v97jUA0a0YJ7F3u/VJud+iduMJDa/tviUs03SIV7lDncYQWxebfcPTjBpm5znEbcIFptPz/FZR5uGBac6xnX2CRKbR69wrcNMz7O8yCfsFSA2f7r+WGy6nuRMl9urUWzedPXMwjbP82H7NVgwX97i7UbzJTf6jt12222379vuCEc6wpFOkhhNIdNgwTzp6gn17z7tOtfYrd4hTnGG0x0t1K+53FAL5kdXT5i9LvN7fiDM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prjlG2OSSf6bLaNaqVT5k17jBI3M3WiciIW+0fnjVA1I0qLPaow4ozxAKzpcW1uM4vxKQl7bVWqayoEpeZ6bDfi5suq12jWnHzveAyKXGvmmqLhLRc73naThc7Q9QnTDbN2xqEpstq16hWaIJfull/cQ1mut8BOTLye8HLbveAgaLKrFdvrt26NsLjrpPUbKElWuWV1pUPbLbKGcYKRGXNMcJWLZguq12jWpyqyk+MEddmhal+rU0X0rpz2M+9ZLTzRKWMM1fadl+X1a5RrWnWukaJuHpTrNaiG4FCXKvGSEl/8R8XabddqwmSGlSq06NAob7pQQMUrtkjFitIoHBnWmSGlJ61WanKAQUKFGeM5SboXr15dilCoHjXqjFSfg0q1SlSoDf6uUOVgeKaLbREq6IFeutM95mnn3bvW+5RTXolcDKGKnMe3vGGAz520v4HN6Zvz27hkx4AAAAASUVORK5CYII="},bag:{size:22,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAQAAABJXchjAAAC/UlEQVR4Ae3BXWiVZQAA4Od792m0UJhSQy+GdZHrSBDLrF0kDbuwELstUgmDfjToIgw0MRW7kSAQEiJJbwJBjcDALgx/yDCK/F8QFKbEmmKazZuQFqLf+c62c7b3bGeH78LncdcdidFN86ipJuZfpw0YRWI0r9qhMVbaqaYWtfXYK9EYSx11Xg1BLbPslWiUxF6z1BBUF+wxQyPNsEdQVYvqNlqu0TokDqsiVc0iG+QO22T8Nlkos8FR3xghMVK7c2bKXDFPv/Frd85MmSvm6TdMi+GCr82VGbTEWRNxww9WSNzWqtsug4ZoMdxmy+Q+8JmJOm+KhTIdgkOGCIbq8Z7cMe9rhA2Oya3XY4hEpXY/a5O57hVXNUabXabLXPWIfmWJSpfcrzkue0BZi9yHntUs92l10B1BrkszzVcW5P7STFeVBbmzmumsslR1PSbHIVWkqjusiYICCAogKIAgXqdOsTp1ipaK0+GAEnotdtHoOhxQQq/FLooQxFmr5JaSdcayVsktJetECeI8KFMylpLMHFGCONdk5hvLEzLXRAni9Mu0mmM0D7lXpk+UIM4puceMpkvupChBnK/k1kvVMsVauQOiBHEuOSfzuI/Usk2XzCmXRQlibZN7y1ZTDXePrd6Q2yZSEOtTvXJrnPakSvP1WiN30k6RUrEGvei4Vpm5jut1xLemesrTSird8LJBkVLxzlhun0olJW+qZple0YJ6fGG1QWP5zypfqkOqPtv9Yp/partuqSPqkqrXQQ/bbKXUSDftsFG/OqXq1+91W71kiQUStw363n67/WYcUuPzqy22SM3Wjj/1uWncUhNx0wUXTFhQAEEBBAUQFEBQAEEBBAUQFEBQAEEBBAUQFECQ65NrMxna5PqUBbkTcs+ZDM/L/aQslTsj97kFDhrQONMs8rbcGWWJSp94TXNst1pZUOkdf2iG372rQlBpwHLNsMINFVoMdd5u3WabPD96xglDJKpZ5QXdpmmsf3xnv4+NkKity3SN87cT7hrD/w1CmKiWHePxAAAAAElFTkSuQmCC"},plus:{size:17,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAQAAACQqPihAAAAz0lEQVR4Ae3BIVLDUBiF0S+XDrZLqE3dYwcgqzAVkSyARXQtVSBRlbADcLwtICur2slE8ZKKfzK96p1DVVVhd0Qltpz4I6Qh5pFPek98ESBiXhh0hIiYM4N7QoSFsBAWwkJYCAthISyEhbAQFgvGWjYsmZYYPLBj2pEDmUJDqeWXudZk/hGljvk6CqL0xlxn9hQaxlo2LJn2TKL3wwfTjhzIFBaMZTLXrEj0vtkRICyEhbAQFsJCWAgLYSEshIWwEBYi5p3BnhtLvJKoqurmLoEZGakNbs0TAAAAAElFTkSuQmCC"},search:{size:20,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAQAAACQ9RH5AAAD2UlEQVR4Ae3Ba2hVdQAA8N85N4uVbbdNp1ExI3siZBaVICwqTPOxJkX0dFAQRkEfioqooIIeBNH7TU8xorqFKT0QsQ/21KQoKkt3Mc3RXG5mq0zrw/HfvXeeM+92WV/y97PPPiMlUr16c03W4giHO8xGG/yo0ypL9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iLvEG/aLTayis5QFFzkALvFRlqnVkWJRf6wW87I6/WGc4z1jfm2+Y+NcqL97PO/8g+Ihe5zzyrCeQAAAABJRU5ErkJggg=="},check:{size:16,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABVUlEQVR4Ae3Bu20UQQAA0Lde13AF0AQSLZglQISklphxAUAdyDOSJXIyMlIaOG0CLTAShBTgI1jGd+fznu+XgPY9k8nkP9A4pdfeWXjrizut0wk+mpl55oOFv86cSpAMGivOnUZ0rXrv1p0zpxBcq6JPVjSOFyRVlK1pHCtIqii7p3GcIKmibEPjGEFSRdkDGocLkirKHtQ4VJBUUTaicZggqaJsVGvVhc+C377ZLkqqKNuitXTuqydmXip644KkirKtzqxaGNy4NCZIqih7RGvpVvHKoPPT3KYoqa5kj2qt+q7oDJ4reuuCpIqyHbTW9YrOoFP0loKkirKdtO7rFZ1Bp+gNgqSKsh21NvWKzqBT9AiSKsp21npIr+gMOsVTSRVle2iMeSPbFGV7aY2Z++XCuivZnlrj5orOUpTtrbVNr+gMouwAre16P7zApRuTyWTyz/oDUB1ZN9kNGUEAAAAASUVORK5CYII="},file:{size:16,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAQAAAD9CzEMAAABtElEQVR4Ad3Bv2rUcAAA4K+/ZndUXARBIp3cxEkQHYq4aOmiHQTvQH0GIw30DYTK3WhdgqBu/sHdQe2mzQNY6wM4V0oI5rze7+5yZNDv889bMm7DTZecNN03W56LWjLqlOeumMcD2yKWjXrjsvlct++LiZY13fPQ/G746ZMJEk23VF54ZM9kh0Zt46ljBU2XVB7bM4u+2raeYwVNJ1S+ms1QX22g5xjBYob6agM9Y4JFDfXVBnr+EixuqK820DMiaONAZUVl6IHawG0NQRu7KpvOqWy7r7alIdHGwKoja9aMO6MhaOOVD2aUiFmXS1VKmULtjmeumkEQk0vVUrk/Dlyz4aV9UyTa27Fj1KExQUymVCtlWkjEFAoLCjoWdCzoWCJmXS4VV8oUJgpicqlpUrmIoGNBTKY0TSkTkYgpFBYUdCzoWNCxRMy6XCqulClMFMTkUtOkchFBx4KYTGmaUiYiEVMoLCjoWNCxoGNB04HKijZWVH5oCJp2VTadM6/zNlU+a0g0Da06smZNe080BE0vfbCo195qWDbqnQvOau+9u35pWDLujpsuOm0+3330yo7/zm9pA1VwIYzMRQAAAABJRU5ErkJggg=="},message:{size:20,uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAQAAACQ9RH5AAAD+UlEQVR4Ae3Bf4iW9QEA8M/7vVfIS67uamWlcZW1cE7SrD8qNK2z2hzbXJ60QtoUrP5IiiiSKJIiCIoo65/KiDIz1jbJ+WtalDXH8kedyVwL71REa8w8Uy/jrDievu/zvK/v/X76z8/HCSf8WAr65wzXmORnGtSpU2efXfbZY7s1tuuHgr76rWtdbbTutVltueX6pKAvrrHQxfpmk7k26VVBby72pBv0x3dedZ+9elTQkwYLzFXUfwc1W60HBd1rtN4IlfZYYa1W++33pQb16l3kJtNUesgC3SrozgjrNcra4Qlrfaq6er93j0ZZy9zssKoKqhvufRdI7fegZ/XuNgv8RGqrKxxSRY1qhnvPKKnHzPC+vthooVNdLjrTWEtUUaOa1S4RtbvSq47qq04r7PJLQeIiRe84To3jNbtb9JUmG/XXR9aZbqjERC22q1Cj0lCrDJM4pMm/DMRuG8wSJH7lLV8oU6PSI64XzbHCQO10wA0SQ1zmeWWCcue5T/S2VwzG014WTXClMkG5eaKj5hisuTaL5isTZA1xq+hRrQbrqDmiXxgjI8j6tVMkDntcHrb4h+h+GUHWH0VLHJWPp0UzBCVB6izXiRbJy5s+lxhitJIgNUWQ+NQGeem0XDReSZC6UPSiPG0TjVMSpC4UrZenbaLxSoLUKNE+edommqAkSI0W7ZanA6JawQ+C6DTDJNp1ylOtqMO3fhBEQTREvk4WtSsJov/pkKh1ujydLDqoJEjtEDXKU62oXUmQahM1ytNwUbuSINUqapSnJtG/lQSpNtFUeZoq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Wa3RAuiJR899MgXFzr7VO/8KPviwlsLomV/+uCJT1546Sb+8sETn7zw0o3dd9f3cN9dR0dHR0dHR/97/wCCc9FG6sbg8AAAAABJRU5ErkJggg=="}};function face(f,weight){return f?typeof f=="string"?{fontFamily:f,fontWeight:weight}:{fontFamily:weight==="700"?f.bold??f.regular:weight==="500"?f.medium??f.regular:f.regular}:{fontWeight:weight}}function makeKit(options){let views=/* @__PURE__ */new Map,texts=/* @__PURE__ */new Map,types=/* @__PURE__ */new Map,type=key=>{let s=types.get(key);if(!s){let{fontWeight:fontWeight,...rest}=PHONE_TEXT[key];s={...rest,...face(PHONE_DECOR[key].font==="mono"?options.fonts?.mono:options.fonts?.sans,fontWeight)},types.set(key,s)}return s};return{options:options,v(key){let s=views.get(key);return s||(s={...PHONE_BOX[key]},views.set(key,s)),s},t(key){let s=texts.get(key);return s||(s={...PHONE_BOX[key],...type(key)},texts.set(key,s)),s},tx:type}}var DEFAULT_KIT=makeKit({}),KitContext=react.createContext(DEFAULT_KIT);function ShopKitProvider({fonts:fonts,renderIcon:renderIcon,children:children}){let kit=react.useMemo(()=>makeKit({...fonts?{fonts:fonts}:{},...renderIcon?{renderIcon:renderIcon}:{}}),[fonts,renderIcon]);return react.createElement(KitContext.Provider,{value:kit},children)}function useKit(){return react.useContext(KitContext)}function inkOf(key){return PHONE_TEXT[key].color??"#000000"}function Decor({k:k}){let d=PHONE_DECOR[k],radius=PHONE_BOX[k].borderRadius??0,out=[];if(d.ring){let ring=reactNative.Platform.OS==="web"?{boxShadow:`inset 0 0 0 ${d.ring.width}px ${d.ring.color}`}:{borderWidth:d.ring.width,borderColor:d.ring.color};out.push(react.createElement(reactNative.View,{key:"ring",pointerEvents:"none",style:[{position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:radius},ring]}))}return d.insetBottom&&out.push(react.createElement(reactNative.View,{key:"bar",pointerEvents:"none",style:{position:"absolute",right:0,bottom:0,left:0,height:d.insetBottom.width,backgroundColor:d.insetBottom.color}})),d.lineTop&&out.push(react.createElement(reactNative.View,{key:"top",pointerEvents:"none",style:{position:"absolute",right:0,top:-d.lineTop.width,left:0,height:d.lineTop.width,backgroundColor:d.lineTop.color}})),d.lineBottom&&out.push(react.createElement(reactNative.View,{key:"bottom",pointerEvents:"none",style:{position:"absolute",right:0,bottom:-d.lineBottom.width,left:0,height:d.lineBottom.width,backgroundColor:d.lineBottom.color}})),out.length?out:null}function dropShadow(k){let d=PHONE_DECOR[k].drop;return d?reactNative.Platform.OS==="web"?{boxShadow:`${d.x}px ${d.y}px ${d.blur}px ${d.spread}px ${d.color}`}:{shadowColor:d.color,shadowOpacity:1,shadowRadius:d.blur/2,shadowOffset:{width:d.x,height:d.y}}:null}function Icon({name:name,size:size,color:color,style:style}){let own=useKit().options.renderIcon?.({name:name,size:size,color:color});if(own!=null)return react.createElement(reactNative.View,{style:[{width:size,height:size},style],pointerEvents:"none"},own);let img=[{width:size,height:size,tintColor:color},style];return react.createElement(reactNative.Image,{source:{uri:PHONE_ICONS[name].uri},style:img,accessible:false,importantForAccessibility:"no",resizeMode:"contain"})}function PartIcon({name:name,k:k,inkKey:inkKey,style:style}){let box=PHONE_BOX[k];return react.createElement(Icon,{name:name,size:box.width??24,color:inkOf(inkKey??k),style:[box.marginTop?{marginTop:box.marginTop}:null,style]})}function T({k:k,style:style,children:children,lines:lines,role:role,bare:bare}){let kit=useKit();return react.createElement(reactNative.Text,{style:[bare?kit.tx(k):kit.t(k),wrapStyle(k),style],...wrapOf(k),...lines?{numberOfLines:lines}:{},...role?{accessibilityRole:role}:{}},children)}function wrapOf(k){return PHONE_DECOR[k].wrap?reactNative.Platform.OS==="web"?{}:reactNative.Platform.OS==="ios"?{lineBreakStrategyIOS:"standard"}:{textBreakStrategy:"balanced"}:{}}function wrapStyle(k){let w=PHONE_DECOR[k].wrap;return w&&reactNative.Platform.OS==="web"?{textWrap:w}:null}function underline(k){let off=PHONE_DECOR[k].underlineOffset;return off?{textUnderlineOffset:off}:{}}function Press({onPress:onPress,disabled:disabled,label:label,style:style,children:children,role:role="button",selected:selected}){return react.createElement(reactNative.Pressable,{onPress:disabled?void 0:onPress,disabled:disabled===true,accessibilityRole:role,...label?{accessibilityLabel:label}:{},accessibilityState:{disabled:disabled===true,...selected!==void 0?{selected:selected,checked:selected}:{}},style:style},children)}function phoneLabel(label){return label.replace(/\s*→$/,"")}var TAB_ROUTE={package:{name:"package"},shop:{name:"shop"},orders:{name:"orders"},plan:{name:"plan"}};function tabLabel(copy,tab){return tab==="package"?copy.tabPackage:tab==="shop"?copy.tabShop:tab==="orders"?copy.tabOrders:copy.tabPlan}function CareTabs({copy:copy,current:current,tabs:tabs}){let kit=useKit(),nav=useShopNativeNav();/* @__PURE__ */
|
|
4
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v("subtabs"),{flexDirection:"row",zIndex:1}],accessibilityRole:"tablist",accessibilityLabel:copy.tabsLabel,testID:"shop-subtabs",children:[tabs.map(tab=>{let on=tab===current,k=on?"subtabCurrent":"subtab";/* @__PURE__ */
|
|
5
|
+
return jsxRuntime.jsxs(Press,{role:"tab",selected:on,onPress:()=>nav.go(TAB_ROUTE[tab]),style:[kit.v(k),{flex:1,alignItems:"center",justifyContent:"center"}],children:[
|
|
6
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:k,bare:true,children:tabLabel(copy,tab)}),
|
|
7
|
+
/* @__PURE__ */jsxRuntime.jsx(Decor,{k:k})]},tab)}),
|
|
8
|
+
/* @__PURE__ */jsxRuntime.jsx(Decor,{k:"subtabs"})]})}function Frame({tabs:tabs,tray:tray,children:children}){let kit=useKit();/* @__PURE__ */
|
|
9
|
+
return jsxRuntime.jsxs(reactNative.View,{style:{flex:1,backgroundColor:PHONE_BOX.subtabs.backgroundColor},children:[tabs?/* @__PURE__ */jsxRuntime.jsx(CareTabs,{copy:tabs.copy,current:tabs.current,tabs:tabs.tabs}):null,
|
|
10
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{style:{flex:1},contentContainerStyle:[kit.v(tabs?"body":"pushBody"),BODY_END],keyboardShouldPersistTaps:"handled",children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{testID:"shop-body",children:children})}),tray??null]})}var BODY_END={paddingBottom:PHONE_BOX.breaks.columnGap};function TitleBlock({title:title,meta:meta}){let kit=useKit();/* @__PURE__ */
|
|
11
|
+
return jsxRuntime.jsxs(reactNative.View,{style:kit.v("titleBlock"),children:[
|
|
12
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"screenTitle",role:"header",children:title}),meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"screenMeta",children:meta}):null]})}function Stack({children:children}){let kit=useKit();/* @__PURE__ */
|
|
13
|
+
return jsxRuntime.jsx(reactNative.View,{style:kit.v("stack"),children:children})}function Card({children:children,label:label,style:style}){let kit=useKit();/* @__PURE__ */
|
|
14
|
+
return jsxRuntime.jsx(reactNative.View,{style:[kit.v("card"),style],...label?{accessibilityLabel:label}:{},children:children})}function CardTitle({children:children}){/* @__PURE__ */
|
|
15
|
+
return jsxRuntime.jsx(T,{k:"cardTitle",role:"header",children:children})}function CardHead({title:title,end:end}){let kit=useKit();/* @__PURE__ */
|
|
16
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v("cardHead"),{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"}],children:[
|
|
17
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardTitleInHead",role:"header",children:title}),end??null]})}function ShopLinkText({link:link,k:k="cardLink",style:style}){let kit=useKit(),nav=useShopNativeNav();/* @__PURE__ */
|
|
18
|
+
return jsxRuntime.jsx(Press,{role:"link",onPress:()=>nav.go(link.to),style:[kit.v(k),style],children:/* @__PURE__ */jsxRuntime.jsx(T,{k:k,bare:true,children:phoneLabel(link.label)})})}var PILL_KEY={rx:"pill",soon:"pillSoon",clear:"pillClear",plain:"pillPlain",overdue:"pillOverdue",later:"pillPlain",stable:"pillStable"};function Pill({pill:pill}){let kit=useKit(),k=PILL_KEY[pill.tone];/* @__PURE__ */
|
|
19
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v(k),{flexDirection:"row",alignItems:"center",alignSelf:"flex-start"}],children:[
|
|
20
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:k,bare:true,children:pill.label}),
|
|
21
|
+
/* @__PURE__ */jsxRuntime.jsx(Decor,{k:k})]})}var TILE_KEY={base:null,pink:"thumbPink",yellow:"thumbYellow",sage:"thumbSage"};function tileTint(tone){let k=TILE_KEY[tone];return(k?PHONE_BOX[k]:PHONE_BOX.thumb).backgroundColor}function Thumb({tone:tone,icon:icon}){let kit=useKit();/* @__PURE__ */
|
|
22
|
+
return jsxRuntime.jsx(reactNative.View,{style:[kit.v("thumb"),{backgroundColor:tileTint(tone),alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:icon,k:"thumbIcon",inkKey:"thumb"})})}function ItemRow({index:index,count:count,thumb:thumb,children:children,end:end,first:first="itemsLiFirst",mid:mid="itemsLiMid",last:last="itemsLiLast"}){let kit=useKit(),style=[];count===1?style.push({paddingTop:0,paddingBottom:0}):index===0?style.push(kit.v(first)):index===count-1?style.push(kit.v(last)):style.push(kit.v(mid));let gap=PHONE_BOX.itemsLiFirst.columnGap;return style.push({rowGap:0,columnGap:0}),/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:style,children:[
|
|
23
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",alignItems:"center",columnGap:gap},children:[thumb,
|
|
24
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{flex:1,minWidth:0,marginRight:gap},children:children})]}),end?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{marginTop:PHONE_BOX.itemsLiFirst.rowGap,marginLeft:PHONE_BOX.thumb.width+gap,marginRight:gap,alignItems:"flex-start"},children:end}):null]})}function ItemName({name:name,rx:rx,copy:copy,pills:pills}){let kit=useKit();/* @__PURE__ */
|
|
25
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v("itemsName"),{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}],children:[
|
|
26
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsName",bare:true,children:name}),rx?/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:{label:copy.rx,tone:"rx"}}):null,(pills??[]).map(p=>/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:p},p.label))]})}function Sum({rows:rows,total:total}){let kit=useKit(),box=total?"sumTotal":"sumPlain",row=total?"sumRowFirst":"sumPlainRowFirst",dd=total?"sumDd":"sumPlainDd";/* @__PURE__ */
|
|
27
|
+
return jsxRuntime.jsx(reactNative.View,{style:kit.v(box),children:rows.map((r,i)=>{let lastRow=i===rows.length-1;/* @__PURE__ */
|
|
28
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v(row),{flexDirection:"row",flexWrap:"wrap",alignItems:"baseline",justifyContent:"space-between"},lastRow?null:{borderBottomWidth:PHONE_BOX.card.borderWidth,borderBottomColor:PHONE_BOX.card.borderColor}],children:[
|
|
29
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"sumDt",children:r.k}),
|
|
30
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:total&&lastRow?"sumDdTotal":dd,style:{marginLeft:"auto"},children:r.v})]},`${r.k}-${i}`)})})}function Rows({rows:rows,plan:plan}){let kit=useKit();/* @__PURE__ */
|
|
31
|
+
return jsxRuntime.jsx(reactNative.View,{children:rows.map((r,i)=>{let pad;return plan?pad=kit.v(i===0?"planRowsLiFirst":"planRowsLiNext"):rows.length===1?pad={}:i===0?pad=kit.v("rowsLiFirst"):i===rows.length-1?pad=kit.v("rowsLiNext"):pad={...kit.v("rowsLiNext"),paddingBottom:PHONE_BOX.rowsLiFirst.paddingBottom},/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[pad,{flexDirection:"row",alignItems:"center",rowGap:0,columnGap:0}],children:[
|
|
32
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,minWidth:0},children:[
|
|
33
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"rowsK",children:r.k}),r.v?/* @__PURE__ */jsxRuntime.jsx(T,{k:"rowsV",children:r.v}):null,r.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"rowsMeta",style:r.metaAlert?{color:inkOf("pillOverdue")}:null,children:r.meta}):null,r.alert?/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:r.alert}):null]}),r.end?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{marginLeft:PHONE_BOX.rowsLiFirst.columnGap},children:r.end}):null]},r.key)})})}function Legal({line:line}){/* @__PURE__ */
|
|
34
|
+
return jsxRuntime.jsx(reactNative.View,{testID:"shop-legal",children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"legal",children:line})})}function busyLabel(a){return a.busy&&a.busyLabel?a.busyLabel:a.label}function InkButton({action:action}){let kit=useKit();/* @__PURE__ */
|
|
35
|
+
return jsxRuntime.jsx(Press,{onPress:action.onPress,disabled:action.disabled===true,style:[kit.v("btnInk"),{flexDirection:"row",alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"btnInk",bare:true,children:busyLabel(action)})})}function OutlineButton({action:action,k:k,icon:icon,iconKey:iconKey}){let kit=useKit();/* @__PURE__ */
|
|
36
|
+
return jsxRuntime.jsxs(Press,{onPress:action.onPress,disabled:action.disabled===true,style:[kit.v(k),{flexDirection:"row",alignItems:"center",justifyContent:"center",alignSelf:k==="btnOutline"||k==="btnDanger"?"stretch":"flex-start"}],children:[icon&&iconKey?/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:icon,k:iconKey,inkKey:k}):null,
|
|
37
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:k==="btnRow"?"btnRowLabel":k,bare:true,children:busyLabel(action)})]})}function ActText({label:label,onPress:onPress,disabled:disabled}){/* @__PURE__ */
|
|
38
|
+
return jsxRuntime.jsx(Press,{onPress:onPress,disabled:disabled===true,children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsActButton",bare:true,style:[underline("itemsActButton"),{textAlign:"left"}],children:label})})}function TrayBar({action:action,fine:fine,error:error}){let kit=useKit();return!action&&!fine&&!error?null:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:kit.v("traybar"),testID:"shop-traybar",children:[
|
|
39
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error??null}),action?/* @__PURE__ */jsxRuntime.jsx(InkButton,{action:action}):null,fine?/* @__PURE__ */jsxRuntime.jsx(T,{k:"traybarFine",children:fine}):null,
|
|
40
|
+
/* @__PURE__ */jsxRuntime.jsx(Decor,{k:"traybar"})]})}function Ghost({rows:rows=3}){let kit=useKit(),widths=["100%","82%","64%"];/* @__PURE__ */
|
|
41
|
+
return jsxRuntime.jsx(reactNative.View,{style:kit.v("ghost"),accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:Array.from({length:rows},(_,i)=>/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("ghostBar"),{width:widths[i%3]}]},i))})}function LoadFailed({copy:copy,thing:thing,retry:retry}){/* @__PURE__ */
|
|
42
|
+
return jsxRuntime.jsxs(Card,{children:[
|
|
43
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:copy.loadFailed(thing)}),
|
|
44
|
+
/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnSm",action:{label:copy.tryAgain,onPress:retry}})]})}function InlineError({line:line}){return line?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{accessibilityLiveRegion:"polite",accessibilityRole:"alert",children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterSum",style:{color:inkOf("pillOverdue")},children:line})}):null}function ShopSwitch({on:on,label:label,disabled:disabled,onChange:onChange}){let kit=useKit();/* @__PURE__ */
|
|
45
|
+
return jsxRuntime.jsxs(Press,{role:"switch",label:label,selected:on,disabled:disabled===true,onPress:()=>onChange(!on),style:kit.v("switch"),children:[
|
|
46
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v(on?"switchTrack":"switchTrackOff")}),
|
|
47
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{pointerEvents:"none",style:[kit.v(on?"switchKnob":"switchKnobOff"),dropShadow(on?"switchKnob":"switchKnobOff")]})]})}function ConfirmSheet({open:open,title:title,body:body,confirm:confirm,keep:keep,closeLabel:closeLabel,busyLabel:busyLabel2,busy:busy,error:error,onConfirm:onConfirm,onClose:onClose}){let kit=useKit();/* @__PURE__ */
|
|
48
|
+
return jsxRuntime.jsx(reactNative.Modal,{visible:open,transparent:true,animationType:"slide",onRequestClose:onClose,statusBarTranslucent:true,children:/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,justifyContent:"flex-end"},children:[
|
|
49
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.Pressable,{style:[{position:"absolute",top:0,right:0,bottom:0,left:0},{backgroundColor:PHONE_BOX.sheetBackdrop.backgroundColor}],onPress:onClose,accessibilityRole:"button",accessibilityLabel:closeLabel}),
|
|
50
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:kit.v("sheet"),accessibilityViewIsModal:true,testID:"shop-sheet",children:[
|
|
51
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("sheetGrab"),{alignItems:"center",justifyContent:"center"}],accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("sheetGrabBar")})}),
|
|
52
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("sheetHead"),{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}],children:[
|
|
53
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardTitleInHead",role:"header",style:{flex:1,minWidth:0},children:title}),
|
|
54
|
+
/* @__PURE__ */jsxRuntime.jsx(Press,{label:closeLabel,onPress:onClose,style:[kit.v("sheetClose"),{alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:"close",k:"sheetCloseIcon",inkKey:"sheetClose"})})]}),
|
|
55
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:kit.v("sheetBody"),children:[
|
|
56
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"sheetText",children:body}),
|
|
57
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error}),
|
|
58
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:kit.v("sheetActions"),children:[
|
|
59
|
+
/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnDanger",action:{label:confirm,busyLabel:busyLabel2,busy:busy,disabled:busy,onPress:onConfirm}}),
|
|
60
|
+
/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnOutline",action:{label:keep,onPress:onClose}})]})]})]})]})})}function Gap({children:children}){let kit=useKit();/* @__PURE__ */
|
|
61
|
+
return jsxRuntime.jsx(reactNative.View,{style:{rowGap:kit.v("stack").rowGap,marginTop:kit.v("stack").rowGap},children:children})}var FIELD_LIMITS={label:60,recipientName:100,line1:100,line2:100,city:60,region:60,postalCode:16},AUTOFILL={label:{autoComplete:"off"},recipientName:{autoComplete:"name",textContentType:"name"},line1:{autoComplete:"address-line1",textContentType:"streetAddressLine1"},line2:{autoComplete:"address-line2",textContentType:"streetAddressLine2"},city:{autoComplete:"off",textContentType:"addressCity"},region:{autoComplete:"off",textContentType:"addressState"},postalCode:{autoComplete:"postal-code",textContentType:"postalCode"}};function Field({label:label,value:value,name:name,onChange:onChange}){let kit=useKit(),fill=AUTOFILL[name];/* @__PURE__ */
|
|
62
|
+
return jsxRuntime.jsxs(reactNative.View,{style:kit.v("field"),children:[
|
|
63
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"fieldLabel",children:label}),
|
|
64
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("fieldInput"),{flexDirection:"row",alignItems:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(reactNative.TextInput,{style:[kit.t("fieldInputText"),{flex:1,minWidth:0}],value:value,onChangeText:onChange,accessibilityLabel:label,autoComplete:fill.autoComplete,...fill.textContentType?{textContentType:fill.textContentType}:{},autoCapitalize:name==="region"?"characters":"words",autoCorrect:false,maxLength:FIELD_LIMITS[name],...name==="postalCode"?{keyboardType:"number-pad"}:{}})})]})}function AddressFormScreen({copy:copy,busy:busy,error:error,onSave:onSave}){let[f,setF]=react.useState({label:"",recipientName:"",line1:"",line2:"",city:"",region:"",postalCode:""}),set=k=>v=>setF(prev=>({...prev,[k]:v.slice(0,FIELD_LIMITS[k])})),ready=!!(f.label.trim()&&f.recipientName.trim()&&f.line1.trim()&&f.city.trim()&&f.region.trim()&&f.postalCode.trim()),submit=()=>{!ready||busy||onSave({label:f.label.trim(),makeDefault:true,address:{recipientName:f.recipientName.trim(),line1:f.line1.trim(),line2:f.line2.trim()||null,city:f.city.trim(),region:f.region.trim().toUpperCase(),postalCode:f.postalCode.trim(),country:"US"}})},fields=[["label",copy.addressLabel],["recipientName",copy.addressRecipient],["line1",copy.addressLine1],["line2",copy.addressLine2],["city",copy.addressCity],["region",copy.addressRegion],["postalCode",copy.addressPostal]];/* @__PURE__ */
|
|
65
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
66
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
67
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.addressTitle}),
|
|
68
|
+
/* @__PURE__ */jsxRuntime.jsxs(Gap,{children:[fields.map(([k,label])=>/* @__PURE__ */jsxRuntime.jsx(Field,{name:k,label:label,value:f[k],onChange:set(k)},k)),
|
|
69
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error}),
|
|
70
|
+
/* @__PURE__ */jsxRuntime.jsx(InkButton,{action:{label:copy.addressSave,busyLabel:copy.saving,busy:busy,disabled:!ready||busy,onPress:submit}})]})]})}),
|
|
71
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]})}function CardSetupScreen({copy:copy,start:start,error:error}){/* @__PURE__ */
|
|
72
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
73
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
74
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.cardTitle}),
|
|
75
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:start?copy.cardBody:copy.cardUnavailable}),
|
|
76
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error}),start?/* @__PURE__ */jsxRuntime.jsx(Gap,{children:/* @__PURE__ */jsxRuntime.jsx(InkButton,{action:start})}):null]})}),
|
|
77
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]})}function BuyConfirmScreen({copy:copy,title:title,lines:lines,sum:sum,needs:needs,pay:pay,note:note,error:error}){/* @__PURE__ */
|
|
78
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
79
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
80
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
81
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:title}),
|
|
82
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{children:lines.map((l,i)=>/* @__PURE__ */jsxRuntime.jsxs(ItemRow,{index:i,count:lines.length,thumb:/* @__PURE__ */jsxRuntime.jsx(Thumb,{tone:"pink",icon:"pill"}),end:l.price?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsPrice",children:l.price}):null,children:[
|
|
83
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsName",children:l.name}),l.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsMeta",children:l.meta}):null]},l.key))})]}),
|
|
84
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
85
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.total}),sum?/* @__PURE__ */jsxRuntime.jsx(Sum,{rows:sum,total:true}):null,
|
|
86
|
+
/* @__PURE__ */jsxRuntime.jsxs(Gap,{children:[needs.map(n=>/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:n,style:{alignSelf:"flex-start"}},n.label)),pay?/* @__PURE__ */jsxRuntime.jsx(InkButton,{action:pay}):null]}),
|
|
87
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error}),note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterTotal",children:note}):null]})]}),
|
|
88
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]})}function PlanConsentScreen({copy:copy,terms:terms,needs:needs,agree:agree,error:error}){let nav=useShopNativeNav(),kit=useKit();/* @__PURE__ */
|
|
89
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
90
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
91
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.consentTitle}),
|
|
92
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:copy.consentBody}),
|
|
93
|
+
/* @__PURE__ */jsxRuntime.jsxs(Gap,{children:[terms?/* @__PURE__ */jsxRuntime.jsx(Press,{role:"link",label:terms.label,onPress:()=>nav.openExternal(terms.href),style:[kit.v("cardLink"),{alignSelf:"flex-start"}],children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLink",bare:true,style:underline("cardLink"),children:terms.label})}):null,needs.map(n=>/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:n,style:{alignSelf:"flex-start"}},n.label)),
|
|
94
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:error}),agree?/* @__PURE__ */jsxRuntime.jsx(InkButton,{action:agree}):null]})]})}),
|
|
95
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]})}var ICON_COLUMN=22;function OrderRow({row:row}){let kit=useKit(),nav=useShopNativeNav(),gap=kit.v("recRow").columnGap;/* @__PURE__ */
|
|
96
|
+
return jsxRuntime.jsxs(Press,{role:"link",label:[row.title,row.meta,row.pill?.label].filter(Boolean).join(", "),onPress:()=>nav.go(row.to),style:[kit.v("recRow"),{flexDirection:"row",alignItems:"center",rowGap:0,columnGap:0}],children:[
|
|
97
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:ICON_COLUMN,marginRight:gap},children:/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:row.icon,k:"recIcon"})}),
|
|
98
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("recText"),{flex:1,minWidth:0}],children:[
|
|
99
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"recTitle",children:row.title}),
|
|
100
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"recMeta",children:row.meta})]}),row.pill?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("recEnd"),{flexDirection:"row",alignItems:"center",marginLeft:gap}],children:/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:row.pill})}):null]})}function OrdersScreen({copy:copy,tabs:tabs,view:view}){let kit=useKit(),rows=view.rows;/* @__PURE__ */
|
|
101
|
+
return jsxRuntime.jsxs(Frame,{tabs:{copy:copy,current:"orders",tabs:tabs},children:[
|
|
102
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:copy.ordersTitle,meta:view.sub}),
|
|
103
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:rows.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingOrders,retry:rows.retry}):/* @__PURE__ */jsxRuntime.jsxs(Card,{label:copy.allOrders,children:[rows.phase==="loading"?/* @__PURE__ */jsxRuntime.jsx(Ghost,{}):null,rows.phase==="ready"&&rows.value.length===0?/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:view.emptyLine}):null,rows.phase==="ready"&&rows.value.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("rec"),children:rows.value.map(r=>/* @__PURE__ */jsxRuntime.jsx(OrderRow,{row:r},r.key))}):null,view.more?/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnSm",action:view.more}):null]})}),
|
|
104
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:view.legal})]})}var FIRST_LABEL={marginTop:Math.max(0,PHONE_BOX.forLabel.marginTop-PHONE_BOX.cardHead.marginBottom)};function PackageScreen({copy:copy,tabs:tabs,view:view}){let kit=useKit(),nav=useShopNativeNav(),frame={copy:copy,current:"package",tabs:tabs};if(view.phase!=="ready")/* @__PURE__ */
|
|
105
|
+
return jsxRuntime.jsxs(Frame,{tabs:frame,children:[
|
|
106
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:copy.tabPackage}),
|
|
107
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:view.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingPackage,retry:view.retry}):/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
108
|
+
/* @__PURE__ */jsxRuntime.jsx(CardHead,{title:copy.inThisPackage}),
|
|
109
|
+
/* @__PURE__ */jsxRuntime.jsx(Ghost,{})]})}),
|
|
110
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]});let v=view.value,total=v.sum.find(r=>r.k===copy.total)?.v??null,approve=v.approve?{...v.approve,label:total&&!v.approve.busy?copy.withTotal(v.approve.label,total):v.approve.label}:null,headPill=v.countPill??v.reviewPill,firstGroup=true;/* @__PURE__ */
|
|
111
|
+
return jsxRuntime.jsxs(Frame,{tabs:frame,tray:/* @__PURE__ */jsxRuntime.jsx(TrayBar,{action:approve,fine:v.fine??null,error:v.approve?v.error:null}),children:[
|
|
112
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:v.title,meta:v.sub}),
|
|
113
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
114
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
115
|
+
/* @__PURE__ */jsxRuntime.jsx(CardHead,{title:copy.inThisPackage,end:headPill?/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:{label:headPill,tone:"soon"}}):null}),v.empty?/* @__PURE__ */jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
116
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:v.empty.line}),
|
|
117
|
+
/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnSm",action:{label:v.empty.shop.label,onPress:()=>nav.go(v.empty.shop.to)}})]}):null,v.groups.map((g,gi)=>{let label=g.label?/* @__PURE__ */jsxRuntime.jsx(T,{k:firstGroup?"forLabel":"forLabelNext",style:firstGroup?FIRST_LABEL:null,children:g.label}):null;return g.label&&(firstGroup=false),/* @__PURE__ */jsxRuntime.jsxs(react.Fragment,{children:[label,
|
|
118
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{children:g.items.map((it,i)=>/* @__PURE__ */jsxRuntime.jsxs(ItemRow,{index:i,count:g.items.length,thumb:/* @__PURE__ */jsxRuntime.jsx(Thumb,{tone:it.tone,icon:it.icon}),end:it.price?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsPrice",children:it.price}):null,children:[
|
|
119
|
+
/* @__PURE__ */jsxRuntime.jsx(ItemName,{name:it.name,rx:it.rx,copy:copy,pills:it.pills}),it.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsMeta",children:it.meta}):null,it.alert?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{accessibilityLiveRegion:"polite",children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsMeta",children:it.alert})}):null,it.details||it.remove?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("itemsActs"),{flexDirection:"row"}],children:[it.details?/* @__PURE__ */jsxRuntime.jsx(ActText,{label:it.details.label,onPress:()=>nav.go(it.details.to)}):null,it.remove?/* @__PURE__ */jsxRuntime.jsx(ActText,{label:it.remove.busy&&it.remove.busyLabel?it.remove.busyLabel:it.remove.label,onPress:it.remove.onPress,disabled:it.remove.disabled===true}):null]}):null]},it.key))})]},g.label??gi)})]}),v.add?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
120
|
+
/* @__PURE__ */jsxRuntime.jsx(CardHead,{title:v.add.title,end:v.add.link?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:v.add.link}):null}),
|
|
121
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{children:v.add.items.map((it,i)=>/* @__PURE__ */jsxRuntime.jsxs(ItemRow,{index:i,count:v.add.items.length,thumb:/* @__PURE__ */jsxRuntime.jsx(Thumb,{tone:it.tone,icon:it.icon}),end:/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnRow",icon:"plus",iconKey:"btnRowIcon",action:it.add}),children:[
|
|
122
|
+
/* @__PURE__ */jsxRuntime.jsx(ItemName,{name:it.name,rx:false,copy:copy}),it.meta||it.price?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsMeta",children:[it.meta,it.price].filter(Boolean).join(" · ")}):null]},it.key))})]}):null,
|
|
123
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
124
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.total}),v.sum.length>0?/* @__PURE__ */jsxRuntime.jsx(Sum,{rows:v.sum,total:true}):null,v.note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterSum",children:v.note}):null,v.skip?"to"in v.skip?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:v.skip,k:"cardLinkAfterNote",style:{alignSelf:"flex-start"}}):/* @__PURE__ */jsxRuntime.jsx(Press,{onPress:v.skip.onPress,disabled:v.skip.disabled===true,style:{alignSelf:"flex-start"},children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLinkAfterNote",children:v.skip.label})}):null,v.approve?null:/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:v.error})]}),v.delivery.length>0?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
125
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.delivery}),
|
|
126
|
+
/* @__PURE__ */jsxRuntime.jsx(Rows,{rows:v.delivery.map(r=>({key:r.k,k:r.k,v:r.v??null,meta:r.meta??null,end:r.change?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:r.change}):null}))})]}):null]}),
|
|
127
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:v.legal})]})}function ShopSwitchCard({title:title,rows:rows}){/* @__PURE__ */
|
|
128
|
+
return jsxRuntime.jsxs(Card,{children:[
|
|
129
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:title}),
|
|
130
|
+
/* @__PURE__ */jsxRuntime.jsx(Rows,{plan:true,rows:rows.map(r=>({key:r.key,k:r.title,meta:r.meta??null,end:/* @__PURE__ */jsxRuntime.jsx(ShopSwitch,{on:r.on,disabled:r.disabled===true,label:r.label,onChange:r.onChange})}))})]})}function BreakCard({copy:copy,card:card}){let kit=useKit(),[open,setOpen]=react.useState(null),sheet=open?card[open]:null;/* @__PURE__ */
|
|
131
|
+
return jsxRuntime.jsxs(Card,{children:[
|
|
132
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.needABreak}),
|
|
133
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("breaks"),{flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginTop:Math.max(0,PHONE_BOX.breaks.marginTop-PHONE_BOX.cardTitle.marginBottom)}],children:[card.skip?/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnSm",action:{label:card.skip.label,onPress:()=>setOpen("skip")}}):null,card.pause?/* @__PURE__ */jsxRuntime.jsx(Press,{onPress:()=>setOpen("pause"),children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"linkDanger",bare:true,style:underline("linkDanger"),children:card.pause.label})}):null]}),sheet?null:/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:card.error}),
|
|
134
|
+
/* @__PURE__ */jsxRuntime.jsx(ConfirmSheet,{open:sheet!==null,title:sheet?.ask??"",body:sheet?.body??"",confirm:sheet?.label??"",keep:copy.keepIt,closeLabel:copy.close,busyLabel:copy.saving,busy:card.busy,error:sheet?card.error:null,onConfirm:()=>{open&&card.onConfirm(open).then(done=>{done&&setOpen(null)})},onClose:()=>setOpen(null)})]})}function PlanScreen({copy:copy,tabs:tabs,view:view,reminders:reminders}){let frame={copy:copy,current:"plan",tabs:tabs};if(view.phase!=="ready")/* @__PURE__ */
|
|
135
|
+
return jsxRuntime.jsxs(Frame,{tabs:frame,children:[
|
|
136
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:copy.planTitle}),
|
|
137
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:view.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingPlan,retry:view.retry}):/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
138
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.whatRepeats}),
|
|
139
|
+
/* @__PURE__ */jsxRuntime.jsx(Ghost,{})]})}),
|
|
140
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]});let v=view.value;/* @__PURE__ */
|
|
141
|
+
return jsxRuntime.jsxs(Frame,{tabs:frame,children:[
|
|
142
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:copy.planTitle,meta:v.sub}),
|
|
143
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[v.next?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
144
|
+
/* @__PURE__ */jsxRuntime.jsx(CardHead,{title:copy.nextPackage,end:v.next.link?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:v.next.link}):null}),
|
|
145
|
+
/* @__PURE__ */jsxRuntime.jsx(Sum,{rows:v.next.sum,total:false})]}):null,
|
|
146
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
147
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.whatRepeats}),v.emptyLine?/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:v.emptyLine}):null,v.rows.length>0?/* @__PURE__ */jsxRuntime.jsx(Rows,{plan:true,rows:v.rows.map(r=>({key:r.key,k:r.title,meta:r.meta,metaAlert:r.alert,alert:r.error,end:/* @__PURE__ */jsxRuntime.jsx(ShopSwitch,{on:r.on,disabled:r.busy,label:copy.repeatsLabel(r.title),onChange:r.onToggle})}))}):null]}),reminders??null,v.delivery.length>0?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
148
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.deliveryAndPayment}),
|
|
149
|
+
/* @__PURE__ */jsxRuntime.jsx(Rows,{plan:true,rows:v.delivery.map(r=>({key:r.k,k:r.k,v:r.v,alert:r.alert??null,end:r.change?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:r.change}):null}))})]}):null,v.breakCard?/* @__PURE__ */jsxRuntime.jsx(BreakCard,{copy:copy,card:v.breakCard}):null]}),
|
|
150
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:v.legal})]})}function Hero({copy:copy,tone:tone,icon:icon}){let kit=useKit();/* @__PURE__ */
|
|
151
|
+
return jsxRuntime.jsx(reactNative.View,{style:[kit.v("hero"),{backgroundColor:tileTint(tone),alignItems:"center",justifyContent:"center"}],accessible:true,accessibilityRole:"image",accessibilityLabel:copy.photoToCome,children:icon?/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:icon,k:"heroIcon",inkKey:"prodIcon"}):null})}function Source({icon:icon,bold:bold,rest:rest,link:link,inCard:inCard}){let kit=useKit(),nav=useShopNativeNav(),k=inCard?"sourceInCard":"source";/* @__PURE__ */
|
|
152
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[kit.v(k),{flexDirection:"row",alignItems:"flex-start"}],children:[
|
|
153
|
+
/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:icon,k:inCard?"sourceInCardIcon":"sourceIcon"}),
|
|
154
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.Text,{style:[kit.tx(k),{flex:1,minWidth:0}],children:[bold?/* @__PURE__ */jsxRuntime.jsx(reactNative.Text,{style:kit.tx("sourceBold"),children:bold}):null,bold?` ${rest}`:rest,link?" ":null,link?/* @__PURE__ */jsxRuntime.jsx(reactNative.Text,{style:[kit.tx("sourceLink"),underline("sourceLink")],accessibilityRole:"link",onPress:()=>nav.openExternal(link.href),children:link.label}):null]})]})}function ProductScreen({copy:copy,view:view}){let kit=useKit();if(view.phase!=="ready")/* @__PURE__ */
|
|
155
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
156
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
157
|
+
/* @__PURE__ */jsxRuntime.jsx(Hero,{copy:copy,tone:"base",icon:null}),view.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingProduct,retry:view.retry}):/* @__PURE__ */jsxRuntime.jsx(Card,{children:/* @__PURE__ */jsxRuntime.jsx(Ghost,{})})]}),
|
|
158
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]});let v=view.value,price=v.price?v.priceUnit?`${v.price} ${v.priceUnit}`:v.price:null,meta=[v.sub,price].filter(Boolean).join(" · ")||null;/* @__PURE__ */
|
|
159
|
+
return jsxRuntime.jsxs(Frame,{tray:/* @__PURE__ */jsxRuntime.jsx(TrayBar,{action:v.submit,fine:v.fine??null,error:v.error}),children:[
|
|
160
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:v.title,meta:meta}),
|
|
161
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
162
|
+
/* @__PURE__ */jsxRuntime.jsx(Hero,{copy:copy,tone:v.tone,icon:v.icon}),v.source?/* @__PURE__ */jsxRuntime.jsx(Source,{icon:"check",bold:v.source.bold,rest:v.source.rest,link:v.source.link}):null,v.stockLine?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteStandalone",children:v.stockLine}):null,v.choices?/* @__PURE__ */jsxRuntime.jsx(Card,{label:copy.howOften,children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("choices"),accessibilityRole:"radiogroup",accessibilityLabel:copy.howOften,children:v.choices.map(c=>{let on=v.choice===c.value,k=on?"choiceCurrent":"choice";/* @__PURE__ */
|
|
163
|
+
return jsxRuntime.jsxs(Press,{role:"radio",selected:on,label:[c.title,c.meta].filter(Boolean).join(", "),onPress:()=>v.onChoice(c.value),style:[kit.v(k),{flexDirection:"row",alignItems:"center",rowGap:0,columnGap:0}],children:[
|
|
164
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:RADIO_COLUMN,marginRight:kit.v(k).columnGap},children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v(on?"radioOn":"radioOff")})}),
|
|
165
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,minWidth:0,marginRight:kit.v(k).columnGap},children:[
|
|
166
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"choiceTitle",style:{lineHeight:kit.tx("choiceText").lineHeight},children:c.title}),c.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"choiceMeta",children:c.meta}):null]})]},c.value)})})}):null,v.facts?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
167
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:v.facts.title}),
|
|
168
|
+
/* @__PURE__ */jsxRuntime.jsx(Facts,{rows:v.facts.rows}),v.facts.note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterFacts",children:v.facts.note}):null]}):null,v.cards.map(c=>/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
169
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:c.title}),
|
|
170
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:c.lead})]},c.key))]}),
|
|
171
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:v.legal})]})}var RADIO_COLUMN=22;function Facts({rows:rows}){let kit=useKit(),pairs=[];rows.forEach((r,i)=>{i%2===0&&pairs.push([]),pairs[pairs.length-1].push(r)});let gap=kit.v("facts").columnGap;
|
|
172
|
+
/* @__PURE__ */
|
|
173
|
+
return jsxRuntime.jsx(reactNative.View,{style:[kit.v("facts"),{columnGap:0,marginTop:Math.max(0,PHONE_BOX.facts.marginTop-PHONE_BOX.cardTitle.marginBottom)}],children:pairs.map((pair,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",columnGap:gap,alignItems:"stretch"},children:[pair.map(r=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v(r.her?"factsLiHer":"factsLi"),{flex:1,minWidth:0}],children:[
|
|
174
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"factsK",children:r.k}),
|
|
175
|
+
/* @__PURE__ */jsxRuntime.jsxs(T,{k:"factsN",lines:1,children:[`${r.n} `
|
|
176
|
+
/* @__PURE__ */,jsxRuntime.jsx(reactNative.Text,{style:kit.tx("factsUnit"),children:r.unit})]})]},r.k)),pair.length===1?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{flex:1}}):null]},i))})}function RxProductScreen({copy:copy,view:view,avatar:avatar}){let kit=useKit(),nav=useShopNativeNav();if(view.phase!=="ready")/* @__PURE__ */
|
|
177
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
178
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
179
|
+
/* @__PURE__ */jsxRuntime.jsx(Hero,{copy:copy,tone:"pink",icon:null}),view.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingProduct,retry:view.retry}):/* @__PURE__ */jsxRuntime.jsx(Card,{children:/* @__PURE__ */jsxRuntime.jsx(Ghost,{})})]}),
|
|
180
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legal})]});let v=view.value,meta=[v.stepLabel,v.sub].filter(Boolean).join(" · ")||null,submit=v.submit?"href"in v.submit?{label:v.submit.label,onPress:()=>nav.openExternal(v.submit.href)}:v.submit:null,ask=v.aside?/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnOutlineSm",icon:"message",iconKey:"btnOutlineSmIcon",action:{label:v.aside.link.label,onPress:()=>nav.openExternal(v.aside.link.href)}}):null,gap=kit.v("person").columnGap;/* @__PURE__ */
|
|
181
|
+
return jsxRuntime.jsxs(Frame,{tray:/* @__PURE__ */jsxRuntime.jsx(TrayBar,{action:submit,fine:v.fine??null,error:v.error}),children:[
|
|
182
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:v.title,meta:meta}),
|
|
183
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
184
|
+
/* @__PURE__ */jsxRuntime.jsx(Hero,{copy:copy,tone:v.tone,icon:v.icon}),v.stockLine?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteStandalone",children:v.stockLine}):null,v.script?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
185
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("person"),{flexDirection:"row",alignItems:"center",rowGap:0,columnGap:0}],children:[avatar?/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("avatar"),{marginRight:gap,overflow:"hidden"}],children:[
|
|
186
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.Image,{source:avatar,style:{width:"100%",height:"100%"},accessible:false}),
|
|
187
|
+
/* @__PURE__ */jsxRuntime.jsx(Decor,{k:"avatar"})]}):null,
|
|
188
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,minWidth:0,marginRight:gap},children:[
|
|
189
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"personName",role:"header",children:v.script.name}),v.script.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"personMeta",children:v.script.meta}):null]})]}),v.script.directions?/* @__PURE__ */jsxRuntime.jsx(Source,{icon:"file",rest:v.script.directions,inCard:true}):null,v.script.note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterSource",children:v.script.note}):null]}):null,v.cards.map((c,i)=>/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
190
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:c.title}),
|
|
191
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"rxLead",children:c.lead}),c.note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteStandalone",children:c.note}):null,i===v.cards.length-1?ask:null]},c.key)),v.cards.length===0&&v.aside?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
192
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:v.aside.title}),
|
|
193
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"rxLead",children:v.aside.lead}),ask]}):null,typeof v.note=="string"?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteStandalone",children:v.note}):null,v.note&&typeof v.note!="string"?/* @__PURE__ */jsxRuntime.jsxs(T,{k:"noteStandalone",children:[`${v.note.before} `
|
|
194
|
+
/* @__PURE__ */,jsxRuntime.jsx(reactNative.Text,{style:kit.tx("noteLink"),accessibilityRole:"link",onPress:()=>nav.openExternal(v.note.link.href),children:v.note.link.label}),v.note.after]}):null]}),
|
|
195
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:v.legal})]})}function Prods({children:children}){let kit=useKit(),rows=[];return children.forEach((c,i)=>{i%2===0&&rows.push([]),rows[rows.length-1].push(c)}),/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("prods"),{columnGap:0}],children:rows.map((row,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flexDirection:"row",columnGap:PHONE_BOX.prods.columnGap,alignItems:"stretch"},children:[row,row.length===1?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{flex:1}}):null]},i))})}function Tile({tile:tile}){let kit=useKit(),nav=useShopNativeNav(),label=[tile.name,...tile.pills.map(p=>p.label),tile.meta,tile.price].filter(Boolean).join(", ");/* @__PURE__ */
|
|
196
|
+
return jsxRuntime.jsxs(Press,{role:"link",label:label,onPress:()=>nav.go(tile.to),style:[kit.v("prod"),{flex:1,minWidth:0}],children:[
|
|
197
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("prodImg"),{backgroundColor:tileTint(tile.tone),alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:tile.icon,k:"prodIcon"})}),tile.pills.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("prodTags"),{flexDirection:"row",flexWrap:"wrap"}],children:tile.pills.map(p=>/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:p},p.label))}):null,
|
|
198
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:kit.v("prodBody"),children:[
|
|
199
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"prodName",children:tile.name}),tile.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"prodMeta",children:tile.meta}):null,tile.price?/* @__PURE__ */jsxRuntime.jsx(T,{k:"prodPrice",children:tile.price}):null]})]})}function GhostTiles({n:n}){let kit=useKit();/* @__PURE__ */
|
|
200
|
+
return jsxRuntime.jsx(reactNative.View,{accessibilityElementsHidden:true,importantForAccessibility:"no-hide-descendants",children:/* @__PURE__ */jsxRuntime.jsx(Prods,{children:Array.from({length:n},(_,i)=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("prod"),{flex:1,minWidth:0}],children:[
|
|
201
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("prodImg"),{backgroundColor:tileTint("base")}]}),
|
|
202
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("prodBody"),children:/* @__PURE__ */jsxRuntime.jsx(Ghost,{rows:2})})]},i))})})}function ShopScreen({copy:copy,tabs:tabs,view:view}){let kit=useKit(),nav=useShopNativeNav(),shelves=view.shelves;/* @__PURE__ */
|
|
203
|
+
return jsxRuntime.jsxs(Frame,{tabs:{copy:copy,current:"shop",tabs:tabs},children:[
|
|
204
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:copy.shopTitle,meta:view.sub}),
|
|
205
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
206
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("input"),{flexDirection:"row",alignItems:"center"}],children:[
|
|
207
|
+
/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:"search",k:"inputIcon"}),
|
|
208
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.TextInput,{style:[kit.t("inputText"),{flex:1,minWidth:0}],value:view.query,onChangeText:view.onQuery,placeholder:copy.searchPlaceholder,placeholderTextColor:inkOf("inputPlaceholder"),accessibilityLabel:copy.searchLabel,autoCapitalize:"none",autoCorrect:false,returnKeyType:"search"})]}),view.filters.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.ScrollView,{horizontal:true,showsHorizontalScrollIndicator:false,accessibilityLabel:copy.filtersLabel,contentContainerStyle:[kit.v("filters"),{flexDirection:"row"}],children:view.filters.map(f=>{let k=f.current?"filterCurrent":"filter";/* @__PURE__ */
|
|
209
|
+
return jsxRuntime.jsx(Press,{role:"tab",selected:f.current,...f.to?{onPress:()=>nav.go(f.to)}:{},style:[kit.v(k),{flexDirection:"row",alignItems:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(T,{k:k,bare:true,children:f.label})},f.label)})}):null,shelves.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingShop,retry:shelves.retry}):null,shelves.phase==="loading"?/* @__PURE__ */jsxRuntime.jsx(GhostTiles,{n:6}):null,shelves.phase==="ready"?shelves.value.filter(s=>s.tiles.length>0).map(s=>/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{children:[
|
|
210
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v("sectionHead"),{flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"}],children:[
|
|
211
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardTitleInHead",role:"header",children:s.title}),s.link?/* @__PURE__ */jsxRuntime.jsx(ShopLinkText,{link:s.link}):null]}),
|
|
212
|
+
/* @__PURE__ */jsxRuntime.jsx(Prods,{children:s.tiles.map(t=>/* @__PURE__ */jsxRuntime.jsx(Tile,{tile:t},t.key))})]},s.key)):null,shelves.phase==="ready"&&view.empty?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{accessibilityLiveRegion:"polite",children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:view.empty})}):null]}),
|
|
213
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:view.legal})]})}var DOT_COLUMN=28;function Dot({state:state}){let kit=useKit();return state==="done"?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("dotDone"),{alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:"check",k:"dotDoneIcon",inkKey:"dotDone"})}):state==="now"?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("dotNow"),{alignItems:"center",justifyContent:"center"}],children:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("dotNowCore")})}):/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v("dotNext")})}function Tracker({copy:copy,steps:steps}){let kit=useKit();/* @__PURE__ */
|
|
214
|
+
return jsxRuntime.jsx(reactNative.View,{children:steps.map((s,i)=>{let last=i===steps.length-1,li=kit.v(last?"trackerLiLast":"trackerLi"),titleKey=s.state==="next"?"trackerTitleNext":"trackerTitle";/* @__PURE__ */
|
|
215
|
+
return jsxRuntime.jsxs(reactNative.View,{style:[li,{flexDirection:"row",alignItems:"flex-start",rowGap:0,columnGap:0}],accessible:true,accessibilityLabel:[s.title,s.state==="now"?copy.now:null,s.when,s.text].filter(Boolean).join(", "),children:[last?null:/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:kit.v(s.state==="done"?"trackerLineDone":"trackerLine")}),
|
|
216
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{width:DOT_COLUMN,marginRight:li.columnGap},children:/* @__PURE__ */jsxRuntime.jsx(Dot,{state:s.state})}),
|
|
217
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:{flex:1,minWidth:0},children:[
|
|
218
|
+
/* @__PURE__ */jsxRuntime.jsxs(reactNative.View,{style:[kit.v(titleKey),{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}],children:[
|
|
219
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:titleKey,bare:true,children:s.title}),s.state==="now"?/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:{label:copy.now,tone:"stable"}}):null]}),s.when?/* @__PURE__ */jsxRuntime.jsx(T,{k:"trackerWhen",children:s.when}):null,s.text?/* @__PURE__ */jsxRuntime.jsx(T,{k:"trackerText",children:s.text}):null]})]},s.key)})})}function TrackingScreen({copy:copy,view:view}){let kit=useKit(),nav=useShopNativeNav();if(view.phase!=="ready")/* @__PURE__ */
|
|
220
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
221
|
+
/* @__PURE__ */jsxRuntime.jsx(Stack,{children:view.phase==="failed"?/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingOrder,retry:view.retry}):/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
222
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.whereItStands}),
|
|
223
|
+
/* @__PURE__ */jsxRuntime.jsx(Ghost,{})]})}),
|
|
224
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:copy.legalTracking})]});let v=view.value,link=kit.v("rowLink");/* @__PURE__ */
|
|
225
|
+
return jsxRuntime.jsxs(Frame,{children:[
|
|
226
|
+
/* @__PURE__ */jsxRuntime.jsx(TitleBlock,{title:v.title,meta:v.sub}),
|
|
227
|
+
/* @__PURE__ */jsxRuntime.jsxs(Stack,{children:[
|
|
228
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
229
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.whereItStands}),v.tracker.kind==="ended"?/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLead",children:v.tracker.line}):/* @__PURE__ */jsxRuntime.jsx(Tracker,{copy:copy,steps:v.tracker.steps}),v.track?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:{marginTop:PHONE_BOX.noteAfterTotal.marginTop},children:/* @__PURE__ */jsxRuntime.jsx(Press,{role:"link",label:v.track.label,onPress:()=>nav.openExternal(v.track.href),style:[kit.v("cardLink"),{alignSelf:"flex-start"}],children:/* @__PURE__ */jsxRuntime.jsx(T,{k:"cardLink",bare:true,style:underline("cardLink"),children:v.track.label})})}):null]}),v.items.length>0?/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
230
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.inTheBox}),
|
|
231
|
+
/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{children:v.items.map((it,i)=>/* @__PURE__ */jsxRuntime.jsxs(ItemRow,{index:i,count:v.items.length,first:"trackItemsLiFirst",last:"trackItemsLiLast",thumb:/* @__PURE__ */jsxRuntime.jsx(Thumb,{tone:it.tone,icon:it.icon}),end:it.pill?/* @__PURE__ */jsxRuntime.jsx(Pill,{pill:it.pill}):null,children:[
|
|
232
|
+
/* @__PURE__ */jsxRuntime.jsx(ItemName,{name:it.name,rx:it.rx,copy:copy}),it.meta?/* @__PURE__ */jsxRuntime.jsx(T,{k:"itemsMeta",children:it.meta}):null]},it.key))})]}):null,
|
|
233
|
+
/* @__PURE__ */jsxRuntime.jsxs(Card,{children:[
|
|
234
|
+
/* @__PURE__ */jsxRuntime.jsx(CardTitle,{children:copy.payment}),
|
|
235
|
+
/* @__PURE__ */jsxRuntime.jsx(Sum,{rows:v.sum,total:true}),v.note?/* @__PURE__ */jsxRuntime.jsx(T,{k:"noteAfterTotal",children:v.note}):null,v.actions.length>0?/* @__PURE__ */jsxRuntime.jsx(reactNative.View,{style:[kit.v("breaks"),{flexDirection:"row",flexWrap:"wrap",alignItems:"center"}],children:v.actions.map(a=>/* @__PURE__ */jsxRuntime.jsx(OutlineButton,{k:"btnSm",action:a},a.label))}):null,
|
|
236
|
+
/* @__PURE__ */jsxRuntime.jsx(InlineError,{line:v.error})]}),
|
|
237
|
+
/* @__PURE__ */jsxRuntime.jsxs(Press,{role:"link",label:v.allOrders.label,onPress:()=>nav.go(v.allOrders.to),style:[link,{flexDirection:"row",alignItems:"center",rowGap:0,columnGap:0}],children:[
|
|
238
|
+
/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:"box",k:"rowLinkIcon",inkKey:"rowLink",style:{marginRight:link.columnGap}}),
|
|
239
|
+
/* @__PURE__ */jsxRuntime.jsx(T,{k:"rowLink",bare:true,style:{flex:1,minWidth:0},children:v.allOrders.label}),
|
|
240
|
+
/* @__PURE__ */jsxRuntime.jsx(PartIcon,{name:"chevron",k:"rowLinkChevron",style:{marginLeft:link.columnGap}})]})]}),
|
|
241
|
+
/* @__PURE__ */jsxRuntime.jsx(Legal,{line:v.legal})]})}function LivePackage(){let{copy:copy}=useShop(),nav=useShopNativeNav(),{tabs:tabs,view:view}=usePackageScreen(nav.go);/* @__PURE__ */
|
|
242
|
+
return jsxRuntime.jsx(PackageScreen,{copy:copy,tabs:tabs,view:view})}function LiveShop({initialQuery:initialQuery}){let{copy:copy}=useShop(),{tabs:tabs,view:view}=useShopScreen(initialQuery);/* @__PURE__ */
|
|
243
|
+
return jsxRuntime.jsx(ShopScreen,{copy:copy,tabs:tabs,view:view})}function LiveProduct({offerId:offerId,petId:petId,avatar:avatar}){let{copy:copy}=useShop(),nav=useShopNativeNav(),state=useProductScreen(offerId,petId,nav.go);return state.kind==="rx"?/* @__PURE__ */jsxRuntime.jsx(RxProductScreen,{copy:copy,view:state.view,...avatar?{avatar:avatar}:{}}):/* @__PURE__ */jsxRuntime.jsx(ProductScreen,{copy:copy,view:state.view})}function LivePlan({reminders:reminders}){let{copy:copy}=useShop(),{tabs:tabs,view:view}=usePlanScreen();/* @__PURE__ */
|
|
244
|
+
return jsxRuntime.jsx(PlanScreen,{copy:copy,tabs:tabs,view:view,reminders:reminders})}function LiveOrders(){let{copy:copy}=useShop(),{tabs:tabs,view:view}=useOrdersScreen();/* @__PURE__ */
|
|
245
|
+
return jsxRuntime.jsx(OrdersScreen,{copy:copy,tabs:tabs,view:view})}function LiveTracking({orderId:orderId}){let{copy:copy}=useShop(),{view:view}=useTrackingScreen(orderId);/* @__PURE__ */
|
|
246
|
+
return jsxRuntime.jsx(TrackingScreen,{copy:copy,view:view})}function LiveAddress({then:then}){let{copy:copy}=useShop(),nav=useShopNativeNav();/* @__PURE__ */
|
|
247
|
+
return jsxRuntime.jsx(AddressFormScreen,{copy:copy,...useAddressStep(then,nav.go)})}function LiveCard({then:then,handoff:handoff}){let{copy:copy}=useShop(),nav=useShopNativeNav();/* @__PURE__ */
|
|
248
|
+
return jsxRuntime.jsx(CardSetupScreen,{copy:copy,...useCardStep(then,nav.go,handoff)})}function LiveBuy({route:route}){let{copy:copy}=useShop(),nav=useShopNativeNav();/* @__PURE__ */
|
|
249
|
+
return jsxRuntime.jsx(BuyConfirmScreen,{copy:copy,...useBuyStep(route,nav.go)})}function LiveConsent({route:route}){let{copy:copy}=useShop(),nav=useShopNativeNav();/* @__PURE__ */
|
|
250
|
+
return jsxRuntime.jsx(PlanConsentScreen,{copy:copy,...useConsentStep(route,nav.go)})}function shopBackRoute(route){switch(route.name){case"package":case"shop":case"plan":case"orders":return null;case"product":return{name:"shop"};case"order":return{name:"orders"};case"address":case"card":return route.then??{name:"plan"};case"buy":case"consent":return{name:"product",offerId:route.offerId,...route.petId?{petId:route.petId}:{}}}}function EverfurShop(props){let{client:client,pets:pets,packageSource:packageSource,copy:copy,fonts:fonts,renderIcon:renderIcon,payments:payments,...rest}=props;/* @__PURE__ */
|
|
251
|
+
return jsxRuntime.jsx(ShopProvider,{client:client,payments:payments??null,...pets?{pets:pets}:{},...packageSource?{packageSource:packageSource}:{},...copy?{copy:copy}:{},children:/* @__PURE__ */jsxRuntime.jsx(ShopKitProvider,{...fonts?{fonts:fonts}:{},...renderIcon?{renderIcon:renderIcon}:{},children:/* @__PURE__ */jsxRuntime.jsx(ShopGate,{...rest})})})}function ShopGate({route:route,onRouteChange:onRouteChange,openExternal:openExternal,bookVisitHref:bookVisitHref,cardHandoff:cardHandoff,avatar:avatar,reminders:reminders,onUnavailable:onUnavailable}){let{copy:copy}=useShop(),config=useShopConfig(),nav=react.useMemo(()=>({go:onRouteChange,openExternal:openExternal}),[onRouteChange,openExternal]),unavailable=config.phase==="unavailable"||config.error?.kind==="signedOut";return react.useEffect(()=>{unavailable&&onUnavailable?.()},[unavailable,onUnavailable]),config.phase==="loading"||unavailable?null:config.phase==="failed"||!config.value?/* @__PURE__ */jsxRuntime.jsx(ShopNativeNavProvider,{value:nav,children:/* @__PURE__ */jsxRuntime.jsx(Frame,{children:/* @__PURE__ */jsxRuntime.jsx(Stack,{children:/* @__PURE__ */jsxRuntime.jsx(LoadFailed,{copy:copy,thing:copy.thingShop,retry:config.refresh})})})}):/* @__PURE__ */jsxRuntime.jsx(ShopNativeNavProvider,{value:nav,children:/* @__PURE__ */jsxRuntime.jsx(ShopPages,{route:route,config:config.value,bookVisitHref:bookVisitHref??null,cardHandoff:cardHandoff??null,avatar:avatar,reminders:reminders})})}function ShopPages({route:route,config:config,bookVisitHref:bookVisitHref,cardHandoff:cardHandoff,avatar:avatar,reminders:reminders}){let pkg=usePackage(),packageShown=pkg.phase==="loading"||pkg.phase==="failed"||pkg.phase==="ready"&&pkg.value!==null,tabs=react.useMemo(()=>packageShown?["package","shop","orders","plan"]:["shop","orders","plan"],[packageShown]),shown=route.name==="package"&&!packageShown?{name:"shop"}:route,shared=react.useMemo(()=>({config:config,tabs:tabs,pkg:pkg,bookVisitHref:bookVisitHref}),[config,tabs,pkg,bookVisitHref]);/* @__PURE__ */
|
|
252
|
+
return jsxRuntime.jsx(ShopSharedProvider,{value:shared,children:screen(shown,cardHandoff,avatar,reminders)})}function screen(route,cardHandoff,avatar,reminders){switch(route.name){case"package":/* @__PURE__ */
|
|
253
|
+
return jsxRuntime.jsx(LivePackage,{});case"shop":/* @__PURE__ */
|
|
254
|
+
return jsxRuntime.jsx(LiveShop,{...route.query?{initialQuery:route.query}:{}});case"product":/* @__PURE__ */
|
|
255
|
+
return jsxRuntime.jsx(LiveProduct,{offerId:route.offerId,...route.petId?{petId:route.petId}:{},...avatar?{avatar:avatar}:{}},route.offerId);case"plan":/* @__PURE__ */
|
|
256
|
+
return jsxRuntime.jsx(LivePlan,{reminders:reminders});case"orders":/* @__PURE__ */
|
|
257
|
+
return jsxRuntime.jsx(LiveOrders,{});case"order":/* @__PURE__ */
|
|
258
|
+
return jsxRuntime.jsx(LiveTracking,{orderId:route.orderId},route.orderId);case"address":/* @__PURE__ */
|
|
259
|
+
return jsxRuntime.jsx(LiveAddress,{...route.then?{then:route.then}:{}});case"card":/* @__PURE__ */
|
|
260
|
+
return jsxRuntime.jsx(LiveCard,{handoff:cardHandoff,...route.then?{then:route.then}:{}});case"buy":/* @__PURE__ */
|
|
261
|
+
return jsxRuntime.jsx(LiveBuy,{route:route});case"consent":/* @__PURE__ */
|
|
262
|
+
return jsxRuntime.jsx(LiveConsent,{route:route})}}var SECRET_IN_URL=/(client_secret|_secret_|[?&#](sk|rk)_(live|test)_)/i,FAILED={ok:false,message:null},CLOSED={ok:false,message:null,closed:true};function safePageUrl(raw){if(!raw)return null;let u;try{u=new URL(raw)}catch{return null}return u.protocol!=="https:"||u.username||u.password||SECRET_IN_URL.test(raw)?null:u.toString()}function returnedParam(result,returnUrl,key){if(result.type!=="success"||typeof result.url!="string"||!result.url.startsWith(returnUrl))return;let queryAt=result.url.indexOf("?");if(queryAt===-1)return null;let query=result.url.slice(queryAt+1).split("#")[0]??"";for(let pair of query.split("&")){let[k,v=""]=pair.split("=");if(k===key)try{return decodeURIComponent(v)}catch{return null}}return null}async function runInBrowser(openAuthSession,url,returnUrl,read){let result;try{result=await openAuthSession(url,returnUrl)}catch{return FAILED}return result.type!=="success"?CLOSED:read(result)}function createInAppBrowserCardSetup(options){let{openAuthSession:openAuthSession,pageUrl:pageUrl,client:client,returnUrl:returnUrl}=options,makePage=async()=>{if(pageUrl)return pageUrl();if(!client)return null;let res=await client.startCardSetupSession({idempotencyKey:newIdempotencyKey(),returnUrl:returnUrl});return res.ok?res.value.url:null};return async()=>{let url;try{url=safePageUrl(await makePage())}catch{url=null}return url?runInBrowser(openAuthSession,url,returnUrl,result=>{let outcome=returnedParam(result,returnUrl,"oms_card");return outcome===void 0?FAILED:outcome==="canceled"?CLOSED:outcome===null||outcome==="done"?{ok:true}:FAILED}):FAILED}}function createInAppBrowserPayments(options){let{openAuthSession:openAuthSession,client:client,returnUrl:returnUrl}=options;return{confirmCardSetup:()=>Promise.resolve(FAILED),async handleNextAction(_clientSecret,context){if(!context?.orderId)return FAILED;let url;try{let res=await client.cardActionLink(context.orderId,{returnUrl:returnUrl});url=res.ok?safePageUrl(res.value.url):null}catch{url=null}return url?runInBrowser(openAuthSession,url,returnUrl,result=>{let outcome=returnedParam(result,returnUrl,"oms_card_action");return outcome==="succeeded"?{ok:true}:outcome==="canceled"?CLOSED:FAILED}):FAILED}}}function createInAppBrowserCard(options){return{cardHandoff:createInAppBrowserCardSetup({openAuthSession:options.openAuthSession,client:options.client,returnUrl:options.returnUrl}),payments:createInAppBrowserPayments(options)}}var OmsWireError=class _OmsWireError extends Error{constructor(field){super(`OMS answer could not be read: ${field}`);this.field=field;this.name="OmsWireError",Object.setPrototypeOf(this,_OmsWireError.prototype)}};function obj(value,field){if(value===null||typeof value!="object"||Array.isArray(value))throw new OmsWireError(field);return value}function arr(value,field){if(value==null)return[];if(!Array.isArray(value))throw new OmsWireError(field);return value}function str(o,key,field=key){let v=o[key];if(typeof v!="string"||v.length===0)throw new OmsWireError(field);return v}function optStr(o,key){let v=o[key];return typeof v=="string"&&v.length>0?v:null}function int(o,key,field=key){let v=o[key];if(typeof v!="number"||!Number.isFinite(v))throw new OmsWireError(field);return Math.trunc(v)}function optInt(o,key){let v=o[key];return typeof v=="number"&&Number.isFinite(v)?Math.trunc(v):null}function bool(o,key){return o[key]===true}function petIdOf(value){if(!value||typeof value!="object")return null;let id=value.pet_id;return typeof id=="string"&&id.length>0?id:null}var PACK_UNITS=["each","gram","milliliter"],SPEEDS=["ground","two_day","next_day"];function packUnit(o){let v=o.pack_unit;return typeof v=="string"&&PACK_UNITS.includes(v)?v:null}function speed(v){return typeof v=="string"&&SPEEDS.includes(v)?v:null}function httpsUrl(o,key){let v=optStr(o,key);if(!v)return null;try{return new URL(v).protocol==="https:"?v:null}catch{return null}}function shopConfigFromWire(raw){let o=obj(raw,"shop-config"),delivery=o.delivery&&typeof o.delivery=="object"?o.delivery:null,key=optStr(o,"stripe_publishable_key");return{recurringTermsVersion:optStr(o,"recurring_terms_version"),recurringTermsUrl:httpsUrl(o,"recurring_terms_url"),stripePublishableKey:key&&/^pk_(test|live)_[A-Za-z0-9]+$/.test(key)?key:null,delivery:delivery?{firstFill:speed(delivery.first_fill),refill:speed(delivery.refill)}:null}}function offerFromWire(raw){let o=obj(raw,"offer"),qty=o.pack_quantity;return{offerId:str(o,"offer_id"),sku:optStr(o,"sku")??"",title:str(o,"title"),fulfillmentType:optStr(o,"fulfillment_type")??"physical",requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),price:optInt(o,"price")}}function offerPageFromWire(raw){let o=obj(raw,"offers");return{offers:arr(o.offers,"offers").map(offerFromWire),nextCursor:optStr(o,"next_cursor")}}function quoteFromWire(raw){let o=obj(raw,"quote");return{lines:arr(o.lines,"lines").map(l=>{let line=obj(l,"line");return{offerId:str(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}}),shipping:int(o,"shipping"),tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:str(o,"expires_at")}}function checkoutFromWire(raw){let o=obj(raw,"checkout");return{checkoutId:str(o,"checkout_id"),state:optStr(o,"state")??"draft",orderIds:arr(o.order_ids,"order_ids").filter(id=>typeof id=="string"),createdAt:optStr(o,"created_at")??"",total:int(o,"total"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0}}function confirmationFromWire(raw){let o=obj(raw,"confirmation");return{checkoutId:str(o,"checkout_id"),resale:arr(o.resale,"resale").map(r=>{let entry=obj(r,"resale"),outcome=str(entry,"outcome");if(outcome!=="confirmed"&&outcome!=="action_required")throw new OmsWireError("resale.outcome");let payerAction=optStr(entry,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("resale.payer_action");return{outcome:outcome,orderId:str(entry,"order_id"),payerAction:outcome==="confirmed"?null:payerAction}})}}function orderSummaryFromWire(raw){let o=obj(raw,"order"),ref=o.reference&&typeof o.reference=="object"?o.reference:null;return{orderId:str(o,"order_id"),referenceNumber:ref?optStr(ref,"number"):null,status:str(o,"status"),total:int(o,"total"),placedAt:optStr(o,"placed_at")}}function orderPageFromWire(raw){let o=obj(raw,"orders");return{orders:arr(o.orders,"orders").map(orderSummaryFromWire),nextCursor:optStr(o,"next_cursor")}}function orderLineFromWire(raw){let o=obj(raw,"line"),qty=o.pack_quantity;return{lineId:str(o,"line_id"),offerId:str(o,"offer_id"),sku:optStr(o,"sku")??"",title:str(o,"title"),requiresRx:bool(o,"requires_rx"),compounded:bool(o,"compounded"),packQuantity:typeof qty=="string"&&/^\d+(\.\d+)?$/.test(qty)?qty:null,packUnit:packUnit(o),quantity:int(o,"quantity"),unitPrice:int(o,"unit_price"),discount:optInt(o,"discount")??0,tax:optInt(o,"tax")??0,fulfillmentType:optStr(o,"fulfillment_type")??"physical",petId:petIdOf(o.pet)}}function trackingFromWire(raw){let o=obj(raw,"tracking");return{carrier:optStr(o,"carrier"),trackingNumber:optStr(o,"tracking_number"),status:str(o,"status"),occurredAt:optStr(o,"occurred_at"),trackingUrl:httpsUrl(o,"tracking_url"),deliveryBy:optStr(o,"delivery_by")}}function shipmentFromWire(raw){let o=obj(raw,"shipment");return{shipmentId:str(o,"shipment_id"),state:str(o,"state"),lines:arr(o.lines,"shipment.lines").map(l=>{let line=obj(l,"shipment.line");return{lineId:str(line,"line_id"),quantity:int(line,"quantity")}}),tracking:arr(o.tracking,"tracking").map(trackingFromWire)}}function orderFromWire(raw){let o=obj(raw,"order");return{summary:orderSummaryFromWire(o.summary),lines:arr(o.lines,"lines").map(orderLineFromWire),shipping:optInt(o,"shipping")??0,shippingTax:optInt(o,"shipping_tax")??0,shipments:arr(o.shipments,"shipments").map(shipmentFromWire),canCancel:bool(o,"can_cancel"),canReturn:bool(o,"can_return"),canPay:bool(o,"can_pay"),paymentStatus:optStr(o,"payment_status"),refunds:arr(o.refunds,"refunds").map(r=>{let refund=obj(r,"refund");return{refundId:str(refund,"refund_id"),amount:int(refund,"amount"),state:str(refund,"state")}}),returnIds:arr(o.return_ids,"return_ids").filter(id=>typeof id=="string")}}function cancelOutcomeFromWire(raw){let o=obj(raw,"cancel");return{outcome:str(o,"outcome"),refunded:optInt(o,"refunded"),reasonCode:optStr(o,"reason_code")}}function payOutcomeFromWire(raw){let o=obj(raw,"pay"),outcome=str(o,"outcome");if(outcome!=="authorized"&&outcome!=="action_required")throw new OmsWireError("pay.outcome");let payerAction=optStr(o,"payer_action");if(outcome==="action_required"&&!payerAction)throw new OmsWireError("pay.payer_action");return{outcome:outcome,orderId:str(o,"order_id"),payerAction:outcome==="authorized"?null:payerAction}}function returnFromWire(raw){let o=obj(raw,"return");return{returnId:str(o,"return_id"),orderId:str(o,"order_id"),lines:arr(o.lines,"return.lines").map(l=>{let line=obj(l,"return.line");return{lineId:str(line,"line_id"),quantity:int(line,"quantity"),reasonCode:str(line,"reason_code")}}),state:str(o,"state"),rma:optStr(o,"rma"),labelUrl:httpsUrl(o,"label_url")}}function caseFromWire(raw){let o=obj(raw,"case");return{caseId:str(o,"case_id"),orderId:str(o,"order_id"),reasonCode:str(o,"reason_code"),message:typeof o.message=="string"?o.message:"",openedAt:str(o,"opened_at"),closedAt:optStr(o,"closed_at")}}function casesFromWire(raw){return arr(obj(raw,"cases").cases,"cases").map(caseFromWire)}function prescriptionsFromWire(raw){return arr(obj(raw,"prescriptions").prescriptions,"prescriptions").map(r=>{let o=obj(r,"prescription");return{rxId:str(o,"rx_id"),petId:str(o,"pet_id"),drug:str(o,"drug"),strength:optStr(o,"strength"),form:optStr(o,"form"),status:str(o,"status"),offerId:optStr(o,"offer_id"),packCount:optInt(o,"pack_count"),fillsUsed:optInt(o,"fills_used"),fillsTotal:optInt(o,"fills_total"),expiresOn:optStr(o,"expires_on"),nextFillOn:optStr(o,"next_fill_on")}})}function addressEntryFromWire(raw){let o=obj(raw,"address");return{ref:str(o,"ref"),label:optStr(o,"label")??"",isDefault:bool(o,"is_default"),isComplete:bool(o,"is_complete")}}function addressesFromWire(raw){return arr(obj(raw,"addresses").addresses,"addresses").map(addressEntryFromWire)}function addressDetailFromWire(raw){let o=obj(raw,"address"),a=obj(o.address,"address.address"),address={recipientName:optStr(a,"recipient_name"),line1:str(a,"line1","address.line1"),line2:optStr(a,"line2"),city:str(a,"city","address.city"),region:str(a,"region","address.region"),postalCode:str(a,"postal_code","address.postal_code"),country:str(a,"country","address.country")};return{...addressEntryFromWire(o),address:address}}function paymentMethodsFromWire(raw){return arr(obj(raw,"payment_methods").payment_methods,"payment_methods").map(r=>{let o=obj(r,"payment_method");return{paymentMethodId:str(o,"payment_method_id"),brand:optStr(o,"brand")??"",last4:optStr(o,"last4")??"",wallet:optStr(o,"wallet")}})}function paymentSetupFromWire(raw){let o=obj(raw,"setup");return{setupId:str(o,"setup_id"),payerAction:str(o,"payer_action")}}function cardSetupLinkFromWire(raw){let o=obj(raw,"card_setup");return{url:str(o,"url")}}function cardActionLinkFromWire(raw){let o=obj(raw,"card_action");return{url:str(o,"url"),expiresAt:str(o,"expires_at")}}function planFromWire(raw){let o=obj(raw,"plan");return{planId:str(o,"plan_id"),lines:arr(o.lines,"plan.lines").map(l=>{let line=obj(l,"plan.line");return{offerId:str(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),cadenceDays:int(o,"cadence_days"),destination:optStr(o,"destination"),paymentMethodId:optStr(o,"payment_method_id"),discountBps:optInt(o,"discount_bps")??0,nextRun:optStr(o,"next_run"),state:str(o,"state"),stopReason:optStr(o,"stop_reason")}}function planPageFromWire(raw){let o=obj(raw,"plans");return{plans:arr(o.plans,"plans").map(planFromWire),nextCursor:optStr(o,"next_cursor")}}function cartLineToWire(line){let wire={offer_id:line.offerId,quantity:line.quantity};return line.petId&&(wire.pet={namespace:"consumer",pet_id:line.petId}),line.rxId&&(wire.rx_id=line.rxId),wire}function addressInputToWire(input){let a=input.address;return{label:input.label,make_default:input.makeDefault===true,address:{recipient_name:a.recipientName,line1:a.line1,line2:a.line2,city:a.city,region:a.region,postal_code:a.postalCode,country:a.country}}}function cycleReviewFromWire(raw){let o=obj(raw,"cycle");return{planId:str(o,"plan_id"),reviewId:optStr(o,"review_id"),cycle:int(o,"cycle"),state:optStr(o,"state"),lines:arr(o.lines,"cycle.lines").map(l=>{let line=obj(l,"cycle.line");return{offerId:str(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet)}}),shipsOn:optStr(o,"ships_on"),approveBy:optStr(o,"approve_by"),quoteLines:arr(o.quote&&typeof o.quote=="object"?o.quote.lines:null,"cycle.quote.lines").map(l=>{let line=obj(l,"cycle.quote.line");return{offerId:str(line,"offer_id"),quantity:int(line,"quantity"),petId:petIdOf(line.pet),unitPrice:int(line,"unit_price"),discount:optInt(line,"discount")??0,tax:optInt(line,"tax")??0}})}}function cycleDraftFromWire(raw){let o=obj(raw,"cycle-draft");return{checkoutId:str(o,"checkout_id"),shipping:optInt(o,"shipping")??0,tax:optInt(o,"tax")??0,total:int(o,"total"),expiresAt:optStr(o,"expires_at")}}var DEFAULT_PATH="/api/v1/oms",DEFAULT_TIMEOUT_MS=3e4,PAYMENT_METHOD_ID=/^[A-Za-z0-9_]+$/,REASON_CODE=/^[a-z][a-z0-9_]{0,63}$/;function checkBaseUrl(raw){let url;try{url=new URL(raw)}catch{throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl is not a URL")}let local=url.hostname==="localhost"||url.hostname==="127.0.0.1"||url.hostname==="[::1]";if(url.protocol!=="https:"&&!(local&&url.protocol==="http:"))throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be https");if(url.username||url.password||url.search||url.hash)throw new EverfurConfigError("invalid-argument","createOmsClient: baseUrl must be a bare origin or path");return url.origin+url.pathname.replace(/\/+$/,"")}function seg(id){return encodeURIComponent(id)}function isValidId(id){return typeof id=="string"&&id.length>0&&id.length<=256}function createOmsClient(config){let base=checkBaseUrl(config.baseUrl)+(config.path??DEFAULT_PATH).replace(/\/+$/,""),fetchImpl=config.fetch??(typeof globalThis.fetch=="function"?globalThis.fetch.bind(globalThis):void 0);if(!fetchImpl)throw new EverfurConfigError("missing-peer-dependency","createOmsClient: no fetch available; pass config.fetch");if(!config.auth||config.auth.kind!=="everfur_consumer"||typeof config.auth.getToken!="function")throw new EverfurConfigError("invalid-argument",'createOmsClient: auth must be { kind: "everfur_consumer", getToken }');let getToken=config.auth.getToken,channel=config.channel??"web",timeoutMs=config.timeoutMs??DEFAULT_TIMEOUT_MS;async function token(){try{let t=await getToken();return typeof t=="string"&&t.length>0?t:null}catch{return null}}async function send(call){let bearer=await token();if(!bearer)return omsErr({kind:"signedOut"});let url=base+call.path;if(call.query){let params=new URLSearchParams;for(let[k,v]of Object.entries(call.query))v!==void 0&¶ms.set(k,String(v));let qs=params.toString();qs&&(url+=`?${qs}`)}let headers={accept:"application/json",authorization:`Bearer ${bearer}`},init={method:call.method,headers:headers};call.body!==void 0&&(headers["content-type"]="application/json",init.body=JSON.stringify(call.body));let controller=typeof AbortController=="function"?new AbortController:null;controller&&(init.signal=controller.signal);let timedOut=false,timer=setTimeout(()=>{timedOut=true,controller?.abort()},timeoutMs),res;try{res=await fetchImpl(url,init)}catch{return clearTimeout(timer),omsErr({kind:timedOut?"timeout":"network"})}try{let requestId=res.headers.get("x-request-id")??void 0,rid=requestId?{requestId:requestId}:{};if(res.status<200||res.status>=300){let body=res.status===402||res.status===409||res.status===422?await res.json().catch(()=>null):null;return omsErr(omsErrorFromStatus(res.status,body,{...rid,retryAfter:res.headers.get("retry-after")}))}if(call.read===null||res.status===204)return omsOk(void 0);let raw;try{raw=await res.json()}catch{return omsErr({kind:"badResponse",...rid})}try{return omsOk(call.read(raw))}catch{return omsErr({kind:"badResponse",...rid})}}catch{return omsErr({kind:timedOut?"timeout":"network"})}finally{clearTimeout(timer)}}let invalid=()=>Promise.resolve(omsErr({kind:"invalidRequest"}));function withId(id,run){return isValidId(id)?run(seg(id)):invalid()}let lines=ls=>ls.map(cartLineToWire);return{shopConfig:()=>send({method:"GET",path:"/shop-config",read:shopConfigFromWire}),offers:(q={})=>send({method:"GET",path:"/catalog/offers",query:{text:q.text,requires_rx:q.requiresRx,cursor:q.cursor,limit:q.limit},read:offerPageFromWire}),offer:offerId=>withId(offerId,id=>send({method:"GET",path:`/catalog/offers/${id}`,read:offerFromWire})),prescriptions:()=>send({method:"GET",path:"/prescriptions",read:prescriptionsFromWire}),addresses:()=>send({method:"GET",path:"/addresses",read:addressesFromWire}),address:ref=>withId(ref,id=>send({method:"GET",path:`/addresses/${id}`,read:addressDetailFromWire})),addAddress:input=>send({method:"POST",path:"/addresses",body:addressInputToWire(input),read:addressEntryFromWire}),updateAddress:(ref,input)=>withId(ref,id=>send({method:"PUT",path:`/addresses/${id}`,body:addressInputToWire(input),read:addressEntryFromWire})),removeAddress:ref=>withId(ref,id=>send({method:"DELETE",path:`/addresses/${id}`,read:null})),makeDefaultAddress:ref=>withId(ref,id=>send({method:"POST",path:`/addresses/${id}/default`,read:addressEntryFromWire})),paymentMethods:()=>send({method:"GET",path:"/payment-methods",read:paymentMethodsFromWire}),setupPaymentMethod:()=>send({method:"POST",path:"/payment-methods/setup",read:paymentSetupFromWire}),startCardSetupSession:r=>send({method:"POST",path:"/payment-methods/setup-session",body:{idempotency_key:r.idempotencyKey,return_url:r.returnUrl},read:cardSetupLinkFromWire}),removePaymentMethod:pm=>PAYMENT_METHOD_ID.test(pm)?send({method:"DELETE",path:`/payment-methods/${pm}`,read:null}):invalid(),quote:r=>send({method:"POST",path:"/cart/quote",body:{lines:lines(r.lines),ship_to:r.shipTo,promo_code:r.promoCode??null},read:quoteFromWire}),createCheckout:r=>send({method:"POST",path:"/checkouts",body:{idempotency_key:r.idempotencyKey,channel:channel,lines:lines(r.lines),ship_to:r.shipTo,receipt_email:r.receiptEmail??null,promo_code:r.promoCode??null},read:checkoutFromWire}),confirmCheckout:(checkoutId,r)=>PAYMENT_METHOD_ID.test(r.paymentMethodId)&&Number.isInteger(r.expectedTotal)?withId(checkoutId,id=>send({method:"POST",path:`/checkouts/${id}/confirm`,body:{idempotency_key:r.idempotencyKey,expected_total:r.expectedTotal,payment_method_id:r.paymentMethodId},read:confirmationFromWire})):invalid(),orders:(q={})=>send({method:"GET",path:"/orders",query:{cursor:q.cursor,limit:q.limit,reference:q.reference},read:orderPageFromWire}),order:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}`,read:orderFromWire})),cancelOrder:(orderId,r)=>REASON_CODE.test(r.reasonCode)?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cancel`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode},read:cancelOutcomeFromWire})):invalid(),payOrder:(orderId,r)=>{if(r.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(r.paymentMethodId))return invalid();let body={idempotency_key:r.idempotencyKey};return r.paymentMethodId&&(body.payment_method_id=r.paymentMethodId),withId(orderId,id=>send({method:"POST",path:`/orders/${id}/pay`,body:body,read:payOutcomeFromWire}))},cardActionLink:(orderId,r)=>withId(orderId,id=>send({method:"POST",path:`/orders/${id}/card-action-link`,body:{return_url:r.returnUrl},read:cardActionLinkFromWire})),requestReturn:(orderId,r)=>r.lines.every(l=>REASON_CODE.test(l.reasonCode))?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/returns`,body:{idempotency_key:r.idempotencyKey,lines:r.lines.map(l=>({line_id:l.lineId,quantity:l.quantity,reason_code:l.reasonCode}))},read:returnFromWire})):invalid(),getReturn:returnId=>withId(returnId,id=>send({method:"GET",path:`/returns/${id}`,read:returnFromWire})),cancelReturn:returnId=>withId(returnId,id=>send({method:"POST",path:`/returns/${id}/cancel`,read:returnFromWire})),openCase:(orderId,r)=>REASON_CODE.test(r.reasonCode)&&r.message.length<=4e3?withId(orderId,id=>send({method:"POST",path:`/orders/${id}/cases`,body:{idempotency_key:r.idempotencyKey,reason_code:r.reasonCode,message:r.message},read:caseFromWire})):invalid(),orderCases:orderId=>withId(orderId,id=>send({method:"GET",path:`/orders/${id}/cases`,read:casesFromWire})),plans:(q={})=>send({method:"GET",path:"/subscriptions",query:{cursor:q.cursor,limit:q.limit},read:planPageFromWire}),createPlan:input=>PAYMENT_METHOD_ID.test(input.paymentMethodId)?send({method:"POST",path:"/subscriptions",body:{idempotency_key:input.idempotencyKey,cadence_days:input.cadenceDays,destination:input.destination,payment_method_id:input.paymentMethodId,consent_terms_version:input.consentTermsVersion,lines:lines(input.lines)},read:planFromWire}):invalid(),updatePlan:(planId,patch)=>{if(patch.paymentMethodId!==void 0&&!PAYMENT_METHOD_ID.test(patch.paymentMethodId))return invalid();let body={idempotency_key:patch.idempotencyKey};return patch.lines&&(body.lines=lines(patch.lines)),patch.cadenceDays!==void 0&&(body.cadence_days=patch.cadenceDays),patch.destination!==void 0&&(body.destination=patch.destination),patch.paymentMethodId!==void 0&&(body.payment_method_id=patch.paymentMethodId),withId(planId,id=>send({method:"PATCH",path:`/subscriptions/${id}`,body:body,read:planFromWire}))},planAction:(planId,r)=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/actions`,body:{idempotency_key:r.idempotencyKey,operation:r.operation},read:planFromWire})),cancelPlan:planId=>withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cancel`,read:planFromWire})),cycleReview:planId=>withId(planId,id=>send({method:"GET",path:`/subscriptions/${id}/cycle`,read:cycleReviewFromWire})),editCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"PUT",path:`/subscriptions/${id}/cycles/${cycle}/lines`,body:{idempotency_key:r.idempotencyKey,lines:lines(r.lines)},read:cycleReviewFromWire})):invalid(),draftCycle:(planId,cycle)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/draft`,read:cycleDraftFromWire})):invalid(),approveCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0&&Number.isInteger(r.expectedTotal)?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/approve`,body:{idempotency_key:r.idempotencyKey,checkout_id:r.checkoutId,expected_total:r.expectedTotal},read:confirmationFromWire})):invalid(),skipCycle:(planId,cycle,r)=>Number.isInteger(cycle)&&cycle>0?withId(planId,id=>send({method:"POST",path:`/subscriptions/${id}/cycles/${cycle}/skip`,body:{idempotency_key:r.idempotencyKey},read:planFromWire})):invalid()}}exports.EverfurShop=EverfurShop;exports.SHOP_COPY=SHOP_COPY;exports.SHOP_COPY_PLACEHOLDERS=SHOP_COPY_PLACEHOLDERS;exports.ShopSwitchCard=ShopSwitchCard;exports.UNAVAILABLE_PACKAGE_SOURCE=UNAVAILABLE_PACKAGE_SOURCE;exports.createInAppBrowserCard=createInAppBrowserCard;exports.createInAppBrowserCardSetup=createInAppBrowserCardSetup;exports.createInAppBrowserPayments=createInAppBrowserPayments;exports.createOmsClient=createOmsClient;exports.createOmsPackageSource=createOmsPackageSource;exports.isOmsRefusal=isOmsRefusal;exports.isOmsRetryable=isOmsRetryable;exports.isOmsUnavailable=isOmsUnavailable;exports.newIdempotencyKey=newIdempotencyKey;exports.shopBackRoute=shopBackRoute;exports.shopCopy=shopCopy;
|