@everfur/sdk 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/dist/{Chat-CHqcgMyw.d.ts → Chat-CFi5cNUF.d.ts} +4 -4
  3. package/dist/{Chat-BoAvCWhI.d.cts → Chat-DQOsAumH.d.cts} +4 -4
  4. package/dist/{DepthViews-B0g83e_N.d.cts → DepthViews-C409ubw-.d.cts} +1 -1
  5. package/dist/{DepthViews-7Y8Ur058.d.ts → DepthViews-D81c95Ra.d.cts} +1 -1
  6. package/dist/{DepthViews-Dg2bIon_.d.ts → DepthViews-es8mIK0w.d.ts} +1 -1
  7. package/dist/{DepthViews-CT5mQld9.d.cts → DepthViews-uilL1NJZ.d.ts} +1 -1
  8. package/dist/IntakeMedia-BcjjUizr.d.ts +103 -0
  9. package/dist/IntakeMedia-CL_S2tZE.d.cts +103 -0
  10. package/dist/animations/index.cjs +1 -1
  11. package/dist/animations/index.d.cts +3 -3
  12. package/dist/animations/index.d.ts +3 -3
  13. package/dist/animations/index.js +1 -1
  14. package/dist/{attachments-C3HJNYQ7.d.cts → attachments-B2GjBgvF.d.cts} +2 -2
  15. package/dist/{attachments-rkox0ewd.d.cts → attachments-DI710no4.d.cts} +5 -5
  16. package/dist/{attachments-CfxsVg7W.d.ts → attachments-DNaSbmA3.d.ts} +2 -2
  17. package/dist/{attachments-CThFsH4b.d.ts → attachments-SF88N654.d.ts} +5 -5
  18. package/dist/{bookingCopy-Y3OGdoMT.d.ts → bookingCopy-D2N3RhsV.d.ts} +451 -50
  19. package/dist/{bookingCopy-Do3zMeXb.d.cts → bookingCopy-xlXxORCA.d.cts} +451 -50
  20. package/dist/{bookingTypes-DCs8mmBb.d.cts → bookingTypes-D4pD3tHs.d.cts} +13 -1
  21. package/dist/{bookingTypes-DCs8mmBb.d.ts → bookingTypes-D4pD3tHs.d.ts} +13 -1
  22. package/dist/{branding-DYWma2il.d.ts → branding-Bio5MM6g.d.cts} +3 -3
  23. package/dist/{branding-ChXm8gxI.d.cts → branding-ytH4jJq1.d.ts} +3 -3
  24. package/dist/{callCopy-CPe9mbwG.d.cts → callCopy-DHjem0R-.d.cts} +12 -1
  25. package/dist/{callCopy-CPe9mbwG.d.ts → callCopy-DHjem0R-.d.ts} +12 -1
  26. package/dist/{casesRepository-Jj6t60AY.d.cts → casesRepository-B-md8h1S.d.cts} +1 -1
  27. package/dist/{casesRepository-BbgXYPxa.d.ts → casesRepository-CC6951TK.d.ts} +1 -1
  28. package/dist/chat/index.cjs +1 -1
  29. package/dist/chat/index.d.cts +9 -9
  30. package/dist/chat/index.d.ts +9 -9
  31. package/dist/chat/index.js +1 -1
  32. package/dist/client/index.cjs +2 -2
  33. package/dist/client/index.d.cts +10 -10
  34. package/dist/client/index.d.ts +10 -10
  35. package/dist/client/index.js +2 -2
  36. package/dist/{config-Dfbj5mlx.d.ts → config-BM0sv5jx.d.ts} +1 -1
  37. package/dist/{config-BZX97FmW.d.cts → config-Daa1plhQ.d.cts} +1 -1
  38. package/dist/consent/index.cjs +1 -1
  39. package/dist/consent/index.d.cts +5 -5
  40. package/dist/consent/index.d.ts +5 -5
  41. package/dist/consent/index.js +1 -1
  42. package/dist/{context-Cbe0zYym.d.ts → context-CDV2pwGI.d.ts} +7 -7
  43. package/dist/{context-DJXnZ1Mx.d.cts → context-DQHtwcHN.d.cts} +7 -7
  44. package/dist/{copy-dKK5KoAQ.d.cts → copy-BEx5F71o.d.cts} +2 -2
  45. package/dist/{copy-DHekqSKE.d.ts → copy-Cl1l-qmY.d.ts} +2 -2
  46. package/dist/core/index.cjs +7 -7
  47. package/dist/core/index.d.cts +21 -21
  48. package/dist/core/index.d.ts +21 -21
  49. package/dist/core/index.js +7 -7
  50. package/dist/{depth-NmWSbvfi.d.cts → depth-CAAwiStc.d.cts} +132 -38
  51. package/dist/{depth-CrpRjWGB.d.ts → depth-DfNRVtrV.d.ts} +132 -38
  52. package/dist/{entitlementRepository-tVNazi8R.d.ts → entitlementRepository-CVWvND1P.d.ts} +3 -3
  53. package/dist/{entitlementRepository-iL-9vS1i.d.cts → entitlementRepository-DPvWjV-N.d.cts} +3 -3
  54. package/dist/{identity-B8rp0L9G.d.ts → identity-BhT7oJDS.d.ts} +1 -1
  55. package/dist/{identity-D7PO5s9m.d.cts → identity-DUlshgow.d.cts} +1 -1
  56. package/dist/index.cjs +6 -6
  57. package/dist/index.d.cts +17 -17
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +6 -6
  60. package/dist/notifications/index.d.cts +2 -2
  61. package/dist/notifications/index.d.ts +2 -2
  62. package/dist/{pets-BWx9BKea.d.cts → pets-Bneph9m1.d.cts} +1 -1
  63. package/dist/{pets-BQbXmICf.d.ts → pets-DjcLmRrW.d.ts} +1 -1
  64. package/dist/{petsRepository-SqIvEMiT.d.cts → petsRepository-BnVre3q7.d.cts} +1 -1
  65. package/dist/{petsRepository-0oBVydl6.d.ts → petsRepository-BwxmfX_s.d.ts} +1 -1
  66. package/dist/photo/index.cjs +1 -1
  67. package/dist/photo/index.js +1 -1
  68. package/dist/{ports-ChnzSy4E.d.cts → ports-BPKxFOSe.d.cts} +10 -9
  69. package/dist/{ports-iXPWd7Vt.d.ts → ports-Di9rdLO9.d.ts} +10 -9
  70. package/dist/records/depth/index.cjs +2 -2
  71. package/dist/records/depth/index.d.cts +7 -7
  72. package/dist/records/depth/index.d.ts +7 -7
  73. package/dist/records/depth/index.js +2 -2
  74. package/dist/records/index.cjs +3 -3
  75. package/dist/records/index.d.cts +19 -10
  76. package/dist/records/index.d.ts +19 -10
  77. package/dist/records/index.js +3 -3
  78. package/dist/{requestFunnel-CQzz2DIW.d.ts → requestFunnel-CiSX2pun.d.ts} +2 -2
  79. package/dist/{requestFunnel-DAwb7haa.d.cts → requestFunnel-DMR_1T3O.d.cts} +2 -2
  80. package/dist/{runtimeTypes-DB9-kigO.d.cts → runtimeTypes-2gJ5hYoE.d.cts} +5 -5
  81. package/dist/{runtimeTypes-BNOxfmfg.d.ts → runtimeTypes-CkMFCbHW.d.ts} +5 -5
  82. package/dist/server/events/index.cjs +1 -1
  83. package/dist/server/events/index.d.cts +2 -2
  84. package/dist/server/events/index.d.ts +2 -2
  85. package/dist/server/events/index.js +1 -1
  86. package/dist/server/index.cjs +1 -1
  87. package/dist/server/index.d.cts +3 -3
  88. package/dist/server/index.d.ts +3 -3
  89. package/dist/server/index.js +1 -1
  90. package/dist/televet/booking/index.cjs +4 -1
  91. package/dist/televet/booking/index.d.cts +116 -29
  92. package/dist/televet/booking/index.d.ts +116 -29
  93. package/dist/televet/booking/index.js +4 -1
  94. package/dist/televet/call/index.cjs +1 -1
  95. package/dist/televet/call/index.d.cts +1 -1
  96. package/dist/televet/call/index.d.ts +1 -1
  97. package/dist/televet/call/index.js +1 -1
  98. package/dist/televet/index.cjs +1 -1
  99. package/dist/televet/index.js +1 -1
  100. package/dist/testing/index.cjs +3 -3
  101. package/dist/testing/index.d.cts +1 -1
  102. package/dist/testing/index.d.ts +1 -1
  103. package/dist/testing/index.js +3 -3
  104. package/dist/testing/rn/index.cjs +1 -1
  105. package/dist/testing/rn/index.d.cts +14 -12
  106. package/dist/testing/rn/index.d.ts +14 -12
  107. package/dist/testing/rn/index.js +1 -1
  108. package/dist/testing/web/index.d.cts +9 -9
  109. package/dist/testing/web/index.d.ts +9 -9
  110. package/dist/{timelineRows-Dll2IGFg.d.ts → timelineRows-D3171ksh.d.ts} +1 -1
  111. package/dist/{timelineRows-BuNhzDbH.d.cts → timelineRows-DDnz4gx2.d.cts} +1 -1
  112. package/dist/{tokens-ARWZtMOU.d.cts → tokens-BYtbKwFh.d.cts} +6 -3
  113. package/dist/{tokens-ARWZtMOU.d.ts → tokens-BYtbKwFh.d.ts} +6 -3
  114. package/dist/{typeStyle-YCS8dt19.d.cts → typeStyle-BqfwxZH4.d.cts} +2 -2
  115. package/dist/{typeStyle-8iEqQmP_.d.ts → typeStyle-DKz02DGU.d.ts} +2 -2
  116. package/dist/{uploadTransport-C1p8FuG8.d.cts → uploadTransport-BM_pnEWj.d.cts} +5 -0
  117. package/dist/{uploadTransport-bZIKBTyK.d.ts → uploadTransport-C6kGP1Kd.d.ts} +5 -0
  118. package/dist/{useRecordsDepth-CNEHZJtj.d.cts → useRecordsDepth-COJ0wSYK.d.cts} +1 -1
  119. package/dist/{useRecordsDepth-CuNdne6E.d.ts → useRecordsDepth-Z9FF5X4E.d.ts} +1 -1
  120. package/dist/video/index.cjs +1 -1
  121. package/dist/video/index.js +1 -1
  122. package/dist/{view-DFy8EDwf.d.ts → view-DoQEHXJR.d.ts} +47 -5
  123. package/dist/{view-BhqWlYrZ.d.cts → view-nRy6SitU.d.cts} +47 -5
  124. package/dist/web/consent/index.cjs +1 -1
  125. package/dist/web/consent/index.d.cts +5 -5
  126. package/dist/web/consent/index.d.ts +5 -5
  127. package/dist/web/consent/index.js +1 -1
  128. package/dist/web/index.cjs +7 -7
  129. package/dist/web/index.d.cts +23 -22
  130. package/dist/web/index.d.ts +23 -22
  131. package/dist/web/index.js +7 -7
  132. package/dist/web/notifications/index.d.cts +3 -3
  133. package/dist/web/notifications/index.d.ts +3 -3
  134. package/dist/web/records/depth/index.cjs +2 -2
  135. package/dist/web/records/depth/index.d.cts +7 -7
  136. package/dist/web/records/depth/index.d.ts +7 -7
  137. package/dist/web/records/depth/index.js +2 -2
  138. package/dist/web/records/index.cjs +3 -3
  139. package/dist/web/records/index.d.cts +28 -17
  140. package/dist/web/records/index.d.ts +28 -17
  141. package/dist/web/records/index.js +3 -3
  142. package/dist/web/televet/booking/index.cjs +4 -2
  143. package/dist/web/televet/booking/index.d.cts +227 -123
  144. package/dist/web/televet/booking/index.d.ts +227 -123
  145. package/dist/web/televet/booking/index.js +4 -2
  146. package/dist/web/televet/call/index.cjs +1 -1
  147. package/dist/web/televet/call/index.d.cts +1 -1
  148. package/dist/web/televet/call/index.d.ts +1 -1
  149. package/dist/web/televet/call/index.js +1 -1
  150. package/dist/web/televet/index.cjs +3 -3
  151. package/dist/web/televet/index.d.cts +12 -4
  152. package/dist/web/televet/index.d.ts +12 -4
  153. package/dist/web/televet/index.js +3 -3
  154. package/package.json +1 -1
  155. package/dist/BookedScreen-BJPbXLCG.d.ts +0 -54
  156. package/dist/BookedScreen-Cnld-jB_.d.cts +0 -54
@@ -1,2 +1,2 @@
1
- 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var Nr=Object.defineProperty;var o=(e,r)=>Nr(e,"name",{value:r,configurable:true});function Oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Oe(e[r]);}return e}o(Oe,"deepFreeze");var Lr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),lt={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},dt={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},st={nano:8,small:9,micro:10,tiny:11,caption:12,bodyTight:13,body:14,subtitle:16,heading:18,verdict:24},Mr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Vr={regular:"400",medium:"500",bold:"700"},Br={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},qr=0,pe="System",ye="monospace",Ur=["content","heading","control","compact","badge"];function Hr(e){let r={};for(let t of Ur)r[t]=e;return r}o(Hr,"authoredTierSizes");function ct(){return {family:pe,mono:ye,fontUrl:null,families:{regular:pe,medium:pe,bold:pe,mono:ye,monoMedium:ye,monoBold:ye},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:st,tierSizes:Hr(st),lineHeight:Mr,weight:Vr,letterSpacing:Br,scale:1,maxScale:qr,scaleCaps:Lr}}o(ct,"baseType");var ut={},Te=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function ke(e){return `cubic-bezier(${e.join(", ")})`}o(ke,"cssCubicBezier");var pt={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:ke(Te.standard),emphasized:ke(Te.emphasized),exit:ke(Te.exit)},reducedMotion:false},Wr={brand:"#10462E",brandSoft:"rgba(16,70,46,0.10)",brandSofter:"rgba(16,70,46,0.15)",brandBorder:"rgba(16,70,46,0.18)",borderHairlineGreen:"rgba(16,70,46,0.25)",brandBorderStrong:"rgba(16,70,46,0.55)",brandInk:"#10462E",linkInk:"#10462E",surface:"#FFFFFF",surfaceCream:"#FDFBF8",surfaceSubtle:"#EFE9E3",background:"#FFFFFF",borderRingCream:"#D8D2C8",chatGround:"#FFFFFF",composerFill:"#FDFBF8",composerBorder:"rgba(16,70,46,0.75)",shadow:"#0B3421",text:{primary:"#111111",secondary:"#0E462E",muted:"#6E6660",placeholder:"rgba(61,61,61,0.75)",onBrand:"#FFFFFF",metaCool:"#3D3D3D",timestamp:"rgba(61,61,61,0.75)"},primary:"#10462E",onPrimary:"#FFFFFF",accent:"#10462E",onAccent:"#FFFFFF",accentEdge:"#07C168",success:"#07C168",danger:"#B91C1C",onDanger:"#FFFFFF",errorRed:"#CC1600",warningStrong:"#A45610",cautionAccent:"#D9821D",riskConcern:"#EFA700",sentiment:{up:"#07C168",neutral:"#FBC558",down:"#FF1B00"},badgeBgPositive:"rgba(7,193,104,0.12)",badgeBgCaution:"rgba(217,130,29,0.14)",badgeBgCritical:"rgba(185,28,28,0.12)",badgeBgNeutral:"rgba(110,102,96,0.12)",bubbleUser:"#10462E",bubbleAssistant:"#FFFFFF",bubbleVet:"#FFC3BC",onBubbleVet:"#111111",skeleton:"#EFE9E3",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},yt=Oe({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:Wr,space:lt,radius:dt,type:ct(),motion:pt,slots:ut}),$r={brand:"#6BD39A",brandSoft:"rgba(107,211,154,0.12)",brandSofter:"rgba(107,211,154,0.18)",brandBorder:"rgba(107,211,154,0.22)",borderHairlineGreen:"rgba(107,211,154,0.28)",brandBorderStrong:"rgba(107,211,154,0.55)",brandInk:"#6BD39A",linkInk:"#6BD39A",surface:"#1C1F23",surfaceCream:"#23272C",surfaceSubtle:"#23272C",background:"#15171A",borderRingCream:"#3A3F45",chatGround:"#1C1F23",composerFill:"#23272C",composerBorder:"rgba(107,211,154,0.75)",shadow:"#000000",text:{primary:"#F5F3F0",secondary:"#A9E4C4",muted:"#9A938C",placeholder:"rgba(255,255,255,0.55)",onBrand:"#0E1F17",metaCool:"#C9C9C9",timestamp:"rgba(245,243,240,0.7)"},primary:"#6BD39A",onPrimary:"#0E1F17",accent:"#6BD39A",onAccent:"#0E1F17",accentEdge:"#34D888",success:"#07C168",danger:"#F87171",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:"#111111",skeleton:"#23272C",scanButtonPink:"#FFC3BC",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Oe({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:$r,space:lt,radius:dt,type:ct(),motion:pt,slots:ut});var ft=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),mt=globalThis,Fe=mt[ft]??(mt[ft]=react.createContext(yt));Fe.displayName??="EverfurThemeContext";function w(){return react.useContext(Fe)}o(w,"useEverfurTheme");function Jr(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(Jr,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=w(),n=Jr(t,e);return react.createElement(reactNative.Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");react.forwardRef(o(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function J(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(J,"slotBox");function Z(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(Z,"slotText");var Zr=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function S(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[Zr[r]]}}o(S,"face");function bt(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(bt,"reportHostFailure");function en(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(en,"isThenable");function tn(e,...r){if(typeof e=="function")try{let t=e(...r);return en(t)&&Promise.resolve(t).then(void 0,bt),t}catch(t){bt(t);return}}o(tn,"callHost");var ht=new WeakMap;function ee(e){if(typeof e!="function")return;let r=ht.get(e);if(r!==void 0)return r;let t=o((...n)=>{tn(e,...n);},"guarded");return ht.set(e,t),t}o(ee,"guardHost");var W=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"});var rn="your pet";function V(e){let r=e?.trim()??"";return r.length>0?r:rn}o(V,"petNameOr");var Rt=Object.freeze({title:"Health records",openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${V(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"Marker Summary",marker:"Marker",markers:"Markers",outOfRange:"OUT OF RANGE",inRange:"IN RANGE",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${V(e)}\u2019s records request`,"title"),body:o(e=>`We\u2019re requesting ${V(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${V(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${V(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${V(e)}\u2019s records`,"title"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicA11y:o(e=>`Request ${V(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${V(e)}\u2019s records`,"uploadDocumentA11y")});function vt(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(vt,"recordsEmptyVariantForError");function Et(e,r){return e===null?"":r?`${e} ${r}`:e}o(Et,"formatEntityValue");var _t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=_t[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${_t[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(O,"formatRecordsDate");var b=Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function Ct(e){switch(e){case "above":return {label:"Above range",outOfRange:true};case "below":return {label:"Below range",outOfRange:true};case "in_range":return {label:"In range",outOfRange:false};default:return {label:"No range on file",outOfRange:false}}}o(Ct,"markerStatusLabel");function nn(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(nn,"trajectoryLabel");function fe(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(fe,"humanize");var wt=Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function Ie(e){return Object.prototype.hasOwnProperty.call(wt,e)?wt[e]:fe(e)}o(Ie,"bodySystemLabel");var xt=Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function St(e){return Object.prototype.hasOwnProperty.call(xt,e)?xt[e]:fe(e)}o(St,"soapSectionLabel");function Tt(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(Tt,"formatWeightKg");function De(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(De,"formatMarkerReading");function kt(e,r,t){let n=nn(r,t);return e?`${b.measured(O(e))}${n?` \xB7 ${n}`:""}`:n}o(kt,"labDetailLine");var me=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function Ot(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(Ot,"toMillis");function Pe(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:b.kind.visit,at:t.visitDate,date:O(t.visitDate),title:t.summary??b.clinicVisit,detail:t.veterinarian?b.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(b.lot(t.lot)),t.expiresOn&&a.push(b.expires(O(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:b.kind.vaccine,at:t.administeredOn,date:O(t.administeredOn),title:t.product||b.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:b.kind.weight,at:t.observedOn,date:O(t.observedOn),title:Tt(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(l=>!!l);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:b.kind.medication,at:t.startedOn,date:O(t.startedOn),title:t.drugName||b.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=Ot(t.at),l=Ot(n.at);return a===null&&l===null?me[t.kind]-me[n.kind]:a===null?1:l===null?-1:l!==a?l-a:me[t.kind]-me[n.kind]}))}o(Pe,"buildTimelineRows");var Ae=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(Ae.map(e=>e.wireCode));var on=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),It=Object.freeze(Ae.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:on[e.wireCode]}))),an=new Map(It.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),sn=Object.freeze(["http_envelope",...[...new Set(It.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...sn]){let a=an.get(n+t);if(a)return a}}o(ge,"contractErrorFor");function ln(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(ln,"contractDocUrl");function Dt(e){return null}o(Dt,"publishedDocUrl");var dn=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Pt(e){return dn[e]}o(Pt,"categoryFor");function At(e){let r=ge(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(At,"fromWire");var cn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function je(e){return cn.has(e)}o(je,"isAutoRetryable");var un=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function jt(e){return je(e)||un.has(e)}o(jt,"isRetryableCode");var pn=500,ze=8e3,zt=4;function Nt(e,r=Math.random){let t=Math.max(0,e),n=Math.min(pn*2**t,ze);return Math.floor(r()*n)}o(Nt,"backoffDelayMs");var yn=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Ne(e){return yn[e]}o(Ne,"userFacingError");function Lt(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Lt,"defineHidden");var fn=/^[a-z][a-z0-9_]{0,63}$/;function B(e,r){let t=ge(r?.wireCode,r?.wireEnvelope),n={code:e,category:Pt(e),retryable:r?.retryable??jt(e),displayMessage:Ne(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&fn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Lt(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Lt(n,"raw",r.raw),Object.freeze(n)}o(B,"makeEverfurError");function $(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o($,"ok");function F(e){return Object.freeze({ok:false,error:e})}o(F,"err");var be=class be extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,be.prototype);}};o(be,"EverfurConfigError");var te=be;function Mt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Mt,"assertNever");function Vt(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o(Vt,"errorFrame");function bn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(bn,"authHeaders");function re(e,r){return {...e,headers:{...hn(e.headers),...bn(r)}}}o(re,"withAuthHeaders");function hn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(hn,"stripAuthHeaders");async function Bt(e,r){if(r.mode==="anonymous")return r.transport.request(re(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return F(Le())}let n=await r.transport.request(re(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return F(Le())}let l=await r.transport.request(re(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !l.ok&&l.error.httpStatus===401?F(Le(l.error.httpStatus)):l}o(Bt,"authedSend");function Le(e){return B("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Le,"authRejectedError");function qt(e){return B("internalError",{retryable:true,wireMessage:Rn(e)})}o(qt,"networkError");function Rn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(Rn,"describeCause");var vn=3e4,_n=ze*2,En="idempotency-key",wn=new Set(["POST","PUT","PATCH","DELETE"]),xn=Object.freeze({onEvent(){}}),Cn=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function Sn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(Sn,"seededIdempotencyKey");function Ht(e){let r=e.observer??xn,t=e.timers??Cn,n=e.rng??Math.random,a=e.sleep??((h,E)=>Vn(h,t,E)),l=e.maxAttempts??zt,s=e.unaryTimeoutMs??vn,c=e.newIdempotencyKey??kn(),i=o(h=>{try{r.onEvent(h);}catch{}},"emit");async function u(h,E,C){let k=C?.maxAttempts,I=Math.max(1,k??l),j=C?.idempotent??wn.has(E.method),z=C?.idempotencyKey===void 0?null:Sn(C.idempotencyKey),H=j?z??c():null,zr=Tn(E,H),xe=0;for(;;){let X=o(Se=>Object.freeze({call:h,method:E.method,path:E.path,attempt:xe,...H?{idempotencyKey:H}:{},...Se}),"stamp");i(X({phase:"attempt"}));let it=Ln(s,t),at=Mn(it.signal,E.signal),Q;try{Q=await Bt({...zr,signal:at.signal},e.auth);}catch(Se){Q=F(qt(Se));}finally{at.dispose(),it.cancel();}if(Q.ok)return i(X({phase:"settled",ok:true,reason:"ok"})),Q;let M=Q.error,ue=Fn(M,xe,{maxAttempts:I,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...k!==void 0?{perCallMaxAttempts:k}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Ce={ok:false,code:M.code,reason:ue.reason,...M.httpStatus!==void 0?{httpStatus:M.httpStatus}:{},...M.requestId!==void 0?{requestId:M.requestId}:{}};if(!ue.retry)return i(X({phase:"settled",...Ce})),F(M);if(i(X({phase:"retry",...Ce,delayMs:ue.delayMs})),await a(ue.delayMs,E.signal),E.signal?.aborted===true)return i(X({phase:"settled",...Ce,reason:"aborted"})),F(M);xe+=1;}}o(u,"send");async function y(h){return re(h,await Nn(e.auth))}o(y,"authorize");async function*_(h,E,C){i(Object.freeze({call:h,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield Vt({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(_,"stream"),Object.freeze({send:u,authorize:y,stream:_})}o(Ht,"createRequestFunnel");function Tn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==En&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(Tn,"assembleHeaders");function kn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(kn,"defaultIdempotencyKeyFactory");var On=10;function Fn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=In(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!je(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let s=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(On,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??s()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=Dn(e,t.now);return i!==null?i>_n?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:Nt(r,t.rng)}}o(Fn,"decideRetry");function In(e){let r=e.code==="unknown"?At(zn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(In,"throttleKind");function Dn(e,r){let t=An(e.raw);if(t!==null){let a=t-r;return a>0?a:0}let n=Pn(e.raw);return n===null?null:Math.round(n*1e3)}o(Dn,"retryOverrideMs");function Pn(e){for(let r of Me(e)){let t=r.retry_after_seconds;if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t}return null}o(Pn,"findRetryAfterSeconds");function An(e){for(let r of Me(e)){let t=r.resets_at,n=jn(t);if(n!==null)return n}return null}o(An,"findResetsAt");function Me(e){if(!Ut(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Ut(n)&&r.push(n);}return r}o(Me,"candidateScopes");function jn(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(jn,"parseInstantMs");function zn(e){for(let r of Me(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(zn,"rawWireCode");function Ut(e){return typeof e=="object"&&e!==null}o(Ut,"isRecord");async function Nn(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o(Nn,"resolveDeviceAuth");function Ln(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Ln,"boundedSignal");function Mn(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(Mn,"mergeSignals");function Vn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",l),n();},e),l=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",l,{once:true});})}o(Vn,"delayAbortable");function Wt(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(Wt,"hasLoneSurrogate");var $t=64,Gt=512;function qn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(qn,"normalizeOrigin");zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var Un=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Ve=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),Hn=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),Wn=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Hn).optional()}),$n=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),Be=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});function Yt(e){return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:qn(e.origin),canonicalKey:e.canonical_key??null})}o(Yt,"mapEntityRow");function Kt(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(Kt,"mapDocumentRow");zod.z.object({identity:zod.z.array(Un).optional(),entities:zod.z.array(Ve).optional(),entity_series:zod.z.array(Wn).optional(),forward_looking:zod.z.array($n).optional(),documents:zod.z.array(Be).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});var v=zod.z.string().nullish(),he=zod.z.number().nullish(),Gn=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,ref_low:he,ref_high:he,status:v,source_clinic:v,source_doc_id:v,doc_id:v,reviewed:zod.z.boolean().nullish()}),Yn=zod.z.object({collected_at:v,at:v,value:he,unit:v,qualitative_result:v,status:v}),Kn=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:v,name:v,loinc_code:v,canonical_unit:v,unit:v,panel_name:v,panel:v,meaning_text:v,meaning:v,latest:Yn.nullish(),trajectory:v,points:zod.z.array(Gn).optional()}),Xn=zod.z.object({total_markers:zod.z.number().int().nonnegative(),in_range_count:zod.z.number().int().nonnegative(),out_of_range_count:zod.z.number().int().nonnegative(),unknown_count:zod.z.number().int().nonnegative()}),Qn=zod.z.object({markers:zod.z.array(Kn).optional(),summary:Xn.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:v});function Jn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Jn,"isObject");function Xt(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(Xt,"withheldMarkers");function Qt(e,r){let t=Jn(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return Xt(n);let a=Qn.safeParse(t);if(!a.success)return Xt(n);let l=a.data,s=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(l.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(s))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:l.summary?Object.freeze({totalMarkers:l.summary.total_markers,inRangeCount:l.summary.in_range_count,outOfRangeCount:l.summary.out_of_range_count,unknownCount:l.summary.unknown_count}):null,disclaimer:l.disclaimer??"",featuredMarkerId:l.featured_marker_id??null})}o(Qt,"mapRecordMarkers");var Jt=128,q=128;var Zn=zod.z.string().min(1).refine(e=>e.startsWith("https://")),eo=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:Zn,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),to=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function Zt(e){let r=to.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let a=eo.safeParse(n);a.success&&t.push(Object.freeze({sourceDocId:a.data.source_doc_id,fileName:a.data.file_name??null,docFormat:a.data.doc_format??null,byteSize:a.data.byte_size??null,receivedAt:a.data.received_at??null,downloadUrl:a.data.download_url,expiresInSeconds:a.data.expires_in_seconds??0}));}return Object.freeze(t)}o(Zt,"mapRequestDocuments");var ro=zod.z.string().min(1).refine(e=>e.startsWith("https://")),ne=zod.z.string().nullish(),no=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:ne}),oo=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:ne,created_at:ne,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:ne})).optional()}),io=zod.z.object({download_url:ro,expires_at:ne});function ao(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(ao,"resolveShareUrl");function er(e,r){let t=no.safeParse(e);if(!t.success)return null;let n=ao(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null})}o(er,"mapRecordShareLink");function tr(e){let r=oo.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null}))):null}o(tr,"mapRecordShareList");function rr(e){let r=io.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(rr,"mapRecordPdfLink");var so=zod.z.object({signatures:zod.z.array(zod.z.object({signature_id:zod.z.string().min(1),preview_url:zod.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:zod.z.string().nullish()})).optional()});function nr(e){let r=so.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(nr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),oe=zod.z.number().nullish(),lo=zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,ref_low:oe,ref_high:oe,status:m,doc_id:m}),co=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:zod.z.object({at:m,value:oe,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(lo).optional()}),uo=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),po=zod.z.object({note_id:zod.z.string(),encounter_id:m,observed_on:m,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),yo=zod.z.object({exam_id:zod.z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:zod.z.record(zod.z.object({finding_status:m,finding:m})).optional()}),fo=zod.z.object({has_lab_history:zod.z.boolean().optional(),has_vaccination_history:zod.z.boolean().optional(),has_weight_history:zod.z.boolean().optional(),has_vitals_history:zod.z.boolean().optional(),has_physical_exam_history:zod.z.boolean().optional(),has_procedure_history:zod.z.boolean().optional(),has_genetic_history:zod.z.boolean().optional(),has_reproductive_history:zod.z.boolean().optional(),has_parasite_prevention_history:zod.z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:zod.z.number().int().nonnegative().optional(),documents_in_review:zod.z.number().int().nonnegative().optional(),entities_pending_review:zod.z.record(zod.z.number().int().nonnegative()).optional(),held_total:zod.z.number().int().nonnegative().optional()}),mo=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:m,severity:m,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),go=zod.z.object({lab_results:zod.z.array(co).optional(),encounters:zod.z.array(uo).optional(),clinician_notes:zod.z.array(po).optional(),physical_exams:zod.z.array(yo).optional(),completeness:fo.nullish(),conflicts:zod.z.array(mo).optional()}),bo=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:m,weight_kg:oe,doc_id:m})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:zod.z.string().optional()}),ho=zod.z.object({document:Be,contributions:zod.z.array(Ve),contribution_count:zod.z.number().int().nonnegative().optional()});function Ue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ue,"isObject");function He(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(He,"petOf");function qe(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(qe,"emptyDepth");function ir(e,r){let t=Ue(r)?r:{},n=He(t,e);if(t.withheld===true)return qe(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return qe(n,false);let l=go.safeParse(t);if(!l.success)return qe(n,true);let s=l.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((s.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((s.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((s.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((s.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,y])=>Object.freeze({system:u,findingStatus:y.finding_status??null,finding:y.finding??null})))}))),completeness:s.completeness?Object.freeze({hasLabHistory:s.completeness.has_lab_history===true,hasVaccinationHistory:s.completeness.has_vaccination_history===true,hasWeightHistory:s.completeness.has_weight_history===true,hasVitalsHistory:s.completeness.has_vitals_history===true,hasPhysicalExamHistory:s.completeness.has_physical_exam_history===true,hasProcedureHistory:s.completeness.has_procedure_history===true,hasGeneticHistory:s.completeness.has_genetic_history===true,hasReproductiveHistory:s.completeness.has_reproductive_history===true,hasParasitePreventionHistory:s.completeness.has_parasite_prevention_history===true,earliestRecordAt:s.completeness.earliest_record_at??null,latestRecordAt:s.completeness.latest_record_at??null,documentsIngested:s.completeness.documents_ingested??0,documentsInReview:s.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...s.completeness.entities_pending_review??{}}),heldTotal:s.completeness.held_total??0}):null,conflicts:Object.freeze((s.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(ir,"mapRecordDepth");function or(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(or,"withheldTimeline");function ar(e,r){let t=Ue(r)?r:{},n=He(t,e);if(t.withheld===true)return or(n);let a=bo.safeParse(t);if(!a.success)return or(n);let l=a.data,s=l.visits.map(y=>Object.freeze({visitId:y.visit_id,visitDate:y.visit_date??null,veterinarian:y.veterinarian??null,summary:y.summary??null,docId:y.doc_id??null})),c=l.vaccines.map(y=>Object.freeze({vaccineId:y.vaccine_id,product:y.product??null,lot:y.lot??null,administeredOn:y.administered_on??null,expiresOn:y.expires_on??null,docId:y.doc_id??null})),i=l.weights.map(y=>Object.freeze({weightId:y.weight_id,observedOn:y.observed_on??null,weightKg:y.weight_kg??null,docId:y.doc_id??null})),u=l.medications.map(y=>Object.freeze({medicationId:y.medication_id,drugName:y.drug_name??null,dose:y.dose??null,route:y.route??null,frequency:y.frequency??null,sig:y.sig??null,rxNumber:y.rx_number??null,startedOn:y.started_on??null,stoppedOn:y.stopped_on??null,docId:y.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:s.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(s),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:l.disclaimer??""})}o(ar,"mapRecordsTimeline");function sr(e,r){let t=Ue(r)?r:{},n=He(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let l=ho.safeParse(t);if(!l.success)return a();let s=Object.freeze(l.data.contributions.map(Yt));return Object.freeze({petRef:n,withheld:false,document:Kt(l.data.document),contributions:s,contributionCount:l.data.contribution_count??s.length})}o(sr,"mapDocumentContributions");var Ro="/widget/v1/records/pets";function lr(e){let r=e.funnel??Ht({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!Wt(i)&&[...i].length<=u,"segment"),n=o(async(i,u,y,_)=>{if(!t(u,q))return N();let h=await r.send(i,{method:"GET",path:y});if(!h.ok)return h;let E=_(h.value);return E.petRef===u?$(E):F(B("internalError",{retryable:false}))},"read"),a=o(i=>`${Ro}/${encodeURIComponent(i)}`,"pet"),l=o(i=>`${a(i)}/everfur_record`,"record"),s=o(async(i,u,y)=>{let _=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!_.ok)return _;let h=y(_.value);return h===null?F(B("internalError",{retryable:false})):$(h)},"parsed"),c=o((i,u)=>!t(i.entityType,$t)||!t(i.canonicalKey,Gt)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,Jt)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>ir(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>ar(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,y=>sr(i,y)):N()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>Qt(i,u)),"getMarkers"),createShare(i){return t(i,q)?s("records.share.create",{method:"POST",path:`${l(i)}/share`},u=>er(u,e.apiBaseUrl)):N()},listShares(i){return t(i,q)?s("records.share.list",{method:"GET",path:`${l(i)}/shares`},tr):N()},async revokeShare(i,u){if(!t(i,q)||!t(u,64))return N();let y=await r.send("records.share.revoke",{method:"DELETE",path:`${l(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return y.ok?$(void 0):y},getPdfLink(i){return t(i,q)?s("records.pdf.link",{method:"GET",path:`${l(i)}/pdf-link`},rr):N()},async editFact(i,u){let y=t(i,q)?c(u,u.correctedFields):null;if(y===null)return N();let _=await r.send("records.fact.edit",{method:"POST",path:`${l(i)}/facts/edit`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},async removeFact(i,u){let y=t(i,q)?c(u):null;if(y===null)return N();let _=await r.send("records.fact.remove",{method:"POST",path:`${l(i)}/facts/remove`,body:y},{idempotent:false,maxAttempts:1});return _.ok?$(void 0):_},listRequestDocuments(i){return t(i,64)?s("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(i)}/documents`},Zt):N()},listAuthorizationSignatures:o(()=>s("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},nr),"listAuthorizationSignatures")}}o(lr,"createRecordsDepthClient");function N(){return Promise.resolve(F(B("validationFailed",{retryable:false})))}o(N,"invalid");var dr=Symbol.for("@everfur/sdk#EverfurContext@v1"),cr=globalThis,ur=cr[dr]??(cr[dr]=react.createContext(null));ur.displayName??="EverfurContext";function ie(){let e=react.useContext(ur);if(e===null)throw new te("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(ie,"useEverfurContext");var xo=new Map,pr=new Set;function Co(e){return xo.get(e)??0}o(Co,"recordsConsentEpochOf");function So(e){return pr.add(e),()=>{pr.delete(e);}}o(So,"subscribe");function yr(e){let r=react.useCallback(()=>Co(e),[e]);return react.useSyncExternalStore(So,r,r)}o(yr,"useRecordsConsentEpoch");function mr(){let{runtime:e,userRef:r,scopeEpoch:t}=ie();return react.useMemo(()=>{let{services:n}=e.registry;return lr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(mr,"useEverfurRecordsDepthClient");function ae(e,r,t,n=""){let a=mr(),{userRef:l}=ie(),s=yr(e),c=react.useMemo(()=>({}),[a,e,n,s]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),y=react.useRef(0),_=react.useCallback(async()=>{let j=y.current+=1;if(u({scope:c,value:null,error:null,loading:true}),l===null){u({scope:c,value:null,error:null,loading:false});return}let z=await r(a,e);j===y.current&&(z.ok?u({scope:c,value:z.value,error:null,loading:false}):u({scope:c,value:null,error:z.error,loading:false}));},[a,e,r,c,l]);react.useEffect(()=>(_(),()=>{y.current+=1;}),[_]);let h=i.scope===c?i:{value:null,error:null,loading:true},E=react.useCallback(()=>{_();},[_]),C=h.error===null||h.error.httpStatus!==404,k=C?h.error:null,I=h.loading?"loading":k!==null?"error":h.value===null?"empty":h.value.withheld?"populated":t(h.value)?"empty":"populated";return react.useMemo(()=>({status:I,value:h.value,error:k,available:C,refresh:E}),[I,h.value,k,C,E])}o(ae,"useRecordsDepthRead");var Ye=class Ye extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Ye,"HostRenderBoundary");var $e=Ye;function Io({render:e}){return e()}o(Io,"RenderHost");function Ge({render:e,fallback:r,resetKey:t}){return react.createElement($e,{fallback:r,resetKey:t,children:react.createElement(Io,{render:e})})}o(Ge,"HostRender");var Do=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Po(e){return Do[e]}o(Po,"requires");function br(e,r,t){let n=Po(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return Ke({name:e,enabled:false,isPending:true,limits:{}});let l=Ao(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?Ke({name:e,enabled:true,isPending:false,limits:l}):Ke({name:e,enabled:false,isPending:false,limits:l,disabled:jo(n,a)})}o(br,"decideCapability");function Ao(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[l,s]of Object.entries(a)){let c=t[l];t[l]=c===void 0?s:Math.min(c,s);}}return t}o(Ao,"mergeLimits");function jo(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Ne("accessDenied"),level:"user_entitlement",recoverable:false})}o(jo,"disabledFor");function Ke(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(Ke,"freezeDecision");function Xe(e){let{runtime:r}=ie(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>br(e,n.decisions,{isPending:n.isPending}),[e,n])}o(Xe,"useCapability");var Lo=48;function Mo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Mo,"selectView");function _r(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:l}=e,s=Xe(r),c=react.useMemo(()=>Mo(s),[s]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx(Ge,{render:a,fallback:jsxRuntime.jsx(Rr,{capability:r,style:l})}):jsxRuntime.jsx(Rr,{capability:r,style:l});case "disabled":return n?jsxRuntime.jsx(Ge,{render:()=>n(s),fallback:jsxRuntime.jsx(vr,{decision:s,style:l}),resetKey:s}):jsxRuntime.jsx(vr,{decision:s,style:l});default:return Mt(c)}}o(_r,"CapabilityGate");function Rr({capability:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]);return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:n.skeletonBar})})}o(Rr,"PendingSkeleton");function vr({decision:e,style:r}){let t=w(),n=react.useMemo(()=>Er(t),[t]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx(g,{style:n.offstateText,children:a}):null})}o(vr,"OffState");function Er(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Lo,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...S(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Er,"makeStyles");var se=Object.freeze({title:"For educational use only",body:"Everfur is for educational purposes only. It helps you track visible changes through AI checkups. It does not diagnose, treat, prescribe, or replace veterinary care. For urgent symptoms or emergencies, contact a veterinarian immediately."});function Cr(e){let r=w(),t=react.useMemo(()=>qo(r),[r]);return jsxRuntime.jsxs(reactNative.View,{style:[t.container,e.style],accessible:true,accessibilityRole:"text",accessibilityLabel:`${se.title}. ${se.body}`,children:[jsxRuntime.jsx(g,{style:t.title,children:se.title}),jsxRuntime.jsx(g,{style:t.body,children:se.body})]})}o(Cr,"ClinicalDisclaimer");function qo(e){let{color:r,space:t,type:n}=e;return reactNative.StyleSheet.create({container:{paddingHorizontal:t.lg,paddingVertical:t.md,borderTopWidth:reactNative.StyleSheet.hairlineWidth,borderTopColor:r.borderHairlineGreen,backgroundColor:r.surfaceCream,gap:t.xs},title:{...S(e,"bold"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.secondary,letterSpacing:n.letterSpacing.eyebrow},body:{...S(e,"regular"),fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.snug),color:r.text.muted}})}o(qo,"makeStyles");var Sr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),Ze=60;function Tr(e){return `Try again in ${e}s`}o(Tr,"coolingActionLabel");var kr="Try again, available shortly";function Re({variant:e,onAction:r,message:t,testID:n}){let a=Go(),l=Sr[e],[s,c]=react.useState(e==="rate_limited"?Ze:0);react.useEffect(()=>{e==="rate_limited"&&c(Ze);},[e]),react.useEffect(()=>{if(s<=0)return;let y=setTimeout(()=>c(_=>Math.max(0,_-1)),1e3);return ()=>clearTimeout(y)},[s]);let i=e==="rate_limited"&&s>0,u=i?Tr(s):l.action;return jsxRuntime.jsxs(reactNative.View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsxRuntime.jsx(reactNative.View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(g,{style:a.title,children:l.title}),jsxRuntime.jsx(g,{style:a.body,children:t??l.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?kr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsxRuntime.jsx(g,{style:a.actionLabel,children:u})}):null]})}o(Re,"RecordsEmptyState");function Go(){let e=w();return react.useMemo(()=>Yo(e),[e])}o(Go,"useStyles");function Yo(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,s=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:s,height:s,borderRadius:s/2,backgroundColor:r.brandSoft,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...S(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...S(e,"regular"),fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.normal),color:r.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...J(l.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...Z(l.primaryButton)}})}o(Yo,"makeStyles");var Jo=120,Zo=44;function ei({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:l,radius:s,type:c}=w();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:Jo,justifyContent:"center",gap:l.md,padding:l.lg,borderRadius:s.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsxRuntime.jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:Zo,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:l.lg,borderRadius:s.pill,borderWidth:1.5,borderColor:a.brandInk},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brandInk},children:t})})]})}o(ei,"RecordsGateOffState");function Dr(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(ei,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Dr,"recordsGateExit");var et="Back";function _e({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let l=ii();return jsxRuntime.jsxs(reactNative.View,{style:l.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:et,hitSlop:12,style:l.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:l.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:l.back}),jsxRuntime.jsx(g,{style:a==="document"?l.documentTitle:l.title,accessibilityRole:"header",numberOfLines:1,children:e}),jsxRuntime.jsx(reactNative.View,{style:l.right,children:t??jsxRuntime.jsx(reactNative.View,{style:l.back})})]})}o(_e,"ScreenHeader");function ii(){let e=w();return react.useMemo(()=>ai(e),[e])}o(ii,"useStyles");function ai(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,l=t.md,s=t.xs/2,c=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:l,height:l,borderLeftWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...S(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},documentTitle:{flex:1,textAlign:"center",...S(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:s,borderRadius:s,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:s,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:s,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:s},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:s,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:s,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:s,borderRightWidth:s,borderBottomWidth:s,borderColor:r.brandInk}})}o(ai,"makeStyles");function K({width:e,height:r,radius:t,style:n}){let{color:a,radius:l}=w();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??l.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(K,"SkeletonBlock");var di=44,ci=24,tt=34,ui=6;function Ar({testID:e}){let r=pi();return jsxRuntime.jsxs(reactNative.View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:b.loadingTimeline,testID:e,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineDisclaimer,children:jsxRuntime.jsx(K,{width:"100%",height:di,radius:12})}),Array.from({length:ui},(t,n)=>jsxRuntime.jsxs(reactNative.View,{children:[n>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,children:[jsxRuntime.jsx(K,{width:tt,height:tt,radius:tt/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(K,{width:44,height:10,radius:5}),jsxRuntime.jsx(K,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(K,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(K,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ar,"TimelineSkeleton");var rt=62;function pi(){let e=w();return react.useMemo(()=>yi(e),[e])}o(pi,"useStyles");function yi(e){let{color:r,space:t,radius:n}=e,a=reactNative.StyleSheet.hairlineWidth;return reactNative.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:ci},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:rt},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(yi,"makeStyles");var Ri=300,vi=o((e,r)=>e.getTimeline(r),"readTimeline"),_i=o(e=>e.isEmpty,"timelineEmpty"),Ei=o((e,r)=>e.getRecordDepth(r),"readDepth"),wi=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),xi=o(e=>e.contributions.length===0,"contributionsEmpty");function Ci({petRef:e,style:r,onBack:t}){let n=ae(e,vi,_i);return jsxRuntime.jsx(ot,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(_e,{title:b.timeline,onBack:ee(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Ar,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Fi,{timeline:a})})}o(Ci,"EverfurRecordsTimeline");function Si({petRef:e,style:r,onBack:t}){let n=ae(e,Ei,wi);return jsxRuntime.jsx(ot,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(_e,{title:W.records,onBack:ee(t)}):null,render:a=>jsxRuntime.jsx(Ii,{depth:a})})}o(Si,"EverfurRecordDepth");function Ti({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),l=ae(e,a,xi,r),s=l.value?.document?.title?.trim()||b.uploadedDocument;return jsxRuntime.jsx(ot,{state:l,style:t,onBack:n,header:jsxRuntime.jsx(_e,{title:s,onBack:ee(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(Re,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx(Di,{view:c})})}o(Ti,"EverfurDocumentContributions");function ot({state:e,style:r,header:t,loading:n,empty:a,render:l,onBack:s}){let c=we();return jsxRuntime.jsx(_r,{capability:"records",style:r,...Dr(ee(s),et),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:ki(e,l,c,n,a)}),jsxRuntime.jsx(Cr,{})]})})}o(ot,"DepthSurface");function ki(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(Oi,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:W.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(Re,{variant:vt(e.error),message:e.error.displayMessage,onAction:e.error.retryable?e.refresh:void 0,testID:"depth-error"}):null;case "populated":return e.value===null||e.value.withheld?null:r(e.value);default:return null}}o(ki,"renderState");function Oi({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),Ri);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:W.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(Oi,"LoadingState");function Fi({timeline:e}){let r=we(),t=Pe(e);return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:b.timeline,children:[e.disclaimer.length>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:Rt.important(e.disclaimer),children:jsxRuntime.jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{children:[a>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.topLine,children:[jsxRuntime.jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx(g,{style:r.date,children:n.date})]}),jsxRuntime.jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Fi,"TimelineBody");function Ee({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(Ee,"SectionHeader");function Ii({depth:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=Ct(t.latest.status),a=kt(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,De(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.name}),jsxRuntime.jsx(g,{style:r.rowValue,children:De(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsxRuntime.jsx(g,{style:r.rowDetail,children:a}):null,jsxRuntime.jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsxRuntime.jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visits,count:e.encounters.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?O(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.type?fe(t.type):b.visit}),n?jsxRuntime.jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",l=a?b.abnormal:n.findingStatus==="not_examined"?b.notExamined:b.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[Ie(n.system),l,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:Ie(n.system)}),a&&n.finding?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:l})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(Ee,{title:b.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?O(t.observedOn):b.visitNote}),t.sections.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.kindLabel,children:St(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||b.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(Ii,"DepthBody");function Di({view:e}){let r=we();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:W.records,children:[e.document?.receivedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(e.document.receivedAt)}):null,jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.label}),jsxRuntime.jsx(g,{style:r.rowValue,children:Et(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:O(t.observedAt)}):null]},t.key))})]})}o(Di,"ContributionsBody");function we(){let e=w();return react.useMemo(()=>Pi(e),[e])}o(we,"useStyles");function Pi(e){let{color:r,space:t,radius:n,type:a,slots:l}=e,{size:s,lineHeight:c}=a,i=o((I,j)=>Math.round(I*j),"lh"),u=reactNative.StyleSheet.hairlineWidth,y=t.xxl*3+t.xl,_=t.xxl+t.md,h=e.brightness==="dark"?r.errorRed:r.danger,E=Z(l.recordCard),C=o((I,j,z,H="regular")=>({...S(e,H),fontSize:I,lineHeight:i(I,j),color:z}),"text"),k=o((I,j,z,H="regular")=>({...C(I,j,z,H),...E}),"inCard");return reactNative.StyleSheet.create({container:{flex:1,minHeight:y,backgroundColor:r.background},body:{flex:1},centered:{minHeight:y,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(s.subtitle,c.snug,h),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:_,minWidth:_,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...J(l.primaryButton)},primaryLabel:{...S(e,"bold"),color:r.onPrimary,fontSize:s.body,...Z(l.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(s.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...J(l.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...k(s.caption,c.normal,r.text.muted,"medium")},date:k(s.caption,c.normal,r.text.muted),rowTitle:{...k(s.body,c.normal,r.text.primary,"bold")},rowValue:{...k(s.body,c.normal,r.text.primary,"medium")},rowDetail:k(s.bodyTight,c.normal,r.text.muted),rowMuted:{...k(s.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(s.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(s.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(s.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:rt},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...S(e,"mono"),fontSize:s.micro,lineHeight:s.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(s.body,c.normal,r.text.primary,"medium")}})}o(Pi,"makeStyles");
2
- exports.EverfurDocumentContributions=Ti;exports.EverfurRecordDepth=Si;exports.EverfurRecordsTimeline=Ci;exports.buildTimelineRows=Pe;exports.mapDocumentContributions=sr;exports.mapRecordDepth=ir;exports.mapRecordsTimeline=ar;exports.useEverfurRecordsDepthClient=mr;exports.useRecordsDepthRead=ae;
1
+ 'use strict';var react=require('react'),reactNative=require('react-native'),zod=require('zod'),jsxRuntime=require('react/jsx-runtime');var $r=Object.defineProperty;var o=(e,r)=>$r(e,"name",{value:r,configurable:true});function Ie(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e))Ie(e[r]);}return e}o(Ie,"deepFreeze");var Yr=Object.freeze({content:0,heading:2,control:1.8,compact:1.5,badge:1.3}),yt={xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},ft={tile:5,xs:6,sm:10,md:14,lg:20,xl:28,pill:500},pt={nano:8,small:9,micro:10,tiny:11,caption:13,bodyTight:15,body:17,subtitle:20,heading:22,verdict:24},Kr={tight:1.15,snug:1.3,normal:1.4,relaxed:1.55},Gr={regular:"400",medium:"500",bold:"700"},Xr={eyebrow:1,monoWide:.9,headerBrand:-0.42,tight:-0.35},Qr=0,pe="System",ye="monospace",Jr=["content","heading","control","compact","badge"];function Zr(e){let r={};for(let t of Jr)r[t]=e;return r}o(Zr,"authoredTierSizes");function mt(){return {family:pe,mono:ye,fontUrl:null,families:{regular:pe,medium:pe,bold:pe,mono:ye,monoMedium:ye,monoBold:ye},namedFaces:{regular:false,medium:false,bold:false,mono:false,monoMedium:false,monoBold:false},fontUrls:{},size:pt,tierSizes:Zr(pt),lineHeight:Kr,weight:Gr,letterSpacing:Xr,scale:1,maxScale:Qr,scaleCaps:Yr}}o(mt,"baseType");var gt={},Oe=Object.freeze({standard:Object.freeze([.2,0,0,1]),emphasized:Object.freeze([.2,.8,.2,1]),exit:Object.freeze([.4,0,1,1])});function Fe(e){return `cubic-bezier(${e.join(", ")})`}o(Fe,"cssCubicBezier");var bt={duration:{instant:80,fast:140,normal:220,slow:320},spring:{gentle:{damping:18,stiffness:200}},easing:{standard:Fe(Oe.standard),emphasized:Fe(Oe.emphasized),exit:Fe(Oe.exit)},reducedMotion:false},en={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",checkupCardLowRiskBg:"rgba(7,193,104,0.10)",checkupCardConcernBg:"rgba(239,167,0,0.10)"},ht=Ie({brightness:"light",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:en,space:yt,radius:ft,type:mt(),motion:bt,slots:gt}),tn={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",checkupCardLowRiskBg:"rgba(7,193,104,0.16)",checkupCardConcernBg:"rgba(239,167,0,0.16)"};Ie({brightness:"dark",highContrast:false,meta:{displayName:"Everfur",logoUrl:null,placeholder:null,hidePoweredBy:false},color:tn,space:yt,radius:ft,type:mt(),motion:bt,slots:gt});var Rt=Symbol.for("@everfur/sdk#EverfurThemeContext@v1"),vt=globalThis,Pe=vt[Rt]??(vt[Rt]=react.createContext(ht));Pe.displayName??="EverfurThemeContext";function x(){return react.useContext(Pe)}o(x,"useEverfurTheme");function ln(e,r){let t=e.scaleCaps[r];return t>0?t:void 0}o(ln,"tierMultiplier");function g({tier:e="content",...r}){let{type:t}=x(),n=ln(t,e);return react.createElement(reactNative.Text,n===void 0?r:{maxFontSizeMultiplier:n,...r})}o(g,"Text");react.forwardRef(o(function(r,t){return react.createElement(reactNative.TextInput,{...r,...t===null?{}:{ref:t}})},"TextInput"));function te(e,r){if(e===void 0)return {};let t={};return e.backgroundColor!==void 0&&(t.backgroundColor=e.backgroundColor),e.borderColor!==void 0&&(t.borderColor=e.borderColor,t.borderWidth=r??1),e.borderRadius!==void 0&&(t.borderRadius=e.borderRadius),t}o(te,"slotBox");function re(e){return e?.textColor===void 0?{}:{color:e.textColor}}o(re,"slotText");var dn=Object.freeze({regular:"regular",medium:"medium",bold:"bold",mono:"regular",monoMedium:"medium",monoBold:"bold"});function k(e,r){let t=e.type,n=t.families[r];return r==="mono"||t.namedFaces[r]?{fontFamily:n}:{fontFamily:n,fontWeight:t.weight[dn[r]]}}o(k,"face");function Et(e){let r=globalThis.console;try{r?.error?.("[everfur] A host callback threw; the SDK ignored it.",e);}catch{}}o(Et,"reportHostFailure");function cn(e){return (typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function"}o(cn,"isThenable");function un(e,...r){if(typeof e=="function")try{let t=e(...r);return cn(t)&&Promise.resolve(t).then(void 0,Et),t}catch(t){Et(t);return}}o(un,"callHost");var wt=new WeakMap;function ne(e){if(typeof e!="function")return;let r=wt.get(e);if(r!==void 0)return r;let t=o((...n)=>{un(e,...n);},"guarded");return wt.set(e,t),t}o(ne,"guardHost");var $=Object.freeze({loading:"Loading",empty:"No records yet",upload:"Upload records",consentRequired:"Consent required",allow:"Allow",sessionRequired:"Sign in required",recordUnavailable:"Record unavailable",retry:"Try again",records:"Records",beingReviewed:"being reviewed"}),xt="Everfur summarizes what your vet recorded. It is informational, not diagnostic.";var pn="your pet";function L(e){let r=e?.trim()??"";return r.length>0?r:pn}o(L,"petNameOr");var St=Object.freeze({title:"Health records",titleWeb:o(e=>{let r=e?.trim()??"";return r.length>0?`${r}\u2019s Records`:"Health records"},"titleWeb"),titleNative:o(e=>{let r=e?.trim()??"";return r.length>0?r:"Health records"},"titleNative"),openTimeline:"Open timeline",loading:"Loading health records",lead:o(e=>`${L(e)}\u2019s lab trends`,"lead"),retryMarkers:"Retry loading lab trends",viewFullRecord:"View full medical record",viewTimeline:"View full timeline",important:o(e=>`Important: ${e}`,"important")});Object.freeze({title:"At a glance",marker:"Marker",markers:"Markers",outOfRange:"out of range",inRange:"in range",noRange:"NO RANGE",subtitle:"Summary of your pet\u2019s biomarkers",ask:"Ask about these markers",askA11y:"Ask Everfur about these markers",a11y:o((e,r,t,n)=>`Marker summary: ${e} ${e===1?"marker":"markers"}, ${r} in range, ${t} out of range${n>0?`, ${n} without a range`:""}.`,"a11y")});Object.freeze({counter:o((e,r)=>`${e+1} of ${r}`,"counter"),a11y:o((e,r,t)=>e!==null?`${e}, marker ${r+1} of ${t}. Swipe left or right to see more markers.`:`Marker ${r+1} of ${t}`,"a11y")});Object.freeze({tapHint:"Tap a point to see where it came from.",singleHint:"One reading so far: we\u2019ll plot a trend as more come in.",empty:"No readings for this marker yet.",ask:"Ask about this marker",askNamed:o(e=>{let r=e?.trim()??"";return r.length>0?`Ask about ${r}`:"Ask about this marker"},"askNamed"),askA11y:o(e=>`Ask Everfur about ${e}`,"askA11y"),status:o(e=>`Status: ${e}`,"status"),latestA11y:o((e,r,t)=>`Latest reading ${e}, ${r}, collected ${t}`,"latestA11y"),readingsA11y:o(e=>`${e} readings, oldest to newest`,"readingsA11y")});Object.freeze({title:o(e=>`${L(e)}\u2019s records are on the way`,"title"),anotherClinic:"Another clinic",anotherClinicSub:"Seen more than one vet? We ask each one.",uploadDocumentPhotoSub:"A PDF, or a photo of a paper record.",body:o(e=>`We\u2019re requesting ${L(e)}\u2019s records from your vet. This usually takes a few days; we\u2019ll show lab trends here as soon as they arrive.`,"body"),a11y:o(e=>`Records request in progress for ${L(e)}.`,"a11y"),openA11y:o((e,r)=>`Open ${L(e)}\u2019s records request. ${r}`,"openA11y"),ask:"Ask about this request",askA11y:"Ask Everfur about this records request"});Object.freeze({title:o(e=>`Add ${L(e)}\u2019s records`,"title"),firstRecordTitle:o(e=>`Add ${L(e)}\u2019s first record`,"firstRecordTitle"),body:"Records can come from more than one clinic over a lifetime.",requestFromClinic:"Request from a clinic",requestFromClinicSub:"We send a secure request and read every page they send back.",requestFromClinicA11y:o(e=>`Request ${L(e)}\u2019s records from a clinic`,"requestFromClinicA11y"),uploadDocument:"Upload a document",uploadDocumentA11y:o(e=>`Upload one of ${L(e)}\u2019s records`,"uploadDocumentA11y")});function Ct(e){return e?.httpStatus===429?"rate_limited":e?.httpStatus===502?"service_unavailable":"error"}o(Ct,"recordsEmptyVariantForError");function kt(e,r){return e===null?"":r?`${e} ${r}`:e}o(kt,"formatEntityValue");var Tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(e){if(!e)return "-";let r=/^(\d{4})-(\d{2})-(\d{2})/.exec(e);if(r!==null){let a=Tt[Number(r[2])-1];return a===void 0?"-":`${a} ${Number(r[3])}, ${r[1]}`}let t=Date.parse(e);if(Number.isNaN(t))return "-";let n=new Date(t);return `${Tt[n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`}o(F,"formatRecordsDate");var R=Object.freeze({timeline:"Timeline",loadingTimeline:"Loading timeline",labResults:"Blood & lab work",visits:"Visits",physicalExams:"Physical exams",visitNotes:"Visit notes",visit:"Visit",exam:"Exam",visitNote:"Visit note",notRecorded:"Not recorded",abnormal:"Abnormal",notExamined:"Not examined",normal:"Normal",measured:o(e=>`Measured ${e}`,"measured"),uploadedDocument:"Uploaded document",kind:Object.freeze({visit:"Visit",vaccine:"Vaccine",weight:"Weight",medication:"Medication"}),clinicVisit:"Clinic visit",doctor:o(e=>`Dr. ${e}`,"doctor"),lot:o(e=>`Lot ${e}`,"lot"),expires:o(e=>`Expires ${e}`,"expires")});function It(e){switch(e){case "above":return {label:"Above range",outOfRange:true};case "below":return {label:"Below range",outOfRange:true};case "in_range":return {label:"In range",outOfRange:false};default:return {label:"No range on file",outOfRange:false}}}o(It,"markerStatusLabel");function yn(e,r){return r<2?null:`${e==="flat"?"Holding steady":`Trending ${e==="down"?"down":e==="up"?"up":"steady"}`} over ${r} visits`}o(yn,"trajectoryLabel");function fe(e){let r=e.replace(/_/g," ").trim();return r.length===0?e:r.charAt(0).toUpperCase()+r.slice(1)}o(fe,"humanize");var Ot=Object.freeze({general:"General / attitude",eent:"Eyes, ears, nose & throat",oral_dental:"Oral & dental",cardiovascular:"Cardiovascular",respiratory:"Respiratory",gastrointestinal:"GI / abdomen",urogenital:"Urogenital",musculoskeletal:"Musculoskeletal",neurologic:"Neurologic",integument:"Skin & coat",lymphatic:"Lymph nodes"});function De(e){return Object.prototype.hasOwnProperty.call(Ot,e)?Ot[e]:fe(e)}o(De,"bodySystemLabel");var Ft=Object.freeze({reason_for_visit:"Reason for visit",subjective:"Subjective",objective:"Objective",assessment:"Assessment",plan:"Plan",discharge_instructions:"Discharge instructions",follow_up:"Follow-up",remarks:"Notes"});function Pt(e){return Object.prototype.hasOwnProperty.call(Ft,e)?Ft[e]:fe(e)}o(Pt,"soapSectionLabel");function Dt(e){return e===null||!Number.isFinite(e)?"-":`${e.toFixed(3).replace(/\.?0+$/,"")} kg`}o(Dt,"formatWeightKg");function Ae(e,r,t){if((e===null||!Number.isFinite(e))&&t)return t;if(e===null||!Number.isFinite(e))return "-";let n=e.toFixed(3).replace(/\.?0+$/,"");return r?`${n} ${r}`:n}o(Ae,"formatMarkerReading");function At(e,r,t){let n=yn(r,t);return e?`${R.measured(F(e))}${n?` \xB7 ${n}`:""}`:n}o(At,"labDetailLine");var me=Object.freeze({visit:0,vaccine:1,weight:2,medication:3});function jt(e){if(!e)return null;let r=Date.parse(e);return Number.isNaN(r)?null:r}o(jt,"toMillis");function je(e){let r=[...e.visits.map((t,n)=>({key:`visit-${n}-${t.visitId}`,kind:"visit",kindLabel:R.kind.visit,at:t.visitDate,date:F(t.visitDate),title:t.summary??R.clinicVisit,detail:t.veterinarian?R.doctor(t.veterinarian):null,docId:t.docId})),...e.vaccines.map((t,n)=>{let a=[];return t.lot&&a.push(R.lot(t.lot)),t.expiresOn&&a.push(R.expires(F(t.expiresOn))),{key:`vaccine-${n}-${t.vaccineId}`,kind:"vaccine",kindLabel:R.kind.vaccine,at:t.administeredOn,date:F(t.administeredOn),title:t.product||R.kind.vaccine,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}}),...e.weights.map((t,n)=>({key:`weight-${n}-${t.weightId}`,kind:"weight",kindLabel:R.kind.weight,at:t.observedOn,date:F(t.observedOn),title:Dt(t.weightKg),detail:null,docId:t.docId})),...e.medications.map((t,n)=>{let a=[t.dose,t.route,t.frequency].filter(s=>!!s);return {key:`medication-${n}-${t.medicationId}`,kind:"medication",kindLabel:R.kind.medication,at:t.startedOn,date:F(t.startedOn),title:t.drugName||R.kind.medication,detail:a.length?a.join(" \xB7 "):null,docId:t.docId}})];return Object.freeze(r.sort((t,n)=>{let a=jt(t.at),s=jt(n.at);return a===null&&s===null?me[t.kind]-me[n.kind]:a===null?1:s===null?-1:s!==a?s-a:me[t.kind]-me[n.kind]}))}o(je,"buildTimelineRows");var ze=Object.freeze([Object.freeze({wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true}),Object.freeze({wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true}),Object.freeze({wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false}),Object.freeze({wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false}),Object.freeze({wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false}),Object.freeze({wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true}),Object.freeze({wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false}),Object.freeze({wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false}),Object.freeze({wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false}),Object.freeze({wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false}),Object.freeze({wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false}),Object.freeze({wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false}),Object.freeze({wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true}),Object.freeze({wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false}),Object.freeze({wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false}),Object.freeze({wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true}),Object.freeze({wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false}),Object.freeze({wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false}),Object.freeze({wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true}),Object.freeze({wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false}),Object.freeze({wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true}),Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);Object.freeze(ze.map(e=>e.wireCode));var fn=Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict"}),Nt=Object.freeze(ze.map(e=>Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:fn[e.wireCode]}))),mn=new Map(Nt.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),gn=Object.freeze(["http_envelope",...[...new Set(Nt.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function ge(e,r){if(typeof e!="string")return;let t=e.trim().toUpperCase();if(t.length!==0)for(let n of [r??"http_envelope",...gn]){let a=mn.get(n+t);if(a)return a}}o(ge,"contractErrorFor");function bn(e){return e.envelope==="sse_frame"?`/errors#sse-${e.wireCode}`:e.envelope==="oauth_error"?`/errors#oauth-${e.wireCode}`:`/errors#${e.wireCode}`}o(bn,"contractDocUrl");function Lt(e){return null}o(Lt,"publishedDocUrl");var hn=Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function Mt(e){return hn[e]}o(Mt,"categoryFor");function Vt(e){let r=ge(e);if(r)return r.normalized;let t=(e??"").trim().toUpperCase(),n=t.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return "authRejected";if(t.startsWith("AUTH"))return "authExpired";switch(n){case "DAILYQUOTAEXCEEDED":case "QUOTAEXCEEDED":return "quotaExceeded";case "RATELIMITED":case "TOOMANYREQUESTS":case "TELEVETRATELIMITED":return "rateLimited";case "IDEMPOTENCYKEYCONFLICT":case "IDEMPOTENCYCONFLICT":return "idempotencyConflict";case "ACCESSDENIED":case "FORBIDDEN":return "accessDenied";case "NOTFOUND":case "CONVERSATIONNOTFOUND":return "conversationNotFound";case "PETNOTFOUND":return "petNotFound";case "TIMEOUT":case "STREAMTIMEOUT":return "streamTimeout";case "MEDIAUPLOADFAILED":case "UNRECOGNIZEDVIDEOFORMAT":case "FILETOOSMALL":return "mediaUploadFailed";case "MODERATIONBLOCKED":return "moderationBlocked";case "UPSTREAMLLMTIMEOUT":return "upstreamLlmTimeout";case "INTERNALERROR":case "INTERNALSERVERERROR":return "internalError";case "STREAMINCOMPLETE":case "CHATSTREAMINCOMPLETE":return "streamIncomplete";case "INVALIDANALYSISTYPE":case "INVALIDUPLOADPURPOSE":return "unknown";default:return "unknown"}}o(Vt,"fromWire");var Rn=new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function Ne(e){return Rn.has(e)}o(Ne,"isAutoRetryable");var vn=new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function Bt(e){return Ne(e)||vn.has(e)}o(Bt,"isRetryableCode");var _n=500,Le=8e3,qt=4;function Ut(e,r=Math.random){let t=Math.max(0,e),n=Math.min(_n*2**t,Le);return Math.floor(r()*n)}o(Ut,"backoffDelayMs");var En=Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:"This feature isn't available on your account right now.",paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:"Something in that request was not right. Check the details and try again.",sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",unknown:"Something went wrong. Please try again."});function Me(e){return En[e]}o(Me,"userFacingError");function Ht(e,r,t){Object.defineProperty(e,r,{value:t,enumerable:false,writable:false,configurable:false});}o(Ht,"defineHidden");var wn=/^[a-z][a-z0-9_]{0,63}$/;function q(e,r){let t=ge(r?.wireCode,r?.wireEnvelope),n={code:e,category:Mt(e),retryable:r?.retryable??Bt(e),displayMessage:Me(e)};if(r?.httpStatus!==void 0&&(n.httpStatus=r.httpStatus),r?.requestId&&(n.requestId=r.requestId),typeof r?.reasonCode=="string"&&wn.test(r.reasonCode)&&(n.reasonCode=r.reasonCode),t);return r?.wireMessage&&Ht(n,"wireMessage",r.wireMessage),r?.raw!==void 0&&r.raw!==null&&Ht(n,"raw",r.raw),Object.freeze(n)}o(q,"makeEverfurError");function Y(e,r){return Object.freeze(r===void 0?{ok:true,value:e}:{ok:true,value:e,warning:r})}o(Y,"ok");function I(e){return Object.freeze({ok:false,error:e})}o(I,"err");var be=class be extends Error{constructor(r,t){super(t),this.name="EverfurConfigError",this.kind=r,Object.setPrototypeOf(this,be.prototype);}};o(be,"EverfurConfigError");var oe=be;function Wt(e){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(e)}`)}o(Wt,"assertNever");function $t(e){return Object.freeze({kind:"error",terminal:true,code:e.code,retryable:e.retryable,wireMessage:e.wireMessage,synthesized:e.synthesized,lastEventId:e.lastEventId,serverRequestId:e.serverRequestId??null})}o($t,"errorFrame");function Cn(e){let r={};return e.mode==="personalized"?r.authorization=`Bearer ${e.token}`:r["x-everfur-partner-key"]=e.publishableKey,e.userRef&&(r["x-everfur-user-ref"]=e.userRef),e.sessionId&&(r["x-everfur-session-id"]=e.sessionId),r}o(Cn,"authHeaders");function ie(e,r){return {...e,headers:{...Tn(e.headers),...Cn(r)}}}o(ie,"withAuthHeaders");function Tn(e){if(!e)return {};let r={};for(let[t,n]of Object.entries(e)){let a=t.toLowerCase();a==="authorization"||a==="x-everfur-partner-key"||(r[t]=n);}return r}o(Tn,"stripAuthHeaders");async function Yt(e,r){if(r.mode==="anonymous")return r.transport.request(ie(e,{mode:"anonymous",publishableKey:r.publishableKey,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));let t;try{t=await r.identity.currentToken();}catch{return I(Ve())}let n=await r.transport.request(ie(e,{mode:"personalized",token:t,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));if(n.ok||n.error.httpStatus!==401)return n;let a;try{a=await r.identity.currentToken({forceRefresh:!0});}catch{return I(Ve())}let s=await r.transport.request(ie(e,{mode:"personalized",token:a,userRef:r.userRef,...r.sessionId?{sessionId:r.sessionId}:{}}));return !s.ok&&s.error.httpStatus===401?I(Ve(s.error.httpStatus)):s}o(Yt,"authedSend");function Ve(e){return q("authRejected",{retryable:false,...e!==void 0?{httpStatus:e}:{}})}o(Ve,"authRejectedError");function Kt(e){return q("internalError",{retryable:true,wireMessage:kn(e)})}o(Kt,"networkError");function kn(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}o(kn,"describeCause");var On=3e4,Fn=Le*2,In="idempotency-key",Pn=new Set(["POST","PUT","PATCH","DELETE"]),Dn=Object.freeze({onEvent(){}}),An=Object.freeze({setTimeout:o((e,r)=>setTimeout(e,r),"setTimeout"),clearTimeout:o(e=>clearTimeout(e),"clearTimeout"),now:o(()=>Date.now(),"now")});function jn(e){let r=e.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return r.length===0?null:`efs_${r}`.slice(0,128)}o(jn,"seededIdempotencyKey");function Xt(e){let r=e.observer??Dn,t=e.timers??An,n=e.rng??Math.random,a=e.sleep??((b,E)=>Gn(b,t,E)),s=e.maxAttempts??qt,l=e.unaryTimeoutMs??On,c=e.newIdempotencyKey??Nn(),i=o(b=>{try{r.onEvent(b);}catch{}},"emit");async function u(b,E,C){let O=C?.maxAttempts,P=Math.max(1,O??s),z=C?.idempotent??Pn.has(E.method),N=C?.idempotencyKey===void 0?null:jn(C.idempotencyKey),H=z?N??c():null,Wr=zn(E,H),Ce=0;for(;;){let Z=o(ke=>Object.freeze({call:b,method:E.method,path:E.path,attempt:Ce,...H?{idempotencyKey:H}:{},...ke}),"stamp");i(Z({phase:"attempt"}));let ct=Yn(l,t),ut=Kn(ct.signal,E.signal),ee;try{ee=await Yt({...Wr,signal:ut.signal},e.auth);}catch(ke){ee=I(Kt(ke));}finally{ut.dispose(),ct.cancel();}if(ee.ok)return i(Z({phase:"settled",ok:true,reason:"ok"})),ee;let B=ee.error,ue=Mn(B,Ce,{maxAttempts:P,rng:n,now:t.now(),aborted:E.signal?.aborted===true,...O!==void 0?{perCallMaxAttempts:O}:{},...e.errorPolicy!==void 0?{policy:e.errorPolicy}:{}}),Te={ok:false,code:B.code,reason:ue.reason,...B.httpStatus!==void 0?{httpStatus:B.httpStatus}:{},...B.requestId!==void 0?{requestId:B.requestId}:{}};if(!ue.retry)return i(Z({phase:"settled",...Te})),I(B);if(i(Z({phase:"retry",...Te,delayMs:ue.delayMs})),await a(ue.delayMs,E.signal),E.signal?.aborted===true)return i(Z({phase:"settled",...Te,reason:"aborted"})),I(B);Ce+=1;}}o(u,"send");async function p(b){return ie(b,await $n(e.auth))}o(p,"authorize");async function*h(b,E,C){i(Object.freeze({call:b,phase:"stream.open",method:E.method,path:E.path,attempt:0}));try{yield*e.auth.transport.stream(E,C);}catch{yield $t({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:null});}}return o(h,"stream"),Object.freeze({send:u,authorize:p,stream:h})}o(Xt,"createRequestFunnel");function zn(e,r){let t={};for(let[n,a]of Object.entries(e.headers??{}))n.toLowerCase()!==In&&(t[n]=a);return r!==null&&(t["Idempotency-Key"]=r),{...e,headers:t}}o(zn,"assembleHeaders");function Nn(){let e=0;return ()=>`efk_${Date.now().toString(36)}_${(e++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}o(Nn,"defaultIdempotencyKeyFactory");var Ln=10;function Mn(e,r,t){if(t.aborted)return {retry:false,reason:"aborted"};let n=Vn(e);if(n==="quota")return {retry:false,reason:"daily-quota-exhausted"};if(n!=="burst"&&!Ne(e.code))return {retry:false,reason:"terminal-code"};let a=n==="burst"?"burst-throttle":"retryable-code";if(o(()=>{if(t.policy===void 0)return false;try{return !t.policy.shouldRetry(e.code,r)}catch{return false}},"policyVetoedRetry")())return {retry:false,reason:"terminal-code"};let l=o(()=>{if(t.policy===void 0)return null;let u;try{u=t.policy.maxAttempts(e.code);}catch{return null}return typeof u!="number"||!Number.isFinite(u)?null:Math.max(1,Math.min(Ln,Math.floor(u)))},"policyCeiling"),c=t.perCallMaxAttempts??l()??t.maxAttempts;if(r+1>=c)return {retry:false,reason:"attempts-exhausted"};let i=Bn(e,t.now);return i!==null?i>Fn?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:a,delayMs:i}:{retry:true,reason:a,delayMs:Ut(r,t.rng)}}o(Mn,"decideRetry");function Vn(e){let r=e.code==="unknown"?Vt(Wn(e.raw)):e.code;return r==="quotaExceeded"?"quota":r==="rateLimited"||e.httpStatus===429?"burst":null}o(Vn,"throttleKind");function Bn(e,r){let t=Un(e.raw);if(t!==null){let a=t-r;return a>0?a:0}let n=qn(e.raw);return n===null?null:Math.round(n*1e3)}o(Bn,"retryOverrideMs");function qn(e){for(let r of Be(e)){let t=r.retry_after_seconds;if(typeof t=="number"&&Number.isFinite(t)&&t>=0)return t}return null}o(qn,"findRetryAfterSeconds");function Un(e){for(let r of Be(e)){let t=r.resets_at,n=Hn(t);if(n!==null)return n}return null}o(Un,"findResetsAt");function Be(e){if(!Gt(e))return [];let r=[e];for(let t of ["error","detail"]){let n=e[t];Gt(n)&&r.push(n);}return r}o(Be,"candidateScopes");function Hn(e){if(typeof e=="number"&&Number.isFinite(e))return e<1e11?Math.round(e*1e3):Math.round(e);if(typeof e=="string"&&e.trim().length>0){let r=Date.parse(e);return Number.isFinite(r)?r:null}return null}o(Hn,"parseInstantMs");function Wn(e){for(let r of Be(e)){let t=r.code;if(typeof t=="string"&&t.length>0)return t}return null}o(Wn,"rawWireCode");function Gt(e){return typeof e=="object"&&e!==null}o(Gt,"isRecord");async function $n(e){return e.mode==="anonymous"?{mode:"anonymous",publishableKey:e.publishableKey,userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}:{mode:"personalized",token:await e.identity.currentToken(),userRef:e.userRef,...e.sessionId?{sessionId:e.sessionId}:{}}}o($n,"resolveDeviceAuth");function Yn(e,r){let t=new AbortController,n=r.setTimeout(()=>t.abort(),e);return {signal:t.signal,cancel:o(()=>r.clearTimeout(n),"cancel")}}o(Yn,"boundedSignal");function Kn(e,r){let t=o(()=>{},"noop");if(!r)return {signal:e,dispose:t};let n=new AbortController;if(e.aborted||r.aborted)return n.abort(),{signal:n.signal,dispose:t};let a=o(()=>n.abort(),"onAbort");return e.addEventListener("abort",a,{once:true}),r.addEventListener("abort",a,{once:true}),{signal:n.signal,dispose:o(()=>{e.removeEventListener("abort",a),r.removeEventListener("abort",a);},"dispose")}}o(Kn,"mergeSignals");function Gn(e,r,t){return e<=0||t?.aborted===true?Promise.resolve():new Promise(n=>{let a=r.setTimeout(()=>{t?.removeEventListener("abort",s),n();},e),s=o(()=>{r.clearTimeout(a),n();},"onAbort");t?.addEventListener("abort",s,{once:true});})}o(Gn,"delayAbortable");function qe(e){for(let r=0;r<e.length;r+=1){let t=e.charCodeAt(r);if(t>=55296&&t<=56319){let n=e.charCodeAt(r+1);if(!(n>=56320&&n<=57343))return true;r+=1;}else if(t>=56320&&t<=57343)return true}return false}o(qe,"hasLoneSurrogate");var Qt=64,Jt=512;function Qn(e){return e==="owner_reported"||e==="clinic_document"?e:null}o(Qn,"normalizeOrigin");zod.z.object({request_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),status:zod.z.string(),simple_status:zod.z.string().nullish(),simple_status_detail:zod.z.string().nullish(),status_label:zod.z.string().optional(),dispatch_status:zod.z.string().nullish(),can_retry_send:zod.z.boolean().optional(),can_revoke:zod.z.boolean().optional(),can_convert_to_upload:zod.z.boolean().optional(),can_update_clinic_email:zod.z.boolean().optional(),reminder_count:zod.z.number().int().nonnegative().optional(),last_reminder_at:zod.z.string().nullish(),waiting_expectation:zod.z.string().nullish(),document_count:zod.z.number().optional(),held_item_count:zod.z.number().optional(),received_at:zod.z.string().nullish(),parsing_started_at:zod.z.string().nullish(),review_started_at:zod.z.string().nullish(),created_at:zod.z.string().optional(),updated_at:zod.z.string().optional(),source:zod.z.string().nullish().catch(null),action_needed_label:zod.z.string().nullish().catch(null),failure_reason:zod.z.string().nullish().catch(null),failure_code:zod.z.string().nullish().catch(null),recovery_stage:zod.z.string().nullish().catch(null),show_clinic_phone:zod.z.boolean().optional().catch(void 0),clinic_name:zod.z.string().nullish().catch(null),clinic_email:zod.z.string().nullish().catch(null),clinic_phone:zod.z.string().nullish().catch(null),converted_to_upload_at:zod.z.string().nullish().catch(null),request_group_id:zod.z.string().nullish().catch(null)}).passthrough();zod.z.object({request_group_id:zod.z.string().min(1),pet_ref:zod.z.string().min(1),total:zod.z.number().int().nonnegative(),responded:zod.z.number().int().nonnegative(),pending:zod.z.number().int().nonnegative(),members:zod.z.array(zod.z.unknown())});zod.z.object({source_doc_id:zod.z.string().min(1),request_id:zod.z.string().min(1)});var Jn=zod.z.object({label:zod.z.string(),value:zod.z.string()}),Ue=zod.z.object({key:zod.z.string(),category:zod.z.string().optional(),label:zod.z.string().optional(),value:zod.z.string().nullish(),unit:zod.z.string().nullish(),observed_at:zod.z.string().nullish(),status:zod.z.string().nullish(),origin:zod.z.string().nullish(),canonical_key:zod.z.string().nullish()}),Zn=zod.z.object({at:zod.z.string(),value:zod.z.number().nullish(),display:zod.z.string().nullish(),origin:zod.z.string().nullish()}),eo=zod.z.object({key:zod.z.string(),label:zod.z.string().optional(),points:zod.z.array(Zn).optional()}),to=zod.z.object({title:zod.z.string(),detail:zod.z.string().nullish(),due_at:zod.z.string().nullish()}),He=zod.z.object({doc_id:zod.z.string(),title:zod.z.string().nullish(),page_count:zod.z.number().nullish(),received_at:zod.z.string().nullish()});function Zt(e){return Object.freeze({key:e.key,category:e.category??"",label:e.label??e.key,value:e.value??null,unit:e.unit??null,observedAt:e.observed_at??null,status:e.status??null,origin:Qn(e.origin),canonicalKey:e.canonical_key??null})}o(Zt,"mapEntityRow");function er(e){return Object.freeze({docId:e.doc_id,title:e.title??null,pageCount:e.page_count??null,receivedAt:e.received_at??null})}o(er,"mapDocumentRow");zod.z.object({identity:zod.z.array(Jn).optional(),entities:zod.z.array(Ue).optional(),entity_series:zod.z.array(eo).optional(),forward_looking:zod.z.array(to).optional(),documents:zod.z.array(He).optional()});zod.z.object({pet_ref:zod.z.string().optional(),granted:zod.z.boolean().optional(),version:zod.z.string().nullish(),granted_at:zod.z.string().nullish()});var _=zod.z.string().nullish(),he=zod.z.number().nullish(),ro=zod.z.object({collected_at:_,at:_,value:he,unit:_,qualitative_result:_,ref_low:he,ref_high:he,status:_,source_clinic:_,source_doc_id:_,doc_id:_,reviewed:zod.z.boolean().nullish()}),no=zod.z.object({collected_at:_,at:_,value:he,unit:_,qualitative_result:_,status:_}),oo=zod.z.object({marker_id:zod.z.string().min(1),canonical_name:_,name:_,loinc_code:_,canonical_unit:_,unit:_,panel_name:_,panel:_,meaning_text:_,meaning:_,latest:no.nullish(),trajectory:_,points:zod.z.array(ro).optional()}),io=zod.z.object({total_markers:zod.z.number().int().nonnegative(),in_range_count:zod.z.number().int().nonnegative(),out_of_range_count:zod.z.number().int().nonnegative(),unknown_count:zod.z.number().int().nonnegative()}),ao=zod.z.object({markers:zod.z.array(oo).optional(),summary:io.nullish(),disclaimer:zod.z.string().optional(),featured_marker_id:_});function so(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(so,"isObject");function tr(e){return Object.freeze({petRef:e,withheld:true,markers:Object.freeze([]),summary:null,disclaimer:"",featuredMarkerId:null})}o(tr,"withheldMarkers");function rr(e,r){let t=so(r)?r:{},n=typeof t.pet_ref=="string"&&t.pet_ref.length>0?t.pet_ref:e;if(t.withheld===true)return tr(n);let a=ao.safeParse(t);if(!a.success)return tr(n);let s=a.data,l=o(i=>Object.freeze({at:i.collected_at??i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,sourceClinic:i.source_clinic??null,docId:i.source_doc_id??i.doc_id??null,reviewed:i.reviewed===true}),"point"),c=(s.markers??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.canonical_name??i.name??i.marker_id,loincCode:i.loinc_code??null,unit:i.canonical_unit??i.unit??null,panel:i.panel_name??i.panel??null,meaning:i.meaning_text??i.meaning??null,latest:i.latest?Object.freeze({at:i.latest.collected_at??i.latest.at??null,value:i.latest.value??null,unit:i.latest.unit??null,qualitativeResult:i.latest.qualitative_result??null,status:i.latest.status??null}):null,trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(l))}));return Object.freeze({petRef:n,withheld:false,markers:Object.freeze(c),summary:s.summary?Object.freeze({totalMarkers:s.summary.total_markers,inRangeCount:s.summary.in_range_count,outOfRangeCount:s.summary.out_of_range_count,unknownCount:s.summary.unknown_count}):null,disclaimer:s.disclaimer??"",featuredMarkerId:s.featured_marker_id??null})}o(rr,"mapRecordMarkers");var nr=128,M=128;var lo=zod.z.string().min(1).refine(e=>e.startsWith("https://")),co=zod.z.object({source_doc_id:zod.z.string().min(1),file_name:zod.z.string().nullish(),doc_format:zod.z.string().nullish(),byte_size:zod.z.number().int().nonnegative().nullish(),received_at:zod.z.string().nullish(),download_url:lo,expires_in_seconds:zod.z.number().int().nonnegative().nullish()}),uo=zod.z.object({items:zod.z.array(zod.z.unknown()).optional()});function or(e){let r=uo.safeParse(e);if(!r.success)return null;let t=[];for(let n of r.data.items??[]){let a=co.safeParse(n);a.success&&t.push(Object.freeze({sourceDocId:a.data.source_doc_id,fileName:a.data.file_name??null,docFormat:a.data.doc_format??null,byteSize:a.data.byte_size??null,receivedAt:a.data.received_at??null,downloadUrl:a.data.download_url,expiresInSeconds:a.data.expires_in_seconds??0}));}return Object.freeze(t)}o(or,"mapRequestDocuments");var Re=Object.freeze(["vet","groomer","boarding"]),po=zod.z.string().min(1).refine(e=>e.startsWith("https://")),K=zod.z.string().nullish(),We=zod.z.unknown().optional(),yo=zod.z.object({share_id:zod.z.string().min(1),share_url:zod.z.string().min(1),expires_at:K,audience:We}),fo=zod.z.object({shares:zod.z.array(zod.z.object({share_id:zod.z.string().min(1),expires_at:K,created_at:K,view_count:zod.z.number().int().nonnegative().nullish(),last_viewed_at:K,audience:We})).optional()}),mo=zod.z.object({download_url:po,expires_at:K}),go=zod.z.object({share_id:zod.z.string().min(1),expires_at:K,audience:We}),bo=zod.z.object({audience:zod.z.string().min(1),sections:zod.z.array(zod.z.string()),entity_types:zod.z.array(zod.z.string()).nullable()}),ho=254;function ir(e){let r=e.trim();return r.length>0&&r.length<=ho&&/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(r)}o(ir,"isShareRecipientEmail");var ar=o(e=>typeof e=="string"&&Re.includes(e),"isAudience");function $e(e){return ar(e)?e:null}o($e,"audienceOf");function sr(e){let r=zod.z.array(bo).safeParse(e);if(!r.success)return Object.freeze([]);let t=new Set,n=[];for(let a of r.data)!ar(a.audience)||t.has(a.audience)||(t.add(a.audience),n.push(Object.freeze({audience:a.audience,sections:Object.freeze([...a.sections]),entityTypes:a.entity_types===null?null:Object.freeze([...a.entity_types])})));return Object.freeze(n)}o(sr,"mapShareAudiences");function Ro(e,r){let t=e.trim();if(t.length===0)return null;try{let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?new URL(t):r!==void 0?new URL(t,r):null;return n===null||n.protocol!=="https:"?null:n.toString()}catch{return null}}o(Ro,"resolveShareUrl");function lr(e,r){let t=yo.safeParse(e);if(!t.success)return null;let n=Ro(t.data.share_url,r);return n===null?null:Object.freeze({shareId:t.data.share_id,shareUrl:n,expiresAt:t.data.expires_at??null,audience:$e(t.data.audience)})}o(lr,"mapRecordShareLink");function dr(e){let r=fo.safeParse(e);return r.success?Object.freeze((r.data.shares??[]).map(t=>Object.freeze({shareId:t.share_id,expiresAt:t.expires_at??null,createdAt:t.created_at??null,viewCount:t.view_count??0,lastViewedAt:t.last_viewed_at??null,audience:$e(t.audience)}))):null}o(dr,"mapRecordShareList");function cr(e){let r=go.safeParse(e);return r.success?Object.freeze({shareId:r.data.share_id,expiresAt:r.data.expires_at??null,audience:$e(r.data.audience)}):null}o(cr,"mapRecordShareEmailReceipt");function ur(e){let r=mo.safeParse(e);return r.success?Object.freeze({downloadUrl:r.data.download_url,expiresAt:r.data.expires_at??null}):null}o(ur,"mapRecordPdfLink");var pr="application/pdf",vo=Object.freeze(["image/jpeg","image/png","image/heic","image/heif"]),ve=Object.freeze({features:Object.freeze({}),uploadContentTypes:Object.freeze([pr]),shareAudiences:Object.freeze([])}),_o=zod.z.object({features:zod.z.record(zod.z.boolean()),upload_content_types:zod.z.array(zod.z.string()).nullish(),share_audiences:zod.z.unknown().optional()});function yr(e){let r=_o.safeParse(e);if(!r.success)return ve;let t=r.data.upload_content_types??[],n=vo.filter(a=>t.includes(a));return Object.freeze({features:Object.freeze({...r.data.features}),uploadContentTypes:Object.freeze([pr,...n]),shareAudiences:sr(r.data.share_audiences)})}o(yr,"mapRecordsFeatures");var Eo=zod.z.object({signatures:zod.z.array(zod.z.object({signature_id:zod.z.string().min(1),preview_url:zod.z.string().min(1).refine(e=>e.startsWith("https://")),created_at:zod.z.string().nullish()})).optional()});function fr(e){let r=Eo.safeParse(e);return r.success?Object.freeze((r.data.signatures??[]).map(t=>Object.freeze({signatureId:t.signature_id,previewUrl:t.preview_url,createdAt:t.created_at??null}))):null}o(fr,"mapSignatureSuggestions");var m=zod.z.string().nullish(),ae=zod.z.number().nullish(),wo=zod.z.object({at:m,value:ae,unit:m,qualitative_result:m,ref_low:ae,ref_high:ae,status:m,doc_id:m}),xo=zod.z.object({marker_id:zod.z.string(),name:zod.z.string(),loinc_code:m,unit:m,panel:m,meaning:m,latest:zod.z.object({at:m,value:ae,unit:m,qualitative_result:m,status:m}).nullish(),trajectory:m,points:zod.z.array(wo).optional()}),So=zod.z.object({encounter_id:zod.z.string(),date:m,type:m,clinic_name:m,veterinarian:m,doc_id:m}),Co=zod.z.object({note_id:zod.z.string(),encounter_id:m,observed_on:m,sections:zod.z.array(zod.z.object({section:zod.z.string(),text:zod.z.string()})).optional()}),To=zod.z.object({exam_id:zod.z.string(),encounter_id:m,observed_on:m,doc_id:m,systems:zod.z.record(zod.z.object({finding_status:m,finding:m})).optional()}),ko=zod.z.object({has_lab_history:zod.z.boolean().optional(),has_vaccination_history:zod.z.boolean().optional(),has_weight_history:zod.z.boolean().optional(),has_vitals_history:zod.z.boolean().optional(),has_physical_exam_history:zod.z.boolean().optional(),has_procedure_history:zod.z.boolean().optional(),has_genetic_history:zod.z.boolean().optional(),has_reproductive_history:zod.z.boolean().optional(),has_parasite_prevention_history:zod.z.boolean().optional(),earliest_record_at:m,latest_record_at:m,documents_ingested:zod.z.number().int().nonnegative().optional(),documents_in_review:zod.z.number().int().nonnegative().optional(),entities_pending_review:zod.z.record(zod.z.number().int().nonnegative()).optional(),held_total:zod.z.number().int().nonnegative().optional()}),Oo=zod.z.object({conflict_id:zod.z.string(),entity_type:zod.z.string(),field:m,severity:m,candidates:zod.z.array(zod.z.object({value:zod.z.string(),source_doc_id:m,doc_id:m,collected_at:m})).optional()}),Fo=zod.z.object({lab_results:zod.z.array(xo).optional(),encounters:zod.z.array(So).optional(),clinician_notes:zod.z.array(Co).optional(),physical_exams:zod.z.array(To).optional(),completeness:ko.nullish(),conflicts:zod.z.array(Oo).optional()}),Io=zod.z.object({visits:zod.z.array(zod.z.object({visit_id:zod.z.string(),visit_date:m,veterinarian:m,summary:m,doc_id:m})),vaccines:zod.z.array(zod.z.object({vaccine_id:zod.z.string(),product:m,lot:m,administered_on:m,expires_on:m,doc_id:m})),weights:zod.z.array(zod.z.object({weight_id:zod.z.string(),observed_on:m,weight_kg:ae,doc_id:m})),medications:zod.z.array(zod.z.object({medication_id:zod.z.string(),drug_name:m,dose:m,route:m,frequency:m,sig:m,rx_number:m,started_on:m,stopped_on:m,doc_id:m})),disclaimer:zod.z.string().optional()}),Po=zod.z.object({document:He,contributions:zod.z.array(Ue),contribution_count:zod.z.number().int().nonnegative().optional()});function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ke,"isObject");function Ge(e,r){return typeof e.pet_ref=="string"&&e.pet_ref.length>0?e.pet_ref:r}o(Ge,"petOf");function Ye(e,r){return Object.freeze({petRef:e,available:false,withheld:r,labResults:Object.freeze([]),encounters:Object.freeze([]),clinicianNotes:Object.freeze([]),physicalExams:Object.freeze([]),completeness:null,conflicts:Object.freeze([])})}o(Ye,"emptyDepth");function gr(e,r){let t=Ke(r)?r:{},n=Ge(t,e);if(t.withheld===true)return Ye(n,true);if(!["lab_results","encounters","clinician_notes","physical_exams","completeness","conflicts"].some(i=>i in t))return Ye(n,false);let s=Fo.safeParse(t);if(!s.success)return Ye(n,true);let l=s.data,c=o(i=>Object.freeze({at:i.at??null,value:i.value??null,unit:i.unit??null,qualitativeResult:i.qualitative_result??null,refLow:i.ref_low??null,refHigh:i.ref_high??null,status:i.status??null,docId:i.doc_id??null}),"point");return Object.freeze({petRef:n,available:true,withheld:false,labResults:Object.freeze((l.lab_results??[]).map(i=>Object.freeze({markerId:i.marker_id,name:i.name,loincCode:i.loinc_code??null,unit:i.unit??null,panel:i.panel??null,meaning:i.meaning??null,latest:Object.freeze({at:i.latest?.at??null,value:i.latest?.value??null,unit:i.latest?.unit??null,qualitativeResult:i.latest?.qualitative_result??null,status:i.latest?.status??null}),trajectory:i.trajectory??null,points:Object.freeze((i.points??[]).map(c))}))),encounters:Object.freeze((l.encounters??[]).map(i=>Object.freeze({encounterId:i.encounter_id,date:i.date??null,type:i.type??null,clinicName:i.clinic_name??null,veterinarian:i.veterinarian??null,docId:i.doc_id??null}))),clinicianNotes:Object.freeze((l.clinician_notes??[]).map(i=>Object.freeze({noteId:i.note_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,sections:Object.freeze((i.sections??[]).map(u=>Object.freeze({section:u.section,text:u.text})))}))),physicalExams:Object.freeze((l.physical_exams??[]).map(i=>Object.freeze({examId:i.exam_id,encounterId:i.encounter_id??null,observedOn:i.observed_on??null,docId:i.doc_id??null,systems:Object.freeze(Object.entries(i.systems??{}).map(([u,p])=>Object.freeze({system:u,findingStatus:p.finding_status??null,finding:p.finding??null})))}))),completeness:l.completeness?Object.freeze({hasLabHistory:l.completeness.has_lab_history===true,hasVaccinationHistory:l.completeness.has_vaccination_history===true,hasWeightHistory:l.completeness.has_weight_history===true,hasVitalsHistory:l.completeness.has_vitals_history===true,hasPhysicalExamHistory:l.completeness.has_physical_exam_history===true,hasProcedureHistory:l.completeness.has_procedure_history===true,hasGeneticHistory:l.completeness.has_genetic_history===true,hasReproductiveHistory:l.completeness.has_reproductive_history===true,hasParasitePreventionHistory:l.completeness.has_parasite_prevention_history===true,earliestRecordAt:l.completeness.earliest_record_at??null,latestRecordAt:l.completeness.latest_record_at??null,documentsIngested:l.completeness.documents_ingested??0,documentsInReview:l.completeness.documents_in_review??0,entitiesPendingReview:Object.freeze({...l.completeness.entities_pending_review??{}}),heldTotal:l.completeness.held_total??0}):null,conflicts:Object.freeze((l.conflicts??[]).map(i=>Object.freeze({conflictId:i.conflict_id,entityType:i.entity_type,field:i.field??null,severity:i.severity??"needs_review",candidates:Object.freeze((i.candidates??[]).map(u=>Object.freeze({value:u.value,docId:u.source_doc_id??u.doc_id??null,collectedAt:u.collected_at??null})))})))})}o(gr,"mapRecordDepth");function mr(e){return Object.freeze({petRef:e,withheld:true,isEmpty:false,visits:Object.freeze([]),vaccines:Object.freeze([]),weights:Object.freeze([]),medications:Object.freeze([]),disclaimer:""})}o(mr,"withheldTimeline");function br(e,r){let t=Ke(r)?r:{},n=Ge(t,e);if(t.withheld===true)return mr(n);let a=Io.safeParse(t);if(!a.success)return mr(n);let s=a.data,l=s.visits.map(p=>Object.freeze({visitId:p.visit_id,visitDate:p.visit_date??null,veterinarian:p.veterinarian??null,summary:p.summary??null,docId:p.doc_id??null})),c=s.vaccines.map(p=>Object.freeze({vaccineId:p.vaccine_id,product:p.product??null,lot:p.lot??null,administeredOn:p.administered_on??null,expiresOn:p.expires_on??null,docId:p.doc_id??null})),i=s.weights.map(p=>Object.freeze({weightId:p.weight_id,observedOn:p.observed_on??null,weightKg:p.weight_kg??null,docId:p.doc_id??null})),u=s.medications.map(p=>Object.freeze({medicationId:p.medication_id,drugName:p.drug_name??null,dose:p.dose??null,route:p.route??null,frequency:p.frequency??null,sig:p.sig??null,rxNumber:p.rx_number??null,startedOn:p.started_on??null,stoppedOn:p.stopped_on??null,docId:p.doc_id??null}));return Object.freeze({petRef:n,withheld:false,isEmpty:l.length===0&&c.length===0&&i.length===0&&u.length===0,visits:Object.freeze(l),vaccines:Object.freeze(c),weights:Object.freeze(i),medications:Object.freeze(u),disclaimer:s.disclaimer??""})}o(br,"mapRecordsTimeline");function hr(e,r){let t=Ke(r)?r:{},n=Ge(t,e),a=o(()=>Object.freeze({petRef:n,withheld:true,document:null,contributions:Object.freeze([]),contributionCount:0}),"withheld");if(t.withheld===true)return a();let s=Po.safeParse(t);if(!s.success)return a();let l=Object.freeze(s.data.contributions.map(Zt));return Object.freeze({petRef:n,withheld:false,document:er(s.data.document),contributions:l,contributionCount:s.data.contribution_count??l.length})}o(hr,"mapDocumentContributions");var Do="/widget/v1/records/pets";function Rr(e){let r=e.funnel??Xt({auth:e.auth,...e.errorPolicy?{errorPolicy:e.errorPolicy}:{}}),t=o((i,u)=>typeof i=="string"&&i.length>0&&!qe(i)&&[...i].length<=u,"segment"),n=o(async(i,u,p,h)=>{if(!t(u,M))return A();let b=await r.send(i,{method:"GET",path:p});if(!b.ok)return b;let E=h(b.value);return E.petRef===u?Y(E):I(q("internalError",{retryable:false}))},"read"),a=o(i=>`${Do}/${encodeURIComponent(i)}`,"pet"),s=o(i=>`${a(i)}/everfur_record`,"record"),l=o(async(i,u,p)=>{let h=await r.send(i,u,u.method==="POST"?{idempotent:false,maxAttempts:1}:void 0);if(!h.ok)return h;let b=p(h.value);return b===null?I(q("internalError",{retryable:false})):Y(b)},"parsed"),c=o((i,u)=>!t(i.entityType,Qt)||!t(i.canonicalKey,Jt)||i.idempotencyKey!==void 0&&!t(i.idempotencyKey,nr)||u!==void 0&&Object.keys(u).length===0?null:{entity_type:i.entityType,canonical_key:i.canonicalKey,...u!==void 0?{corrected_fields:u}:{},...i.idempotencyKey!==void 0?{idempotency_key:i.idempotencyKey}:{}},"factBody");return {getRecordDepth:o(i=>n("records.depth.record",i,`${a(i)}/record`,u=>gr(i,u)),"getRecordDepth"),getTimeline:o(i=>n("records.depth.timeline",i,`${a(i)}/timeline`,u=>br(i,u)),"getTimeline"),getDocumentContributions(i,u){return t(u,64)?n("records.depth.contributions",i,`${a(i)}/documents/${encodeURIComponent(u)}/contributions`,p=>hr(i,p)):A()},getMarkers:o(i=>n("records.depth.markers",i,`${a(i)}/markers`,u=>rr(i,u)),"getMarkers"),createShare(i,u){if(!t(i,M))return A();let p=u?.audience;return p!==void 0&&!Re.includes(p)?A():l("records.share.create",{method:"POST",path:`${s(i)}/share`,...p!==void 0?{body:{audience:p}}:{}},h=>lr(h,e.apiBaseUrl))},emailShare(i,u){let p=u.recipientKind,h=typeof u.recipientEmail=="string"?u.recipientEmail.trim():"",b=p==="other"||Re.includes(p);return !t(i,M)||!b||!ir(h)||qe(h)?A():l("records.share.email",{method:"POST",path:`${s(i)}/share/email`,body:{recipient_email:h,recipient_kind:p}},cr)},async readFeatures(){try{let i=await r.send("records.getFeatures",{method:"GET",path:"/widget/v1/records/features"});return i.ok?yr(i.value):ve}catch{return ve}},listShares(i){return t(i,M)?l("records.share.list",{method:"GET",path:`${s(i)}/shares`},dr):A()},async revokeShare(i,u){if(!t(i,M)||!t(u,64))return A();let p=await r.send("records.share.revoke",{method:"DELETE",path:`${s(i)}/shares/${encodeURIComponent(u)}`},{idempotent:false,maxAttempts:1});return p.ok?Y(void 0):p},getPdfLink(i){return t(i,M)?l("records.pdf.link",{method:"GET",path:`${s(i)}/pdf-link`},ur):A()},async editFact(i,u){let p=t(i,M)?c(u,u.correctedFields):null;if(p===null)return A();let h=await r.send("records.fact.edit",{method:"POST",path:`${s(i)}/facts/edit`,body:p},{idempotent:false,maxAttempts:1});return h.ok?Y(void 0):h},async removeFact(i,u){let p=t(i,M)?c(u):null;if(p===null)return A();let h=await r.send("records.fact.remove",{method:"POST",path:`${s(i)}/facts/remove`,body:p},{idempotent:false,maxAttempts:1});return h.ok?Y(void 0):h},listRequestDocuments(i){return t(i,64)?l("records.request.documents",{method:"GET",path:`/widget/v1/records/requests/${encodeURIComponent(i)}/documents`},or):A()},listAuthorizationSignatures:o(()=>l("records.signatures.list",{method:"GET",path:"/widget/v1/records/authorization-signatures"},fr),"listAuthorizationSignatures")}}o(Rr,"createRecordsDepthClient");function A(){return Promise.resolve(I(q("validationFailed",{retryable:false})))}o(A,"invalid");var vr=Symbol.for("@everfur/sdk#EverfurContext@v1"),_r=globalThis,Er=_r[vr]??(_r[vr]=react.createContext(null));Er.displayName??="EverfurContext";function se(){let e=react.useContext(Er);if(e===null)throw new oe("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return e}o(se,"useEverfurContext");var Lo=new Map,wr=new Set;function Mo(e){return Lo.get(e)??0}o(Mo,"recordsConsentEpochOf");function Vo(e){return wr.add(e),()=>{wr.delete(e);}}o(Vo,"subscribe");function xr(e){let r=react.useCallback(()=>Mo(e),[e]);return react.useSyncExternalStore(Vo,r,r)}o(xr,"useRecordsConsentEpoch");function Cr(){let{runtime:e,userRef:r,scopeEpoch:t}=se();return react.useMemo(()=>{let{services:n}=e.registry;return Rr({auth:n.authFor(r),...n.errorPolicy?{errorPolicy:n.errorPolicy}:{},...typeof n.apiBaseUrl=="string"?{apiBaseUrl:n.apiBaseUrl}:{}})},[e,r,t])}o(Cr,"useEverfurRecordsDepthClient");function le(e,r,t,n=""){let a=Cr(),{userRef:s}=se(),l=xr(e),c=react.useMemo(()=>({}),[a,e,n,l]),[i,u]=react.useState({scope:c,value:null,error:null,loading:true}),p=react.useRef(0),h=react.useCallback(async()=>{let z=p.current+=1;if(u({scope:c,value:null,error:null,loading:true}),s===null){u({scope:c,value:null,error:null,loading:false});return}let N=await r(a,e);z===p.current&&(N.ok?u({scope:c,value:N.value,error:null,loading:false}):u({scope:c,value:null,error:N.error,loading:false}));},[a,e,r,c,s]);react.useEffect(()=>(h(),()=>{p.current+=1;}),[h]);let b=i.scope===c?i:{value:null,error:null,loading:true},E=react.useCallback(()=>{h();},[h]),C=b.error===null||b.error.httpStatus!==404,O=C?b.error:null,P=b.loading?"loading":O!==null?"error":b.value===null?"empty":b.value.withheld?"populated":t(b.value)?"empty":"populated";return react.useMemo(()=>({status:P,value:b.value,error:O,available:C,refresh:E}),[P,b.value,O,C,E])}o(le,"useRecordsDepthRead");var Ze=class Ze extends react.Component{constructor(){super(...arguments);this.state={failed:false,key:this.props.resetKey};}static getDerivedStateFromError(){return {failed:true}}static getDerivedStateFromProps(t,n){return Object.is(t.resetKey,n.key)?null:{failed:false,key:t.resetKey}}render(){return this.state.failed?this.props.fallback:this.props.children}};o(Ze,"HostRenderBoundary");var Qe=Ze;function Wo({render:e}){return e()}o(Wo,"RenderHost");function Je({render:e,fallback:r,resetKey:t}){return react.createElement(Qe,{fallback:r,resetKey:t,children:react.createElement(Wo,{render:e})})}o(Je,"HostRender");var $o=Object.freeze({chat:Object.freeze(["chat.message.create"]),records:Object.freeze(["records.upload.create","records.record.read"]),recordsClinic:Object.freeze(["records.clinic.create"]),video:Object.freeze(["video.gait.execute"]),photo:Object.freeze(["photo.checkup.execute"]),animations:Object.freeze(["animations.state.read"]),televet:Object.freeze(["televet.visit.create"])});function Yo(e){return $o[e]}o(Yo,"requires");function kr(e,r,t){let n=Yo(e),a=new Map;for(let c of r)a.set(c.resource,c);if(t?.isPending===true&&n.some(c=>!a.has(c)))return et({name:e,enabled:false,isPending:true,limits:{}});let s=Ko(n,a);return n.filter(c=>a.get(c)?.granted!==true).length===0?et({name:e,enabled:true,isPending:false,limits:s}):et({name:e,enabled:false,isPending:false,limits:s,disabled:Go(n,a)})}o(kr,"decideCapability");function Ko(e,r){let t={};for(let n of e){let a=r.get(n)?.limits;if(a)for(let[s,l]of Object.entries(a)){let c=t[s];t[s]=c===void 0?l:Math.min(c,l);}}return t}o(Ko,"mergeLimits");function Go(e,r){for(let t of e){let n=r.get(t)?.disabled;if(n)return Object.freeze({reason:n.reason,level:n.level,recoverable:n.recoverable})}return Object.freeze({reason:Me("accessDenied"),level:"user_entitlement",recoverable:false})}o(Go,"disabledFor");function et(e){let r={name:e.name,enabled:e.enabled,isPending:e.isPending,limits:Object.freeze({...e.limits})};return e.disabled!==void 0&&(r.disabled=e.disabled),Object.freeze(r)}o(et,"freezeDecision");function tt(e){let{runtime:r}=se(),t=r.entitlements,n=react.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot);return react.useMemo(()=>kr(e,n.decisions,{isPending:n.isPending}),[e,n])}o(tt,"useCapability");var Jo=48;function Zo(e){return e.isPending?"pending":e.enabled?"enabled":"disabled"}o(Zo,"selectView");function Pr(e){let{capability:r,children:t,renderDisabled:n,renderPending:a,style:s}=e,l=tt(r),c=react.useMemo(()=>Zo(l),[l]);switch(c){case "enabled":return t;case "pending":return a?jsxRuntime.jsx(Je,{render:a,fallback:jsxRuntime.jsx(Fr,{capability:r,style:s})}):jsxRuntime.jsx(Fr,{capability:r,style:s});case "disabled":return n?jsxRuntime.jsx(Je,{render:()=>n(l),fallback:jsxRuntime.jsx(Ir,{decision:l,style:s}),resetKey:l}):jsxRuntime.jsx(Ir,{decision:l,style:s});default:return Wt(c)}}o(Pr,"CapabilityGate");function Fr({capability:e,style:r}){let t=x(),n=react.useMemo(()=>Dr(t),[t]);return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityState:{busy:true},accessibilityLabel:`Loading ${e}`,children:jsxRuntime.jsx(reactNative.View,{style:n.skeletonBar})})}o(Fr,"PendingSkeleton");function Ir({decision:e,style:r}){let t=x(),n=react.useMemo(()=>Dr(t),[t]),a=e.disabled?.reason??"";return jsxRuntime.jsx(reactNative.View,{style:[n.offstate,r],accessible:true,accessibilityRole:"text",accessibilityLabel:a,children:a.length>0?jsxRuntime.jsx(g,{style:n.offstateText,children:a}):null})}o(Ir,"OffState");function Dr(e){let{color:r,space:t,radius:n,type:a}=e;return reactNative.StyleSheet.create({offstate:{minHeight:Jo,justifyContent:"center",paddingHorizontal:t.lg,paddingVertical:t.md,backgroundColor:r.surfaceCream,borderRadius:n.md,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder},offstateText:{...k(e,"regular"),fontSize:a.size.body,lineHeight:Math.round(a.size.body*a.lineHeight.normal),color:r.text.muted},skeletonBar:{height:t.md,borderRadius:n.xs,backgroundColor:r.brandSofter}})}o(Dr,"makeStyles");function Ar(e){let r=x(),t=react.useMemo(()=>ri(r),[r]);return jsxRuntime.jsx(g,{style:[t.footnote,e.style],accessibilityRole:"text",testID:"records-footnote",children:xt})}o(Ar,"RecordsFootnote");function ri(e){let{color:r,space:t,type:n}=e;return reactNative.StyleSheet.create({footnote:{...k(e,"regular"),paddingHorizontal:t.lg,paddingTop:t.md,paddingBottom:t.lg,textAlign:"center",fontSize:n.size.caption,lineHeight:Math.round(n.size.caption*n.lineHeight.normal),color:r.text.muted,backgroundColor:r.background}})}o(ri,"makeStyles");var jr=Object.freeze({idle:Object.freeze({title:"Find your pet\u2019s clinic",body:"Search for the clinic that holds your pet\u2019s records. We\u2019ll request them on your behalf once you sign the authorization.",action:null}),no_requests:Object.freeze({title:"No record requests yet",body:"When you request records from a clinic, you\u2019ll be able to track every step here.",action:null}),no_records:Object.freeze({title:"Nothing to show just yet",body:"Once your pet\u2019s records arrive and our team reviews them, lab trends and visits will appear here.",action:null}),rate_limited:Object.freeze({title:"Slow down a moment",body:"You\u2019ve made a lot of requests just now. You can try again shortly.",action:"Try again"}),service_unavailable:Object.freeze({title:"Records search is temporarily down",body:"We\u2019re working on it. Please try again in a few minutes.",action:"Try again"}),error:Object.freeze({title:"Couldn\u2019t reach Everfur",body:"Check your connection and try again.",action:"Try again"})}),ot=60;function zr(e){return `Try again in ${e}s`}o(zr,"coolingActionLabel");var Nr="Try again, available shortly";function _e({variant:e,onAction:r,message:t,testID:n}){let a=si(),s=jr[e],[l,c]=react.useState(e==="rate_limited"?ot:0);react.useEffect(()=>{e==="rate_limited"&&c(ot);},[e]),react.useEffect(()=>{if(l<=0)return;let p=setTimeout(()=>c(h=>Math.max(0,h-1)),1e3);return ()=>clearTimeout(p)},[l]);let i=e==="rate_limited"&&l>0,u=i?zr(l):s.action;return jsxRuntime.jsxs(reactNative.View,{style:a.container,accessibilityRole:"summary",testID:n,children:[jsxRuntime.jsx(reactNative.View,{style:a.glyph,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsx(g,{style:a.title,children:s.title}),jsxRuntime.jsx(g,{style:a.body,children:t??s.body}),u!==null&&r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,disabled:i,accessibilityRole:"button",accessibilityLabel:i?Nr:u,accessibilityState:{disabled:i},style:[a.action,i?a.actionDisabled:null],testID:n?`${n}-action`:`records-empty-${e}-action`,children:jsxRuntime.jsx(g,{style:a.actionLabel,children:u})}):null]})}o(_e,"RecordsEmptyState");function si(){let e=x();return react.useMemo(()=>li(e),[e])}o(si,"useStyles");function li(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,l=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({container:{paddingVertical:t.xxl,paddingHorizontal:t.xl,alignItems:"center",gap:t.sm+t.xs/2},glyph:{width:l,height:l,borderRadius:l/2,backgroundColor:r.brandSoft,borderWidth:reactNative.StyleSheet.hairlineWidth,borderColor:r.brandBorder,marginBottom:t.xs},title:{...k(e,"bold"),fontSize:a.size.subtitle,lineHeight:Math.round(a.size.subtitle*a.lineHeight.snug)-1,color:r.brandInk,textAlign:"center"},body:{...k(e,"regular"),fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.normal),color:r.text.muted,textAlign:"center",maxWidth:320},action:{marginTop:t.sm,minHeight:t.xxl+t.sm,borderRadius:n.pill,paddingHorizontal:t.lg+t.xs/2,backgroundColor:r.brand,alignItems:"center",justifyContent:"center",...te(s.primaryButton)},actionDisabled:{opacity:.5},actionLabel:{...k(e,"bold"),color:r.onPrimary,fontSize:a.size.bodyTight,lineHeight:Math.round(a.size.bodyTight*a.lineHeight.snug)-1,...re(s.primaryButton)}})}o(li,"makeStyles");var pi=120,yi=44;function fi({reason:e,onExit:r,exitLabel:t,style:n}){let{color:a,space:s,radius:l,type:c}=x();return jsxRuntime.jsxs(reactNative.View,{testID:"records-gate-off",style:[{minHeight:pi,justifyContent:"center",gap:s.md,padding:s.lg,borderRadius:l.md,borderWidth:1,borderColor:a.brandBorder,backgroundColor:a.surfaceCream},n],children:[e.length>0?jsxRuntime.jsx(g,{style:{fontSize:c.size.bodyTight,color:a.text.muted},children:e}):null,jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:t,testID:"records-gate-off-exit",style:{minHeight:yi,alignSelf:"flex-start",justifyContent:"center",paddingHorizontal:s.lg,borderRadius:l.pill,borderWidth:1.5,borderColor:a.brandInk},children:jsxRuntime.jsx(g,{style:{fontSize:c.size.body,color:a.brandInk},children:t})})]})}o(fi,"RecordsGateOffState");function Br(e,r){return e===void 0?{}:{renderDisabled:o(t=>jsxRuntime.jsx(fi,{reason:t.disabled?.reason??"",onExit:e,exitLabel:r}),"renderDisabled")}}o(Br,"recordsGateExit");var it="Back";function we({title:e,onBack:r,right:t,testID:n,variant:a="brand"}){let s=Ri();return jsxRuntime.jsxs(reactNative.View,{style:s.row,testID:n,children:[r?jsxRuntime.jsx(reactNative.Pressable,{onPress:r,accessibilityRole:"button",accessibilityLabel:it,hitSlop:12,style:s.back,testID:n?`${n}-back`:void 0,children:jsxRuntime.jsx(reactNative.View,{style:s.chevron,accessibilityElementsHidden:true,importantForAccessibility:"no"})}):jsxRuntime.jsx(reactNative.View,{style:s.back}),e.trim().length>0?jsxRuntime.jsx(g,{style:a==="document"?s.documentTitle:s.title,accessibilityRole:"header",numberOfLines:1,children:e}):jsxRuntime.jsx(reactNative.View,{style:s.spacer,accessibilityElementsHidden:true,importantForAccessibility:"no",testID:n?`${n}-spacer`:void 0}),jsxRuntime.jsx(reactNative.View,{style:s.right,children:t??jsxRuntime.jsx(reactNative.View,{style:s.back})})]})}o(we,"ScreenHeader");function Ri(){let e=x();return react.useMemo(()=>vi(e),[e])}o(Ri,"useStyles");function vi(e){let{color:r,space:t,type:n}=e,a=t.xxl+t.md,s=t.md,l=t.xs/2,c=t.lg+t.xs+t.xs/2;return reactNative.StyleSheet.create({row:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md,gap:t.sm},back:{width:a,height:a,alignItems:"center",justifyContent:"center"},chevron:{width:s,height:s,borderLeftWidth:l,borderBottomWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginLeft:t.xs},title:{flex:1,...k(e,"bold"),fontSize:n.size.heading,lineHeight:Math.round(n.size.heading*n.lineHeight.tight)+1,color:r.brandInk},spacer:{flex:1},documentTitle:{flex:1,textAlign:"center",...k(e,"bold"),fontSize:n.size.subtitle,lineHeight:Math.round(n.size.subtitle*n.lineHeight.snug),color:r.text.primary},right:{flexDirection:"row",alignItems:"center",gap:t.sm+t.xs/2},listGlyph:{width:c,height:c,justifyContent:"space-evenly"},listBar:{height:l,borderRadius:l,backgroundColor:r.brandInk},shareGlyph:{width:c-t.xs,height:c-t.xs},shareDot:{position:"absolute",width:t.xs+t.xs/2,height:t.xs+t.xs/2,borderRadius:t.xs,borderWidth:l,borderColor:r.brandInk},shareDotTop:{right:0,top:0},shareDotLeft:{left:0,top:t.xs+t.xs/2},shareDotBottom:{right:0,bottom:0},shareStroke:{position:"absolute",left:t.xs,top:t.sm,width:t.sm+t.xs/2,height:l,backgroundColor:r.brandInk},shareStrokeUp:{transform:[{rotate:"-30deg"}]},shareStrokeDown:{transform:[{rotate:"30deg"}]},sendGlyph:{width:c-t.xs,height:c-t.xs},sendBody:{position:"absolute",left:0,top:0,right:0,bottom:0,borderWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],borderRadius:l},sendFold:{position:"absolute",left:0,right:0,top:"50%",height:l,backgroundColor:r.brandInk},downloadGlyph:{width:c-t.xs,height:c-t.xs,alignItems:"center"},downloadStem:{width:l,height:t.sm+t.xs/2,backgroundColor:r.brandInk},downloadHead:{width:t.sm,height:t.sm,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk,transform:[{rotate:"45deg"}],marginTop:-t.sm},downloadTray:{position:"absolute",bottom:0,left:0,right:0,height:t.xs+t.xs/2,borderLeftWidth:l,borderRightWidth:l,borderBottomWidth:l,borderColor:r.brandInk}})}o(vi,"makeStyles");function J({width:e,height:r,radius:t,style:n}){let{color:a,radius:s}=x();return jsxRuntime.jsx(reactNative.View,{style:[{width:e,height:r,borderRadius:t??s.xs,backgroundColor:a.skeleton},n],accessibilityElementsHidden:true,importantForAccessibility:"no"})}o(J,"SkeletonBlock");var wi=44,xi=24,at=34,Si=6;function Ur({testID:e}){let r=Ci();return jsxRuntime.jsxs(reactNative.View,{style:r.timeline,accessible:true,accessibilityRole:"progressbar",accessibilityLabel:R.loadingTimeline,testID:e,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineDisclaimer,children:jsxRuntime.jsx(J,{width:"100%",height:wi,radius:12})}),Array.from({length:Si},(t,n)=>jsxRuntime.jsxs(reactNative.View,{children:[n>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,children:[jsxRuntime.jsx(J,{width:at,height:at,radius:at/2}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.timelineTop,children:[jsxRuntime.jsx(J,{width:44,height:10,radius:5}),jsxRuntime.jsx(J,{width:56,height:12,radius:6})]}),jsxRuntime.jsx(J,{width:"70%",height:14,radius:7}),n%2===0?jsxRuntime.jsx(J,{width:"45%",height:12,radius:6}):null]})]})]},n))]})}o(Ur,"TimelineSkeleton");var st=62;function Ci(){let e=x();return react.useMemo(()=>Ti(e),[e])}o(Ci,"useStyles");function Ti(e){let{color:r,space:t,radius:n}=e,a=reactNative.StyleSheet.hairlineWidth;return reactNative.StyleSheet.create({dashboard:{flex:1,paddingHorizontal:t.sm,paddingTop:t.xs,gap:t.lg,backgroundColor:r.background},inset:{paddingHorizontal:t.sm},summaryCard:{alignItems:"center",borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg+t.xs,gap:t.md+t.xs/2},badges:{flexDirection:"row",gap:t.md},carouselCard:{borderRadius:n.lg-t.xs,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,padding:t.lg},dots:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.xs+t.xs/2},centered:{alignSelf:"center"},actions:{gap:t.sm+t.xs/2},actionRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:n.md,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.lg,paddingVertical:t.lg},actionLeft:{flex:1,flexDirection:"row",alignItems:"center",gap:t.md},request:{paddingHorizontal:t.lg,paddingTop:t.xs,gap:t.lg+t.xs/2,backgroundColor:r.background},railRow:{flexDirection:"row",alignItems:"flex-start",gap:t.md},railColumn:{alignItems:"center",width:xi},connector:{marginVertical:t.xs/2},railBody:{flex:1,paddingBottom:t.lg+t.xs/2,gap:t.xs+t.xs/2},statusCard:{borderRadius:n.md,backgroundColor:r.brandSoft,padding:t.md+t.xs/2,gap:t.sm},timeline:{flex:1,backgroundColor:r.background},timelineDisclaimer:{paddingHorizontal:t.lg,paddingTop:t.xs,paddingBottom:t.md},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBody:{flex:1,gap:t.xs-1},timelineTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.sm},timelineSeparator:{height:a,backgroundColor:r.brandBorder,marginLeft:st},clinics:{gap:t.md},clinicRow:{borderRadius:n.lg-t.xs/2,borderWidth:a,borderColor:r.brandBorder,backgroundColor:r.surface,paddingHorizontal:t.md+t.xs/2,paddingVertical:t.md+t.xs/2,gap:t.sm},shares:{gap:t.md,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:a,borderColor:r.brandBorder},shareRow:{gap:t.xs+t.xs/2}})}o(Ti,"makeStyles");var Di=300,Ai=o((e,r)=>e.getTimeline(r),"readTimeline"),ji=o(e=>e.isEmpty,"timelineEmpty"),zi=o((e,r)=>e.getRecordDepth(r),"readDepth"),Ni=o(e=>!e.available||e.labResults.length+e.encounters.length+e.clinicianNotes.length+e.physicalExams.length===0,"depthEmpty"),Li=o(e=>e.contributions.length===0,"contributionsEmpty");function Mi({petRef:e,style:r,onBack:t}){let n=le(e,Ai,ji);return jsxRuntime.jsx(dt,{state:n,style:r,onBack:t,header:jsxRuntime.jsx(we,{title:R.timeline,onBack:ne(t),testID:"timeline-header"}),loading:jsxRuntime.jsx(Ur,{testID:"timeline-loading"}),empty:jsxRuntime.jsx(_e,{variant:"no_records",testID:"timeline-empty"}),render:a=>jsxRuntime.jsx(Hi,{timeline:a})})}o(Mi,"EverfurRecordsTimeline");function Vi({petRef:e,style:r,onBack:t}){let n=le(e,zi,Ni);return jsxRuntime.jsx(dt,{state:n,style:r,onBack:t,header:t?jsxRuntime.jsx(we,{title:$.records,onBack:ne(t)}):null,render:a=>jsxRuntime.jsx(Wi,{depth:a})})}o(Vi,"EverfurRecordDepth");function Bi({petRef:e,docId:r,style:t,onBack:n}){let a=react.useCallback((c,i)=>c.getDocumentContributions(i,r),[r]),s=le(e,a,Li,r),l=s.value?.document?.title?.trim()||R.uploadedDocument;return jsxRuntime.jsx(dt,{state:s,style:t,onBack:n,header:jsxRuntime.jsx(we,{title:l,onBack:ne(n),testID:"contributions-header"}),empty:jsxRuntime.jsx(_e,{variant:"no_records",testID:"contributions-empty"}),render:c=>jsxRuntime.jsx($i,{view:c})})}o(Bi,"EverfurDocumentContributions");function dt({state:e,style:r,header:t,loading:n,empty:a,render:s,onBack:l}){let c=Se();return jsxRuntime.jsx(Pr,{capability:"records",style:r,...Br(ne(l),it),children:jsxRuntime.jsxs(reactNative.View,{style:[c.container,r],children:[t??null,jsxRuntime.jsx(reactNative.View,{style:c.body,children:qi(e,s,c,n,a)}),jsxRuntime.jsx(Ar,{})]})})}o(dt,"DepthSurface");function qi(e,r,t,n,a){switch(e.status){case "loading":return n??jsxRuntime.jsx(Ui,{styles:t});case "empty":return a??jsxRuntime.jsx(reactNative.View,{style:t.centered,accessible:true,accessibilityRole:"summary",accessibilityLabel:$.empty,children:jsxRuntime.jsx(reactNative.View,{style:t.emptyGlyph})});case "error":return e.error?jsxRuntime.jsx(_e,{variant:Ct(e.error),message:e.error.displayMessage,onAction:e.error.retryable?e.refresh:void 0,testID:"depth-error"}):null;case "populated":return e.value===null||e.value.withheld?null:r(e.value);default:return null}}o(qi,"renderState");function Ui({styles:e}){let[r,t]=react.useState(false);return react.useEffect(()=>{let n=setTimeout(()=>t(true),Di);return ()=>clearTimeout(n)},[]),jsxRuntime.jsx(reactNative.View,{style:e.centered,accessible:true,accessibilityState:{busy:true},accessibilityLabel:$.loading,children:r?jsxRuntime.jsx(reactNative.ActivityIndicator,{}):null})}o(Ui,"LoadingState");function Hi({timeline:e}){let r=Se(),t=je(e);return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.timelineContent,accessibilityLabel:R.timeline,children:[e.disclaimer.length>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineBand,accessible:true,accessibilityRole:"text",accessibilityLabel:St.important(e.disclaimer),children:jsxRuntime.jsx(g,{style:r.timelineBandText,children:e.disclaimer})}):null,t.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{children:[a>0?jsxRuntime.jsx(reactNative.View,{style:r.timelineSeparator}):null,jsxRuntime.jsxs(reactNative.View,{style:r.timelineRow,accessible:true,accessibilityRole:"text",accessibilityLabel:[n.kindLabel,n.date,n.title,n.detail].filter(Boolean).join(", "),testID:`records-timeline-row-${n.kind}`,children:[jsxRuntime.jsx(reactNative.View,{style:r.timelineBubble,accessibilityElementsHidden:true,importantForAccessibility:"no"}),jsxRuntime.jsxs(reactNative.View,{style:r.timelineBody,children:[jsxRuntime.jsxs(reactNative.View,{style:r.topLine,children:[jsxRuntime.jsx(g,{style:r.timelineKind,children:n.kindLabel}),jsxRuntime.jsx(g,{style:r.date,children:n.date})]}),jsxRuntime.jsx(g,{style:r.timelineTitle,children:n.title}),n.detail?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.detail}):null]})]})]},n.key))]})}o(Hi,"TimelineBody");function xe({title:e,count:r,styles:t}){return jsxRuntime.jsx(g,{style:t.heading,accessibilityRole:"header",children:`${e} (${r})`})}o(xe,"SectionHeader");function Wi({depth:e}){let r=Se();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:$.records,children:[e.labResults.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(xe,{title:R.labResults,count:e.labResults.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.labResults.map(t=>{let n=It(t.latest.status),a=At(t.latest.at,t.trajectory,t.points.length);return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[t.name,Ae(t.latest.value,t.latest.unit,t.latest.qualitativeResult),n.label,a].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.name}),jsxRuntime.jsx(g,{style:r.rowValue,children:Ae(t.latest.value,t.latest.unit,t.latest.qualitativeResult)}),a?jsxRuntime.jsx(g,{style:r.rowDetail,children:a}):null,jsxRuntime.jsx(g,{style:[r.chip,n.outOfRange?r.chipCritical:r.chipNeutral],children:n.label}),t.meaning?jsxRuntime.jsx(g,{style:r.rowDetail,children:t.meaning}):null]},t.markerId)})})]}):null,e.encounters.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(xe,{title:R.visits,count:e.encounters.length,styles:r}),jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.encounters.map(t=>{let n=[t.date?F(t.date):null,t.clinicName,t.veterinarian].filter(a=>a&&a!=="-").join(" \xB7 ");return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.type?fe(t.type):R.visit}),n?jsxRuntime.jsx(g,{style:r.rowDetail,children:n}):null]},t.encounterId)})})]}):null,e.physicalExams.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(xe,{title:R.physicalExams,count:e.physicalExams.length,styles:r}),e.physicalExams.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?F(t.observedOn):R.exam}),t.systems.map(n=>{let a=n.findingStatus==="abnormal",s=a?R.abnormal:n.findingStatus==="not_examined"?R.notExamined:R.normal;return jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",accessibilityLabel:[De(n.system),s,a?n.finding:null].filter(Boolean).join(", "),children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:De(n.system)}),a&&n.finding?jsxRuntime.jsx(g,{style:r.rowDetail,children:n.finding}):null,jsxRuntime.jsx(g,{style:[r.chip,a?r.chipCaution:r.chipNeutral],children:s})]},n.system)})]},t.examId))]}):null,e.clinicianNotes.length>0?jsxRuntime.jsxs(reactNative.View,{style:r.section,children:[jsxRuntime.jsx(xe,{title:R.visitNotes,count:e.clinicianNotes.length,styles:r}),e.clinicianNotes.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.card,children:[jsxRuntime.jsx(g,{style:r.rowTitle,accessibilityRole:"header",children:t.observedOn?F(t.observedOn):R.visitNote}),t.sections.map((n,a)=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.kindLabel,children:Pt(n.section)}),jsxRuntime.jsx(g,{style:n.text?r.rowDetail:r.rowMuted,children:n.text||R.notRecorded})]},`${n.section}:${a}`))]},t.noteId))]}):null]})}o(Wi,"DepthBody");function $i({view:e}){let r=Se();return jsxRuntime.jsxs(reactNative.ScrollView,{style:r.list,contentContainerStyle:r.listContent,accessibilityLabel:$.records,children:[e.document?.receivedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:F(e.document.receivedAt)}):null,jsxRuntime.jsx(reactNative.View,{style:r.card,children:e.contributions.map(t=>jsxRuntime.jsxs(reactNative.View,{style:r.row,accessible:true,accessibilityRole:"text",children:[jsxRuntime.jsx(g,{style:r.rowTitle,children:t.label}),jsxRuntime.jsx(g,{style:r.rowValue,children:kt(t.value,t.unit)}),t.observedAt?jsxRuntime.jsx(g,{style:r.rowDetail,children:F(t.observedAt)}):null]},t.key))})]})}o($i,"ContributionsBody");function Se(){let e=x();return react.useMemo(()=>Yi(e),[e])}o(Se,"useStyles");function Yi(e){let{color:r,space:t,radius:n,type:a,slots:s}=e,{size:l,lineHeight:c}=a,i=o((P,z)=>Math.round(P*z),"lh"),u=reactNative.StyleSheet.hairlineWidth,p=t.xxl*3+t.xl,h=t.xxl+t.md,b=e.brightness==="dark"?r.errorRed:r.danger,E=re(s.recordCard),C=o((P,z,N,H="regular")=>({...k(e,H),fontSize:P,lineHeight:i(P,z),color:N}),"text"),O=o((P,z,N,H="regular")=>({...C(P,z,N,H),...E}),"inCard");return reactNative.StyleSheet.create({container:{flex:1,minHeight:p,backgroundColor:r.background},body:{flex:1},centered:{minHeight:p,flexGrow:1,alignItems:"center",justifyContent:"center",padding:t.xl,gap:t.lg},emptyGlyph:{width:t.xxl+t.sm,height:t.xxl+t.sm,borderRadius:n.lg,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},errorText:{...C(l.subtitle,c.snug,b),textAlign:"center",marginBottom:t.md},primaryButton:{minHeight:h,minWidth:h,alignItems:"center",justifyContent:"center",paddingHorizontal:t.xl,paddingVertical:t.md,borderRadius:n.pill,backgroundColor:r.primary,...te(s.primaryButton)},primaryLabel:{...k(e,"bold"),color:r.onPrimary,fontSize:l.body,...re(s.primaryButton)},list:{flex:1},listContent:{padding:t.lg,gap:t.md},section:{gap:t.sm},heading:{...C(l.heading,c.snug,r.text.primary,"bold")},card:{gap:t.sm,padding:t.md,borderRadius:n.md,backgroundColor:r.surfaceCream,borderWidth:u,borderColor:r.brandBorder,...te(s.recordCard,u)},row:{gap:t.xs,paddingVertical:t.xs,borderBottomWidth:u,borderBottomColor:r.borderHairlineGreen},topLine:{flexDirection:"row",justifyContent:"space-between",gap:t.md},kindLabel:{...O(l.caption,c.normal,r.text.muted,"medium")},date:O(l.caption,c.normal,r.text.muted),rowTitle:{...O(l.body,c.normal,r.text.primary,"bold")},rowValue:{...O(l.body,c.normal,r.text.primary,"medium")},rowDetail:O(l.bodyTight,c.normal,r.text.muted),rowMuted:{...O(l.bodyTight,c.normal,r.text.muted),opacity:.7},chip:{...C(l.caption,c.normal,r.text.primary),alignSelf:"flex-start",paddingHorizontal:t.sm,paddingVertical:t.xs,borderRadius:n.pill},chipNeutral:{backgroundColor:r.badgeBgNeutral},chipCaution:{backgroundColor:r.badgeBgCaution},chipCritical:{backgroundColor:r.badgeBgCritical},disclaimer:{...C(l.caption,c.normal,r.text.muted),marginTop:t.md},timelineContent:{paddingBottom:t.xxl},timelineBand:{flexDirection:"row",gap:t.sm,borderRadius:n.md-t.xs/2,padding:t.md,backgroundColor:r.brandSoft,marginHorizontal:t.lg,marginTop:t.xs,marginBottom:t.md},timelineBandText:{flex:1,...C(l.caption,c.normal,r.text.secondary)},timelineSeparator:{height:u,backgroundColor:r.brandBorder,marginLeft:st},timelineRow:{flexDirection:"row",gap:t.md,paddingHorizontal:t.lg,paddingVertical:t.md+t.xs/2},timelineBubble:{width:t.xxl+t.xs/2,height:t.xxl+t.xs/2,borderRadius:n.pill,backgroundColor:r.brandSoft,borderWidth:u,borderColor:r.brandBorder},timelineBody:{flex:1,gap:t.xs-1},timelineKind:{...k(e,"mono"),fontSize:l.micro,lineHeight:l.bodyTight,letterSpacing:a.letterSpacing.eyebrow/3,textTransform:"uppercase",color:r.text.secondary},timelineTitle:{...C(l.body,c.normal,r.text.primary,"medium")}})}o(Yi,"makeStyles");
2
+ exports.EverfurDocumentContributions=Bi;exports.EverfurRecordDepth=Vi;exports.EverfurRecordsTimeline=Mi;exports.buildTimelineRows=je;exports.mapDocumentContributions=hr;exports.mapRecordDepth=gr;exports.mapRecordsTimeline=br;exports.useEverfurRecordsDepthClient=Cr;exports.useRecordsDepthRead=le;
@@ -1,14 +1,14 @@
1
- export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-B0g83e_N.cjs';
2
- export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-CNEHZJtj.cjs';
3
- export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-BuNhzDbH.cjs';
4
- export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-NmWSbvfi.cjs';
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-C409ubw-.cjs';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-COJ0wSYK.cjs';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-DDnz4gx2.cjs';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordShareAudience, m as RecordsClinic, n as RecordsDepthClient, o as RecordsRequestDocument, p as RecordsTimelineMedication, q as RecordsTimelineVaccine, r as RecordsTimelineView, s as RecordsTimelineVisit, t as RecordsTimelineWeight, u as mapDocumentContributions, v as mapRecordDepth, w as mapRecordsTimeline } from '../../depth-CAAwiStc.cjs';
5
5
  export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.cjs';
6
6
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DmELDpXp.cjs';
7
7
  export { E as EverfurResult } from '../../EverfurResult-ZtH-YV1h.cjs';
8
8
  export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-Bn2z0NNo.cjs';
9
9
  import 'react';
10
10
  import 'react-native';
11
- import '../../requestFunnel-DAwb7haa.cjs';
11
+ import '../../requestFunnel-DMR_1T3O.cjs';
12
12
  import '../../ErrorPolicyPort-D6CybiqJ.cjs';
13
- import '../../config-BZX97FmW.cjs';
14
- import '../../identity-D7PO5s9m.cjs';
13
+ import '../../config-Daa1plhQ.cjs';
14
+ import '../../identity-DUlshgow.cjs';
@@ -1,14 +1,14 @@
1
- export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-Dg2bIon_.js';
2
- export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-CuNdne6E.js';
3
- export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-Dll2IGFg.js';
4
- export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordsClinic, m as RecordsDepthClient, n as RecordsRequestDocument, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, t as mapDocumentContributions, u as mapRecordDepth, v as mapRecordsTimeline } from '../../depth-CrpRjWGB.js';
1
+ export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../DepthViews-es8mIK0w.js';
2
+ export { C as ClinicDraft, a as ClinicLocation, R as RecordsAskEntityRef, b as RecordsAskHandler, c as RecordsDepthStatus, d as RecordsHostSeams, e as RecordsScreen, f as RecordsScreenBaseProps, g as RecordsUrlKind, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, h as useRecordsDepthRead } from '../../useRecordsDepth-Z9FF5X4E.js';
3
+ export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../timelineRows-D3171ksh.js';
4
+ export { R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, i as RecordLabMarker, j as RecordLabPoint, k as RecordPhysicalExam, l as RecordShareAudience, m as RecordsClinic, n as RecordsDepthClient, o as RecordsRequestDocument, p as RecordsTimelineMedication, q as RecordsTimelineVaccine, r as RecordsTimelineView, s as RecordsTimelineVisit, t as RecordsTimelineWeight, u as mapDocumentContributions, v as mapRecordDepth, w as mapRecordsTimeline } from '../../depth-DfNRVtrV.js';
5
5
  export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../ids-B2GAAifq.js';
6
6
  export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DmELDpXp.js';
7
7
  export { E as EverfurResult } from '../../EverfurResult-SGvHKsCB.js';
8
8
  export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../models-DSqA5Ahs.js';
9
9
  import 'react';
10
10
  import 'react-native';
11
- import '../../requestFunnel-CQzz2DIW.js';
11
+ import '../../requestFunnel-CiSX2pun.js';
12
12
  import '../../ErrorPolicyPort-D22LUVrK.js';
13
- import '../../config-Dfbj5mlx.js';
14
- import '../../identity-B8rp0L9G.js';
13
+ import '../../config-BM0sv5jx.js';
14
+ import '../../identity-BhT7oJDS.js';