@everfur/sdk 0.3.0 → 0.4.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 +69 -4
- package/README.md +6 -1
- package/dist/{Chat-DwAC2vhB.d.ts → Chat-BZZ-Py5l.d.ts} +3 -3
- package/dist/{Chat-DPUD6dnc.d.cts → Chat-Dq4fffIO.d.cts} +3 -3
- package/dist/{DepthViews-DNEM96Se.d.ts → DepthViews-BG3E25MD.d.ts} +1 -1
- package/dist/{DepthViews-DP0R-DhB.d.cts → DepthViews-B_hIypI6.d.cts} +1 -1
- package/dist/{DepthViews-DbFhR4Du.d.cts → DepthViews-CL75jyRA.d.cts} +1 -1
- package/dist/{DepthViews-D_3hl4xk.d.ts → DepthViews-CkYri51q.d.ts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments-CQgFrEQ7.d.cts → attachments-BorG422I.d.cts} +2 -2
- package/dist/{attachments-5NeobOCd.d.ts → attachments-BrUWQYNK.d.ts} +5 -4
- package/dist/{attachments-D8T5re7e.d.cts → attachments-D_SECjr1.d.cts} +5 -4
- package/dist/{attachments-Bw3iMQgu.d.ts → attachments-DpldrvIW.d.ts} +2 -2
- package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
- package/dist/bookingCopy-SREvkG19.d.cts +732 -0
- package/dist/{entitlementRepository-DSbzuyAW.d.ts → branding-CsRdeNwK.d.cts} +1 -133
- package/dist/{entitlementRepository-DKdXFgTo.d.cts → branding-CsRdeNwK.d.ts} +1 -133
- package/dist/callCopy-DoQKG3-L.d.cts +40 -0
- package/dist/callCopy-DoQKG3-L.d.ts +40 -0
- package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
- package/dist/casesRepository-v6QczS9N.d.ts +51 -0
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.d.cts +9 -8
- package/dist/chat/index.d.ts +9 -8
- package/dist/chat/index.js +1 -1
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +10 -8
- package/dist/client/index.d.ts +10 -8
- package/dist/client/index.js +5 -5
- package/dist/{config-CzTZGlfF.d.cts → config--Wu1Umhd.d.cts} +2 -2
- package/dist/{config-DW60uRb9.d.ts → config-C7eb_IMD.d.ts} +2 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +1 -1
- package/dist/{context-XvTzq1tE.d.cts → context-CL3lyuy1.d.cts} +6 -6
- package/dist/{context-DXhqHlPU.d.ts → context-CahAEha8.d.ts} +6 -6
- package/dist/{copy-Mjoo91aS.d.ts → copy-DdVFDL01.d.ts} +2 -2
- package/dist/{copy-bKDNigLb.d.cts → copy-UeUJVk8X.d.cts} +2 -2
- package/dist/core/index.cjs +7 -7
- package/dist/core/index.d.cts +118 -29
- package/dist/core/index.d.ts +118 -29
- package/dist/core/index.js +7 -7
- package/dist/{depth-CErXCU8J.d.cts → depth-D5HwcvKC.d.cts} +34 -3
- package/dist/{depth-DjDcJ6kH.d.ts → depth-DvPwPuT_.d.ts} +34 -3
- package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
- package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
- package/dist/{identity-DI4eVx9S.d.cts → identity-C2-08BZW.d.cts} +2 -2
- package/dist/{identity-BMx2SUOM.d.ts → identity-CEi9GRFZ.d.ts} +2 -2
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +6 -6
- package/dist/notifications/index.cjs +2 -2
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/index.js +2 -2
- package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
- package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
- package/dist/{pets-CtQdRpWo.d.ts → pets-DJv2sj2H.d.ts} +1 -1
- package/dist/{pets-aB8q0JyX.d.cts → pets-JVCXgRgR.d.cts} +1 -1
- package/dist/{casesRepository-DHwtGRYY.d.cts → petsRepository-B_gKbAzJ.d.cts} +2 -48
- package/dist/{casesRepository-ClLv6qMl.d.ts → petsRepository-Bk6GDwLs.d.ts} +2 -48
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +1 -1
- package/dist/{ports-DEBzEhbp.d.cts → ports-BY2ph0_y.d.cts} +5 -15
- package/dist/{ports-DMolTRzU.d.ts → ports-D7YW8qz9.d.ts} +5 -15
- package/dist/records/depth/index.cjs +2 -2
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +2 -2
- package/dist/records/index.cjs +3 -3
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +3 -3
- package/dist/{requestFunnel-L-BQfi0z.d.cts → requestFunnel-BjDpqqvm.d.cts} +25 -2
- package/dist/{requestFunnel-CjW7uDuA.d.ts → requestFunnel-DFMGcluw.d.ts} +25 -2
- package/dist/{runtime-B8s-_hv8.d.cts → runtimeTypes-gZEJu-da.d.cts} +9 -99
- package/dist/{runtime-BR9ysG0J.d.ts → runtimeTypes-w5KqBMcs.d.ts} +9 -99
- 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/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +294 -0
- package/dist/televet/booking/index.d.ts +294 -0
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +141 -0
- package/dist/televet/call/index.d.ts +141 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.d.cts +87 -5
- package/dist/televet/index.d.ts +87 -5
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +3 -3
- package/dist/testing/index.d.cts +2 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +3 -3
- package/dist/testing/rn/index.cjs +1 -1
- package/dist/testing/rn/index.d.cts +9 -8
- package/dist/testing/rn/index.d.ts +9 -8
- package/dist/testing/rn/index.js +1 -1
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +9 -8
- package/dist/testing/web/index.d.ts +9 -8
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-DZed6dAM.d.ts → timelineRows-C15jxFFH.d.ts} +1 -1
- package/dist/{timelineRows-CaohZzXS.d.cts → timelineRows-odO8g9r2.d.cts} +1 -1
- package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
- package/dist/typeStyle-DmoyacDG.d.ts +111 -0
- package/dist/{useRecordsDepth-BHBzJ76R.d.cts → useRecordsDepth-C6rjEaLn.d.cts} +1 -1
- package/dist/{useRecordsDepth-BU-OhzH6.d.ts → useRecordsDepth-crhBllQK.d.ts} +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view-DtSPYpKa.d.ts → view-Bxwxp4xD.d.ts} +2 -2
- package/dist/{view-C3qPIXGX.d.cts → view-DyitEO0m.d.cts} +2 -2
- package/dist/web/consent/index.cjs +1 -1
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -1
- package/dist/web/index.cjs +7 -7
- package/dist/web/index.d.cts +18 -17
- package/dist/web/index.d.ts +18 -17
- package/dist/web/index.js +7 -7
- package/dist/web/notifications/index.cjs +2 -2
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/notifications/index.js +2 -2
- package/dist/web/records/depth/index.cjs +2 -2
- package/dist/web/records/depth/index.d.cts +7 -7
- package/dist/web/records/depth/index.d.ts +7 -7
- package/dist/web/records/depth/index.js +2 -2
- package/dist/web/records/index.cjs +3 -3
- package/dist/web/records/index.d.cts +102 -11
- package/dist/web/records/index.d.ts +102 -11
- package/dist/web/records/index.js +3 -3
- package/dist/web/televet/booking/index.cjs +1 -0
- package/dist/web/televet/booking/index.d.cts +349 -0
- package/dist/web/televet/booking/index.d.ts +349 -0
- package/dist/web/televet/booking/index.js +1 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +142 -0
- package/dist/web/televet/call/index.d.ts +142 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -1
- package/dist/web/televet/index.d.cts +90 -4
- package/dist/web/televet/index.d.ts +90 -4
- package/dist/web/televet/index.js +1 -1
- package/package.json +72 -4
- package/televet/booking/package.json +8 -0
- package/televet/call/package.json +8 -0
- package/web/televet/booking/native-blocked.cjs +12 -0
- package/web/televet/booking/package.json +8 -0
- package/web/televet/call/native-blocked.cjs +12 -0
- package/web/televet/call/package.json +8 -0
- package/dist/typeStyle-0TydiZ1w.d.cts +0 -19
- package/dist/typeStyle-CWMsoe6b.d.ts +0 -19
|
@@ -1,13 +1,71 @@
|
|
|
1
|
+
import { P as PetRef } from '../../ids-B2GAAifq.js';
|
|
2
|
+
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
1
3
|
import { U as UseVetVisitOptions, a as UseVetVisitState, V as VetVisitEntry, b as VetVisitErrorReason, c as VetVisitController } from '../../useVetVisit-CjmMa896.js';
|
|
2
4
|
export { d as VetVisitAvailability, e as VetVisitHandoff, f as VetVisitHandoffOptions, g as VetVisitHandoffVisit, h as VetVisitOpenResult, i as VetVisitReturn, j as VetVisitStatus, p as parseVetVisitReturn, v as vetVisitErrorReasonOf } from '../../useVetVisit-CjmMa896.js';
|
|
3
5
|
import { ReactNode, CSSProperties } from 'react';
|
|
4
6
|
import { E as EverfurError } from '../../EverfurResult-DN9pL2Ab.js';
|
|
5
7
|
export { a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../EverfurResult-DN9pL2Ab.js';
|
|
6
|
-
import { P as PetRef } from '../../ids-B2GAAifq.js';
|
|
7
|
-
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
8
8
|
import { V as VetVisitIntent } from '../../visitIntent-D7_yVp1I.js';
|
|
9
9
|
export { a as VET_VISIT_INTENTS, i as isVetVisitIntent } from '../../visitIntent-D7_yVp1I.js';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* What the button hands the host when it opens the in-page visit.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately the scoping the BUTTON was given and nothing more. The host already holds the session, the
|
|
15
|
+
* theme and the router; what it cannot know is which pet and which state this particular button was placed
|
|
16
|
+
* for, so that, and only that, travels. Identical to the RN twin's request, so one host-side presenter
|
|
17
|
+
* satisfies both.
|
|
18
|
+
*/
|
|
19
|
+
interface EverfurTelevetFlowRequest {
|
|
20
|
+
/** The pet this button was scoped to, when it was scoped to one. */
|
|
21
|
+
readonly petRef?: PetRef | null | undefined;
|
|
22
|
+
/** The member's US state, when the host gave one. The booking screens preflight availability with it. */
|
|
23
|
+
readonly usState?: string | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The host's presenter: show the Everfur booking flow. Called on click, and expected to route or present.
|
|
27
|
+
*
|
|
28
|
+
* It returns nothing. The button is not waiting on it and has nothing to do with the result: presenting a
|
|
29
|
+
* screen is the host's business, and a presenter that throws is contained (see `presentEverfurTelevetFlow`)
|
|
30
|
+
* rather than allowed to break the click.
|
|
31
|
+
*/
|
|
32
|
+
type EverfurTelevetFlowPresenter = (request: EverfurTelevetFlowRequest) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Register how this site presents the in-page vet visit. Call it ONCE, in your app entry:
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { registerEverfurTelevetFlow } from '@everfur/sdk/web/televet';
|
|
38
|
+
* registerEverfurTelevetFlow(() => router.push('/vet/book'));
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* From that line on, every `VetVisitButton` on the site opens your screen instead of a new tab, with no other
|
|
42
|
+
* change at any call site. Passing `null` unregisters it, which is what a test does between cases and what a
|
|
43
|
+
* partner does to go back to the hosted visit everywhere at once.
|
|
44
|
+
*/
|
|
45
|
+
declare function registerEverfurTelevetFlow(next: EverfurTelevetFlowPresenter | null): void;
|
|
46
|
+
/** Is an in-page flow registered? The button asks this to choose its destination before it mints anything. */
|
|
47
|
+
declare function hasEverfurTelevetFlow(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Present the registered flow. Answers whether the visit was HANDED OVER, which is what lets the caller fall
|
|
50
|
+
* through to the hosted handoff rather than leave the member on a screen that never opened.
|
|
51
|
+
*
|
|
52
|
+
* A THROWING PRESENTER IS NOT A DEAD BUTTON. A host router can throw (a route that was renamed, a modal
|
|
53
|
+
* controller that unmounted), and the member clicking the button has no idea any of that happened. So a throw
|
|
54
|
+
* is caught and reported as "not handed over", and the caller then mints and opens the hosted visit: the
|
|
55
|
+
* member reaches a vet either way, which is the floor this whole file is built around.
|
|
56
|
+
*
|
|
57
|
+
* THE THROW IS NOT SWALLOWED. It is re-surfaced to the partner's engineer through the console, because a
|
|
58
|
+
* router that throws on every click is a defect in their site that they need to see. The message is
|
|
59
|
+
* developer-facing and is never rendered: end-user copy is not authored in this repository.
|
|
60
|
+
*
|
|
61
|
+
* ONE COST OF THE FALL-THROUGH, STATED PLAINLY. The hosted path needs the click's own task to open its tab
|
|
62
|
+
* (see useVetVisit.ts), and a presenter that throws has already spent part of that task. The synchronous
|
|
63
|
+
* `window.open` still runs in the same task, so the fall-through keeps the gesture; what it cannot keep is a
|
|
64
|
+
* gesture a presenter consumed by awaiting something. A presenter is documented as synchronous for that
|
|
65
|
+
* reason: it routes, it does not fetch.
|
|
66
|
+
*/
|
|
67
|
+
declare function presentEverfurTelevetFlow(request: EverfurTelevetFlowRequest): boolean;
|
|
68
|
+
|
|
11
69
|
/**
|
|
12
70
|
* The vet visit hook for a web page. Render your own control and call `open()` directly from its click
|
|
13
71
|
* handler; `available` is false (render nothing) unless Everfur grants vet visits to this signed-in user.
|
|
@@ -37,6 +95,34 @@ interface VetVisitButtonProps {
|
|
|
37
95
|
readonly intent?: VetVisitIntent | null | undefined;
|
|
38
96
|
/** Called when the visit could not be opened. `error` is null for a browser-side failure (a blocked tab). */
|
|
39
97
|
readonly onError?: ((reason: VetVisitErrorReason, error: EverfurError | null) => void) | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Open the IN-PAGE booking flow (`EverfurTelevet`) for THIS button, instead of handing off to the hosted
|
|
100
|
+
* visit.
|
|
101
|
+
*
|
|
102
|
+
* PER-BUTTON, AND MORE SPECIFIC THAN THE REGISTRY. The flow is a component the host mounts, and the SDK
|
|
103
|
+
* owns no router, so the host is the only thing that can say where it lives: which is why this is a
|
|
104
|
+
* callback and not a `mode` flag the button could not honour. Use it for one button that routes somewhere
|
|
105
|
+
* of its own; use `registerEverfurTelevetFlow` for the site-wide default.
|
|
106
|
+
*
|
|
107
|
+
* `visitRef` still wins over it: a click that names an existing visit opens THAT visit, and there is no
|
|
108
|
+
* in-page surface for one yet. Sending an owner into a fresh booking funnel because they followed a
|
|
109
|
+
* reminder for the visit they already have is the wrong screen, loudly.
|
|
110
|
+
*/
|
|
111
|
+
readonly onStartInApp?: (() => void) | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Which destination a click takes. Defaults to `'in-app'`.
|
|
114
|
+
*
|
|
115
|
+
* `'in-app'` opens the flow this site registered with `registerEverfurTelevetFlow`; with nothing registered
|
|
116
|
+
* there is no flow to open, so the click mints and opens the hosted visit in a new tab exactly as it did
|
|
117
|
+
* before. That is the floor: a site that upgrades and changes nothing keeps a working button, and the
|
|
118
|
+
* member always reaches a vet.
|
|
119
|
+
*
|
|
120
|
+
* `'redirect'` is the explicit opt-in back to the hosted handoff. It ignores the registry entirely, which
|
|
121
|
+
* is what a partner wants for a surface they deliberately keep hosted.
|
|
122
|
+
*
|
|
123
|
+
* `visitRef` still wins over both: a click that names an existing visit opens THAT visit.
|
|
124
|
+
*/
|
|
125
|
+
readonly prefer?: 'in-app' | 'redirect' | undefined;
|
|
40
126
|
/** Merged over the button's own style. */
|
|
41
127
|
readonly style?: CSSProperties | undefined;
|
|
42
128
|
/** A class the host may hang its own layout rules on; the SDK sets no classes of its own. */
|
|
@@ -44,7 +130,7 @@ interface VetVisitButtonProps {
|
|
|
44
130
|
/** Host/test seam: inject a controller instead of building one from the provider's session. */
|
|
45
131
|
readonly controller?: VetVisitController | undefined;
|
|
46
132
|
}
|
|
47
|
-
/** Opens the
|
|
133
|
+
/** Opens the Everfur vet visit, in the partner's own page by default. Renders nothing unless it is granted. */
|
|
48
134
|
declare function VetVisitButton(props: VetVisitButtonProps): ReactNode;
|
|
49
135
|
|
|
50
|
-
export { EverfurError, PetRef, UseVetVisitOptions, UseVetVisitState, VetVisitButton, type VetVisitButtonProps, VetVisitController, VetVisitEntry, VetVisitErrorReason, VetVisitIntent, useVetVisit };
|
|
136
|
+
export { EverfurError, type EverfurTelevetFlowPresenter, type EverfurTelevetFlowRequest, PetRef, UseVetVisitOptions, UseVetVisitState, VetVisitButton, type VetVisitButtonProps, VetVisitController, VetVisitEntry, VetVisitErrorReason, VetVisitIntent, hasEverfurTelevetFlow, presentEverfurTelevetFlow, registerEverfurTelevetFlow, useVetVisit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {createContext,useMemo,useRef,useContext,useSyncExternalStore,useState,useEffect,useCallback}from'react';import {jsx}from'react/jsx-runtime';var cr=Object.defineProperty;var n=(e,r)=>cr(e,"name",{value:r,configurable:true});var G=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(G.map(e=>e.wireCode));var fr=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),me=Object.freeze(G.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:fr[e.wireCode]}))),pr=new Map(me.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),yr=Object.freeze(["http_envelope",...[...new Set(me.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function D(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let o of [r??"http_envelope",...yr]){let i=pr.get(o+t);if(i)return i}}n(D,"contractErrorFor");function mr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(mr,"contractDocUrl");function ve(e){return null}n(ve,"publishedDocUrl");var vr=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function be(e){return vr[e]}n(be,"categoryFor");function Ee(e){let r=D(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),o=t.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(Ee,"fromWire");var br=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function $(e){return br.has(e)}n($,"isAutoRetryable");var Er=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function ge(e){return $(e)||Er.has(e)}n(ge,"isRetryableCode");var gr=500,Q=8e3,he=4;function _e(e,r=Math.random){let t=Math.max(0,e),o=Math.min(gr*2**t,Q);return Math.floor(r()*o)}n(_e,"backoffDelayMs");var hr=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function X(e){return hr[e]}n(X,"userFacingError");function Re(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}n(Re,"defineHidden");var _r=/^[a-z][a-z0-9_]{0,63}$/;function x(e,r){let t=D(r?.wireCode,r?.wireEnvelope),o={code:e,category:be(e),retryable:r?.retryable??ge(e),displayMessage:X(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&_r.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),t);return r?.wireMessage&&Re(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Re(o,"raw",r.raw),Object.freeze(o)}n(x,"makeEverfurError");function J(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}n(J,"ok");function g(e){return Object.freeze({ok:false,error:e})}n(g,"err");var N=class N extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,N.prototype);}};n(N,"EverfurConfigError");var A=N;function Ce(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(Ce,"errorFrame");function Tr(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}n(Tr,"authHeaders");function P(e,r){return {...e,headers:{...wr(e.headers),...Tr(r)}}}n(P,"withAuthHeaders");function wr(e){if(!e)return {};let r={};for(let[t,o]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=o);}return r}n(wr,"stripAuthHeaders");async function Te(e,r){if(r.mode==="anonymous")return r.transport.request(P(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return g(Z())}let o=await r.transport.request(P(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return g(Z())}let a=await r.transport.request(P(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?g(Z(a.error.httpStatus)):a}n(Te,"authedSend");function Z(e){return x("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(Z,"authRejectedError");function we(e){return x("internalError",{retryable:true,wireMessage:Sr(e)})}n(we,"networkError");function Sr(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Sr,"describeCause");var xr=3e4,kr=Q*2,Fr="idempotency-key",Or=new Set(["POST","PUT","PATCH","DELETE"]),Vr=Object.freeze({onEvent(){}}),Ir=Object.freeze({setTimeout:n((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function xe(e){let r=e.observer??Vr,t=e.timers??Ir,o=e.rng??Math.random,i=e.sleep??((p,d)=>Wr(p,t,d)),a=e.maxAttempts??he,u=e.unaryTimeoutMs??xr,l=e.newIdempotencyKey??Pr(),s=n(p=>{try{r.onEvent(p);}catch{}},"emit");async function f(p,d,y){let h=y?.maxAttempts,c=Math.max(1,h??a),C=y?.idempotent??Or.has(d.method)?l():null,R=Ar(d,C),V=0;for(;;){let k=n(w=>Object.freeze({call:p,method:d.method,path:d.path,attempt:V,...C?{idempotencyKey:C}:{},...w}),"stamp");s(k({phase:"attempt"}));let F=qr(u,t),j=Hr(F.signal,d.signal),O;try{O=await Te({...R,signal:j.signal},e.auth);}catch(w){O=g(we(w));}finally{j.dispose(),F.cancel();}if(O.ok)return s(k({phase:"settled",ok:true,reason:"ok"})),O;let m=O.error,E=jr(m,V,{maxAttempts:c,rng:o,now:t.now(),aborted:d.signal?.aborted===true,...h!==void 0?{perCallMaxAttempts:h}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),T={ok:false,code:m.code,reason:E.reason,...m.httpStatus!==void 0?{httpStatus:m.httpStatus}:{},...m.requestId!==void 0?{requestId:m.requestId}:{}};if(!E.retry)return s(k({phase:"settled",...T})),g(m);if(s(k({phase:"retry",...T,delayMs:E.delayMs})),await i(E.delayMs,d.signal),d.signal?.aborted===true)return s(k({phase:"settled",...T,reason:"aborted"})),g(m);V+=1;}}n(f,"send");async function v(p){return P(p,await Br(e.auth))}n(v,"authorize");async function*b(p,d,y){s(Object.freeze({call:p,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,y);}catch{yield Ce({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(b,"stream"),Object.freeze({send:f,authorize:v,stream:b})}n(xe,"createRequestFunnel");function Ar(e,r){let t={};for(let[o,i]of Object.entries(e.headers??{}))o.toLowerCase()!==Fr&&(t[o]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}n(Ar,"assembleHeaders");function Pr(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Pr,"defaultIdempotencyKeyFactory");var zr=10;function jr(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let o=Dr(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!$(e.code))return {retry:false,reason:"terminal-code"};let i=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let u=n(()=>{if(t.policy===void 0)return null;let f;try{f=t.policy.maxAttempts(e.code);}catch{return null}return typeof f!="number"||!Number.isFinite(f)?null:Math.max(1,Math.min(zr,Math.floor(f)))},"policyCeiling"),l=t.perCallMaxAttempts??u()??t.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let s=Nr(e,t.now);return s!==null?s>kr?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:s}:{retry:true,reason:i,delayMs:_e(r,t.rng)}}n(jr,"decideRetry");function Dr(e){let r=e.code==="unknown"?Ee(Ur(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}n(Dr,"throttleKind");function Nr(e,r){let t=Mr(e.raw);if(t===null)return null;let o=t-r;return o>0?o:0}n(Nr,"retryOverrideMs");function Mr(e){for(let r of ke(e)){let t=r.resets_at,o=Lr(t);if(o!==null)return o}return null}n(Mr,"findResetsAt");function ke(e){if(!Se(e))return [];let r=[e];for(let t of ["error","detail"]){let o=e[t];Se(o)&&r.push(o);}return r}n(ke,"candidateScopes");function Lr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}n(Lr,"parseInstantMs");function Ur(e){for(let r of ke(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}n(Ur,"rawWireCode");function Se(e){return typeof e=="object"&&e!==null}n(Se,"isRecord");async function Br(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}n(Br,"resolveDeviceAuth");function qr(e,r){let t=new AbortController,o=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:n(()=>r.clearTimeout(o),"cancel")}}n(qr,"boundedSignal");function Hr(e,r){let t=n(()=>{},"noop");if(!r)return {signal:e,dispose:t};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:t};let i=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}n(Hr,"mergeSignals");function Wr(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(o=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",a),o();},e),a=n(()=>{r.clearTimeout(i),o();},"onAbort");t?.addEventListener("abort",a,{once:true});})}n(Wr,"delayAbortable");var M=Object.freeze(["visit","join","summary","messages"]);function L(e){return typeof e=="string"&&M.includes(e)}n(L,"isVetVisitIntent");var Yr="/widget/v1/televet/handoffs",Kr="/widget/v1/televet/availability",Gr="/widget/v1/televet/chat-entry",$r=/^[a-z0-9][a-z0-9_-]{0,39}$/,ze=/^[A-Za-z0-9_-]{22}$/,Fe="everfur_flow",Oe=32,Ve=128,Ie=64;function U(e){let r=e.httpStatus;switch(e.code){case "sessionRequired":return "sessionRequired";case "authExpired":case "authRejected":return "authRejected";case "sdkUpdateRequired":return "sdkUpdateRequired";case "validationFailed":return "invalidRequest";case "rateLimited":case "quotaExceeded":return "rateLimited";}return r===void 0?e.code==="internalError"?"network":"unknown":r===429?"rateLimited":r===404?"unavailable":r===403?"accessDenied":r===401?"authRejected":r===400||r===422?"invalidRequest":r>=500?"serverError":"unknown"}n(U,"vetVisitErrorReasonOf");function Ae(e){return g(x("validationFailed",{retryable:false,wireMessage:e}))}n(Ae,"invalid");function ee(e){return g(x("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}n(ee,"unusable");function Qr(e,r){let t={};e!==void 0&&(t.pet_ref=e);let o=r?.returnTo;if(o!=null){if(typeof o!="string"||!$r.test(o))return {ok:false,message:"returnTo must be a registered return destination key"};t.return_to=o;}let i=r?.entry;if(i!=null){if(i!=="chat"||e===void 0)return {ok:false,message:"entry 'chat' needs the pet the chat is about"};t.entry=i;}let a=r?.visitRef,u=r?.intent,l=a!=null;if(l){let s=typeof a=="string"?a.trim():"";if(s.length<1||[...s].length>Ie)return {ok:false,message:`visitRef must be 1..${Ie} characters`};t.visit_ref=s;}if(u!=null){if(!l)return {ok:false,message:"intent needs the visitRef it opens"};if(!L(u))return {ok:false,message:`intent must be one of ${M.join(", ")}`};t.intent=u;}return {ok:true,body:t}}n(Qr,"handoffBody");function Xr(e){if(typeof e!="object"||e===null)return null;let{visit_ref:r,intent:t}=e;return typeof r!="string"||r.length===0||!L(t)?null:Object.freeze({visitRef:r,intent:t})}n(Xr,"parseVisitEcho");function je(e){let r=e.funnel??xe({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=e.telemetry,o=n(i=>(Pe(t,"televet.visit.handoff_failed",{reason:U(i)}),g(i)),"failed");return {async createHandoff(i,a){let u;if(i!=null){let c=typeof i=="string"?[...i].length:0;if(c<1||c>Ve)return o(x("validationFailed",{retryable:false,wireMessage:`pet_ref must be 1..${Ve} characters`}));u=i;}let l=Qr(u,a);if(!l.ok){let c=Ae(l.message);return c.ok?c:o(c.error)}let s=l.body,f=await r.send("televet.visit.handoff",{method:"POST",path:Yr,body:s},{idempotent:false,maxAttempts:1});if(!f.ok)return o(f.error);let v=Zr(f.value),b=s.return_to!==void 0,p=b?f.value?.flow_id:void 0;if(b&&(typeof p!="string"||!ze.test(p))){let c=ee("the handoff response carried no usable return flow id");return c.ok?c:o(c.error)}let d=s.visit_ref!==void 0,y=d?Xr(f.value?.visit):null;if(d&&y===null){let c=ee("the handoff response did not confirm the visit it opens");return c.ok?c:o(c.error)}let h=v===null?null:Object.freeze({...v,...b?{flowId:p}:{},...y!==null?{visit:y}:{}});return h===null?o(x("internalError",{retryable:false,httpStatus:502,wireMessage:"the handoff response carried no usable visit url"})):(Pe(t,"televet.visit.handoff_created",{pet_scoped:s.pet_ref!==void 0}),J(h))},async checkAvailability(i){if(typeof i!="string"||i.length>Oe)return Ae(`state must be at most ${Oe} characters`);let a=await r.send("televet.visit.availability",{method:"POST",path:Kr,body:{state:i}},{idempotent:false,maxAttempts:1});if(!a.ok)return g(a.error);let u=a.value?.available;return typeof u!="boolean"?ee("the availability response carried no usable answer"):J(Object.freeze({available:u}))},async chatEntryOpen(){try{let i=await r.send("televet.visit.chat_entry",{method:"GET",path:Gr},{maxAttempts:1});return i.ok&&i.value?.open===!0}catch{return false}}}}n(je,"createVetVisitController");function Jr(e){if(typeof e!="string")return null;let r=e.indexOf("#"),t=r<0?e:e.slice(0,r),o=t.indexOf("?");if(o<0)return null;let i=t.slice(o+1).split("&").filter(a=>a.startsWith(`${Fe}=`)).map(a=>a.slice(Fe.length+1));return i.length!==1||!ze.test(i[0]??"")?null:Object.freeze({flowId:i[0]})}n(Jr,"parseVetVisitReturn");function Zr(e){if(typeof e!="object"||e===null)return null;let{url:r,expires_at:t}=e;return typeof r!="string"||typeof t!="string"||t.length===0||!nt(r)?null:Object.freeze({url:r,expiresAt:t})}n(Zr,"parseHandoff");var et=new Set(["localhost","127.0.0.1","[::1]"]),rt=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/,tt=/[\s\u0000-\u001f\u007f]/;function nt(e){if(tt.test(e))return false;let r=rt.exec(e);if(r===null)return false;let t=(r[1]??"").toLowerCase(),o=r[2]??"";if(o.length===0||o.includes("@"))return false;let i=o.replace(/:\d+$/,"").toLowerCase(),a=t==="https",u=t==="http"&&et.has(i);if(!a&&!u)return false;let l=e.indexOf("#");if(l<0)return false;let s=e.slice(l);return s.startsWith("#h=")&&s.length>3}n(nt,"isOpenableVisitUrl");function Pe(e,r,t){if(e)try{e.track(r,t);}catch{}}n(Pe,"safeTrack");var De=Symbol.for("@everfur/sdk#EverfurContext@v1"),Ne=globalThis,Me=Ne[De]??(Ne[De]=createContext(null));Me.displayName??="EverfurContext";function B(){let e=useContext(Me);if(e===null)throw new A("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(B,"useEverfurContext");var at=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function st(e){return at[e]}n(st,"requires");function Le(e,r,t){let o=st(e),i=new Map;for(let l of r)i.set(l.resource,l);if(t?.isPending===true&&o.some(l=>!i.has(l)))return re({name:e,enabled:false,isPending:true,limits:{}});let a=lt(o,i);return o.filter(l=>i.get(l)?.granted!==true).length===0?re({name:e,enabled:true,isPending:false,limits:a}):re({name:e,enabled:false,isPending:false,limits:a,disabled:ut(o,i)})}n(Le,"decideCapability");function lt(e,r){let t={};for(let o of e){let i=r.get(o)?.limits;if(i)for(let[a,u]of Object.entries(i)){let l=t[a];t[a]=l===void 0?u:Math.min(l,u);}}return t}n(lt,"mergeLimits");function ut(e,r){for(let t of e){let o=r.get(t)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:X("accessDenied"),level:"user_entitlement",recoverable:false})}n(ut,"disabledFor");function re(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}n(re,"freezeDecision");function Ue(e){let{runtime:r}=B(),t=r.entitlements,o=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>Le(e,o.decisions,{isPending:o.isPending}),[e,o])}n(Ue,"useCapability");var qe=Object.freeze({status:"idle",error:null,errorReason:null});function pt(e,r,t){let{usState:o,chat:i,scope:a}=t,u=r&&(o!==null||i),l=`${o??""}|${i?"chat":""}`,[s,f]=useState(null);if(useEffect(()=>{if(!u)return;let b=true,p=e.current;return f(null),n(async()=>{try{if(i&&!(p.chatEntryOpen&&await p.chatEntryOpen()))return !1;if(o===null)return !0;if(!p.checkAvailability)return !1;let y=await p.checkAvailability(o);return y.ok&&y.value.available}catch{return false}},"ask")().then(y=>{b&&f({key:l,open:y});}),()=>{b=false;}},[u,l,o,i,a,e]),!u)return null;let v=s!==null&&s.key===l;return {open:v&&s.open,pending:!v}}n(pt,"usePreflight");var yt=Object.freeze({status:"opening",error:null,errorReason:null});function We(e,r={}){let{runtime:t,userRef:o,scopeEpoch:i}=B(),a=Ue("televet"),u=a.enabled&&o!==null,l=r.usState??null,s=r.entry==="chat",f=r.petRef??null,v=useMemo(()=>{if(r.controller)return r.controller;let{services:m}=t.registry;return je({auth:m.authFor(o),telemetry:m.telemetry,...m.errorPolicy?{errorPolicy:m.errorPolicy}:{}})},[t,o,i,r.controller]),b=useRef(v);b.current=v;let p=useMemo(()=>({runtime:t,userRef:o,scopeEpoch:i}),[t,o,i]),d=pt(b,u,{usState:l,chat:s,scope:p}),y=u&&(d===null||d.open)&&(!s||f!==null),h=r.returnTo??null,[c,S]=useState(qe),C=useRef(null),R=useRef({runtime:t,userRef:o,scopeEpoch:i});R.current={runtime:t,userRef:o,scopeEpoch:i};let V=useRef(v);V.current=v;let k=useRef(y);k.current=y;let F=useCallback((m,E)=>{if(C.current)return C.current;let T=n((_,I)=>(S({status:_==="cancelled"?"idle":"error",error:I,errorReason:_==="cancelled"?null:_}),Object.freeze({opened:false,reason:_,error:I})),"fail");if(!k.current)return Promise.resolve(T("unavailable",null));let w=e.prepare();if(!w.ok)return Promise.resolve(T(w.reason,null));let W=R.current,de=V.current;S(yt);let Y=(async()=>{let _,I={...h!==null?{returnTo:h}:{},...s?{entry:"chat"}:{},...E!==null?{visitRef:E.visitRef}:{},...E!==null&&E.intent!==null&&E.intent!==void 0?{intent:E.intent}:{}},ce=Object.keys(I).length===0?void 0:I,fe=m===void 0?f:m;try{_=await(ce===void 0?de.createHandoff(fe):de.createHandoff(fe,ce));}catch{return e.abandon(w.value),T("unknown",null)}let K=R.current;if(K.runtime!==W.runtime||K.userRef!==W.userRef||K.scopeEpoch!==W.scopeEpoch)return e.abandon(w.value),T("cancelled",null);if(!_.ok)return e.abandon(w.value),T(U(_.error),_.error);let pe=await e.finish(w.value,_.value);return pe!==null?T(pe,null):(S(qe),Object.freeze(_.value.flowId===void 0?{opened:true}:{opened:true,flowId:_.value.flowId}))})().finally(()=>{C.current===Y&&(C.current=null);});return C.current=Y,Y},[e,f,h,s]),j=useCallback(m=>F(m,null),[F]),O=useCallback((m,E)=>F(void 0,{visitRef:m,intent:E??null}),[F]);return {available:y,isPending:a.isPending||(d?.pending??false),status:c.status,error:c.error,errorReason:c.errorReason,open:j,openVisit:O}}n(We,"useVetVisitWith");function Ye(e){try{e.closed||e.close();}catch{}}n(Ye,"closeQuietly");var mt=Object.freeze({prepare(){let e=null;try{e=typeof window>"u"?null:window.open("about:blank","_blank");}catch{e=null;}if(e===null)return {ok:false,reason:"popupBlocked"};try{e.opener=null;}catch{}return {ok:true,value:{tab:e}}},async finish({tab:e},r){if(e.closed)return "cancelled";try{return e.location.replace(r.url),null}catch{return Ye(e),"popupBlocked"}},abandon({tab:e}){Ye(e);}});function ne(e){return We(mt,e)}n(ne,"useVetVisit");function vt(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}n(vt,"slotBox");function Ke(e){return e?.textColor===void 0?{}:{color:e.textColor}}n(Ke,"slotText");function Ge(e,r){let t=vt(e,r),o={};return t.backgroundColor!==void 0&&(o.backgroundColor=t.backgroundColor),t.borderColor!==void 0&&(o.border=`${t.borderWidth??1}px solid ${t.borderColor}`),t.borderRadius!==void 0&&(o.borderRadius=t.borderRadius),o}n(Ge,"slotBoxCss");function $e(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n($e,"reportHostFailure");function bt(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(bt,"isThenable");function oe(e,...r){if(typeof e=="function")try{let t=e(...r);return bt(t)&&Promise.resolve(t).then(void 0,$e),t}catch(t){$e(t);return}}n(oe,"callHost");var Qe=Object.freeze({visitButton:"Talk to a vet"});function se(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))se(e[r]);}return e}n(se,"deepFreeze");var Et=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),Je={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},Ze={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},Xe={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},gt={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},ht={regular:"400",medium:"500",bold:"700"},_t={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Rt=0,q="System",H="monospace",Ct=["content","heading","control","compact","badge"];function Tt(e){let r={};for(let t of Ct)r[t]=e;return r}n(Tt,"authoredTierSizes");function er(){return {family:q,mono:H,fontUrl:null,families:{regular:q,medium:q,bold:q,mono:H,monoMedium:H,monoBold:H},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:Xe,tierSizes:Tt(Xe),lineHeight:gt,weight:ht,letterSpacing:_t,scale:1,maxScale:Rt,scaleCaps:Et}}n(er,"baseType");var rr={},ie=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ae(e){return `cubic-bezier(${e.join(", ")})`}n(ae,"cssCubicBezier");var tr={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ae(ie.standard),emphasized:ae(ie.emphasized),exit:ae(ie.exit)},reducedMotion:false},wt={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:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",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:"#B91C1C",errorRed:"#FF1B00",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(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},nr=se({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:wt,space:Je,radius:Ze,type:er(),motion:tr,slots:rr}),St={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:"#9A938C",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",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",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};se({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:St,space:Je,radius:Ze,type:er(),motion:tr,slots:rr});var or=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),ir=globalThis,le=ir[or]??(ir[or]=createContext(nr));le.displayName??="EverfurThemeContext";function ue(){return useContext(le)}n(ue,"useEverfurTheme");var ar=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var sr='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Ft="System";function Ot(e){let r=e.trim();return r.length===0||r===Ft?sr:`${lr(r)}, ${sr}`}n(Ot,"cssFontFamily");function Vt(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${lr(r)}, ui-monospace, Menlo, Consolas, monospace`}n(Vt,"cssMonoFamily");function lr(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}n(lr,"quote");function ur(e,r){let t=e.type,o=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?Vt(o):Ot(o),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[ar[r]]}}n(ur,"faceCss");var dr=44,Pt=.6;function zt(e){let{petRef:r,children:t,onOpened:o,onError:i,style:a,className:u,controller:l,returnTo:s,usState:f,entry:v,visitRef:b,intent:p}=e,d=ne({...s!==void 0?{returnTo:s}:{},...f!==void 0?{usState:f}:{},...v!==void 0?{entry:v}:{},...r!==void 0?{petRef:r}:{},...l!==void 0?{controller:l}:{}}),y=ue(),h=useMemo(()=>jt(y),[y]),c=useRef(false);if(!d.available)return null;let S=d.status==="opening";return jsx("button",{type:"button",onClick:n(()=>{S||c.current||(c.current=true,(b==null?d.open():d.openVisit(b,p??null)).then(R=>{R.opened?oe(o,R.flowId??null):R.reason!=="cancelled"&&oe(i,R.reason,R.error);}).finally(()=>{c.current=false;}));},"onClick"),"aria-busy":S,"aria-disabled":S,className:u,style:{...h,...S?{opacity:Pt,cursor:"progress"}:null,...a},children:t??Qe.visitButton})}n(zt,"VetVisitButton");function jt(e){let{color:r,space:t,radius:o,type:i,slots:a}=e;return {boxSizing:"border-box",minHeight:dr,minWidth:dr,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,border:0,cursor:"pointer",padding:`${t.sm}px ${t.xl}px`,borderRadius:o.pill,backgroundColor:r.primary,color:r.onPrimary,...ur(e,"medium"),fontSize:i.size.body,...Ge(a.vetVisitButton),...Ke(a.vetVisitButton)}}n(jt,"buttonStyle");export{M as VET_VISIT_INTENTS,zt as VetVisitButton,L as isVetVisitIntent,Jr as parseVetVisitReturn,ne as useVetVisit,U as vetVisitErrorReasonOf};
|
|
1
|
+
import {createContext,useMemo,useRef,useContext,useSyncExternalStore,useState,useEffect,useCallback}from'react';import {jsx}from'react/jsx-runtime';var yr=Object.defineProperty;var n=(e,r)=>yr(e,"name",{value:r,configurable:true});var $=null;function mr(e){$=e;}n(mr,"registerEverfurTelevetFlow");function Q(){return $!==null}n(Q,"hasEverfurTelevetFlow");function X(e){let r=$;if(r===null)return false;try{return r(e),!0}catch(t){return console.warn("[everfur] The in-page vet visit presenter registered with registerEverfurTelevetFlow threw, so this click fell back to the hosted visit in a new tab. The member reached a vet, but your routing did not run: check the destination you registered.",t),false}}n(X,"presentEverfurTelevetFlow");var Z=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Z.map(e=>e.wireCode));var vr=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),Ee=Object.freeze(Z.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:vr[e.wireCode]}))),br=new Map(Ee.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),Er=Object.freeze(["http_envelope",...[...new Set(Ee.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function N(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let o of [r??"http_envelope",...Er]){let i=br.get(o+t);if(i)return i}}n(N,"contractErrorFor");function gr(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}n(gr,"contractDocUrl");function ge(e){return null}n(ge,"publishedDocUrl");var hr=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function he(e){return hr[e]}n(he,"categoryFor");function _e(e){let r=N(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),o=t.replace(/[^A-Z0-9]/g,"");if(o==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(o){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}n(_e,"fromWire");var _r=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function J(e){return _r.has(e)}n(J,"isAutoRetryable");var Rr=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Re(e){return J(e)||Rr.has(e)}n(Re,"isRetryableCode");var Tr=500,ee=8e3,Te=4;function Ce(e,r=Math.random){let t=Math.max(0,e),o=Math.min(Tr*2**t,ee);return Math.floor(r()*o)}n(Ce,"backoffDelayMs");var Cr=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function re(e){return Cr[e]}n(re,"userFacingError");function we(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}n(we,"defineHidden");var wr=/^[a-z][a-z0-9_]{0,63}$/;function F(e,r){let t=N(r?.wireCode,r?.wireEnvelope),o={code:e,category:he(e),retryable:r?.retryable??Re(e),displayMessage:re(e)};if(r?.httpStatus!==void 0&&(o.httpStatus=r.httpStatus),r?.requestId&&(o.requestId=r.requestId),typeof r?.reasonCode=="string"&&wr.test(r.reasonCode)&&(o.reasonCode=r.reasonCode),t);return r?.wireMessage&&we(o,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&we(o,"raw",r.raw),Object.freeze(o)}n(F,"makeEverfurError");function te(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}n(te,"ok");function _(e){return Object.freeze({ok:false,error:e})}n(_,"err");var M=class M extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,M.prototype);}};n(M,"EverfurConfigError");var z=M;function Se(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}n(Se,"errorFrame");function Fr(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}n(Fr,"authHeaders");function j(e,r){return {...e,headers:{...kr(e.headers),...Fr(r)}}}n(j,"withAuthHeaders");function kr(e){if(!e)return {};let r={};for(let[t,o]of Object.entries(e)){let i=t.toLowerCase();i==="authorization"||i==="x-everfur-partner-key"||(r[t]=o);}return r}n(kr,"stripAuthHeaders");async function xe(e,r){if(r.mode==="anonymous")return r.transport.request(j(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return _(ne())}let o=await r.transport.request(j(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(o.ok||o.error.httpStatus!==401)return o;let i;try{i=await r.identity.currentToken({forceRefresh:!0});}catch{return _(ne())}let a=await r.transport.request(j(e,{mode:"personalized",token:i,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !a.ok&&a.error.httpStatus===401?_(ne(a.error.httpStatus)):a}n(xe,"authedSend");function ne(e){return F("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}n(ne,"authRejectedError");function Fe(e){return F("internalError",{retryable:true,wireMessage:Or(e)})}n(Fe,"networkError");function Or(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}n(Or,"describeCause");var Vr=3e4,Ir=ee*2,Ar="idempotency-key",Pr=new Set(["POST","PUT","PATCH","DELETE"]),zr=Object.freeze({onEvent(){}}),jr=Object.freeze({setTimeout:n((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:n(e=>clearTimeout(e),"clearTimeout"),now:n(()=>Date.now(),"now")});function Dr(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}n(Dr,"seededIdempotencyKey");function Oe(e){let r=e.observer??zr,t=e.timers??jr,o=e.rng??Math.random,i=e.sleep??((y,d)=>Qr(y,t,d)),a=e.maxAttempts??Te,u=e.unaryTimeoutMs??Vr,l=e.newIdempotencyKey??Mr(),s=n(y=>{try{r.onEvent(y);}catch{}},"emit");async function c(y,d,m){let g=m?.maxAttempts,p=Math.max(1,g??a),k=m?.idempotent??Pr.has(d.method),C=m?.idempotencyKey===void 0?null:Dr(m.idempotencyKey),R=k?C??l():null,V=Nr(d,R),x=0;for(;;){let h=n(O=>Object.freeze({call:y,method:d.method,path:d.path,attempt:x,...R?{idempotencyKey:R}:{},...O}),"stamp");s(h({phase:"attempt"}));let I=Gr(u,t),A=$r(I.signal,d.signal),f;try{f=await xe({...V,signal:A.signal},e.auth);}catch(O){f=_(Fe(O));}finally{A.dispose(),I.cancel();}if(f.ok)return s(h({phase:"settled",ok:true,reason:"ok"})),f;let b=f.error,w=Ur(b,x,{maxAttempts:p,rng:o,now:t.now(),aborted:d.signal?.aborted===true,...g!==void 0?{perCallMaxAttempts:g}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),S={ok:false,code:b.code,reason:w.reason,...b.httpStatus!==void 0?{httpStatus:b.httpStatus}:{},...b.requestId!==void 0?{requestId:b.requestId}:{}};if(!w.retry)return s(h({phase:"settled",...S})),_(b);if(s(h({phase:"retry",...S,delayMs:w.delayMs})),await i(w.delayMs,d.signal),d.signal?.aborted===true)return s(h({phase:"settled",...S,reason:"aborted"})),_(b);x+=1;}}n(c,"send");async function E(y){return j(y,await Kr(e.auth))}n(E,"authorize");async function*v(y,d,m){s(Object.freeze({call:y,phase:"stream.open",method:d.method,path:d.path,attempt:0}));try{yield*e.auth.transport.stream(d,m);}catch{yield Se({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return n(v,"stream"),Object.freeze({send:c,authorize:E,stream:v})}n(Oe,"createRequestFunnel");function Nr(e,r){let t={};for(let[o,i]of Object.entries(e.headers??{}))o.toLowerCase()!==Ar&&(t[o]=i);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}n(Nr,"assembleHeaders");function Mr(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}n(Mr,"defaultIdempotencyKeyFactory");var Lr=10;function Ur(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let o=Br(e);if(o==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(o!=="burst"&&!J(e.code))return {retry:false,reason:"terminal-code"};let i=o==="burst"?"burst-throttle":"retryable-code";if(n(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let u=n(()=>{if(t.policy===void 0)return null;let c;try{c=t.policy.maxAttempts(e.code);}catch{return null}return typeof c!="number"||!Number.isFinite(c)?null:Math.max(1,Math.min(Lr,Math.floor(c)))},"policyCeiling"),l=t.perCallMaxAttempts??u()??t.maxAttempts;if(r+1>=l)return {retry:false,reason:"attempts-exhausted"};let s=qr(e,t.now);return s!==null?s>Ir?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:i,delayMs:s}:{retry:true,reason:i,delayMs:Ce(r,t.rng)}}n(Ur,"decideRetry");function Br(e){let r=e.code==="unknown"?_e(Yr(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}n(Br,"throttleKind");function qr(e,r){let t=Hr(e.raw);if(t===null)return null;let o=t-r;return o>0?o:0}n(qr,"retryOverrideMs");function Hr(e){for(let r of Ve(e)){let t=r.resets_at,o=Wr(t);if(o!==null)return o}return null}n(Hr,"findResetsAt");function Ve(e){if(!ke(e))return [];let r=[e];for(let t of ["error","detail"]){let o=e[t];ke(o)&&r.push(o);}return r}n(Ve,"candidateScopes");function Wr(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}n(Wr,"parseInstantMs");function Yr(e){for(let r of Ve(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}n(Yr,"rawWireCode");function ke(e){return typeof e=="object"&&e!==null}n(ke,"isRecord");async function Kr(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}n(Kr,"resolveDeviceAuth");function Gr(e,r){let t=new AbortController,o=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:n(()=>r.clearTimeout(o),"cancel")}}n(Gr,"boundedSignal");function $r(e,r){let t=n(()=>{},"noop");if(!r)return {signal:e,dispose:t};let o=new AbortController;if(e.aborted||r.aborted)return o.abort(),{signal:o.signal,dispose:t};let i=n(()=>o.abort(),"onAbort");return e.addEventListener("abort",i,{once:true}),r.addEventListener("abort",i,{once:true}),{signal:o.signal,dispose:n(()=>{e.removeEventListener("abort",i),r.removeEventListener("abort",i);},"dispose")}}n($r,"mergeSignals");function Qr(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(o=>{let i=r.setTimeout(()=>{t?.removeEventListener("abort",a),o();},e),a=n(()=>{r.clearTimeout(i),o();},"onAbort");t?.addEventListener("abort",a,{once:true});})}n(Qr,"delayAbortable");var L=Object.freeze(["visit","join","summary","messages"]);function U(e){return typeof e=="string"&&L.includes(e)}n(U,"isVetVisitIntent");var Xr="/widget/v1/televet/handoffs",Zr="/widget/v1/televet/availability",Jr="/widget/v1/televet/chat-entry",et=/^[a-z0-9][a-z0-9_-]{0,39}$/,Ne=/^[A-Za-z0-9_-]{22}$/,Ie="everfur_flow",Ae=32,Pe=128,ze=64;function B(e){let r=e.httpStatus;switch(e.code){case "sessionRequired":return "sessionRequired";case "authExpired":case "authRejected":return "authRejected";case "sdkUpdateRequired":return "sdkUpdateRequired";case "validationFailed":return "invalidRequest";case "rateLimited":case "quotaExceeded":return "rateLimited";}return r===void 0?e.code==="internalError"?"network":"unknown":r===429?"rateLimited":r===404?"unavailable":r===403?"accessDenied":r===401?"authRejected":r===400||r===422?"invalidRequest":r>=500?"serverError":"unknown"}n(B,"vetVisitErrorReasonOf");function je(e){return _(F("validationFailed",{retryable:false,wireMessage:e}))}n(je,"invalid");function oe(e){return _(F("internalError",{retryable:false,httpStatus:502,wireMessage:e}))}n(oe,"unusable");function rt(e,r){let t={};e!==void 0&&(t.pet_ref=e);let o=r?.returnTo;if(o!=null){if(typeof o!="string"||!et.test(o))return {ok:false,message:"returnTo must be a registered return destination key"};t.return_to=o;}let i=r?.entry;if(i!=null){if(i!=="chat"||e===void 0)return {ok:false,message:"entry 'chat' needs the pet the chat is about"};t.entry=i;}let a=r?.visitRef,u=r?.intent,l=a!=null;if(l){let s=typeof a=="string"?a.trim():"";if(s.length<1||[...s].length>ze)return {ok:false,message:`visitRef must be 1..${ze} characters`};t.visit_ref=s;}if(u!=null){if(!l)return {ok:false,message:"intent needs the visitRef it opens"};if(!U(u))return {ok:false,message:`intent must be one of ${L.join(", ")}`};t.intent=u;}return {ok:true,body:t}}n(rt,"handoffBody");function tt(e){if(typeof e!="object"||e===null)return null;let{visit_ref:r,intent:t}=e;return typeof r!="string"||r.length===0||!U(t)?null:Object.freeze({visitRef:r,intent:t})}n(tt,"parseVisitEcho");function Me(e){let r=e.funnel??Oe({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=e.telemetry,o=n(i=>(De(t,"televet.visit.handoff_failed",{reason:B(i)}),_(i)),"failed");return {async createHandoff(i,a){let u;if(i!=null){let p=typeof i=="string"?[...i].length:0;if(p<1||p>Pe)return o(F("validationFailed",{retryable:false,wireMessage:`pet_ref must be 1..${Pe} characters`}));u=i;}let l=rt(u,a);if(!l.ok){let p=je(l.message);return p.ok?p:o(p.error)}let s=l.body,c=await r.send("televet.visit.handoff",{method:"POST",path:Xr,body:s},{idempotent:false,maxAttempts:1});if(!c.ok)return o(c.error);let E=ot(c.value),v=s.return_to!==void 0,y=v?c.value?.flow_id:void 0;if(v&&(typeof y!="string"||!Ne.test(y))){let p=oe("the handoff response carried no usable return flow id");return p.ok?p:o(p.error)}let d=s.visit_ref!==void 0,m=d?tt(c.value?.visit):null;if(d&&m===null){let p=oe("the handoff response did not confirm the visit it opens");return p.ok?p:o(p.error)}let g=E===null?null:Object.freeze({...E,...v?{flowId:y}:{},...m!==null?{visit:m}:{}});return g===null?o(F("internalError",{retryable:false,httpStatus:502,wireMessage:"the handoff response carried no usable visit url"})):(De(t,"televet.visit.handoff_created",{pet_scoped:s.pet_ref!==void 0}),te(g))},async checkAvailability(i){if(typeof i!="string"||i.length>Ae)return je(`state must be at most ${Ae} characters`);let a=await r.send("televet.visit.availability",{method:"POST",path:Zr,body:{state:i}},{idempotent:false,maxAttempts:1});if(!a.ok)return _(a.error);let u=a.value?.available;return typeof u!="boolean"?oe("the availability response carried no usable answer"):te(Object.freeze({available:u}))},async chatEntryOpen(){try{let i=await r.send("televet.visit.chat_entry",{method:"GET",path:Jr},{maxAttempts:1});return i.ok&&i.value?.open===!0}catch{return false}}}}n(Me,"createVetVisitController");function nt(e){if(typeof e!="string")return null;let r=e.indexOf("#"),t=r<0?e:e.slice(0,r),o=t.indexOf("?");if(o<0)return null;let i=t.slice(o+1).split("&").filter(a=>a.startsWith(`${Ie}=`)).map(a=>a.slice(Ie.length+1));return i.length!==1||!Ne.test(i[0]??"")?null:Object.freeze({flowId:i[0]})}n(nt,"parseVetVisitReturn");function ot(e){if(typeof e!="object"||e===null)return null;let{url:r,expires_at:t}=e;return typeof r!="string"||typeof t!="string"||t.length===0||!lt(r)?null:Object.freeze({url:r,expiresAt:t})}n(ot,"parseHandoff");var it=new Set(["localhost","127.0.0.1","[::1]"]),at=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/,st=/[\s\u0000-\u001f\u007f]/;function lt(e){if(st.test(e))return false;let r=at.exec(e);if(r===null)return false;let t=(r[1]??"").toLowerCase(),o=r[2]??"";if(o.length===0||o.includes("@"))return false;let i=o.replace(/:\d+$/,"").toLowerCase(),a=t==="https",u=t==="http"&&it.has(i);if(!a&&!u)return false;let l=e.indexOf("#");if(l<0)return false;let s=e.slice(l);return s.startsWith("#h=")&&s.length>3}n(lt,"isOpenableVisitUrl");function De(e,r,t){if(e)try{e.track(r,t);}catch{}}n(De,"safeTrack");var Le=Symbol.for("@everfur/sdk#EverfurContext@v1"),Ue=globalThis,Be=Ue[Le]??(Ue[Le]=createContext(null));Be.displayName??="EverfurContext";function q(){let e=useContext(Be);if(e===null)throw new z("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}n(q,"useEverfurContext");var ct=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function ft(e){return ct[e]}n(ft,"requires");function qe(e,r,t){let o=ft(e),i=new Map;for(let l of r)i.set(l.resource,l);if(t?.isPending===true&&o.some(l=>!i.has(l)))return ie({name:e,enabled:false,isPending:true,limits:{}});let a=pt(o,i);return o.filter(l=>i.get(l)?.granted!==true).length===0?ie({name:e,enabled:true,isPending:false,limits:a}):ie({name:e,enabled:false,isPending:false,limits:a,disabled:yt(o,i)})}n(qe,"decideCapability");function pt(e,r){let t={};for(let o of e){let i=r.get(o)?.limits;if(i)for(let[a,u]of Object.entries(i)){let l=t[a];t[a]=l===void 0?u:Math.min(l,u);}}return t}n(pt,"mergeLimits");function yt(e,r){for(let t of e){let o=r.get(t)?.disabled;if(o)return Object.freeze({reason:o.reason,level:o.level,recoverable:o.recoverable})}return Object.freeze({reason:re("accessDenied"),level:"user_entitlement",recoverable:false})}n(yt,"disabledFor");function ie(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}n(ie,"freezeDecision");function He(e){let{runtime:r}=q(),t=r.entitlements,o=useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return useMemo(()=>qe(e,o.decisions,{isPending:o.isPending}),[e,o])}n(He,"useCapability");var Ye=Object.freeze({status:"idle",error:null,errorReason:null});function Et(e,r,t){let{usState:o,chat:i,scope:a}=t,u=r&&(o!==null||i),l=`${o??""}|${i?"chat":""}`,[s,c]=useState(null);if(useEffect(()=>{if(!u)return;let v=true,y=e.current;return c(null),n(async()=>{try{if(i&&!(y.chatEntryOpen&&await y.chatEntryOpen()))return !1;if(o===null)return !0;if(!y.checkAvailability)return !1;let m=await y.checkAvailability(o);return m.ok&&m.value.available}catch{return false}},"ask")().then(m=>{v&&c({key:l,open:m});}),()=>{v=false;}},[u,l,o,i,a,e]),!u)return null;let E=s!==null&&s.key===l;return {open:E&&s.open,pending:!E}}n(Et,"usePreflight");var gt=Object.freeze({status:"opening",error:null,errorReason:null});function Ge(e,r={}){let{runtime:t,userRef:o,scopeEpoch:i}=q(),a=He("televet"),u=a.enabled&&o!==null,l=r.usState??null,s=r.entry==="chat",c=r.petRef??null,E=useMemo(()=>{if(r.controller)return r.controller;let{services:f}=t.registry;return Me({auth:f.authFor(o),telemetry:f.telemetry,...f.errorPolicy?{errorPolicy:f.errorPolicy}:{}})},[t,o,i,r.controller]),v=useRef(E);v.current=E;let y=useMemo(()=>({runtime:t,userRef:o,scopeEpoch:i}),[t,o,i]),d=Et(v,u,{usState:l,chat:s,scope:y}),m=u&&(d===null||d.open)&&(!s||c!==null),g=r.returnTo??null,[p,k]=useState(Ye),C=useRef(null),R=useRef({runtime:t,userRef:o,scopeEpoch:i});R.current={runtime:t,userRef:o,scopeEpoch:i};let V=useRef(E);V.current=E;let x=useRef(m);x.current=m;let h=useCallback((f,b)=>{if(C.current)return C.current;let w=n((T,P)=>(k({status:T==="cancelled"?"idle":"error",error:P,errorReason:T==="cancelled"?null:T}),Object.freeze({opened:false,reason:T,error:P})),"fail");if(!x.current)return Promise.resolve(w("unavailable",null));let S=e.prepare();if(!S.ok)return Promise.resolve(w(S.reason,null));let O=R.current,pe=V.current;k(gt);let K=(async()=>{let T,P={...g!==null?{returnTo:g}:{},...s?{entry:"chat"}:{},...b!==null?{visitRef:b.visitRef}:{},...b!==null&&b.intent!==null&&b.intent!==void 0?{intent:b.intent}:{}},ye=Object.keys(P).length===0?void 0:P,me=f===void 0?c:f;try{T=await(ye===void 0?pe.createHandoff(me):pe.createHandoff(me,ye));}catch{return e.abandon(S.value),w("unknown",null)}let G=R.current;if(G.runtime!==O.runtime||G.userRef!==O.userRef||G.scopeEpoch!==O.scopeEpoch)return e.abandon(S.value),w("cancelled",null);if(!T.ok)return e.abandon(S.value),w(B(T.error),T.error);let ve=await e.finish(S.value,T.value);return ve!==null?w(ve,null):(k(Ye),Object.freeze(T.value.flowId===void 0?{opened:true}:{opened:true,flowId:T.value.flowId}))})().finally(()=>{C.current===K&&(C.current=null);});return C.current=K,K},[e,c,g,s]),I=useCallback(f=>h(f,null),[h]),A=useCallback((f,b)=>h(void 0,{visitRef:f,intent:b??null}),[h]);return {available:m,isPending:a.isPending||(d?.pending??false),status:p.status,error:p.error,errorReason:p.errorReason,open:I,openVisit:A}}n(Ge,"useVetVisitWith");function $e(e){try{e.closed||e.close();}catch{}}n($e,"closeQuietly");var ht=Object.freeze({prepare(){let e=null;try{e=typeof window>"u"?null:window.open("about:blank","_blank");}catch{e=null;}if(e===null)return {ok:false,reason:"popupBlocked"};try{e.opener=null;}catch{}return {ok:true,value:{tab:e}}},async finish({tab:e},r){if(e.closed)return "cancelled";try{return e.location.replace(r.url),null}catch{return $e(e),"popupBlocked"}},abandon({tab:e}){$e(e);}});function se(e){return Ge(ht,e)}n(se,"useVetVisit");function _t(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}n(_t,"slotBox");function Qe(e){return e?.textColor===void 0?{}:{color:e.textColor}}n(Qe,"slotText");function Xe(e,r){let t=_t(e,r),o={};return t.backgroundColor!==void 0&&(o.backgroundColor=t.backgroundColor),t.borderColor!==void 0&&(o.border=`${t.borderWidth??1}px solid ${t.borderColor}`),t.borderRadius!==void 0&&(o.borderRadius=t.borderRadius),o}n(Xe,"slotBoxCss");function Ze(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}n(Ze,"reportHostFailure");function Rt(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}n(Rt,"isThenable");function H(e,...r){if(typeof e=="function")try{let t=e(...r);return Rt(t)&&Promise.resolve(t).then(void 0,Ze),t}catch(t){Ze(t);return}}n(H,"callHost");var Je=Object.freeze({visitButton:"Talk to a vet"});function de(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))de(e[r]);}return e}n(de,"deepFreeze");var Tt=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),rr={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},tr={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},er={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Ct={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},wt={regular:"400",medium:"500",bold:"700"},St={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},xt=0,W="System",Y="monospace",Ft=["content","heading","control","compact","badge"];function kt(e){let r={};for(let t of Ft)r[t]=e;return r}n(kt,"authoredTierSizes");function nr(){return {family:W,mono:Y,fontUrl:null,families:{regular:W,medium:W,bold:W,mono:Y,monoMedium:Y,monoBold:Y},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:er,tierSizes:kt(er),lineHeight:Ct,weight:wt,letterSpacing:St,scale:1,maxScale:xt,scaleCaps:Tt}}n(nr,"baseType");var or={},le=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ue(e){return `cubic-bezier(${e.join(", ")})`}n(ue,"cssCubicBezier");var ir={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ue(le.standard),emphasized:ue(le.emphasized),exit:ue(le.exit)},reducedMotion:false},Ot={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:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",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:"#B91C1C",errorRed:"#FF1B00",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(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ar=de({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Ot,space:rr,radius:tr,type:nr(),motion:ir,slots:or}),Vt={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:"#9A938C",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",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",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};de({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Vt,space:rr,radius:tr,type:nr(),motion:ir,slots:or});var sr=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),lr=globalThis,ce=lr[sr]??(lr[sr]=createContext(ar));ce.displayName??="EverfurThemeContext";function fe(){return useContext(ce)}n(fe,"useEverfurTheme");var ur=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});var dr='system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Pt="System";function zt(e){let r=e.trim();return r.length===0||r===Pt?dr:`${cr(r)}, ${dr}`}n(zt,"cssFontFamily");function jt(e){let r=e.trim();return r.length===0||r==="monospace"?"ui-monospace, Menlo, Consolas, monospace":`${cr(r)}, ui-monospace, Menlo, Consolas, monospace`}n(jt,"cssMonoFamily");function cr(e){return `"${e.replace(/[\\"]/g,"\\$&")}"`}n(cr,"quote");function fr(e,r){let t=e.type,o=t.families[r];return {fontFamily:r==="mono"||r==="monoMedium"||r==="monoBold"?jt(o):zt(o),fontWeight:t.namedFaces[r]?t.weight.regular:t.weight[ur[r]]}}n(fr,"faceCss");var pr=44,Mt=.6;function Lt(e){let{petRef:r,children:t,onOpened:o,onError:i,style:a,className:u,controller:l,returnTo:s,usState:c,entry:E,visitRef:v,intent:y,onStartInApp:d,prefer:m}=e,g=se({...s!==void 0?{returnTo:s}:{},...c!==void 0?{usState:c}:{},...E!==void 0?{entry:E}:{},...r!==void 0?{petRef:r}:{},...l!==void 0?{controller:l}:{}}),p=fe(),k=useMemo(()=>Ut(p),[p]),C=useRef(false);if(!g.available)return null;let R=g.status==="opening",V=v!=null,x=m==="redirect"||V,h=!x&&d!==void 0,I=!x&&!h&&Q();return jsx("button",{type:"button",onClick:n(()=>{if(!(R||C.current)){if(h){H(d);return}I&&X({...r!==void 0?{petRef:r}:{},...c!==void 0?{usState:c}:{}})||(C.current=true,(v==null?g.open():g.openVisit(v,y??null)).then(f=>{f.opened?H(o,f.flowId??null):f.reason!=="cancelled"&&H(i,f.reason,f.error);}).finally(()=>{C.current=false;}));}},"onClick"),"aria-busy":R,"aria-disabled":R,className:u,style:{...k,...R?{opacity:Mt,cursor:"progress"}:null,...a},children:t??Je.visitButton})}n(Lt,"VetVisitButton");function Ut(e){let{color:r,space:t,radius:o,type:i,slots:a}=e;return {boxSizing:"border-box",minHeight:pr,minWidth:pr,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,border:0,cursor:"pointer",padding:`${t.sm}px ${t.xl}px`,borderRadius:o.pill,backgroundColor:r.primary,color:r.onPrimary,...fr(e,"medium"),fontSize:i.size.body,...Xe(a.vetVisitButton),...Qe(a.vetVisitButton)}}n(Ut,"buttonStyle");export{L as VET_VISIT_INTENTS,Lt as VetVisitButton,Q as hasEverfurTelevetFlow,U as isVetVisitIntent,nt as parseVetVisitReturn,X as presentEverfurTelevetFlow,mr as registerEverfurTelevetFlow,se as useVetVisit,B as vetVisitErrorReasonOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everfur/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Embed Everfur veterinary chat, health records, and pet-state surfaces in your React Native app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -65,6 +65,12 @@
|
|
|
65
65
|
"web/televet": [
|
|
66
66
|
"./dist/web/televet/index.d.ts"
|
|
67
67
|
],
|
|
68
|
+
"web/televet/call": [
|
|
69
|
+
"./dist/web/televet/call/index.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"web/televet/booking": [
|
|
72
|
+
"./dist/web/televet/booking/index.d.ts"
|
|
73
|
+
],
|
|
68
74
|
"records": [
|
|
69
75
|
"./dist/records/index.d.ts"
|
|
70
76
|
],
|
|
@@ -83,6 +89,12 @@
|
|
|
83
89
|
"televet": [
|
|
84
90
|
"./dist/televet/index.d.ts"
|
|
85
91
|
],
|
|
92
|
+
"televet/call": [
|
|
93
|
+
"./dist/televet/call/index.d.ts"
|
|
94
|
+
],
|
|
95
|
+
"televet/booking": [
|
|
96
|
+
"./dist/televet/booking/index.d.ts"
|
|
97
|
+
],
|
|
86
98
|
"video": [
|
|
87
99
|
"./dist/video/index.d.ts"
|
|
88
100
|
],
|
|
@@ -218,6 +230,28 @@
|
|
|
218
230
|
"default": "./dist/web/televet/index.cjs"
|
|
219
231
|
}
|
|
220
232
|
},
|
|
233
|
+
"./web/televet/call": {
|
|
234
|
+
"react-native": null,
|
|
235
|
+
"import": {
|
|
236
|
+
"types": "./dist/web/televet/call/index.d.ts",
|
|
237
|
+
"default": "./dist/web/televet/call/index.js"
|
|
238
|
+
},
|
|
239
|
+
"require": {
|
|
240
|
+
"types": "./dist/web/televet/call/index.d.cts",
|
|
241
|
+
"default": "./dist/web/televet/call/index.cjs"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"./web/televet/booking": {
|
|
245
|
+
"react-native": null,
|
|
246
|
+
"import": {
|
|
247
|
+
"types": "./dist/web/televet/booking/index.d.ts",
|
|
248
|
+
"default": "./dist/web/televet/booking/index.js"
|
|
249
|
+
},
|
|
250
|
+
"require": {
|
|
251
|
+
"types": "./dist/web/televet/booking/index.d.cts",
|
|
252
|
+
"default": "./dist/web/televet/booking/index.cjs"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
221
255
|
"./chat": {
|
|
222
256
|
"react-native": "./dist/chat/index.js",
|
|
223
257
|
"import": {
|
|
@@ -317,6 +351,28 @@
|
|
|
317
351
|
"default": "./dist/televet/index.cjs"
|
|
318
352
|
}
|
|
319
353
|
},
|
|
354
|
+
"./televet/call": {
|
|
355
|
+
"react-native": "./dist/televet/call/index.js",
|
|
356
|
+
"import": {
|
|
357
|
+
"types": "./dist/televet/call/index.d.ts",
|
|
358
|
+
"default": "./dist/televet/call/index.js"
|
|
359
|
+
},
|
|
360
|
+
"require": {
|
|
361
|
+
"types": "./dist/televet/call/index.d.cts",
|
|
362
|
+
"default": "./dist/televet/call/index.cjs"
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"./televet/booking": {
|
|
366
|
+
"react-native": "./dist/televet/booking/index.js",
|
|
367
|
+
"import": {
|
|
368
|
+
"types": "./dist/televet/booking/index.d.ts",
|
|
369
|
+
"default": "./dist/televet/booking/index.js"
|
|
370
|
+
},
|
|
371
|
+
"require": {
|
|
372
|
+
"types": "./dist/televet/booking/index.d.cts",
|
|
373
|
+
"default": "./dist/televet/booking/index.cjs"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
320
376
|
"./video": {
|
|
321
377
|
"react-native": "./dist/video/index.js",
|
|
322
378
|
"import": {
|
|
@@ -400,8 +456,8 @@
|
|
|
400
456
|
"contract:types": "node scripts/generate-contract-types.mjs",
|
|
401
457
|
"contract:types:check": "node scripts/generate-contract-types.mjs --check",
|
|
402
458
|
"contract:check": "npm run contract:types:check && npm run contract:errors:check",
|
|
403
|
-
"api:check": "api-extractor run --config api-extractor.json && api-extractor run --config api-extractor.server.json && api-extractor run --config api-extractor.server-events.json && api-extractor run --config api-extractor.records.json && api-extractor run --config api-extractor.video.json && api-extractor run --config api-extractor.photo.json && api-extractor run --config api-extractor.animations.json && api-extractor run --config api-extractor.testing-rn.json && api-extractor run --config api-extractor.client.json && api-extractor run --config api-extractor.core.json && api-extractor run --config api-extractor.chat.json && api-extractor run --config api-extractor.web.json && api-extractor run --config api-extractor.web-records.json && api-extractor run --config api-extractor.web-records-depth.json && api-extractor run --config api-extractor.records-depth.json && api-extractor run --config api-extractor.web-televet.json && api-extractor run --config api-extractor.televet.json && api-extractor run --config api-extractor.testing-web.json && api-extractor run --config api-extractor.testing.json && api-extractor run --config api-extractor.notifications.json && api-extractor run --config api-extractor.web-notifications.json && api-extractor run --config api-extractor.consent.json && api-extractor run --config api-extractor.web-consent.json",
|
|
404
|
-
"api:update": "api-extractor run --local --config api-extractor.json && api-extractor run --local --config api-extractor.server.json && api-extractor run --local --config api-extractor.server-events.json && api-extractor run --local --config api-extractor.records.json && api-extractor run --local --config api-extractor.video.json && api-extractor run --local --config api-extractor.photo.json && api-extractor run --local --config api-extractor.animations.json && api-extractor run --local --config api-extractor.testing-rn.json && api-extractor run --local --config api-extractor.client.json && api-extractor run --local --config api-extractor.core.json && api-extractor run --local --config api-extractor.chat.json && api-extractor run --local --config api-extractor.web.json && api-extractor run --local --config api-extractor.web-records.json && api-extractor run --local --config api-extractor.web-records-depth.json && api-extractor run --local --config api-extractor.records-depth.json && api-extractor run --local --config api-extractor.web-televet.json && api-extractor run --local --config api-extractor.televet.json && api-extractor run --local --config api-extractor.testing-web.json && api-extractor run --local --config api-extractor.testing.json && api-extractor run --local --config api-extractor.notifications.json && api-extractor run --local --config api-extractor.web-notifications.json && api-extractor run --local --config api-extractor.consent.json && api-extractor run --local --config api-extractor.web-consent.json",
|
|
459
|
+
"api:check": "api-extractor run --config api-extractor.json && api-extractor run --config api-extractor.server.json && api-extractor run --config api-extractor.server-events.json && api-extractor run --config api-extractor.records.json && api-extractor run --config api-extractor.video.json && api-extractor run --config api-extractor.photo.json && api-extractor run --config api-extractor.animations.json && api-extractor run --config api-extractor.testing-rn.json && api-extractor run --config api-extractor.client.json && api-extractor run --config api-extractor.core.json && api-extractor run --config api-extractor.chat.json && api-extractor run --config api-extractor.web.json && api-extractor run --config api-extractor.web-records.json && api-extractor run --config api-extractor.web-records-depth.json && api-extractor run --config api-extractor.records-depth.json && api-extractor run --config api-extractor.web-televet.json && api-extractor run --config api-extractor.web-televet-call.json && api-extractor run --config api-extractor.web-televet-booking.json && api-extractor run --config api-extractor.televet.json && api-extractor run --config api-extractor.televet-call.json && api-extractor run --config api-extractor.televet-booking.json && api-extractor run --config api-extractor.testing-web.json && api-extractor run --config api-extractor.testing.json && api-extractor run --config api-extractor.notifications.json && api-extractor run --config api-extractor.web-notifications.json && api-extractor run --config api-extractor.consent.json && api-extractor run --config api-extractor.web-consent.json",
|
|
460
|
+
"api:update": "api-extractor run --local --config api-extractor.json && api-extractor run --local --config api-extractor.server.json && api-extractor run --local --config api-extractor.server-events.json && api-extractor run --local --config api-extractor.records.json && api-extractor run --local --config api-extractor.video.json && api-extractor run --local --config api-extractor.photo.json && api-extractor run --local --config api-extractor.animations.json && api-extractor run --local --config api-extractor.testing-rn.json && api-extractor run --local --config api-extractor.client.json && api-extractor run --local --config api-extractor.core.json && api-extractor run --local --config api-extractor.chat.json && api-extractor run --local --config api-extractor.web.json && api-extractor run --local --config api-extractor.web-records.json && api-extractor run --local --config api-extractor.web-records-depth.json && api-extractor run --local --config api-extractor.records-depth.json && api-extractor run --local --config api-extractor.web-televet.json && api-extractor run --local --config api-extractor.web-televet-call.json && api-extractor run --local --config api-extractor.web-televet-booking.json && api-extractor run --local --config api-extractor.televet.json && api-extractor run --local --config api-extractor.televet-call.json && api-extractor run --local --config api-extractor.televet-booking.json && api-extractor run --local --config api-extractor.testing-web.json && api-extractor run --local --config api-extractor.testing.json && api-extractor run --local --config api-extractor.notifications.json && api-extractor run --local --config api-extractor.web-notifications.json && api-extractor run --local --config api-extractor.consent.json && api-extractor run --local --config api-extractor.web-consent.json",
|
|
405
461
|
"attw": "attw --pack",
|
|
406
462
|
"verify:pack": "node scripts/verify-packed-install.mjs",
|
|
407
463
|
"docs:check": "node scripts/check-docs-compile.mjs && node scripts/build-docs-html.mjs --check",
|
|
@@ -415,13 +471,19 @@
|
|
|
415
471
|
"zod": "3.23.0"
|
|
416
472
|
},
|
|
417
473
|
"peerDependencies": {
|
|
474
|
+
"@daily-co/daily-js": ">=0.70",
|
|
418
475
|
"react": ">=18",
|
|
419
476
|
"react-dom": ">=18",
|
|
420
477
|
"react-native": ">=0.74",
|
|
421
478
|
"react-native-safe-area-context": ">=5",
|
|
422
|
-
"react-native-vision-camera": ">=4"
|
|
479
|
+
"react-native-vision-camera": ">=4",
|
|
480
|
+
"@daily-co/react-native-daily-js": ">=0.87",
|
|
481
|
+
"@daily-co/react-native-webrtc": ">=124.0.6-daily.1"
|
|
423
482
|
},
|
|
424
483
|
"peerDependenciesMeta": {
|
|
484
|
+
"@daily-co/daily-js": {
|
|
485
|
+
"optional": true
|
|
486
|
+
},
|
|
425
487
|
"react-dom": {
|
|
426
488
|
"optional": true
|
|
427
489
|
},
|
|
@@ -433,6 +495,12 @@
|
|
|
433
495
|
},
|
|
434
496
|
"react-native-safe-area-context": {
|
|
435
497
|
"optional": true
|
|
498
|
+
},
|
|
499
|
+
"@daily-co/react-native-daily-js": {
|
|
500
|
+
"optional": true
|
|
501
|
+
},
|
|
502
|
+
"@daily-co/react-native-webrtc": {
|
|
503
|
+
"optional": true
|
|
436
504
|
}
|
|
437
505
|
},
|
|
438
506
|
"devDependencies": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
|
|
3
|
+
"react-native": "../../dist/televet/booking/index.js",
|
|
4
|
+
"module": "../../dist/televet/booking/index.js",
|
|
5
|
+
"main": "../../dist/televet/booking/index.cjs",
|
|
6
|
+
"types": "../../dist/televet/booking/index.d.ts",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
|
|
3
|
+
"react-native": "../../dist/televet/call/index.js",
|
|
4
|
+
"module": "../../dist/televet/call/index.js",
|
|
5
|
+
"main": "../../dist/televet/call/index.cjs",
|
|
6
|
+
"types": "../../dist/televet/call/index.d.ts",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
|
|
6
|
+
* bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
|
|
7
|
+
* in a native app; import "@everfur/sdk/web" only from a web build.
|
|
8
|
+
*/
|
|
9
|
+
throw new Error(
|
|
10
|
+
'@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
|
|
11
|
+
'Import @everfur/sdk in a React Native app instead.',
|
|
12
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
|
|
3
|
+
"react-native": "./native-blocked.cjs",
|
|
4
|
+
"module": "../../../dist/web/televet/booking/index.js",
|
|
5
|
+
"main": "../../../dist/web/televet/booking/index.cjs",
|
|
6
|
+
"types": "../../../dist/web/televet/booking/index.d.ts",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// GENERATED by scripts/subpath-shims.mjs from the package.json "exports" map. Do not edit by hand; run `npm run build`.
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* "@everfur/sdk/web" is the WEB host layer: it renders with react-dom. It must never enter a React Native
|
|
6
|
+
* bundle, where there is no DOM to render into. Import "@everfur/sdk" (React Native) or "@everfur/sdk/chat"
|
|
7
|
+
* in a native app; import "@everfur/sdk/web" only from a web build.
|
|
8
|
+
*/
|
|
9
|
+
throw new Error(
|
|
10
|
+
'@everfur/sdk/web is the web (react-dom) entry point and cannot be bundled into a React Native app. ' +
|
|
11
|
+
'Import @everfur/sdk in a React Native app instead.',
|
|
12
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"//": "GENERATED by scripts/subpath-shims.mjs from the package.json \"exports\" map. Do not edit by hand; run `npm run build`.",
|
|
3
|
+
"react-native": "./native-blocked.cjs",
|
|
4
|
+
"module": "../../../dist/web/televet/call/index.js",
|
|
5
|
+
"main": "../../../dist/web/televet/call/index.cjs",
|
|
6
|
+
"types": "../../../dist/web/televet/call/index.d.ts",
|
|
7
|
+
"sideEffects": false
|
|
8
|
+
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { E as EverfurFontWeight, a as EverfurTheme, b as EverfurFontFaceKey } from './entitlementRepository-DKdXFgTo.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
|
|
5
|
-
* font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
|
|
6
|
-
* itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
|
|
7
|
-
* twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
|
|
8
|
-
*/
|
|
9
|
-
interface EverfurFaceStyle {
|
|
10
|
-
readonly fontFamily: string;
|
|
11
|
-
readonly fontWeight?: EverfurFontWeight;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
|
|
15
|
-
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
16
|
-
*/
|
|
17
|
-
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
18
|
-
|
|
19
|
-
export { type EverfurFaceStyle as E, face as f };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { E as EverfurFontWeight, a as EverfurTheme, b as EverfurFontFaceKey } from './entitlementRepository-DSbzuyAW.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The text style a surface spreads for one face. `fontWeight` is present ONLY for a base family (the platform
|
|
5
|
-
* font, the legacy `font_family`, or a `fonts` name repeated across weights); a named face carries its weight
|
|
6
|
-
* itself. The regular mono face carries no weight (code renders in the regular mono face); its medium and bold
|
|
7
|
-
* twins (`monoMedium`, `monoBold`) take theirs when the mono family is a base family.
|
|
8
|
-
*/
|
|
9
|
-
interface EverfurFaceStyle {
|
|
10
|
-
readonly fontFamily: string;
|
|
11
|
-
readonly fontWeight?: EverfurFontWeight;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* The family (and, for a base family, the numeric weight) of one face of the theme. Spread it into a style:
|
|
15
|
-
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
16
|
-
*/
|
|
17
|
-
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
18
|
-
|
|
19
|
-
export { type EverfurFaceStyle as E, face as f };
|