@everfur/sdk 0.9.1 → 0.9.3
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 +56 -0
- package/README.md +1 -1
- package/dist/{Chat-DbHkTbqz.d.cts → Chat-Bkv-MLLu.d.cts} +3 -3
- package/dist/{Chat-BoVmqEeF.d.ts → Chat-Dy1L27a8.d.ts} +3 -3
- package/dist/{DepthViews-yO1H371y.d.ts → DepthViews-BwyzpEyX.d.ts} +1 -1
- package/dist/{DepthViews-DK7EJ6Hp.d.cts → DepthViews-CBalhef3.d.cts} +1 -1
- package/dist/{DepthViews-BzwflaJ3.d.ts → DepthViews-De6yb5Tq.d.ts} +1 -1
- package/dist/{DepthViews-Chyp69Ue.d.cts → DepthViews-eRdy2ayE.d.cts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments-BmMrn9tU.d.ts → attachments-BAcQdIz7.d.ts} +5 -5
- package/dist/{attachments-Dcb19rMP.d.ts → attachments-Brt7ivEo.d.ts} +2 -2
- package/dist/{attachments-B7TrtyfH.d.cts → attachments-DhGAelCA.d.cts} +2 -2
- package/dist/{attachments-Dnpqk1Gl.d.cts → attachments-tPWJ0DJI.d.cts} +5 -5
- package/dist/{bookingCopy-DR0-SmqH.d.ts → bookingCopy-CJLAgEgK.d.ts} +2 -2
- package/dist/{bookingCopy-C153FHEC.d.cts → bookingCopy-Ds2JGcPE.d.cts} +2 -2
- package/dist/{callCopy-DHjem0R-.d.cts → callCopy-Bw6oZT54.d.cts} +7 -2
- package/dist/{callCopy-DHjem0R-.d.ts → callCopy-Bw6oZT54.d.ts} +7 -2
- package/dist/{casesRepository-DC9lEQez.d.cts → casesRepository-D0aQSXkb.d.cts} +1 -1
- package/dist/{casesRepository-BXdwCWQF.d.ts → casesRepository-DjhMfm_n.d.ts} +1 -1
- package/dist/chat/index.cjs +9 -8
- package/dist/chat/index.d.cts +9 -9
- package/dist/chat/index.d.ts +9 -9
- package/dist/chat/index.js +9 -8
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/{config-BRyNmzhx.d.cts → config-C68HTCf4.d.cts} +1 -1
- package/dist/{config-DdK2czhD.d.ts → config-DeUmccwl.d.ts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context-jaONuHXM.d.cts → context-DY9pcjdK.d.cts} +5 -5
- package/dist/{context-_EyjBNKI.d.ts → context-D_2sCvoo.d.ts} +5 -5
- package/dist/{copy-D8iSBQE6.d.cts → copy-tYW0C83H.d.cts} +2 -2
- package/dist/{copy-BJpRsqK-.d.ts → copy-wAnv8ldC.d.ts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +12 -12
- package/dist/core/index.d.ts +12 -12
- package/dist/core/index.js +1 -1
- package/dist/{depth-bKpg3L9r.d.ts → depth-C7RIscDR.d.ts} +2 -2
- package/dist/{depth-DJ1KGMww.d.cts → depth-jbSWsweM.d.cts} +2 -2
- package/dist/{entitlementRepository-4x_tBE73.d.cts → entitlementRepository-Ccc6K6wB.d.cts} +2 -2
- package/dist/{entitlementRepository-CojBLazH.d.ts → entitlementRepository-D7Fc7OdG.d.ts} +2 -2
- package/dist/{identity-A8fVB518.d.ts → identity-BTT6YtH5.d.ts} +1 -1
- package/dist/{identity-CmxZ4GR0.d.cts → identity-ScajqjK5.d.cts} +1 -1
- package/dist/index.cjs +10 -9
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +10 -9
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/{pets-e5RjSP6O.d.ts → pets-CqeoV1Jv.d.ts} +1 -1
- package/dist/{pets-DjBlY7yg.d.cts → pets-uKMldfz0.d.cts} +1 -1
- package/dist/{petsRepository-DkQ2fwZY.d.cts → petsRepository-BYe7_MUo.d.cts} +1 -1
- package/dist/{petsRepository-CQh8paML.d.ts → petsRepository-BdfbY9Oe.d.ts} +1 -1
- package/dist/{ports-CzVBbI_A.d.ts → ports-D4FQKTBS.d.ts} +4 -4
- package/dist/{ports-2voZkqty.d.cts → ports-okLpXkpu.d.cts} +4 -4
- package/dist/records/depth/index.cjs +6 -4
- package/dist/records/depth/index.d.cts +7 -7
- package/dist/records/depth/index.d.ts +7 -7
- package/dist/records/depth/index.js +6 -4
- package/dist/records/index.cjs +19 -17
- package/dist/records/index.d.cts +9 -9
- package/dist/records/index.d.ts +9 -9
- package/dist/records/index.js +19 -17
- package/dist/{requestFunnel-CQ42Kf9G.d.ts → requestFunnel-Dhaj0yUq.d.ts} +2 -2
- package/dist/{requestFunnel-CA0ANsWj.d.cts → requestFunnel-u8qnM5Ll.d.cts} +2 -2
- package/dist/{runtimeTypes-C0tI7s-V.d.ts → runtimeTypes-BFes64Vp.d.ts} +4 -4
- package/dist/{runtimeTypes-BxtQXaYi.d.cts → runtimeTypes-C67itXfp.d.cts} +4 -4
- 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 -1
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/televet/booking/index.js +1 -1
- package/dist/televet/call/index.cjs +3 -5
- package/dist/televet/call/index.d.cts +1 -1
- package/dist/televet/call/index.d.ts +1 -1
- package/dist/televet/call/index.js +3 -5
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/{timelineRows-WFv_3EOi.d.cts → timelineRows-CDSO3ElK.d.cts} +1 -1
- package/dist/{timelineRows-GSpzKLla.d.ts → timelineRows-pd4wYVbe.d.ts} +1 -1
- package/dist/{useRecordsDepth-BQF0Zynl.d.ts → useRecordsDepth-CqSMkcyR.d.ts} +1 -1
- package/dist/{useRecordsDepth-BL5Pf3oK.d.cts → useRecordsDepth-W3UAKQRN.d.cts} +1 -1
- package/dist/{view-rgB1iqWO.d.ts → view-CKfIaJYp.d.ts} +8 -2
- package/dist/{view-D3kOelPL.d.cts → view-h7RPJAEe.d.cts} +8 -2
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/index.cjs +7 -5
- package/dist/web/index.d.cts +14 -14
- package/dist/web/index.d.ts +14 -14
- package/dist/web/index.js +7 -5
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.cjs +5 -4
- 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 +6 -5
- package/dist/web/records/index.cjs +10 -9
- package/dist/web/records/index.d.cts +9 -9
- package/dist/web/records/index.d.ts +9 -9
- package/dist/web/records/index.js +10 -9
- package/dist/web/televet/booking/index.cjs +1 -1
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/televet/booking/index.js +1 -1
- package/dist/web/televet/call/index.cjs +3 -5
- package/dist/web/televet/call/index.d.cts +1 -1
- package/dist/web/televet/call/index.d.ts +1 -1
- package/dist/web/televet/call/index.js +3 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from"react";import{TextInput,StyleSheet,useWindowDimensions,View,Pressable,Text as Text$1,Animated}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{jsxs,jsx,Fragment}from"react/jsx-runtime";var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"Usually under a minute",lobbyPrepLabel:"WHILE YOU WAIT",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function formatElapsed(ms){let total=Math.max(0,Math.floor(ms/1e3)),seconds=String(total%60).padStart(2,"0"),minutes=Math.floor(total%3600/60),hours=Math.floor(total/3600);return hours>0?`${hours}:${String(minutes).padStart(2,"0")}:${seconds}`:`${minutes}:${seconds}`}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return createElement(Text$1,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}forwardRef(function(props,ref){return createElement(TextInput,{...props,...ref===null?{}:{ref:ref}})});function optionalModule(name,load,validate){let candidate;try{candidate=load()}catch(cause){return frozenUnavailable(`optional peer '${name}' is not installed: ${describe(cause)}`)}let resolved=unwrapDefault(candidate);return resolved==null?frozenUnavailable(`optional peer '${name}' resolved to no module`):validate&&!validate(resolved)?frozenUnavailable(`optional peer '${name}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:resolved})}function unwrapDefault(candidate){return typeof candidate=="object"&&candidate!==null&&"default"in candidate&&Object.keys(candidate).length<=2?candidate.default:candidate}function frozenUnavailable(reason){/* @__PURE__ */
|
|
1
|
+
import{createContext,forwardRef,createElement,useMemo,useRef,useEffect,useState,useCallback,useContext}from"react";import{TextInput,StyleSheet,useWindowDimensions,View,Pressable,Text as Text$1,Animated}from"react-native";import{useSafeAreaInsets}from"react-native-safe-area-context";import{jsxs,jsx,Fragment}from"react/jsx-runtime";var FACE_WEIGHT=/* @__PURE__ */Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function face(theme,weight){let type=theme.type,fontFamily=type.families[weight];return weight==="mono"||type.namedFaces[weight]?{fontFamily:fontFamily}:{fontFamily:fontFamily,fontWeight:type.weight[FACE_WEIGHT[weight]]}}var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function isSafeRoomUrl(url){try{return new URL(url.trim()).protocol==="https:"}catch{return false}}function isUsableRoomCredential(roomUrl,token){return isSafeRoomUrl(roomUrl)&&token.trim().length>0}function reportHostFailure(error){let globalConsole=globalThis.console;try{globalConsole?.error?.("[everfur] A host callback threw; the SDK ignored it.",error)}catch{}}function isThenable(value){return(typeof value=="object"||typeof value=="function")&&value!==null&&typeof value.then=="function"}function callHost(fn,...args){if(typeof fn=="function")try{let result=fn(...args);return isThenable(result)&&Promise.resolve(result).then(void 0,reportHostFailure),result}catch(error){reportHostFailure(error);return}}var GUARDED=/* @__PURE__ */new WeakMap;function guardHost(fn){if(typeof fn!="function")return;let cached=GUARDED.get(fn);if(cached!==void 0)return cached;let guarded=(...args)=>{callHost(fn,...args)};return GUARDED.set(fn,guarded),guarded}function guardHostProps(props,names){let guarded=null;for(let name of names){let fn=props[name];typeof fn=="function"&&(guarded??={...props},guarded[name]=guardHost(fn))}return guarded??props}var VET_CALL_CONSULT_MINUTES=10,VET_CALL_COPY=/* @__PURE__ */Object.freeze({muteCta:"Mute",unmuteCta:"Unmute",cameraOffCta:"Camera off",cameraOnCta:"Camera on",leaveCta:"Leave",switchCameraCta:"Switch camera",speakerOffCta:"Speaker off",speakerOnCta:"Speaker on",lobbyTitleNoName:"Your vet is joining",lobbySubtitle:"",lobbyPrepLabel:"While you wait",lobbyPrepNoPet:"Have your pet nearby and somewhere well lit.",lobbyTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`${name} is joining`:VET_CALL_COPY.lobbyTitleNoName},lobbyPrep:petName=>{let pet=petName?.trim()??"";return pet.length>0?`Have ${pet} nearby and somewhere well lit.`:VET_CALL_COPY.lobbyPrepNoPet},lobbyDuration:minutes=>`${minutes} minutes`,waitingRoomLabel:"Waiting room",leaveWaitingRoomLabel:"Leave the waiting room",lobbyTipsTitle:clinicianName=>{let name=clinicianName?.trim()??"";return name.length>0?`Before ${name} joins`:VET_CALL_COPY.lobbyPrepLabel},lobbyTipSpot:"Find a bright, quiet spot.",joinFailedReason:"That did not open. Try again.",recordingNoticeTitle:"This consultation is recorded.",recordingNoticeCta:"Continue to the call",recordingNoticeDecline:"Not now",selfCameraOffLabel:"Your camera is off"});function formatElapsed(ms){let total=Math.max(0,Math.floor(ms/1e3)),seconds=String(total%60).padStart(2,"0"),minutes=Math.floor(total%3600/60),hours=Math.floor(total/3600);return hours>0?`${hours}:${String(minutes).padStart(2,"0")}:${seconds}`:`${minutes}:${seconds}`}var ABSOLUTE_FILL=/* @__PURE__ */Object.freeze({position:"absolute",top:0,right:0,bottom:0,left:0});var freezeInPlace=Object.freeze;function deepFreeze(value){if(value!==null&&typeof value=="object"&&!Object.isFrozen(value)){freezeInPlace(value);for(let key of Object.keys(value))deepFreeze(value[key])}return value}var TEXT_SCALE_TIER_CAPS=/* @__PURE__ */Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),SPACE={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},RADIUS={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},TYPE_SIZE={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},LINE_HEIGHT={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},WEIGHT={regular:"400",medium:"500",bold:"700"},LETTER_SPACING={eyebrow:1,monoWide:.9,headerBrand:-.42,tight:-.35},DEFAULT_MAX_FONT_SCALE=0,SYSTEM_FONT_FAMILY="System",SYSTEM_MONO_FAMILY="monospace",TIERS=["content","heading","control","compact","badge"];function authoredTierSizes(size){let out={};for(let tier of TIERS)out[tier]=size;return out}var NO_FONT_SOURCES=[];function baseType(){return{family:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,fontUrl:null,families:{regular:SYSTEM_FONT_FAMILY,medium:SYSTEM_FONT_FAMILY,bold:SYSTEM_FONT_FAMILY,mono:SYSTEM_MONO_FAMILY,monoMedium:SYSTEM_MONO_FAMILY,monoBold:SYSTEM_MONO_FAMILY},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:TYPE_SIZE,tierSizes:authoredTierSizes(TYPE_SIZE),lineHeight:LINE_HEIGHT,weight:WEIGHT,letterSpacing:LETTER_SPACING,scale:1,maxScale:DEFAULT_MAX_FONT_SCALE,scaleCaps:TEXT_SCALE_TIER_CAPS,headingFamily:null,headingWeight:null,fontSources:NO_FONT_SOURCES}}var NO_SLOTS={},EASING_CURVES=/* @__PURE__ */Object.freeze({standard:/* @__PURE__ */Object.freeze([.2,0,0,1]),emphasized:/* @__PURE__ */Object.freeze([.2,.8,.2,1]),exit:/* @__PURE__ */Object.freeze([.4,0,1,1])});function cssCubicBezier(curve){return`cubic-bezier(${curve.join(", ")})`}var MOTION={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:cssCubicBezier(EASING_CURVES.standard),emphasized:cssCubicBezier(EASING_CURVES.emphasized),exit:cssCubicBezier(EASING_CURVES.exit)},reducedMotion:false},LIGHT_COLOR={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FFFFFF",surfaceSubtle:"#F1F5F2",background:"#FFFFFF",borderRingCream:"#E4E4E4",chatGround:"#FFFFFF",composerFill:"#FFFFFF",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#000000",secondary:"#0E462E",muted:"#6B6B6B",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#C03410",onDanger:"#FFFFFF",errorRed:"#C03410",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(192,52,16,0.06)",badgeBgNeutral:"rgba(107,107,107,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#E9F1E9",scanButtonPink:"#FFC3BC",highlight:"#FFC3BC",onHighlight:"#000000",mark:"#07C168",controlEdge:"rgba(16,70,46,0.18)",structureEdge:"rgba(16,70,46,0.25)",primaryEdge:"#10462E",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)",info:"#10462E",badgeBgInfo:"rgba(16,70,46,0.10)",infoEdge:"rgba(16,70,46,0.25)"},EVERFUR_LIGHT=deepFreeze({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:LIGHT_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS}),DARK_COLOR={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A9A9A",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",onDanger:"#0E1F17",errorRed:"#FF6B5B",warningStrong:"#F0A35E",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.18)",badgeBgCaution:"rgba(217,130,29,0.20)",badgeBgCritical:"rgba(185,28,28,0.22)",badgeBgNeutral:"rgba(255,255,255,0.10)",bubbleUser:"#6BD39A",bubbleAssistant:"#1C1F23",bubbleVet:"#FFC3BC",onBubbleVet:"#000000",skeleton:"#23272C",scanButtonPink:"#FFC3BC",highlight:"#605051",onHighlight:"#F5F3F0",mark:"#07C168",controlEdge:"rgba(107,211,154,0.22)",structureEdge:"rgba(107,211,154,0.28)",primaryEdge:"#6BD39A",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)",info:"#6BD39A",badgeBgInfo:"rgba(107,211,154,0.12)",infoEdge:"rgba(107,211,154,0.28)"};deepFreeze({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false,assistantAvatarUrl:null},color:DARK_COLOR,space:SPACE,radius:RADIUS,type:baseType(),motion:MOTION,slots:NO_SLOTS});var EVERFUR_THEME_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),globalThemeHost=globalThis,EverfurThemeContext=globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]??(globalThemeHost[EVERFUR_THEME_CONTEXT_SYMBOL]=createContext(EVERFUR_LIGHT));EverfurThemeContext.displayName??="EverfurThemeContext";function useEverfurTheme(){return useContext(EverfurThemeContext)}function tierMultiplier(type,tier){let cap=type.scaleCaps[tier];return cap>0?cap:void 0}function Text({tier:tier="content",...props}){let{type:type}=useEverfurTheme(),cap=tierMultiplier(type,tier);return createElement(Text$1,cap===void 0?props:{maxFontSizeMultiplier:cap,...props})}forwardRef(function(props,ref){return createElement(TextInput,{...props,...ref===null?{}:{ref:ref}})});function optionalModule(name,load,validate){let candidate;try{candidate=load()}catch(cause){return frozenUnavailable(`optional peer '${name}' is not installed: ${describe(cause)}`)}let resolved=unwrapDefault(candidate);return resolved==null?frozenUnavailable(`optional peer '${name}' resolved to no module`):validate&&!validate(resolved)?frozenUnavailable(`optional peer '${name}' is present but failed its shape check`):/* @__PURE__ */Object.freeze({available:true,module:resolved})}function unwrapDefault(candidate){return typeof candidate=="object"&&candidate!==null&&"default"in candidate&&Object.keys(candidate).length<=2?candidate.default:candidate}function frozenUnavailable(reason){/* @__PURE__ */
|
|
2
2
|
return Object.freeze({available:false,module:null,reason:reason})}function describe(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"unknown load error"}var SLOT=/* @__PURE__ */Symbol.for("@everfur/sdk/televet");function televetGlobal(){let realm=globalThis,existing=realm[SLOT];if(existing!==void 0)return existing;let created={presenter:null,snapshot:/* @__PURE__ */Object.freeze({request:null,serial:0,activeHost:null}),hosts:[],nextHost:1,listeners:/* @__PURE__ */new Set,dailyRegistered:false};return realm[SLOT]=created,created}function markEverfurDailyRegistered(registered){televetGlobal().dailyRegistered=registered}var EVERFUR_DAILY_SETUP=`[everfur] The in-app vet call needs the Daily native modules, which this app has not registered. Install @daily-co/react-native-daily-js, @daily-co/react-native-webrtc and (Expo) @daily-co/config-plugin-rn-daily-js, rebuild the native app (a JS-only OTA cannot add a native module), and call registerEverfurDaily(() => require('@daily-co/react-native-daily-js')) once in your app entry. ON EXPO GO THIS CANNOT BE FIXED BY INSTALLING: Expo Go runs a fixed set of native modules and cannot load Daily at any version, so you need a development build (expo prebuild, then run the native app) before the in-app call works at all. Until then the in-app visit tells the member the call cannot be joined; <VetVisitButton prefer="redirect" /> is the explicit way to the hosted visit in the browser, which needs no native module.`,DAILY_PEER="@daily-co/react-native-daily-js",NOT_REGISTERED=`optional peer '${DAILY_PEER}' has no registered loader`,WRONG_SHAPE=`optional peer '${DAILY_PEER}' is present but failed its shape check`;function isRecordLike(candidate){return typeof candidate=="object"&&candidate!==null}function isDailyBox(candidate){return isRecordLike(candidate)&&"box"in candidate}function normalizeDailyModule(candidate){let inner=candidate.default,fallback=isRecordLike(inner)||typeof inner=="function"?inner:{},owner=typeof candidate.createCallObject=="function"?candidate:fallback,factory=owner.createCallObject,merged={createCallObject:typeof factory=="function"?factory.bind(owner):factory,DailyMediaView:candidate.DailyMediaView??fallback.DailyMediaView};return isEverfurDailyModule(merged)?merged:null}function isEverfurDailyModule(candidate){if(!isRecordLike(candidate)||typeof candidate.createCallObject!="function")return false;let view=candidate.DailyMediaView;return typeof view=="function"||typeof view=="object"&&view!==null}var loader=null,memo=null;function unavailable(reason){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({available:false,module:null,reason:reason})}function registerEverfurDaily(next){loader=next,memo=null,markEverfurDailyRegistered(next!==null)}function loadEverfurDaily(){if(memo!==null)return memo;let load=loader;if(load===null)return memo=unavailable(NOT_REGISTERED),memo;let raw=optionalModule(DAILY_PEER,()=>({box:load()}),isDailyBox);if(!raw.available)return memo=unavailable(raw.reason),memo;let inner=raw.module.box;if(!isRecordLike(inner))return memo=unavailable(WRONG_SHAPE),memo;let normalized=normalizeDailyModule(inner);return memo=normalized===null?unavailable(WRONG_SHAPE):/* @__PURE__ */Object.freeze({available:true,module:normalized}),memo}function CallControl({label:label,glyph:glyph,onPress:onPress,testID:testID,muted:muted=false,style:style}){/* @__PURE__ */
|
|
4
4
|
return jsx(Pressable,{onPress:onPress,testID:testID,accessibilityRole:"button",accessibilityLabel:label,accessibilityState:{selected:muted},style:style,children:glyph})}function GlyphBox({children:children,testID:testID}){/* @__PURE__ */
|
|
@@ -34,9 +34,7 @@ return jsxs(View,{style:[styles.root,{paddingTop:insets.top+theme.space.sm,paddi
|
|
|
34
34
|
/* @__PURE__ */jsxs(View,{style:[styles.avatar,{width:avatarSize,height:avatarSize,borderRadius:avatarSize/2}],testID:"everfur-vet-lobby-avatar",accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
|
|
35
35
|
/* @__PURE__ */jsx(View,{style:styles.avatarGlyphHead}),
|
|
36
36
|
/* @__PURE__ */jsx(View,{style:styles.avatarGlyphBody})]}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */jsx(Text,{tier:"heading",style:styles.title,testID:"everfur-vet-lobby-title",children:VET_CALL_COPY.lobbyTitle(clinicianName)}),
|
|
39
|
-
/* @__PURE__ */jsx(Text,{style:styles.subtitle,testID:"everfur-vet-lobby-subtitle",children:VET_CALL_COPY.lobbySubtitle})]}),
|
|
37
|
+
/* @__PURE__ */jsx(View,{accessibilityLiveRegion:"polite",accessible:true,children:/* @__PURE__ */jsx(Text,{tier:"heading",style:styles.title,testID:"everfur-vet-lobby-title",children:VET_CALL_COPY.lobbyTitle(clinicianName)})}),
|
|
40
38
|
/* @__PURE__ */jsx(WaitingDots,{reducedMotion:theme.motion.reducedMotion,styles:styles})]}),
|
|
41
39
|
/* @__PURE__ */jsxs(View,{style:styles.prepCard,testID:"everfur-vet-lobby-prep",children:[
|
|
42
40
|
/* @__PURE__ */jsx(Text,{tier:"badge",style:styles.prepLabel,children:VET_CALL_COPY.lobbyTipsTitle(clinicianName)}),[VET_CALL_COPY.lobbyTipSpot,VET_CALL_COPY.lobbyPrep(petName)].map((tip,i)=>/* @__PURE__ */jsxs(View,{style:styles.tip,children:[
|
|
@@ -45,7 +43,7 @@ return jsxs(View,{style:[styles.root,{paddingTop:insets.top+theme.space.sm,paddi
|
|
|
45
43
|
/* @__PURE__ */jsxs(View,{style:styles.controls,children:[
|
|
46
44
|
/* @__PURE__ */jsx(LobbyControl,{label:micOn?VET_CALL_COPY.muteCta:VET_CALL_COPY.unmuteCta,glyph:/* @__PURE__ */jsx(MicGlyph,{color:theme.color.text.onBrand,off:!micOn}),active:micOn,onPress:onToggleMic,testID:"everfur-vet-lobby-mic",styles:styles}),
|
|
47
45
|
/* @__PURE__ */jsx(LobbyControl,{label:cameraOn?VET_CALL_COPY.cameraOffCta:VET_CALL_COPY.cameraOnCta,glyph:/* @__PURE__ */jsx(CameraGlyph,{color:theme.color.text.onBrand,off:!cameraOn}),active:cameraOn,onPress:onToggleCamera,testID:"everfur-vet-lobby-camera",styles:styles}),cameraOn&&onSwitchCamera?/* @__PURE__ */jsx(LobbyControl,{label:VET_CALL_COPY.switchCameraCta,glyph:/* @__PURE__ */jsx(SwitchCameraGlyph,{color:theme.color.text.onBrand}),active:true,onPress:onSwitchCamera,testID:"everfur-vet-lobby-switch-camera",styles:styles}):null]}),
|
|
48
|
-
/* @__PURE__ */jsx(Text,{tier:"badge",style:styles.duration,testID:"everfur-vet-lobby-duration",children:VET_CALL_COPY.lobbyDuration(soldMinutes(consultMinutes))})]})}function makeStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme;return StyleSheet.create({root:{flex:1,backgroundColor:color.brand,paddingHorizontal:space.lg},topRow:{flexDirection:"row",alignItems:"center",gap:space.md},tip:{flexDirection:"row",gap:space.md,alignItems:"flex-start",paddingTop:space.sm},tipNumber:{...face(theme,"monoBold"),color:ON_BRAND.textSecondary,fontSize:13,width:24,paddingTop:4},leaveHit:{minHeight:MIN_TOUCH_TARGET,justifyContent:"center",paddingVertical:space.xs,paddingRight:space.md},leaveLabel:{...face(theme,"medium"),color:color.text.onBrand,fontSize:type.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:color.success,backgroundColor:ON_BRAND.surface,marginBottom:space.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:ON_BRAND.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:ON_BRAND.glyph},title:{...face(theme,"bold"),color:color.text.onBrand,fontSize:type.size.heading,lineHeight:Math.round(type.size.heading*type.lineHeight.snug),textAlign:"center",paddingHorizontal:space.sm},
|
|
46
|
+
/* @__PURE__ */jsx(Text,{tier:"badge",style:styles.duration,testID:"everfur-vet-lobby-duration",children:VET_CALL_COPY.lobbyDuration(soldMinutes(consultMinutes))})]})}function makeStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme;return StyleSheet.create({root:{flex:1,backgroundColor:color.brand,paddingHorizontal:space.lg},topRow:{flexDirection:"row",alignItems:"center",gap:space.md},tip:{flexDirection:"row",gap:space.md,alignItems:"flex-start",paddingTop:space.sm},tipNumber:{...face(theme,"monoBold"),color:ON_BRAND.textSecondary,fontSize:13,width:24,paddingTop:4},leaveHit:{minHeight:MIN_TOUCH_TARGET,justifyContent:"center",paddingVertical:space.xs,paddingRight:space.md},leaveLabel:{...face(theme,"medium"),color:color.text.onBrand,fontSize:type.size.body},center:{flex:1,alignItems:"center",justifyContent:"center"},avatar:{alignItems:"center",justifyContent:"center",borderWidth:2,borderColor:color.success,backgroundColor:ON_BRAND.surface,marginBottom:space.lg,overflow:"hidden"},avatarGlyphHead:{width:34,height:34,borderRadius:17,borderWidth:2,borderColor:ON_BRAND.glyph,marginBottom:6},avatarGlyphBody:{width:66,height:33,borderTopLeftRadius:33,borderTopRightRadius:33,borderWidth:2,borderBottomWidth:0,borderColor:ON_BRAND.glyph},title:{...face(theme,"bold"),color:color.text.onBrand,fontSize:type.size.heading,lineHeight:Math.round(type.size.heading*type.lineHeight.snug),textAlign:"center",paddingHorizontal:space.sm},dotRow:{flexDirection:"row",gap:space.xs,marginTop:space.lg},dot:{width:8,height:8,borderRadius:4,backgroundColor:color.success},prepCard:{borderRadius:radius.lg,borderWidth:1,borderColor:ON_BRAND.hairline,backgroundColor:ON_BRAND.surface,padding:space.lg,marginBottom:space.lg},prepLabel:{...face(theme,"monoBold"),color:color.accent,fontSize:type.size.micro,letterSpacing:1.2,textTransform:"uppercase"},prepBody:{...face(theme,"regular"),color:color.text.onBrand,fontSize:type.size.subtitle,lineHeight:Math.round(type.size.subtitle*type.lineHeight.relaxed)},controls:{flexDirection:"row",justifyContent:"center",gap:space.lg,marginBottom:space.lg},control:{minWidth:64,minHeight:48,paddingHorizontal:space.md,alignItems:"center",justifyContent:"center",borderRadius:radius.pill,backgroundColor:ON_BRAND.surfaceRaised},controlOff:{backgroundColor:ON_BRAND.surfaceActive},duration:{...face(theme,"medium"),color:ON_BRAND.textTertiary,fontSize:type.size.micro,letterSpacing:1.6,textAlign:"center"}})}var LEAVE_SETTLE_MS=5e3;function settleWithin(work,ms){return new Promise(resolve=>{let timer=setTimeout(resolve,ms);work.catch(()=>{}).then(()=>{clearTimeout(timer),resolve()})})}function useLeaveOnce(onLeave,teardown){let onLeaveRef=useRef(onLeave);useEffect(()=>{onLeaveRef.current=onLeave});let liveRef=useRef(false);useEffect(()=>(liveRef.current=true,()=>{liveRef.current=false}),[]);let reportedRef=useRef(false),reportLeft=useCallback(()=>{reportedRef.current||!liveRef.current||(reportedRef.current=true,onLeaveRef.current())},[]),leavingRef=useRef(false),leave=useCallback(()=>{leavingRef.current||(leavingRef.current=true,settleWithin(teardown(),LEAVE_SETTLE_MS).then(reportLeft))},[teardown,reportLeft]);return{reportLeft:reportLeft,leave:leave,leaving:leavingRef}}var SLOT2=/* @__PURE__ */Symbol.for("@everfur/sdk/televet/recording-notice-receipt");function receipts(){let realm=globalThis;return realm[SLOT2]??=/* @__PURE__ */new Map}function hasRecordingNoticeAccepted(roomUrl){return(receipts().get(roomUrl)??0)>0}function useSpeakerRoute(callRef){let[speakerOn,setSpeakerOn]=useState(true),route=useRef(true),toggleSpeaker=useCallback(()=>{let call=callRef.current;if(!call?.setNativeInCallAudioMode)return;let next=!route.current;route.current=next,setSpeakerOn(next),call.setNativeInCallAudioMode(next?"video":"voice")},[callRef]);return{speakerOn:speakerOn,toggleSpeaker:toggleSpeaker}}function asTrack(track){return track??null}function hasVideo(participant){return!!participant?.videoTrack}function PersonMark({styles:styles}){/* @__PURE__ */
|
|
49
47
|
return jsxs(View,{style:styles.remoteOffAvatar,accessibilityElementsHidden:true,importantForAccessibility:"no",children:[
|
|
50
48
|
/* @__PURE__ */jsx(View,{style:styles.remoteOffHead}),
|
|
51
49
|
/* @__PURE__ */jsx(View,{style:styles.remoteOffBody})]})}function EverfurVetCall(props){/* @__PURE__ */
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as EverfurResult } from '../EverfurResult-COlXj1wq.cjs';
|
|
2
|
-
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-
|
|
2
|
+
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-C68HTCf4.cjs';
|
|
3
3
|
import '../EverfurError-DeBqRpQV.cjs';
|
|
4
4
|
|
|
5
5
|
/** One scripted stream outcome. Each block is a JSON `data:` payload string; MockTransport wraps it in SSE. */
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as EverfurResult } from '../EverfurResult-ClPTS0P2.js';
|
|
2
|
-
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-
|
|
2
|
+
import { T as TransportPort, d as EverfurRequest, F as Frame } from '../config-DeUmccwl.js';
|
|
3
3
|
import '../EverfurError-DeBqRpQV.js';
|
|
4
4
|
|
|
5
5
|
/** One scripted stream outcome. Each block is a JSON `data:` payload string; MockTransport wraps it in SSE. */
|
|
@@ -4,20 +4,20 @@ export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '..
|
|
|
4
4
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.cjs';
|
|
5
5
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-BCfwLj0h.cjs';
|
|
6
6
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.cjs';
|
|
7
|
-
export { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
7
|
+
export { E as EntitlementSnapshot } from '../../runtimeTypes-C67itXfp.cjs';
|
|
8
8
|
export { c as RecordsRequestStatus, d as RecordsRequestView, e as RecordsSimpleStatus } from '../../models-A4A5S7AG.cjs';
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
10
|
import { R as RiskTier } from '../../PhotoController-3l7MT9jA.cjs';
|
|
11
11
|
export { EverfurTestEntitlements, RecordsSandboxActionResult, RecordsSandboxClinicReply, RecordsSandboxController, RecordsSandboxResult, VetVisitSandboxActionResult, VetVisitSandboxController, VetVisitSandboxEvent, VetVisitSandboxReminderStage, VetVisitSandboxResult, VetVisitSandboxStatus, VetVisitSandboxVisit, useEverfurRecordsSandbox, useEverfurTestEntitlements, useEverfurVetVisitSandbox } from '../web/index.cjs';
|
|
12
|
-
import '../../petsRepository-
|
|
13
|
-
import '../../identity-
|
|
14
|
-
import '../../config-
|
|
12
|
+
import '../../petsRepository-BYe7_MUo.cjs';
|
|
13
|
+
import '../../identity-ScajqjK5.cjs';
|
|
14
|
+
import '../../config-C68HTCf4.cjs';
|
|
15
15
|
import '../../profile-CSs1wlXT.cjs';
|
|
16
16
|
import '../../cacheEpoch-DknKn3S0.cjs';
|
|
17
17
|
import '../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
18
|
-
import '../../ports-
|
|
19
|
-
import '../../casesRepository-
|
|
20
|
-
import '../../requestFunnel-
|
|
18
|
+
import '../../ports-okLpXkpu.cjs';
|
|
19
|
+
import '../../casesRepository-D0aQSXkb.cjs';
|
|
20
|
+
import '../../requestFunnel-u8qnM5Ll.cjs';
|
|
21
21
|
import '../../TelemetryPort-BDNr00hu.cjs';
|
|
22
22
|
import '../../ports-BN6RHF9W.cjs';
|
|
23
23
|
import '../../CameraPort-Cv31Pz7g.cjs';
|
|
@@ -4,20 +4,20 @@ export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '..
|
|
|
4
4
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.js';
|
|
5
5
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-DJf4h12Q.js';
|
|
6
6
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.js';
|
|
7
|
-
export { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
7
|
+
export { E as EntitlementSnapshot } from '../../runtimeTypes-BFes64Vp.js';
|
|
8
8
|
export { c as RecordsRequestStatus, d as RecordsRequestView, e as RecordsSimpleStatus } from '../../models-CnXY5LuO.js';
|
|
9
9
|
import { ReactNode } from 'react';
|
|
10
10
|
import { R as RiskTier } from '../../PhotoController-vzY5bfY_.js';
|
|
11
11
|
export { EverfurTestEntitlements, RecordsSandboxActionResult, RecordsSandboxClinicReply, RecordsSandboxController, RecordsSandboxResult, VetVisitSandboxActionResult, VetVisitSandboxController, VetVisitSandboxEvent, VetVisitSandboxReminderStage, VetVisitSandboxResult, VetVisitSandboxStatus, VetVisitSandboxVisit, useEverfurRecordsSandbox, useEverfurTestEntitlements, useEverfurVetVisitSandbox } from '../web/index.js';
|
|
12
|
-
import '../../petsRepository-
|
|
13
|
-
import '../../identity-
|
|
14
|
-
import '../../config-
|
|
12
|
+
import '../../petsRepository-BdfbY9Oe.js';
|
|
13
|
+
import '../../identity-BTT6YtH5.js';
|
|
14
|
+
import '../../config-DeUmccwl.js';
|
|
15
15
|
import '../../profile-CSs1wlXT.js';
|
|
16
16
|
import '../../cacheEpoch-DknKn3S0.js';
|
|
17
17
|
import '../../ErrorPolicyPort-C3nNSS_j.js';
|
|
18
|
-
import '../../ports-
|
|
19
|
-
import '../../casesRepository-
|
|
20
|
-
import '../../requestFunnel-
|
|
18
|
+
import '../../ports-D4FQKTBS.js';
|
|
19
|
+
import '../../casesRepository-DjhMfm_n.js';
|
|
20
|
+
import '../../requestFunnel-Dhaj0yUq.js';
|
|
21
21
|
import '../../TelemetryPort-BDNr00hu.js';
|
|
22
22
|
import '../../ports-BN6RHF9W.js';
|
|
23
23
|
import '../../CameraPort-Cv31Pz7g.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
1
|
+
import { E as EntitlementSnapshot } from '../../runtimeTypes-C67itXfp.cjs';
|
|
2
2
|
import { E as EverfurResult } from '../../EverfurResult-COlXj1wq.cjs';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.cjs';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.cjs';
|
|
@@ -8,15 +8,15 @@ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } f
|
|
|
8
8
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.cjs';
|
|
9
9
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-BCfwLj0h.cjs';
|
|
10
10
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.cjs';
|
|
11
|
-
import '../../petsRepository-
|
|
12
|
-
import '../../identity-
|
|
13
|
-
import '../../config-
|
|
11
|
+
import '../../petsRepository-BYe7_MUo.cjs';
|
|
12
|
+
import '../../identity-ScajqjK5.cjs';
|
|
13
|
+
import '../../config-C68HTCf4.cjs';
|
|
14
14
|
import '../../profile-CSs1wlXT.cjs';
|
|
15
15
|
import '../../cacheEpoch-DknKn3S0.cjs';
|
|
16
16
|
import '../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
17
|
-
import '../../ports-
|
|
18
|
-
import '../../casesRepository-
|
|
19
|
-
import '../../requestFunnel-
|
|
17
|
+
import '../../ports-okLpXkpu.cjs';
|
|
18
|
+
import '../../casesRepository-D0aQSXkb.cjs';
|
|
19
|
+
import '../../requestFunnel-u8qnM5Ll.cjs';
|
|
20
20
|
import '../../TelemetryPort-BDNr00hu.cjs';
|
|
21
21
|
import '../../ports-BN6RHF9W.cjs';
|
|
22
22
|
import '../../CameraPort-Cv31Pz7g.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
1
|
+
import { E as EntitlementSnapshot } from '../../runtimeTypes-BFes64Vp.js';
|
|
2
2
|
import { E as EverfurResult } from '../../EverfurResult-ClPTS0P2.js';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.js';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
@@ -8,15 +8,15 @@ export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } f
|
|
|
8
8
|
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.js';
|
|
9
9
|
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-DJf4h12Q.js';
|
|
10
10
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.js';
|
|
11
|
-
import '../../petsRepository-
|
|
12
|
-
import '../../identity-
|
|
13
|
-
import '../../config-
|
|
11
|
+
import '../../petsRepository-BdfbY9Oe.js';
|
|
12
|
+
import '../../identity-BTT6YtH5.js';
|
|
13
|
+
import '../../config-DeUmccwl.js';
|
|
14
14
|
import '../../profile-CSs1wlXT.js';
|
|
15
15
|
import '../../cacheEpoch-DknKn3S0.js';
|
|
16
16
|
import '../../ErrorPolicyPort-C3nNSS_j.js';
|
|
17
|
-
import '../../ports-
|
|
18
|
-
import '../../casesRepository-
|
|
19
|
-
import '../../requestFunnel-
|
|
17
|
+
import '../../ports-D4FQKTBS.js';
|
|
18
|
+
import '../../casesRepository-DjhMfm_n.js';
|
|
19
|
+
import '../../requestFunnel-Dhaj0yUq.js';
|
|
20
20
|
import '../../TelemetryPort-BDNr00hu.js';
|
|
21
21
|
import '../../ports-BN6RHF9W.js';
|
|
22
22
|
import '../../CameraPort-Cv31Pz7g.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.js';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-C7RIscDR.js';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
|
|
4
4
|
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-CnXY5LuO.js';
|
|
5
5
|
import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-jbSWsweM.cjs';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
|
|
4
4
|
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-A4A5S7AG.cjs';
|
|
5
5
|
import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
|
|
@@ -2,9 +2,9 @@ import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
|
|
|
2
2
|
import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.js';
|
|
4
4
|
import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.js';
|
|
5
|
-
import { am as RecordsFeatures, an as RecordsUploadContentType, M as RecordMarkersView, N as RecordPdfLink, P as RecordShareAudienceScope, l as RecordShareAudience, T as RecordShareLink, Q as RecordShareEmailInput, S as RecordShareEmailReceipt, X as RecordsClinicBatchClient } from './depth-
|
|
5
|
+
import { am as RecordsFeatures, an as RecordsUploadContentType, M as RecordMarkersView, N as RecordPdfLink, P as RecordShareAudienceScope, l as RecordShareAudience, T as RecordShareLink, Q as RecordShareEmailInput, S as RecordShareEmailReceipt, X as RecordsClinicBatchClient } from './depth-C7RIscDR.js';
|
|
6
6
|
import { C as CreateUploadRequestInput, d as RecordsRequestView, U as UploadedDocument, g as RecordsView, h as ConsentState, G as GrantConsentInput, i as RecordsDenialReason, a as RecordEntity } from './models-CnXY5LuO.js';
|
|
7
|
-
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-
|
|
7
|
+
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-CqSMkcyR.js';
|
|
8
8
|
|
|
9
9
|
interface UploadDocumentInput {
|
|
10
10
|
readonly requestId: RecordsRequestId;
|
|
@@ -322,6 +322,12 @@ declare const REQUEST_TIMELINE_TITLES: Readonly<Record<RequestTimelineEventKey,
|
|
|
322
322
|
*/
|
|
323
323
|
declare function buildRequestTimeline(request: RecordsRequestView, options?: {
|
|
324
324
|
readonly petName?: string | null;
|
|
325
|
+
/**
|
|
326
|
+
* The tenant is a TEST ACCOUNT (entitlements `livemode: false`), which never emails a clinic: rail step 2 reads
|
|
327
|
+
* `Clinic not contacted` and `This is a test account, so no email went to {email}.` (owner-approved
|
|
328
|
+
* 2026-10-04, rows O2 and O3) in place of the tracker's `Clinic notified` line. Absent, the tenant is live.
|
|
329
|
+
*/
|
|
330
|
+
readonly sandbox?: boolean;
|
|
325
331
|
}): readonly RequestTimelineEvent[];
|
|
326
332
|
|
|
327
333
|
/**
|
|
@@ -2,9 +2,9 @@ import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
|
|
|
2
2
|
import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
4
4
|
import { F as FileHandle, U as UploadTransport } from './ports-BN6RHF9W.cjs';
|
|
5
|
-
import { am as RecordsFeatures, an as RecordsUploadContentType, M as RecordMarkersView, N as RecordPdfLink, P as RecordShareAudienceScope, l as RecordShareAudience, T as RecordShareLink, Q as RecordShareEmailInput, S as RecordShareEmailReceipt, X as RecordsClinicBatchClient } from './depth-
|
|
5
|
+
import { am as RecordsFeatures, an as RecordsUploadContentType, M as RecordMarkersView, N as RecordPdfLink, P as RecordShareAudienceScope, l as RecordShareAudience, T as RecordShareLink, Q as RecordShareEmailInput, S as RecordShareEmailReceipt, X as RecordsClinicBatchClient } from './depth-jbSWsweM.cjs';
|
|
6
6
|
import { C as CreateUploadRequestInput, d as RecordsRequestView, U as UploadedDocument, g as RecordsView, h as ConsentState, G as GrantConsentInput, i as RecordsDenialReason, a as RecordEntity } from './models-A4A5S7AG.cjs';
|
|
7
|
-
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-
|
|
7
|
+
import { c as RecordsDepthStatus, i as RecordsClinicController } from './useRecordsDepth-W3UAKQRN.cjs';
|
|
8
8
|
|
|
9
9
|
interface UploadDocumentInput {
|
|
10
10
|
readonly requestId: RecordsRequestId;
|
|
@@ -322,6 +322,12 @@ declare const REQUEST_TIMELINE_TITLES: Readonly<Record<RequestTimelineEventKey,
|
|
|
322
322
|
*/
|
|
323
323
|
declare function buildRequestTimeline(request: RecordsRequestView, options?: {
|
|
324
324
|
readonly petName?: string | null;
|
|
325
|
+
/**
|
|
326
|
+
* The tenant is a TEST ACCOUNT (entitlements `livemode: false`), which never emails a clinic: rail step 2 reads
|
|
327
|
+
* `Clinic not contacted` and `This is a test account, so no email went to {email}.` (owner-approved
|
|
328
|
+
* 2026-10-04, rows O2 and O3) in place of the tracker's `Clinic notified` line. Absent, the tenant is live.
|
|
329
|
+
*/
|
|
330
|
+
readonly sandbox?: boolean;
|
|
325
331
|
}): readonly RequestTimelineEvent[];
|
|
326
332
|
|
|
327
333
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
-
import { E as EverfurConsentScope } from '../../copy-
|
|
3
|
-
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-
|
|
2
|
+
import { E as EverfurConsentScope } from '../../copy-tYW0C83H.cjs';
|
|
3
|
+
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-tYW0C83H.cjs';
|
|
4
4
|
import { E as EverfurError } from '../../EverfurError-DeBqRpQV.cjs';
|
|
5
5
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.cjs';
|
|
6
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-
|
|
7
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-
|
|
6
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-ScajqjK5.cjs';
|
|
7
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-C68HTCf4.cjs';
|
|
8
8
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids-B2GAAifq.cjs';
|
|
9
9
|
export { E as EverfurResult } from '../../EverfurResult-COlXj1wq.cjs';
|
|
10
10
|
export { E as ErrorPolicyPort } from '../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
11
|
-
import '../../requestFunnel-
|
|
11
|
+
import '../../requestFunnel-u8qnM5Ll.cjs';
|
|
12
12
|
|
|
13
13
|
interface EverfurConsentToggleProps {
|
|
14
14
|
/** Which act this row is. One row is one act; two acts are two rows, never one switch. */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
-
import { E as EverfurConsentScope } from '../../copy-
|
|
3
|
-
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-
|
|
2
|
+
import { E as EverfurConsentScope } from '../../copy-wAnv8ldC.js';
|
|
3
|
+
export { C as CONSENT_COPY, a as CONSENT_SCOPE_COPY, b as CONSENT_VERSION_MAX, c as ConsentRepository, d as ConsentRepositoryDeps, e as ConsentRowView, f as ConsentRuntime, g as ConsentScopeCopy, h as EVERFUR_CONSENT_SCOPES, i as EverfurConsentDecision, j as EverfurConsentOptions, k as EverfurConsentScopeState, l as EverfurConsentState, m as EverfurConsentStatus, n as EverfurConsentVerdict, o as consentRowView, p as createConsentRepository, q as createConsentRepositoryOver, r as isEverfurConsentScope, u as useEverfurConsent, s as useEverfurConsentRepository } from '../../copy-wAnv8ldC.js';
|
|
4
4
|
import { E as EverfurError } from '../../EverfurError-DeBqRpQV.js';
|
|
5
5
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.js';
|
|
6
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-
|
|
7
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-
|
|
6
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity-BTT6YtH5.js';
|
|
7
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config-DeUmccwl.js';
|
|
8
8
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
9
9
|
export { E as EverfurResult } from '../../EverfurResult-ClPTS0P2.js';
|
|
10
10
|
export { E as ErrorPolicyPort } from '../../ErrorPolicyPort-C3nNSS_j.js';
|
|
11
|
-
import '../../requestFunnel-
|
|
11
|
+
import '../../requestFunnel-Dhaj0yUq.js';
|
|
12
12
|
|
|
13
13
|
interface EverfurConsentToggleProps {
|
|
14
14
|
/** Which act this row is. One row is one act; two acts are two rows, never one switch. */
|
package/dist/web/index.cjs
CHANGED
|
@@ -96,7 +96,7 @@ return Object.freeze({kind:"done",terminal:true,conversationId:fields.conversati
|
|
|
96
96
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:fields.serverRequestId??null})}function analysisStartedFrame(requestId,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
97
97
|
return Object.freeze({kind:"analysisStarted",requestId:requestId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function analysisCompleteFrame(fields,serverRequestId=null){/* @__PURE__ */
|
|
98
98
|
return Object.freeze({kind:"analysisComplete",terminal:false,resultId:fields.resultId,analysisType:fields.analysisType,modelVersion:fields.modelVersion,confidence:fields.confidence,detections:/* @__PURE__ */Object.freeze([...fields.detections]),interpretation:fields.interpretation,lastEventId:fields.lastEventId,serverRequestId:serverRequestId})}function unknownFrame(raw,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
99
|
-
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function createIdentityProvider(userRef2,getToken,onMinted){let cached=null,inFlight3=null,revoked=false,load=()=>inFlight3||(inFlight3=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight3=null}})(),inFlight3);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */zod.z.record(/* @__PURE__ */zod.z.string(),/* @__PURE__ */zod.z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=new TextDecoder("utf-8"),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var SDK_VERSION="0.9.1",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
|
|
99
|
+
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function createIdentityProvider(userRef2,getToken,onMinted){let cached=null,inFlight3=null,revoked=false,load=()=>inFlight3||(inFlight3=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight3=null}})(),inFlight3);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */zod.z.record(/* @__PURE__ */zod.z.string(),/* @__PURE__ */zod.z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=new TextDecoder("utf-8"),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var SDK_VERSION="0.9.3",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
|
|
100
100
|
return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function checkPublishableKey(raw){let publishableKey=typeof raw=="string"?raw.trim():"";return publishableKey.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(publishableKey)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(config,options){let keyFailure=checkPublishableKey(config?.publishableKey);if(keyFailure!==null)/* @__PURE__ */
|
|
101
101
|
return Object.freeze({ok:false,failure:keyFailure});let publishableKey=config.publishableKey.trim(),baseUrl=tryResolveApiBaseUrl(config.apiBaseUrl);if(!baseUrl.ok)return baseUrl;let contractVersion=config.contractVersion?.trim()||DEFAULT_CONTRACT_VERSION;/* @__PURE__ */
|
|
102
102
|
return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:publishableKey,apiBaseUrl:baseUrl.value,contractVersion:contractVersion,sdkVersion:SDK_VERSION,platform:options?.platform??SDK_PLATFORM,debug:config.debug===true})})}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host){return host.length===0||host.includes("@")?false:host.startsWith("[")&&host.endsWith("]")?true:!host.includes(":")}function canEchoOrigin(rawTrimmed,host){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host)}function safeOrigin(scheme,host){return`${scheme}://${host}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host=hostOf(match[2]);if(host.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host)?`: ${safeOrigin(scheme,host)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
|
|
@@ -200,14 +200,16 @@ return jsxRuntime.jsx("li",{children:/* @__PURE__ */jsxRuntime.jsxs("button",{ty
|
|
|
200
200
|
/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",onClick:onClose,style:styles.close,children:CHAT_COPY.close})]}):null}function makeStyles3(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type;return{sheet:{boxSizing:"border-box",position:"fixed",top:"auto",right:0,bottom:0,left:0,margin:0,width:"100%",maxWidth:"100%",maxHeight:SHEET_MAX_HEIGHT,overflowY:"auto",padding:`${s.lg+4}px ${s.lg+4}px ${s.xxl}px`,border:0,borderRadius:`${SHEET_RADIUS}px ${SHEET_RADIUS}px 0 0`,backgroundColor:c.surface,color:c.text.primary,display:"flex",flexDirection:"column",gap:s.md+2,...sheetSlotCss(theme.slots.dialog)},title:{margin:0,...headingFaceCss(theme,"bold"),fontSize:t.tierSizes.heading.heading,lineHeight:`${Math.round(t.tierSizes.heading.heading*1.22)}px`,color:c.brandInk,...slotText(theme.slots.dialog)},list:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:s.sm},row:{boxSizing:"border-box",width:"100%",minHeight:MIN_TOUCH_TARGET2,display:"flex",flexDirection:"row",alignItems:"center",gap:s.md,margin:0,padding:s.md,borderRadius:r.md,border:`1px solid ${c.brandBorder}`,backgroundColor:c.surfaceCream,color:c.text.primary,textAlign:"left",cursor:"pointer",font:"inherit"},rowActive:{border:`1px solid ${c.brandInk}`,backgroundColor:c.brandSoft},ring:{boxSizing:"border-box",flexShrink:0,width:ROW_RING_SIZE,height:ROW_RING_SIZE,borderRadius:r.pill,border:`2px solid ${c.mark}`,display:"inline-flex",alignItems:"center",justifyContent:"center"},disc:{boxSizing:"border-box",width:ROW_AVATAR_SIZE,height:ROW_AVATAR_SIZE,borderRadius:r.pill,display:"inline-flex",alignItems:"center",justifyContent:"center",...faceCss(theme,"bold"),fontSize:Math.round(ROW_AVATAR_SIZE*.42),lineHeight:1,textTransform:"uppercase"},text:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2},name:{...faceCss(theme,"bold"),fontSize:t.size.body+1,lineHeight:`${t.size.body+4}px`,color:c.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},meta:{...faceCss(theme,"monoBold"),fontSize:t.tierSizes.compact.tiny,lineHeight:`${t.tierSizes.compact.tiny+2}px`,letterSpacing:.4,textTransform:"uppercase",color:c.text.muted},addRow:{boxSizing:"border-box",display:"flex",alignItems:"center",gap:s.sm,width:"100%",minHeight:MIN_TOUCH_TARGET2,padding:`${s.xs}px ${s.sm}px`,background:"none",border:"none",borderRadius:r.lg,cursor:"pointer",textAlign:"left"},addDisc:{boxSizing:"border-box",width:ROW_RING_SIZE,height:ROW_RING_SIZE,borderRadius:r.pill,display:"inline-flex",alignItems:"center",justifyContent:"center",border:`2px dashed ${c.brandBorder}`,backgroundColor:c.surfaceCream,color:c.brandInk,fontSize:t.size.subtitle,lineHeight:1},addLabel:{...faceCss(theme,"bold"),fontSize:t.size.body,color:c.text.primary,...slotText(theme.slots.dialog)},close:{boxSizing:"border-box",alignSelf:"center",minHeight:MIN_TOUCH_TARGET2,minWidth:MIN_TOUCH_TARGET2,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,padding:`0 ${s.xl}px`,borderRadius:r.pill,border:`1px solid ${c.brandBorder}`,backgroundColor:c.surface,color:c.text.primary,cursor:"pointer",...faceCss(theme,"medium"),fontSize:t.tierSizes.control.body}}}var HEADER_AVATAR_SIZE=35,RING_WIDTH=1.75,AVATAR_INNER_SIZE=HEADER_AVATAR_SIZE-RING_WIDTH*2,ADD_BADGE_SIZE=12.4,MENU_BUTTON_SIZE=36,HISTORY_GLYPH_SIZE=20,UNREAD_DOT_SIZE=9,UNREAD_DOT_RING=1.5,MIN_TOUCH_TARGET3=44;function ChatHeader(props){let{pets:pets,activePet:activePet,unread:unread,onOpenHistory:onOpenHistory,historyTriggerRef:historyTriggerRef,onSelectPet:onSelectPet,onAddPet:onAddPet=null,vetEntry:vetEntry=null}=props,{rail:rail=false,historyOpen:historyOpen=false,onNewChat:onNewChat}=props,theme=useEverfurTheme(),styles=react.useMemo(()=>makeStyles4(theme),[theme]),glyphInk=theme.slots.header?.textColor??theme.color.text.primary,historyControls=/* @__PURE__ */jsxRuntime.jsxs("div",{style:styles.historyControls,children:[onNewChat!==void 0?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",onClick:onNewChat,"aria-label":HISTORY_COPY.newChat,style:styles.menuButton,children:/* @__PURE__ */jsxRuntime.jsx(Glyph,{name:"squarePen",size:HISTORY_GLYPH_SIZE,color:glyphInk})}):null,
|
|
201
201
|
/* @__PURE__ */jsxRuntime.jsx("button",{ref:historyTriggerRef,type:"button",onClick:onOpenHistory,"aria-label":historyControlLabel(rail,historyOpen,unread),"aria-expanded":historyOpen,style:styles.menuButton,children:/* @__PURE__ */jsxRuntime.jsxs("span",{"aria-hidden":"true",style:styles.menuDisc,children:[
|
|
202
202
|
/* @__PURE__ */jsxRuntime.jsx(Glyph,{name:"history",size:HISTORY_GLYPH_SIZE,color:glyphInk}),unread?/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.unreadDot}):null]})})]});/* @__PURE__ */
|
|
203
|
-
return jsxRuntime.jsxs("header",{style:styles.bar,children:[
|
|
204
|
-
/* @__PURE__ */jsxRuntime.jsx("div",{style:styles.
|
|
205
|
-
/* @__PURE__ */jsxRuntime.jsx(
|
|
203
|
+
return jsxRuntime.jsxs("header",{style:styles.bar,children:[
|
|
204
|
+
/* @__PURE__ */jsxRuntime.jsx("div",{style:styles.leading,children:rail?null:historyControls}),
|
|
205
|
+
/* @__PURE__ */jsxRuntime.jsx("div",{style:styles.centre,children:/* @__PURE__ */jsxRuntime.jsx(BrandLogo,{logoUrl:theme.meta.logoUrl,name:theme.meta.displayName,styles:styles})}),
|
|
206
|
+
/* @__PURE__ */jsxRuntime.jsxs("div",{style:styles.trailing,children:[vetEntry!==null?/* @__PURE__ */jsxRuntime.jsx("button",{type:"button",onClick:vetEntry,style:styles.vetEntry,children:TELEVET_COPY.visitButton}):null,
|
|
207
|
+
/* @__PURE__ */jsxRuntime.jsx(PetAvatarSlot,{pets:pets,activePet:activePet,styles:styles,onSelectPet:onSelectPet,onAddPet:onAddPet}),rail?historyControls:null]})]})}function historyControlLabel(rail,open,unread){let base=rail?open?CHAT_COPY.hideChatsWeb:CHAT_COPY.showChatsWeb:CHAT_COPY.openHistoryWeb;return unread?`${base}${CHAT_COPY.newReplySuffix}`:base}function PetAvatarSlot({pets:pets,activePet:activePet,styles:styles,onSelectPet:onSelectPet,onAddPet:onAddPet}){let[open,setOpen]=react.useState(false),triggerRef=react.useRef(null),name=activePet?.name?.trim()||CHAT_COPY.yourPet;return pets.length<2&&onAddPet===null||activePet===null?/* @__PURE__ */jsxRuntime.jsx("div",{role:"img","aria-label":name,style:styles.avatarSlot,children:/* @__PURE__ */jsxRuntime.jsx(AvatarRing,{pet:activePet,styles:styles})}):/* @__PURE__ */jsxRuntime.jsxs("div",{style:styles.avatarSlot,children:[
|
|
206
208
|
/* @__PURE__ */jsxRuntime.jsxs("button",{ref:triggerRef,type:"button","aria-haspopup":"dialog","aria-expanded":open,"aria-label":fillCopy(CHAT_COPY.switchActivePet,{name:name}),onClick:()=>setOpen(true),style:styles.avatarButton,children:[
|
|
207
209
|
/* @__PURE__ */jsxRuntime.jsx(AvatarRing,{pet:activePet,styles:styles}),
|
|
208
210
|
/* @__PURE__ */jsxRuntime.jsx("span",{"aria-hidden":"true",style:styles.addBadge,children:/* @__PURE__ */jsxRuntime.jsx("span",{style:styles.addBadgeGlyph,children:"+"})})]}),
|
|
209
211
|
/* @__PURE__ */jsxRuntime.jsx(PetSwitcherDialog,{open:open,pets:pets,activePetRef:activePet.petRef,returnFocusTo:triggerRef,onClose:()=>setOpen(false),onSelect:petRef2=>{setOpen(false),onSelectPet(petRef2)},onAddPet:onAddPet===null?null:()=>{setOpen(false),onAddPet()}})]})}function AvatarRing({pet:pet,styles:styles}){let theme=useEverfurTheme(),palette=pet===null?null:petDiscPaint(pet,isEverfurLightLook(theme),{fill:theme.color.highlight,ink:theme.color.onHighlight});/* @__PURE__ */
|
|
210
|
-
return jsxRuntime.jsx("span",{style:styles.ring,children:/* @__PURE__ */jsxRuntime.jsx("span",{style:{...styles.disc,...palette===null?styles.discEmpty:{backgroundColor:palette.background,color:palette.foreground}},children:palette===null?getInitial(null):palette.initial})})}function makeStyles4(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,header=theme.slots.header;return{vetEntry:{boxSizing:"border-box",minHeight:44,padding:`0 ${s.md}px`,borderRadius:r.pill,backgroundColor:c.surfaceCream,border:`1px solid ${c.controlEdge}`,color:c.brandInk,cursor:"pointer",whiteSpace:"nowrap",...faceCss(theme,"bold"),fontSize:t.size.caption},bar:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,padding:`${s.sm+2}px ${s.lg}px`,backgroundColor:c.surfaceCream,...slotCss(header)},menuButton:{boxSizing:"border-box",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,padding:0,border:"1px solid transparent",borderRadius:r.pill,background:"transparent",cursor:"pointer",color:header?.textColor??c.text.primary},menuDisc:{position:"relative",boxSizing:"border-box",width:MENU_BUTTON_SIZE,height:MENU_BUTTON_SIZE,borderRadius:r.pill,display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},historyControls:{display:"flex",flexDirection:"row",alignItems:"center",flexShrink:0},unreadDot:{position:"absolute",top:6,right:6,boxSizing:"border-box",width:UNREAD_DOT_SIZE,height:UNREAD_DOT_SIZE,borderRadius:r.pill,backgroundColor:c.danger,border:`${UNREAD_DOT_RING}px solid ${header?.backgroundColor??c.surfaceCream}`},centre:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",justifyContent:"center"},logo:LOGO_STYLE,avatarSlot:{position:"relative",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center"},avatarButton:{position:"relative",boxSizing:"border-box",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,padding:0,border:0,background:"transparent",cursor:"pointer"},ring:{boxSizing:"border-box",width:HEADER_AVATAR_SIZE,height:HEADER_AVATAR_SIZE,borderRadius:r.pill,border:`${RING_WIDTH}px solid ${c.mark}`,display:"inline-flex",alignItems:"center",justifyContent:"center"},disc:{boxSizing:"border-box",width:AVATAR_INNER_SIZE,height:AVATAR_INNER_SIZE,borderRadius:r.pill,display:"inline-flex",alignItems:"center",justifyContent:"center",...faceCss(theme,"bold"),fontSize:Math.round(AVATAR_INNER_SIZE*.42),lineHeight:1,textTransform:"uppercase"},discEmpty:{backgroundColor:c.surfaceSubtle,color:c.text.muted},addBadge:{position:"absolute",bottom:(MIN_TOUCH_TARGET3-HEADER_AVATAR_SIZE)/2,right:(MIN_TOUCH_TARGET3-HEADER_AVATAR_SIZE)/2,boxSizing:"border-box",width:ADD_BADGE_SIZE,height:ADD_BADGE_SIZE,borderRadius:r.pill,border:`0.5px solid ${c.mark}`,backgroundColor:c.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},addBadgeGlyph:{...faceCss(theme,"bold"),fontSize:t.tierSizes.badge.small,lineHeight:1,color:c.brandInk}}}var STATIC=/* @__PURE__ */Object.freeze({kind:"static"}),CitationLinkContext=react.createContext(STATIC);function useCitationLinks(){return react.useContext(CitationLinkContext)}function useCitationLinkMode(onOpenUrl){return react.useMemo(()=>onOpenUrl===void 0?STATIC:/* @__PURE__ */Object.freeze({kind:"host",open:url=>{callHost(onOpenUrl,url,"citation")}}),[onOpenUrl])}function CitationLinksScope({onOpenUrl:onOpenUrl,children:children}){let mode=useCitationLinkMode(onOpenUrl);return react.createElement(CitationLinkContext.Provider,{value:mode},children)}var DEFAULT_ROOT_HEADING_LEVEL=2;function headingLevel(value){return typeof value!="number"||!Number.isInteger(value)?DEFAULT_ROOT_HEADING_LEVEL:value<1?1:value>6?6:value}function nextHeadingLevel(level){return level+1}function headingTag(level){return`h${String(level)}`}var NESTED_HEADING_LEVEL_DEFAULT=nextHeadingLevel(DEFAULT_ROOT_HEADING_LEVEL);react.createContext(NESTED_HEADING_LEVEL_DEFAULT);var HISTORY_PANEL_WIDTH=320,MIN_THREAD_WIDTH=480,RAIL_MIN_CONTAINER_WIDTH=HISTORY_PANEL_WIDTH+MIN_THREAD_WIDTH,DESKTOP_MIN_CONTAINER_WIDTH=1024,CHAT_COLUMN_MAX_WIDTH=768,ASSISTANT_MEASURE="72ch",NARROW_LAYOUT=/* @__PURE__ */Object.freeze({rail:false,desktop:false}),RAIL_LAYOUT=/* @__PURE__ */Object.freeze({rail:true,desktop:false}),DESKTOP_LAYOUT=/* @__PURE__ */Object.freeze({rail:true,desktop:true});function layoutFor(width){return width===null||width<RAIL_MIN_CONTAINER_WIDTH?NARROW_LAYOUT:width>=DESKTOP_MIN_CONTAINER_WIDTH?DESKTOP_LAYOUT:RAIL_LAYOUT}var ChatLayoutContext=react.createContext({layout:NARROW_LAYOUT,report:()=>{},headingLevel:headingLevel(void 0)});function useChatLayout(){return react.useContext(ChatLayoutContext).layout}function useChatHeadingLevel(){return react.useContext(ChatLayoutContext).headingLevel}function ChatLayoutScope({children:children,headingLevel:hostLevel}){let[layout,setLayout]=react.useState(NARROW_LAYOUT),level=headingLevel(hostLevel),value=react.useMemo(()=>({layout:layout,report:setLayout,headingLevel:level}),[layout,level]);return react.createElement(ChatLayoutContext.Provider,{value:value},children)}function useMeasuredLayout(root){let{report:report}=react.useContext(ChatLayoutContext);react.useEffect(()=>{let node=root.current;if(node===null||typeof ResizeObserver>"u")return;let read=()=>{let width=node.getBoundingClientRect().width;report(layoutFor(width>0?Math.round(width):null))};read();let observer=new ResizeObserver(read);return observer.observe(node),()=>observer.disconnect()},[root,report])}var CHAT_EASING=/* @__PURE__ */Object.freeze({standard:EASING_CURVES.standard,emphasized:EASING_CURVES.emphasized,exit:EASING_CURVES.exit,outQuad:/* @__PURE__ */Object.freeze([.25,.46,.45,.94]),out:/* @__PURE__ */Object.freeze([.23,1,.32,1])}),cubicBezier=cssCubicBezier,CHAT_MOTION=/* @__PURE__ */Object.freeze({layoutMs:220,messageInMs:200,bannerInMs:220,bannerOutMs:160,iconInMs:180,iconOutMs:120,followUpInMs:180,followUpStaggerMs:70,citationsInMs:220,citationsRisePx:6,drawerMs:220,pressScale:.97,pressMs:140,revealTickMs:24,revealDivisor:12,dotsCycleMs:520,dotsMinOpacity:.44,dotsLiftPx:3.5,dotsStagger:/* @__PURE__ */Object.freeze([0,.18,.36]),copiedMs:1500,uploadFlashMs:600,bubbleInMs:280,bubbleFromScale:.94,bubbleRisePx:6,promptRisePx:8,reduced:false}),CHAT_MOTION_REDUCED=/* @__PURE__ */Object.freeze({...CHAT_MOTION,layoutMs:0,messageInMs:0,bannerInMs:0,bannerOutMs:0,iconInMs:0,iconOutMs:0,followUpInMs:0,followUpStaggerMs:0,citationsInMs:0,citationsRisePx:0,drawerMs:0,pressScale:1,pressMs:0,revealTickMs:0,dotsCycleMs:0,dotsMinOpacity:1,dotsLiftPx:0,bubbleInMs:0,bubbleFromScale:1,bubbleRisePx:0,promptRisePx:0,reduced:true});function chatMotion(theme){return theme.motion.reducedMotion?CHAT_MOTION_REDUCED:CHAT_MOTION}function followUpDelayMs(motion,index){return Math.max(0,index)*motion.followUpStaggerMs}function nextRevealLength(motion,visible,total){if(motion.reduced||visible>=total)return total;let step=Math.max(1,Math.ceil((total-visible)/motion.revealDivisor));return Math.min(total,visible+step)}function useChatMotion(){let theme=useEverfurTheme();return react.useMemo(()=>chatMotion(theme),[theme])}function canAnimate(node){return node!==null&&typeof node.animate=="function"}function animateEnter(node,motion){if(!canAnimate(node)||motion.durationMs<=0)return null;let translate=[motion.fromTranslateX!==void 0?`translateX(${motion.fromTranslateX})`:"",motion.fromTranslateY!==void 0&&motion.fromTranslateY!==0?`translateY(${motion.fromTranslateY}px)`:""].filter(part=>part.length>0).join(" "),from={...motion.fromOpacity!==void 0?{opacity:motion.fromOpacity}:{},...translate.length>0?{transform:translate}:{}},to={...motion.fromOpacity!==void 0?{opacity:1}:{},...translate.length>0?{transform:"none"}:{}};try{return node.animate([from,to],{duration:motion.durationMs,delay:motion.delayMs??0,easing:cubicBezier(CHAT_EASING.standard),fill:"backwards"})}catch{return null}}function popIn(node,motion){if(!canAnimate(node)||motion.bubbleInMs<=0)return null;try{return node.animate([{opacity:0,transform:`translateY(${motion.bubbleRisePx}px) scale(${motion.bubbleFromScale})`},{opacity:1,transform:"none"}],{duration:motion.bubbleInMs,easing:cubicBezier(CHAT_EASING.out),fill:"backwards"})}catch{return null}}function animateExit(node,durationMs,toTranslateX){if(!canAnimate(node)||durationMs<=0)return Promise.resolve();try{let animation=node.animate([{opacity:1,transform:"none"},{opacity:0,...toTranslateX!==void 0?{transform:`translateX(${toTranslateX})`}:{}}],{duration:durationMs,easing:cubicBezier(CHAT_EASING.exit),fill:"forwards"});return new Promise(resolve=>{animation.onfinish=()=>resolve(),animation.oncancel=()=>resolve()})}catch{return Promise.resolve()}}function usePresence(show,exitMs){let[present2,setPresent]=react.useState(show),exiting=present2&&!show;return react.useEffect(()=>{if(show){setPresent(true);return}if(!present2)return;if(exitMs<=0){setPresent(false);return}let handle=setTimeout(()=>setPresent(false),exitMs);return()=>clearTimeout(handle)},[show,exitMs,present2]),{present:present2,exiting:exiting}}function useRevealedText(text3,active,motion){let[visible,setVisible]=react.useState(active&&!motion.reduced?0:text3.length),latest=react.useRef({text:text3,active:active});return latest.current={text:text3,active:active},react.useEffect(()=>{if(!active||motion.reduced||motion.revealTickMs<=0){setVisible(latest.current.text.length);return}let handle=setInterval(()=>{setVisible(current=>nextRevealLength(motion,current,latest.current.text.length))},motion.revealTickMs);return()=>clearInterval(handle)},[active,motion]),active&&!motion.reduced?text3.slice(0,Math.min(visible,text3.length)):text3}var MIN_TOUCH_TARGET4=44,DRAWER_MAX_WIDTH="85%",DRAWER_SHADOW={y:16,blur:48,alpha:.18},SCRIM_ALPHA=.32,UNREAD_DOT_SIZE2=8,ACTIVE_ROW_ALPHA=.22,SEARCH_EDGE_WIDTH=1.5,LOAD_MORE_MARGIN="50%";function HistoryDrawer({chat:chat,history:history,mode:mode,returnFocusTo:returnFocusTo}){let theme=useEverfurTheme(),styles=react.useMemo(()=>makeStyles5(theme,mode==="dialog"),[theme,mode]),motion=useChatMotion(),dialog=useModalDialog(mode==="dialog"&&history.open,history.close,returnFocusTo),panelRef=react.useRef(null),open=history.open,slideMs=motion.drawerMs;if(react.useEffect(()=>{if(!open||mode!=="dialog")return;let animation=animateEnter(panelRef.current,{durationMs:slideMs,fromOpacity:0,fromTranslateX:"-100%"});return()=>animation?.cancel()},[open,mode,slideMs]),!open)return null;let body=/* @__PURE__ */jsxRuntime.jsx(PanelBody,{chat:chat,history:history,styles:styles,theme:theme,rail:mode==="rail"});return mode==="rail"?/* @__PURE__ */jsxRuntime.jsx("aside",{ref:node=>{panelRef.current=node},"aria-label":HISTORY_COPY.heading,style:styles.rail,children:body}):/* @__PURE__ */jsxRuntime.jsx("div",{style:styles.scrim,onClick:history.close,children:/* @__PURE__ */jsxRuntime.jsx("div",{ref:node=>{dialog.dialogRef.current=node,panelRef.current=node},role:"dialog","aria-modal":"true","aria-label":HISTORY_COPY.heading,tabIndex:-1,onKeyDown:dialog.onKeyDown,onClick:event=>event.stopPropagation(),style:styles.overlay,children:body})})}function PanelBody({chat:chat,history:history,styles:styles,theme:theme,rail:rail}){let{rows:rows,filtered:filtered,loading:loading,loadingMore:loadingMore,error:error,cursor:cursor2,emptyKind:emptyKind,searching:searching,query:query,setQuery:setQuery}=history,showRows=!loading&&error===null,[searchFocused,setSearchFocused]=react.useState(false),closeInk=(rail?void 0:theme.slots.dialog?.textColor)??theme.color.brandInk,searchInk=theme.slots.input?.textColor??theme.color.text.muted;/* @__PURE__ */
|
|
212
|
+
return jsxRuntime.jsx("span",{style:styles.ring,children:/* @__PURE__ */jsxRuntime.jsx("span",{style:{...styles.disc,...palette===null?styles.discEmpty:{backgroundColor:palette.background,color:palette.foreground}},children:palette===null?getInitial(null):palette.initial})})}function makeStyles4(theme){let c=theme.color,s=theme.space,r=theme.radius,t=theme.type,header=theme.slots.header;return{vetEntry:{boxSizing:"border-box",minHeight:44,padding:`0 ${s.md}px`,borderRadius:r.pill,backgroundColor:c.surfaceCream,border:`1px solid ${c.controlEdge}`,color:c.brandInk,cursor:"pointer",whiteSpace:"nowrap",...faceCss(theme,"bold"),fontSize:t.size.caption},bar:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:s.sm,padding:`${s.sm+2}px ${s.lg}px`,backgroundColor:c.surfaceCream,...slotCss(header)},menuButton:{boxSizing:"border-box",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,padding:0,border:"1px solid transparent",borderRadius:r.pill,background:"transparent",cursor:"pointer",color:header?.textColor??c.text.primary},menuDisc:{position:"relative",boxSizing:"border-box",width:MENU_BUTTON_SIZE,height:MENU_BUTTON_SIZE,borderRadius:r.pill,display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4},historyControls:{display:"flex",flexDirection:"row",alignItems:"center",flexShrink:0},unreadDot:{position:"absolute",top:6,right:6,boxSizing:"border-box",width:UNREAD_DOT_SIZE,height:UNREAD_DOT_SIZE,borderRadius:r.pill,backgroundColor:c.danger,border:`${UNREAD_DOT_RING}px solid ${header?.backgroundColor??c.surfaceCream}`},leading:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:s.sm,flex:"1 1 0"},trailing:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:s.sm,flex:"1 1 0"},centre:{flex:"0 1 auto",minWidth:0,display:"flex",alignItems:"center",justifyContent:"center"},logo:{...LOGO_STYLE,minWidth:0,flexShrink:1},avatarSlot:{position:"relative",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center"},avatarButton:{position:"relative",boxSizing:"border-box",minWidth:MIN_TOUCH_TARGET3,minHeight:MIN_TOUCH_TARGET3,display:"inline-flex",alignItems:"center",justifyContent:"center",margin:0,padding:0,border:0,background:"transparent",cursor:"pointer"},ring:{boxSizing:"border-box",width:HEADER_AVATAR_SIZE,height:HEADER_AVATAR_SIZE,borderRadius:r.pill,border:`${RING_WIDTH}px solid ${c.mark}`,display:"inline-flex",alignItems:"center",justifyContent:"center"},disc:{boxSizing:"border-box",width:AVATAR_INNER_SIZE,height:AVATAR_INNER_SIZE,borderRadius:r.pill,display:"inline-flex",alignItems:"center",justifyContent:"center",...faceCss(theme,"bold"),fontSize:Math.round(AVATAR_INNER_SIZE*.42),lineHeight:1,textTransform:"uppercase"},discEmpty:{backgroundColor:c.surfaceSubtle,color:c.text.muted},addBadge:{position:"absolute",bottom:(MIN_TOUCH_TARGET3-HEADER_AVATAR_SIZE)/2,right:(MIN_TOUCH_TARGET3-HEADER_AVATAR_SIZE)/2,boxSizing:"border-box",width:ADD_BADGE_SIZE,height:ADD_BADGE_SIZE,borderRadius:r.pill,border:`0.5px solid ${c.mark}`,backgroundColor:c.surface,display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},addBadgeGlyph:{...faceCss(theme,"bold"),fontSize:t.tierSizes.badge.small,lineHeight:1,color:c.brandInk}}}var STATIC=/* @__PURE__ */Object.freeze({kind:"static"}),CitationLinkContext=react.createContext(STATIC);function useCitationLinks(){return react.useContext(CitationLinkContext)}function useCitationLinkMode(onOpenUrl){return react.useMemo(()=>onOpenUrl===void 0?STATIC:/* @__PURE__ */Object.freeze({kind:"host",open:url=>{callHost(onOpenUrl,url,"citation")}}),[onOpenUrl])}function CitationLinksScope({onOpenUrl:onOpenUrl,children:children}){let mode=useCitationLinkMode(onOpenUrl);return react.createElement(CitationLinkContext.Provider,{value:mode},children)}var DEFAULT_ROOT_HEADING_LEVEL=2;function headingLevel(value){return typeof value!="number"||!Number.isInteger(value)?DEFAULT_ROOT_HEADING_LEVEL:value<1?1:value>6?6:value}function nextHeadingLevel(level){return level+1}function headingTag(level){return`h${String(level)}`}var NESTED_HEADING_LEVEL_DEFAULT=nextHeadingLevel(DEFAULT_ROOT_HEADING_LEVEL);react.createContext(NESTED_HEADING_LEVEL_DEFAULT);var HISTORY_PANEL_WIDTH=320,MIN_THREAD_WIDTH=480,RAIL_MIN_CONTAINER_WIDTH=HISTORY_PANEL_WIDTH+MIN_THREAD_WIDTH,DESKTOP_MIN_CONTAINER_WIDTH=1024,CHAT_COLUMN_MAX_WIDTH=768,ASSISTANT_MEASURE="72ch",NARROW_LAYOUT=/* @__PURE__ */Object.freeze({rail:false,desktop:false}),RAIL_LAYOUT=/* @__PURE__ */Object.freeze({rail:true,desktop:false}),DESKTOP_LAYOUT=/* @__PURE__ */Object.freeze({rail:true,desktop:true});function layoutFor(width){return width===null||width<RAIL_MIN_CONTAINER_WIDTH?NARROW_LAYOUT:width>=DESKTOP_MIN_CONTAINER_WIDTH?DESKTOP_LAYOUT:RAIL_LAYOUT}var ChatLayoutContext=react.createContext({layout:NARROW_LAYOUT,report:()=>{},headingLevel:headingLevel(void 0)});function useChatLayout(){return react.useContext(ChatLayoutContext).layout}function useChatHeadingLevel(){return react.useContext(ChatLayoutContext).headingLevel}function ChatLayoutScope({children:children,headingLevel:hostLevel}){let[layout,setLayout]=react.useState(NARROW_LAYOUT),level=headingLevel(hostLevel),value=react.useMemo(()=>({layout:layout,report:setLayout,headingLevel:level}),[layout,level]);return react.createElement(ChatLayoutContext.Provider,{value:value},children)}function useMeasuredLayout(root){let{report:report}=react.useContext(ChatLayoutContext);react.useEffect(()=>{let node=root.current;if(node===null||typeof ResizeObserver>"u")return;let read=()=>{let width=node.getBoundingClientRect().width;report(layoutFor(width>0?Math.round(width):null))};read();let observer=new ResizeObserver(read);return observer.observe(node),()=>observer.disconnect()},[root,report])}var CHAT_EASING=/* @__PURE__ */Object.freeze({standard:EASING_CURVES.standard,emphasized:EASING_CURVES.emphasized,exit:EASING_CURVES.exit,outQuad:/* @__PURE__ */Object.freeze([.25,.46,.45,.94]),out:/* @__PURE__ */Object.freeze([.23,1,.32,1])}),cubicBezier=cssCubicBezier,CHAT_MOTION=/* @__PURE__ */Object.freeze({layoutMs:220,messageInMs:200,bannerInMs:220,bannerOutMs:160,iconInMs:180,iconOutMs:120,followUpInMs:180,followUpStaggerMs:70,citationsInMs:220,citationsRisePx:6,drawerMs:220,pressScale:.97,pressMs:140,revealTickMs:24,revealDivisor:12,dotsCycleMs:520,dotsMinOpacity:.44,dotsLiftPx:3.5,dotsStagger:/* @__PURE__ */Object.freeze([0,.18,.36]),copiedMs:1500,uploadFlashMs:600,bubbleInMs:280,bubbleFromScale:.94,bubbleRisePx:6,promptRisePx:8,reduced:false}),CHAT_MOTION_REDUCED=/* @__PURE__ */Object.freeze({...CHAT_MOTION,layoutMs:0,messageInMs:0,bannerInMs:0,bannerOutMs:0,iconInMs:0,iconOutMs:0,followUpInMs:0,followUpStaggerMs:0,citationsInMs:0,citationsRisePx:0,drawerMs:0,pressScale:1,pressMs:0,revealTickMs:0,dotsCycleMs:0,dotsMinOpacity:1,dotsLiftPx:0,bubbleInMs:0,bubbleFromScale:1,bubbleRisePx:0,promptRisePx:0,reduced:true});function chatMotion(theme){return theme.motion.reducedMotion?CHAT_MOTION_REDUCED:CHAT_MOTION}function followUpDelayMs(motion,index){return Math.max(0,index)*motion.followUpStaggerMs}function nextRevealLength(motion,visible,total){if(motion.reduced||visible>=total)return total;let step=Math.max(1,Math.ceil((total-visible)/motion.revealDivisor));return Math.min(total,visible+step)}function useChatMotion(){let theme=useEverfurTheme();return react.useMemo(()=>chatMotion(theme),[theme])}function canAnimate(node){return node!==null&&typeof node.animate=="function"}function animateEnter(node,motion){if(!canAnimate(node)||motion.durationMs<=0)return null;let translate=[motion.fromTranslateX!==void 0?`translateX(${motion.fromTranslateX})`:"",motion.fromTranslateY!==void 0&&motion.fromTranslateY!==0?`translateY(${motion.fromTranslateY}px)`:""].filter(part=>part.length>0).join(" "),from={...motion.fromOpacity!==void 0?{opacity:motion.fromOpacity}:{},...translate.length>0?{transform:translate}:{}},to={...motion.fromOpacity!==void 0?{opacity:1}:{},...translate.length>0?{transform:"none"}:{}};try{return node.animate([from,to],{duration:motion.durationMs,delay:motion.delayMs??0,easing:cubicBezier(CHAT_EASING.standard),fill:"backwards"})}catch{return null}}function popIn(node,motion){if(!canAnimate(node)||motion.bubbleInMs<=0)return null;try{return node.animate([{opacity:0,transform:`translateY(${motion.bubbleRisePx}px) scale(${motion.bubbleFromScale})`},{opacity:1,transform:"none"}],{duration:motion.bubbleInMs,easing:cubicBezier(CHAT_EASING.out),fill:"backwards"})}catch{return null}}function animateExit(node,durationMs,toTranslateX){if(!canAnimate(node)||durationMs<=0)return Promise.resolve();try{let animation=node.animate([{opacity:1,transform:"none"},{opacity:0,...toTranslateX!==void 0?{transform:`translateX(${toTranslateX})`}:{}}],{duration:durationMs,easing:cubicBezier(CHAT_EASING.exit),fill:"forwards"});return new Promise(resolve=>{animation.onfinish=()=>resolve(),animation.oncancel=()=>resolve()})}catch{return Promise.resolve()}}function usePresence(show,exitMs){let[present2,setPresent]=react.useState(show),exiting=present2&&!show;return react.useEffect(()=>{if(show){setPresent(true);return}if(!present2)return;if(exitMs<=0){setPresent(false);return}let handle=setTimeout(()=>setPresent(false),exitMs);return()=>clearTimeout(handle)},[show,exitMs,present2]),{present:present2,exiting:exiting}}function useRevealedText(text3,active,motion){let[visible,setVisible]=react.useState(active&&!motion.reduced?0:text3.length),latest=react.useRef({text:text3,active:active});return latest.current={text:text3,active:active},react.useEffect(()=>{if(!active||motion.reduced||motion.revealTickMs<=0){setVisible(latest.current.text.length);return}let handle=setInterval(()=>{setVisible(current=>nextRevealLength(motion,current,latest.current.text.length))},motion.revealTickMs);return()=>clearInterval(handle)},[active,motion]),active&&!motion.reduced?text3.slice(0,Math.min(visible,text3.length)):text3}var MIN_TOUCH_TARGET4=44,DRAWER_MAX_WIDTH="85%",DRAWER_SHADOW={y:16,blur:48,alpha:.18},SCRIM_ALPHA=.32,UNREAD_DOT_SIZE2=8,ACTIVE_ROW_ALPHA=.22,SEARCH_EDGE_WIDTH=1.5,LOAD_MORE_MARGIN="50%";function HistoryDrawer({chat:chat,history:history,mode:mode,returnFocusTo:returnFocusTo}){let theme=useEverfurTheme(),styles=react.useMemo(()=>makeStyles5(theme,mode==="dialog"),[theme,mode]),motion=useChatMotion(),dialog=useModalDialog(mode==="dialog"&&history.open,history.close,returnFocusTo),panelRef=react.useRef(null),open=history.open,slideMs=motion.drawerMs;if(react.useEffect(()=>{if(!open||mode!=="dialog")return;let animation=animateEnter(panelRef.current,{durationMs:slideMs,fromOpacity:0,fromTranslateX:"-100%"});return()=>animation?.cancel()},[open,mode,slideMs]),!open)return null;let body=/* @__PURE__ */jsxRuntime.jsx(PanelBody,{chat:chat,history:history,styles:styles,theme:theme,rail:mode==="rail"});return mode==="rail"?/* @__PURE__ */jsxRuntime.jsx("aside",{ref:node=>{panelRef.current=node},"aria-label":HISTORY_COPY.heading,style:styles.rail,children:body}):/* @__PURE__ */jsxRuntime.jsx("div",{style:styles.scrim,onClick:history.close,children:/* @__PURE__ */jsxRuntime.jsx("div",{ref:node=>{dialog.dialogRef.current=node,panelRef.current=node},role:"dialog","aria-modal":"true","aria-label":HISTORY_COPY.heading,tabIndex:-1,onKeyDown:dialog.onKeyDown,onClick:event=>event.stopPropagation(),style:styles.overlay,children:body})})}function PanelBody({chat:chat,history:history,styles:styles,theme:theme,rail:rail}){let{rows:rows,filtered:filtered,loading:loading,loadingMore:loadingMore,error:error,cursor:cursor2,emptyKind:emptyKind,searching:searching,query:query,setQuery:setQuery}=history,showRows=!loading&&error===null,[searchFocused,setSearchFocused]=react.useState(false),closeInk=(rail?void 0:theme.slots.dialog?.textColor)??theme.color.brandInk,searchInk=theme.slots.input?.textColor??theme.color.text.muted;/* @__PURE__ */
|
|
211
213
|
return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[
|
|
212
214
|
/* @__PURE__ */jsxRuntime.jsxs("div",{style:styles.head,children:[
|
|
213
215
|
/* @__PURE__ */jsxRuntime.jsx("p",{style:styles.heading,children:HISTORY_COPY.heading}),
|