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