@everfur/sdk 0.18.2 → 0.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +6 -5
- package/dist/{Chat.d-B7iUVGmB.d.cts → Chat.d-BEbRI8FZ.d.cts} +1 -1
- package/dist/{Chat.d-BkLu9G00.d.ts → Chat.d-CKKuXVw5.d.ts} +1 -1
- package/dist/{DepthViews.d-BiS-GTEf.d.cts → DepthViews.d-BiePRa3Z.d.cts} +1 -1
- package/dist/{DepthViews.d-C-zs_BnZ.d.cts → DepthViews.d-Chn2xwZu.d.cts} +1 -1
- package/dist/{DepthViews.d-C0DVqywN.d.ts → DepthViews.d-CiU4f98J.d.ts} +1 -1
- package/dist/{DepthViews.d-hXV6Ef0y.d.ts → DepthViews.d-_WMIpymE.d.ts} +1 -1
- package/dist/{IntakeMedia.d-4a89XrP7.d.ts → IntakeMedia.d-B_ZVDxh3.d.ts} +1 -1
- package/dist/{IntakeMedia.d-JJCUvQu7.d.cts → IntakeMedia.d-CnGzpllr.d.cts} +1 -1
- package/dist/{IntakeMedia.d-DGxrhgIW.d.ts → IntakeMedia.d-DNUAks9E.d.ts} +1 -1
- package/dist/{IntakeMedia.d-DUPR4lVM.d.cts → IntakeMedia.d-Dqc5V_YH.d.cts} +1 -1
- package/dist/{RecordsPage.d-BG_RDR1V.d.ts → RecordsPage.d-CRRJM35Q.d.ts} +1 -1
- package/dist/{RecordsPage.d-5rHMTDyY.d.cts → RecordsPage.d-CtNzoxre.d.cts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{appStateLifecycle.d-_TM06yEk.d.cts → appStateLifecycle.d-BQcy4J5O.d.cts} +3 -3
- package/dist/{appStateLifecycle.d-7H_2a9it.d.ts → appStateLifecycle.d-JuPhh7Oy.d.ts} +3 -3
- package/dist/{attachments.d-DFbXLAYK.d.cts → attachments.d-BLEOCUU7.d.cts} +2 -2
- package/dist/{attachments.d-HmRqizDG.d.cts → attachments.d-CeXw6R7_.d.cts} +5 -5
- package/dist/{attachments.d-_mgNU-ur.d.ts → attachments.d-DRkqNR-o.d.ts} +2 -2
- package/dist/{attachments.d-D7f7OfPE.d.ts → attachments.d-d1rWAw9K.d.ts} +5 -5
- package/dist/{bookingCopy.d-0K1trjxx.d.cts → bookingCopy.d-CoiNXrY8.d.cts} +10 -3
- package/dist/{bookingCopy.d-RU8lNYJ4.d.ts → bookingCopy.d-CrUufdoE.d.ts} +10 -3
- package/dist/{casesRepository.d-D2SQFL27.d.ts → casesRepository.d-DhI69yuj.d.ts} +1 -1
- package/dist/{casesRepository.d-D7vIZ9oX.d.cts → casesRepository.d-OyZOSNNv.d.cts} +1 -1
- package/dist/chat/index.d.cts +10 -10
- package/dist/chat/index.d.ts +10 -10
- package/dist/chat/lite/index.d.cts +10 -10
- package/dist/chat/lite/index.d.ts +10 -10
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/{clinicBatch.d-BhaCdstU.d.ts → clinicBatch.d-CcqnQ7-d.d.ts} +2 -2
- package/dist/{clinicBatch.d-BN1jfVGo.d.cts → clinicBatch.d-DVahpaN3.d.cts} +2 -2
- package/dist/{config.d-D_k_rNZZ.d.ts → config.d-KX-EkQ9j.d.ts} +1 -1
- package/dist/{config.d-BFTqU7ft.d.cts → config.d-Z_fyOZke.d.cts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-D2fhrjAM.d.cts → context.d-DV5E_2Fs.d.cts} +5 -5
- package/dist/{context.d-B4LODPF1.d.ts → context.d-DY6d4qXG.d.ts} +5 -5
- package/dist/{copy.d-Bn9eIgkW.d.ts → copy.d-BPzpKGGc.d.ts} +2 -2
- package/dist/{copy.d-DjYhMxxS.d.cts → copy.d-CMY9OoCC.d.cts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +13 -13
- package/dist/core/index.d.ts +13 -13
- package/dist/core/index.js +1 -1
- package/dist/{depth.d-DlaIV8TV.d.ts → depth.d-B_qNSgXr.d.ts} +2 -2
- package/dist/{depth.d-CsKZkLNi.d.cts → depth.d-qVYPByPb.d.cts} +2 -2
- package/dist/{entitlementRepository.d-C5d_6QMi.d.ts → entitlementRepository.d-BXDWPyP8.d.ts} +2 -2
- package/dist/{entitlementRepository.d-CpIRpfzy.d.cts → entitlementRepository.d-CwTVi7he.d.cts} +2 -2
- package/dist/{focus.d-DOlAaNIU.d.ts → focus.d-BPofD7ow.d.ts} +2 -2
- package/dist/{focus.d-DdBbwzjP.d.cts → focus.d-DJD4lWFB.d.cts} +2 -2
- package/dist/health-plan/index.d.cts +9 -9
- package/dist/health-plan/index.d.ts +9 -9
- package/dist/{idempotency.d-CmQc1OUv.d.ts → idempotency.d-BVO0mU2R.d.ts} +1 -1
- package/dist/{idempotency.d-P4O5lNBq.d.cts → idempotency.d-BmYuCb-n.d.cts} +1 -1
- package/dist/{identity.d-BmbAwQYx.d.cts → identity.d-3ROlHbnP.d.cts} +1 -1
- package/dist/{identity.d-BZXPu9Hi.d.ts → identity.d-CRVNfZzQ.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/{introEvents.d-Bqw2Hcpt.d.cts → introEvents.d-DGQDEPJi.d.cts} +1 -1
- package/dist/{introEvents.d-Cy8yxOoe.d.ts → introEvents.d-cvMxJfYd.d.ts} +1 -1
- package/dist/notifications/index.d.cts +4 -4
- package/dist/notifications/index.d.ts +4 -4
- package/dist/{optInView.d-DXj2w4KU.d.cts → optInView.d-CU1U_K-B.d.cts} +2 -2
- package/dist/{optInView.d-wGSNOB86.d.ts → optInView.d-DIGu47Lz.d.ts} +2 -2
- package/dist/{parse.d-C9_UMXfA.d.cts → parse.d-GzZJYu__.d.cts} +1 -1
- package/dist/{parse.d-MQST1RP3.d.ts → parse.d-icynBIS-.d.ts} +1 -1
- package/dist/{pets.d-CP13kAFa.d.cts → pets.d-5SMtOAwB.d.cts} +1 -1
- package/dist/{pets.d-tqGZP3Co.d.ts → pets.d-BRsbR8QU.d.ts} +1 -1
- package/dist/{petsRepository.d-CyerzD5G.d.cts → petsRepository.d-DEnoZn92.d.cts} +1 -1
- package/dist/{petsRepository.d-CLyzuoo4.d.ts → petsRepository.d-DWsChqAS.d.ts} +1 -1
- package/dist/{ports.d-CB9YZT2L.d.cts → ports.d--OjPUqPb.d.cts} +4 -4
- package/dist/{ports.d-RKc2C07X.d.ts → ports.d-CIfa_XF6.d.ts} +4 -4
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/index.cjs +1 -1
- package/dist/records/index.d.cts +10 -10
- package/dist/records/index.d.ts +10 -10
- package/dist/records/index.js +1 -1
- package/dist/{requestFunnel.d-DocT7FXR.d.cts → requestFunnel.d-CQX_Z1Hi.d.cts} +2 -2
- package/dist/{requestFunnel.d-BPWf5SQf.d.ts → requestFunnel.d-DSvCGf4J.d.ts} +2 -2
- package/dist/{runtimeTypes.d-D4Cjjf_C.d.ts → runtimeTypes.d-Be_vhOER.d.ts} +4 -4
- package/dist/{runtimeTypes.d-CkwEMpy8.d.cts → runtimeTypes.d-sXpNYnJp.d.cts} +4 -4
- package/dist/{screenProps.d-Byla6nJL.d.cts → screenProps.d-BW6PZh5k.d.cts} +1 -1
- package/dist/{screenProps.d-DNTTp7hU.d.ts → screenProps.d-DpMK2_gi.d.ts} +1 -1
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +36 -5
- package/dist/server/events/index.d.ts +36 -5
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/tabs/index.d.cts +6 -6
- package/dist/tabs/index.d.ts +6 -6
- package/dist/televet/booking/index.cjs +11 -10
- package/dist/televet/booking/index.d.cts +13 -11
- package/dist/televet/booking/index.d.ts +13 -11
- package/dist/televet/booking/index.js +11 -10
- package/dist/televet/index.d.cts +3 -3
- package/dist/televet/index.d.ts +3 -3
- package/dist/{televetGlobal.d-CC-DrqkQ.d.ts → televetGlobal.d-B0_jbCtC.d.ts} +7 -0
- package/dist/{televetGlobal.d-CKwDCbmN.d.cts → televetGlobal.d-BWYJR391.d.cts} +7 -0
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.d.cts +7 -7
- package/dist/testing/rn/index.d.ts +7 -7
- package/dist/testing/web/index.d.cts +7 -7
- package/dist/testing/web/index.d.ts +7 -7
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/{threadOptions.d-CIrevUL8.d.cts → threadOptions.d-Csmb-XgL.d.cts} +2 -2
- package/dist/{threadOptions.d-jgk_sHrj.d.ts → threadOptions.d-DMOn3mmj.d.ts} +2 -2
- package/dist/{timelineRows.d-BST14weg.d.ts → timelineRows.d-B0XZevKx.d.ts} +1 -1
- package/dist/{timelineRows.d-BEjiHpkP.d.cts → timelineRows.d-Kllr7Mcu.d.cts} +1 -1
- package/dist/{useHealthPlanSubscription.d-CYJi9ZNE.d.cts → useHealthPlanSubscription.d-C-c_mQ4u.d.cts} +2 -2
- package/dist/{useHealthPlanSubscription.d-C9kh4mvk.d.ts → useHealthPlanSubscription.d-bNRntgWe.d.ts} +2 -2
- package/dist/{usePresentation.d-COEh8Xa1.d.cts → usePresentation.d-BHKhBKQn.d.cts} +1 -1
- package/dist/{usePresentation.d-WA3sfMpz.d.ts → usePresentation.d-CmQgbrZr.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-CAYnVYl1.d.ts → useRecordsDepth.d-BilHZaR4.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-DZfdRdIU.d.cts → useRecordsDepth.d-WW_2cWwU.d.cts} +1 -1
- package/dist/{view.d-eM315KIZ.d.cts → view.d-BTnjZu2S.d.cts} +3 -3
- package/dist/{view.d-D8soknYh.d.ts → view.d-BtN_L_UF.d.ts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.d.cts +11 -11
- package/dist/web/health-plan/index.d.ts +11 -11
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.d.cts +23 -23
- package/dist/web/index.d.ts +23 -23
- package/dist/web/index.js +1 -1
- package/dist/web/intro/index.d.cts +6 -6
- package/dist/web/intro/index.d.ts +6 -6
- package/dist/web/notifications/index.d.cts +3 -3
- package/dist/web/notifications/index.d.ts +3 -3
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records-sheet/index.cjs +1 -1
- package/dist/web/records-sheet/index.js +1 -1
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/televet/booking/index.cjs +9 -9
- package/dist/web/televet/booking/index.d.cts +18 -11
- package/dist/web/televet/booking/index.d.ts +18 -11
- package/dist/web/televet/booking/index.js +9 -9
- package/dist/web/televet/index.d.cts +3 -3
- package/dist/web/televet/index.d.ts +3 -3
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/package.json +1 -1
package/dist/web/index.js
CHANGED
|
@@ -103,7 +103,7 @@ return Object.freeze({kind:"done",terminal:true,conversationId:fields.conversati
|
|
|
103
103
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:fields.serverRequestId??null})}function analysisStartedFrame(requestId,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
104
104
|
return Object.freeze({kind:"analysisStarted",requestId:requestId,lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}function analysisCompleteFrame(fields,serverRequestId=null){/* @__PURE__ */
|
|
105
105
|
return Object.freeze({kind:"analysisComplete",terminal:false,resultId:fields.resultId,analysisType:fields.analysisType,modelVersion:fields.modelVersion,confidence:fields.confidence,detections:/* @__PURE__ */Object.freeze([...fields.detections]),interpretation:fields.interpretation,lastEventId:fields.lastEventId,serverRequestId:serverRequestId})}function unknownFrame(raw,lastEventId,serverRequestId=null){/* @__PURE__ */
|
|
106
|
-
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function createIdentityProvider(userRef2,getToken,onMinted,onRejected){let cached=null,rejectionReported=false,inFlight3=null,revoked=false,load=()=>inFlight3||(inFlight3=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,rejectionReported=!1,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight3=null}})(),inFlight3);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null},reportRejected(){revoked||rejectionReported||(rejectionReported=true,onRejected?.())}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}function createFallbackUtf8Decoder(){let pending3=[];return{decode(input,options){let stream=options?.stream===true,bytes=pending3.length>0?pending3.slice():[];if(input!==void 0)for(let i2=0;i2<input.length;i2+=1)bytes.push(input[i2]);pending3=[];let out="",i=0;for(;i<bytes.length;){let b0=bytes[i];if(b0<128){out+=String.fromCharCode(b0),i+=1;continue}let need,lower=128,upper=191,cp;if(b0>=194&&b0<=223)need=1,cp=b0&31;else if(b0>=224&&b0<=239)need=2,cp=b0&15,b0===224&&(lower=160),b0===237&&(upper=159);else if(b0>=240&&b0<=244)need=3,cp=b0&7,b0===240&&(lower=144),b0===244&&(upper=143);else{out+="�",i+=1;continue}let j=1,valid=true;for(;j<=need&&!(i+j>=bytes.length);){let b=bytes[i+j],lo=j===1?lower:128,hi=j===1?upper:191;if(b<lo||b>hi){valid=false;break}cp=cp<<6|b&63,j+=1}if(!valid){out+="�",i+=j;continue}if(j<=need){stream?pending3=bytes.slice(i):out+="�";break}out+=String.fromCodePoint(cp),i+=need+1}return out}}}function createUtf8Decoder(){let Native=globalThis.TextDecoder;return typeof Native=="function"?new Native("utf-8"):createFallbackUtf8Decoder()}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */z.record(/* @__PURE__ */z.string(),/* @__PURE__ */z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=createUtf8Decoder(),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.18.2",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
|
|
106
|
+
return Object.freeze({kind:"unknown",raw:{...raw},lastEventId:lastEventId,serverRequestId:serverRequestId,terminal:false})}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function createIdentityProvider(userRef2,getToken,onMinted,onRejected){let cached=null,rejectionReported=false,inFlight3=null,revoked=false,load=()=>inFlight3||(inFlight3=(async()=>{try{let minted=await getToken(),token=typeof minted=="string"?minted:minted?.token;if(typeof token!="string"||token.length===0)throw new EverfurConfigError("invalid-argument","TokenProvider returned an empty token");return cached=token,rejectionReported=!1,onMinted?.(typeof minted=="string"?null:expiryMs(minted.expiresAt)),token}finally{inFlight3=null}})(),inFlight3);return{userRef:userRef2,async currentToken(opts){if(revoked)throw new EverfurConfigError("not-initialized","This identity was cleared (sign-out); mint a new one.");return opts?.forceRefresh&&(cached=null),cached!==null?cached:load()},hasToken(){return!revoked&&cached!==null},clear(){revoked=true,cached=null},reportRejected(){revoked||rejectionReported||(rejectionReported=true,onRejected?.())}}}function expiryMs(value){if(value===void 0)return null;let ms=typeof value=="number"?value<1e11?value*1e3:value:new Date(value).getTime();return Number.isFinite(ms)?ms:null}function newSessionId(){let bytes=new Uint8Array(16),cryptoObj=globalThis.crypto;if(typeof cryptoObj?.getRandomValues=="function")cryptoObj.getRandomValues(bytes);else for(let i=0;i<bytes.length;i+=1)bytes[i]=Math.floor(Math.random()*256);bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;let hex=[];for(let i=0;i<bytes.length;i+=1)hex.push(bytes[i].toString(16).padStart(2,"0"));return hex.slice(0,4).join("")+"-"+hex.slice(4,6).join("")+"-"+hex.slice(6,8).join("")+"-"+hex.slice(8,10).join("")+"-"+hex.slice(10,16).join("")}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var DAILY_QUOTA_WIRE_CODE="DAILY_QUOTA_EXCEEDED",THROTTLES=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function foldDailyQuotaWireCode(code,body){if(!THROTTLES.has(code.toUpperCase().replace(/[^A-Z0-9]/g,"")))return code;let b=body,limit=b?.daily_limit??b?.error?.daily_limit;return typeof limit=="number"&&Number.isFinite(limit)?DAILY_QUOTA_WIRE_CODE:code}function createFallbackUtf8Decoder(){let pending3=[];return{decode(input,options){let stream=options?.stream===true,bytes=pending3.length>0?pending3.slice():[];if(input!==void 0)for(let i2=0;i2<input.length;i2+=1)bytes.push(input[i2]);pending3=[];let out="",i=0;for(;i<bytes.length;){let b0=bytes[i];if(b0<128){out+=String.fromCharCode(b0),i+=1;continue}let need,lower=128,upper=191,cp;if(b0>=194&&b0<=223)need=1,cp=b0&31;else if(b0>=224&&b0<=239)need=2,cp=b0&15,b0===224&&(lower=160),b0===237&&(upper=159);else if(b0>=240&&b0<=244)need=3,cp=b0&7,b0===240&&(lower=144),b0===244&&(upper=143);else{out+="�",i+=1;continue}let j=1,valid=true;for(;j<=need&&!(i+j>=bytes.length);){let b=bytes[i+j],lo=j===1?lower:128,hi=j===1?upper:191;if(b<lo||b>hi){valid=false;break}cp=cp<<6|b&63,j+=1}if(!valid){out+="�",i+=j;continue}if(j<=need){stream?pending3=bytes.slice(i):out+="�";break}out+=String.fromCodePoint(cp),i+=need+1}return out}}}function createUtf8Decoder(){let Native=globalThis.TextDecoder;return typeof Native=="function"?new Native("utf-8"):createFallbackUtf8Decoder()}var BLOCK_SEPARATOR=`\n\n`,MAX_PENDING_BLOCK_CHARS=1048576,wireObjectSchema=/* @__PURE__ */z.record(/* @__PURE__ */z.string(),/* @__PURE__ */z.unknown()),URGENCY_LEVELS=["emergency","schedule_soon","home_care"];async function*parseSse(bytes,serverRequestId=null){let resolvedRequestId=null,requestIdNow=()=>(resolvedRequestId!==null||(resolvedRequestId=typeof serverRequestId=="function"?serverRequestId():serverRequestId),resolvedRequestId),decoder=createUtf8Decoder(),buffer="",scanFrom=0,sawDelta=false;for await(let chunk of bytes){for(buffer+=decoder.decode(chunk,{stream:true});;){let sep=buffer.indexOf(BLOCK_SEPARATOR,scanFrom);if(sep===-1)break;let block=buffer.slice(0,sep);buffer=buffer.slice(sep+BLOCK_SEPARATOR.length),scanFrom=0;let frame=parseBlock(block,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}if(scanFrom=buffer.length>0?buffer.length-1:0,buffer.length>MAX_PENDING_BLOCK_CHARS){yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()});return}}if(buffer+=decoder.decode(),buffer.trim().length>0){let frame=parseBlock(buffer,requestIdNow());if(frame!==null&&(frame.kind==="delta"&&(sawDelta=true),yield frame,frame.terminal))return}yield errorFrame({code:sawDelta?"CHAT_STREAM_INCOMPLETE":"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null,serverRequestId:requestIdNow()})}function parseBlock(block,serverRequestId){let id=null,dataLines=[];for(let rawLine of block.split(`\n`)){let line=rawLine.replace(/\s+$/,"");line.length===0||line.startsWith(":")||(line.startsWith("id:")?id=line.slice(3).trim():line.startsWith("data:")&&dataLines.push(line.slice(5).replace(/^ /,"")))}if(dataLines.length===0)return null;let decoded;try{decoded=JSON.parse(dataLines.join(`\n`))}catch{return null}if(typeof decoded!="object"||decoded===null||Array.isArray(decoded))return null;let parsed=wireObjectSchema.safeParse(decoded);return parsed.success?frameFromWire(parsed.data,id,serverRequestId):null}function frameFromWire(json,lastEventId,serverRequestId){let type=json.type,event=json.event;if(type==="error"||"error"in json)return errorFrame({code:asString(json.code)??"unknown",retryable:json.retryable===true,wireMessage:asString(json.error),synthesized:false,lastEventId:lastEventId,serverRequestId:serverRequestId});if(type==="done"||json.done===true)return doneFrame({conversationId:asString(json.conversation_id)??"",messageId:asString(json.message_id),title:asString(json.title),followUpQuestions:asStringList(json.follow_up_questions),citations:asMapList(json.citations),citationStatus:asString(json.citation_status),urgencyLevel:asUrgency(json.urgency_level),urgencyReason:asString(json.urgency_reason),urgencyProvided:urgencySlotProvided(json),resultId:asString(json.result_id),lastEventId:lastEventId},serverRequestId);if(type==="accepted"||json.status==="reasoning")return acceptedFrame(asString(json.stream_id),lastEventId,serverRequestId);if(type==="heartbeat"||json.heartbeat===true)return heartbeatFrame(lastEventId,serverRequestId);if(type==="text.delta"||"delta"in json||"token"in json){let delta=asString(json.delta)??asString(json.token)??"";return deltaFrame(delta,lastEventId,serverRequestId)}return event==="analysis_started"?analysisStartedFrame(asString(json.request_id),lastEventId,serverRequestId):event==="analysis_complete"?analysisCompleteFrame({resultId:asString(json.result_id),analysisType:asString(json.analysis_type),modelVersion:asString(json.model_version),confidence:asNumber(json.confidence),detections:asMapList(json.detections),interpretation:asString(json.interpretation),lastEventId:lastEventId},serverRequestId):unknownFrame(json,lastEventId,serverRequestId)}function asString(v){return typeof v=="string"?v:null}function asNumber(v){return typeof v=="number"&&Number.isFinite(v)?v:null}function asUrgency(v){return typeof v=="string"&&URGENCY_LEVELS.includes(v)?v:null}function urgencySlotProvided(json){if(!Object.prototype.hasOwnProperty.call(json,"urgency_level"))return false;let raw=json.urgency_level;return raw===null||asUrgency(raw)!==null}function asStringList(v){return Array.isArray(v)?v.map(e=>typeof e=="string"?e:String(e)):[]}function isPlainObject(v){return typeof v=="object"&&v!==null&&!Array.isArray(v)}function asMapList(v){return Array.isArray(v)?v.filter(isPlainObject):[]}var ABSOLUTE_URL=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var SDK_VERSION="0.18.3",SDK_PLATFORM="react-native",DEFAULT_CONTRACT_VERSION="2026-09-19",ENV_API_BASE_URL="EVERFUR_API_BASE_URL";function configFailure(reason,message){/* @__PURE__ */
|
|
107
107
|
return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:reason,message:message})})}function checkPublishableKey(raw){let publishableKey=typeof raw=="string"?raw.trim():"";return publishableKey.length===0?{reason:"missing-publishable-key",message:"publishableKey is required"}:/^sk[_-]/i.test(publishableKey)?{reason:"secret-key-as-publishable-key",message:"publishableKey looks like a SECRET key (sk_...). A device must never hold a partner secret key: use the pk_ publishable key here, and keep the secret key on your server."}:null}function tryResolveClientConfig(config,options){let keyFailure=checkPublishableKey(config?.publishableKey);if(keyFailure!==null)/* @__PURE__ */
|
|
108
108
|
return Object.freeze({ok:false,failure:keyFailure});let publishableKey=config.publishableKey.trim(),baseUrl=tryResolveApiBaseUrl(config.apiBaseUrl);if(!baseUrl.ok)return baseUrl;let contractVersion=config.contractVersion?.trim()||DEFAULT_CONTRACT_VERSION;/* @__PURE__ */
|
|
109
109
|
return Object.freeze({ok:true,config:/* @__PURE__ */Object.freeze({publishableKey:publishableKey,apiBaseUrl:baseUrl.value,contractVersion:contractVersion,sdkVersion:SDK_VERSION,platform:options?.platform??SDK_PLATFORM,debug:config.debug===true})})}function tryResolveApiBaseUrl(apiBaseUrl){let explicit=apiBaseUrl?.trim(),candidate=explicit&&explicit.length>0?explicit:readEnv(ENV_API_BASE_URL);return candidate?normalizeBaseUrl(candidate):configFailure("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${ENV_API_BASE_URL}. The SDK never ships a hardcoded host.`)}function buildBaseHeaders(cfg){return{"X-Everfur-SDK-Version":cfg.sdkVersion,"X-Everfur-SDK-Platform":cfg.platform,"X-Everfur-Contract":cfg.contractVersion}}function hostOf(authority){return authority.slice(authority.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function isPrintableHost(host2){return host2.length===0||host2.includes("@")?false:host2.startsWith("[")&&host2.endsWith("]")?true:!host2.includes(":")}function canEchoOrigin(rawTrimmed,host2){let schemeEnd=rawTrimmed.indexOf("://");return schemeEnd<0||rawTrimmed.slice(schemeEnd+3).includes("@")?false:isPrintableHost(host2)}function safeOrigin(scheme,host2){return`${scheme}://${host2}`}function normalizeBaseUrl(raw){let trimmed=raw.trim(),match=ABSOLUTE_URL.exec(trimmed);if(match===null||match[2]===void 0||match[2].length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let scheme=(match[1]??"").toLowerCase(),host2=hostOf(match[2]);if(host2.length===0)return configFailure("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let shown=canEchoOrigin(trimmed,host2)?`: ${safeOrigin(scheme,host2)}`:"";if(scheme!=="https"){if(!(scheme==="http"&&isLoopbackHost(host2)))return scheme==="http"?configFailure("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${shown}`):configFailure("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${shown}`)}let value=trimmed.endsWith("/")?trimmed.slice(0,-1):trimmed;/* @__PURE__ */
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { H as HealthPlanPage } from '../../focus.d-
|
|
3
|
+
import { H as HealthPlanPage } from '../../focus.d-DJD4lWFB.cjs';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.cjs';
|
|
5
5
|
import { C as CaptureRecordsSignature } from '../../clinicRequestProps.d-1dCtouGA.cjs';
|
|
6
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-
|
|
7
|
-
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-
|
|
6
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-DGQDEPJi.cjs';
|
|
7
|
+
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-DGQDEPJi.cjs';
|
|
8
8
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../../useIntroSeen.d-CTWFUthO.cjs';
|
|
9
9
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../../useIntroSeen.d-CTWFUthO.cjs';
|
|
10
10
|
export { E as EVERFUR_RECORDS_LANDED_EVENT, a as EVERFUR_RECORDS_REQUESTED_EVENT } from '../../introEvents.d-dS3fJCH1.cjs';
|
|
11
11
|
import '../../EverfurError.d-8NHtlgzA.cjs';
|
|
12
12
|
import '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
13
|
-
import '../../requestFunnel.d-
|
|
13
|
+
import '../../requestFunnel.d-CQX_Z1Hi.cjs';
|
|
14
14
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
15
|
-
import '../../config.d-
|
|
16
|
-
import '../../identity.d-
|
|
15
|
+
import '../../config.d-Z_fyOZke.cjs';
|
|
16
|
+
import '../../identity.d-3ROlHbnP.cjs';
|
|
17
17
|
import '../../clinicModels.d-BXgKZqDb.cjs';
|
|
18
18
|
import '../../models.d-BSqvbTE1.cjs';
|
|
19
19
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { H as HealthPlanPage } from '../../focus.d-
|
|
3
|
+
import { H as HealthPlanPage } from '../../focus.d-BPofD7ow.js';
|
|
4
4
|
import { P as PetRef } from '../../ids.d-B2GAAifq.js';
|
|
5
5
|
import { C as CaptureRecordsSignature } from '../../clinicRequestProps.d-CjsMg_OD.js';
|
|
6
|
-
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-
|
|
7
|
-
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-
|
|
6
|
+
import { E as EverfurIntroCopy, a as EverfurIntroBlank, b as EverfurRecordsRequested, I as IntroText } from '../../introEvents.d-cvMxJfYd.js';
|
|
7
|
+
export { c as EVERFUR_INTRO_COPY, d as EverfurRecordsLanded, e as IntroFacts, f as IntroPetWords, g as IntroTextInput, h as defaultIntroBlanks, i as introFacts, j as introPetWords, k as introText, n as numberWord } from '../../introEvents.d-cvMxJfYd.js';
|
|
8
8
|
import { E as EverfurIntroMode, a as EverfurIntroFrame, b as EverfurIntroClose, c as EverfurIntroTabLabels } from '../../useIntroSeen.d-CTWFUthO.js';
|
|
9
9
|
export { d as EverfurIntroExit, e as EverfurIntroSeen, i as isIntroSwipeOut, u as useEverfurIntroSeen } from '../../useIntroSeen.d-CTWFUthO.js';
|
|
10
10
|
export { E as EVERFUR_RECORDS_LANDED_EVENT, a as EVERFUR_RECORDS_REQUESTED_EVENT } from '../../introEvents.d-dS3fJCH1.js';
|
|
11
11
|
import '../../EverfurError.d-8NHtlgzA.js';
|
|
12
12
|
import '../../EverfurResult.d-D_-254ZY.js';
|
|
13
|
-
import '../../requestFunnel.d-
|
|
13
|
+
import '../../requestFunnel.d-DSvCGf4J.js';
|
|
14
14
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
15
|
-
import '../../config.d-
|
|
16
|
-
import '../../identity.d-
|
|
15
|
+
import '../../config.d-KX-EkQ9j.js';
|
|
16
|
+
import '../../identity.d-CRVNfZzQ.js';
|
|
17
17
|
import '../../clinicModels.d-CaS64-P-.js';
|
|
18
18
|
import '../../models.d-DOwnr8fi.js';
|
|
19
19
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
-
export { D as DevicePlatform, b as EVERFUR_NOTIFICATION_EVENT_TYPES, c as EVERFUR_NOTIFICATION_TARGET_KINDS, d as EVERFUR_NOTIFICATION_VERSION, e as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind, E as EverfurNotificationsOptions, a as EverfurNotificationsState, i as EverfurNotificationsStatus, N as NOTIFICATIONS_REASON_MESSAGES, j as NotificationPreferences, k as NotificationPreferencesInput, l as NotificationsClient, m as NotificationsReasonCode, n as NotificationsRuntime, P as PushProvider, R as RegisterDeviceInput, o as RegisteredDevice, p as createNotificationsClient, q as explainNotificationsReason, r as parseEverfurNotification, s as useEverfurNotifications, u as useEverfurNotificationsClient } from '../../parse.d-
|
|
3
|
+
export { D as DevicePlatform, b as EVERFUR_NOTIFICATION_EVENT_TYPES, c as EVERFUR_NOTIFICATION_TARGET_KINDS, d as EVERFUR_NOTIFICATION_VERSION, e as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind, E as EverfurNotificationsOptions, a as EverfurNotificationsState, i as EverfurNotificationsStatus, N as NOTIFICATIONS_REASON_MESSAGES, j as NotificationPreferences, k as NotificationPreferencesInput, l as NotificationsClient, m as NotificationsReasonCode, n as NotificationsRuntime, P as PushProvider, R as RegisterDeviceInput, o as RegisteredDevice, p as createNotificationsClient, q as explainNotificationsReason, r as parseEverfurNotification, s as useEverfurNotifications, u as useEverfurNotificationsClient } from '../../parse.d-GzZJYu__.cjs';
|
|
4
4
|
export { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.cjs';
|
|
5
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-
|
|
6
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-
|
|
5
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-3ROlHbnP.cjs';
|
|
6
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-Z_fyOZke.cjs';
|
|
7
7
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
|
|
8
8
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
|
|
9
9
|
export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
-
export { D as DevicePlatform, b as EVERFUR_NOTIFICATION_EVENT_TYPES, c as EVERFUR_NOTIFICATION_TARGET_KINDS, d as EVERFUR_NOTIFICATION_VERSION, e as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind, E as EverfurNotificationsOptions, a as EverfurNotificationsState, i as EverfurNotificationsStatus, N as NOTIFICATIONS_REASON_MESSAGES, j as NotificationPreferences, k as NotificationPreferencesInput, l as NotificationsClient, m as NotificationsReasonCode, n as NotificationsRuntime, P as PushProvider, R as RegisterDeviceInput, o as RegisteredDevice, p as createNotificationsClient, q as explainNotificationsReason, r as parseEverfurNotification, s as useEverfurNotifications, u as useEverfurNotificationsClient } from '../../parse.d-
|
|
3
|
+
export { D as DevicePlatform, b as EVERFUR_NOTIFICATION_EVENT_TYPES, c as EVERFUR_NOTIFICATION_TARGET_KINDS, d as EVERFUR_NOTIFICATION_VERSION, e as EverfurNotification, f as EverfurNotificationEventType, g as EverfurNotificationTarget, h as EverfurNotificationTargetKind, E as EverfurNotificationsOptions, a as EverfurNotificationsState, i as EverfurNotificationsStatus, N as NOTIFICATIONS_REASON_MESSAGES, j as NotificationPreferences, k as NotificationPreferencesInput, l as NotificationsClient, m as NotificationsReasonCode, n as NotificationsRuntime, P as PushProvider, R as RegisterDeviceInput, o as RegisteredDevice, p as createNotificationsClient, q as explainNotificationsReason, r as parseEverfurNotification, s as useEverfurNotifications, u as useEverfurNotificationsClient } from '../../parse.d-icynBIS-.js';
|
|
4
4
|
export { V as VetVisitIntent } from '../../visitIntent.d-D7_yVp1I.js';
|
|
5
|
-
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-
|
|
6
|
-
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-
|
|
5
|
+
export { A as AuthContext, I as IdentityProvider, M as MintedToken, T as TokenProvider } from '../../identity.d-CRVNfZzQ.js';
|
|
6
|
+
export { A as AcceptedFrame, a as AnalysisCompleteFrame, b as AnalysisStartedFrame, D as DeltaFrame, c as DoneFrame, E as ErrorFrame, d as EverfurRequest, e as EverfurRequestBase, F as Frame, f as FrameBase, g as FrameKind, H as HeartbeatFrame, h as HttpMethod, M as MultipartBody, T as TransportPort, U as UnknownFrame, i as UrgencyLevel } from '../../config.d-KX-EkQ9j.js';
|
|
7
7
|
export { B as Brand, C as ConversationId, P as PetRef, R as RecordsRequestId, U as UserRef, _ as __brand } from '../../ids.d-B2GAAifq.js';
|
|
8
8
|
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
|
|
9
9
|
export { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews.d-
|
|
3
|
-
export { R as RecordsDepthStatus, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, a as useRecordsDepthRead } from '../../../useRecordsDepth.d-
|
|
4
|
-
export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows.d-
|
|
5
|
-
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 RecordsDepthClient, m as RecordsRequestDocument, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../../depth.d-
|
|
6
|
-
export { C as ClinicDraft, a as ClinicLocation, R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, d as RecordsUrlKind } from '../../../screenProps.d-
|
|
2
|
+
export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews.d-Chn2xwZu.cjs';
|
|
3
|
+
export { R as RecordsDepthStatus, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, a as useRecordsDepthRead } from '../../../useRecordsDepth.d-WW_2cWwU.cjs';
|
|
4
|
+
export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows.d-Kllr7Mcu.cjs';
|
|
5
|
+
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 RecordsDepthClient, m as RecordsRequestDocument, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../../depth.d-qVYPByPb.cjs';
|
|
6
|
+
export { C as ClinicDraft, a as ClinicLocation, R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, d as RecordsUrlKind } from '../../../screenProps.d-BW6PZh5k.cjs';
|
|
7
7
|
export { R as RecordsAskEntityRef, a as RecordsAskHandler } from '../../../recordsAsk.d-C5CGSi3j.cjs';
|
|
8
8
|
export { R as RecordsClinic } from '../../../clinicModels.d-BXgKZqDb.cjs';
|
|
9
9
|
export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../../ids.d-B2GAAifq.cjs';
|
|
@@ -13,8 +13,8 @@ export { E as EverfurResult } from '../../../EverfurResult.d-BFH-3s6E.cjs';
|
|
|
13
13
|
export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../../models.d-BSqvbTE1.cjs';
|
|
14
14
|
import 'react';
|
|
15
15
|
import '../../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
16
|
-
import '../../../requestFunnel.d-
|
|
17
|
-
import '../../../config.d-
|
|
18
|
-
import '../../../identity.d-
|
|
19
|
-
import '../../../clinicBatch.d-
|
|
16
|
+
import '../../../requestFunnel.d-CQX_Z1Hi.cjs';
|
|
17
|
+
import '../../../config.d-Z_fyOZke.cjs';
|
|
18
|
+
import '../../../identity.d-3ROlHbnP.cjs';
|
|
19
|
+
import '../../../clinicBatch.d-DVahpaN3.cjs';
|
|
20
20
|
import '../../../clinicRequestProps.d-1dCtouGA.cjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews.d-
|
|
3
|
-
export { R as RecordsDepthStatus, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, a as useRecordsDepthRead } from '../../../useRecordsDepth.d-
|
|
4
|
-
export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows.d-
|
|
5
|
-
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 RecordsDepthClient, m as RecordsRequestDocument, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../../depth.d-
|
|
6
|
-
export { C as ClinicDraft, a as ClinicLocation, R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, d as RecordsUrlKind } from '../../../screenProps.d-
|
|
2
|
+
export { E as EverfurDocumentContributions, a as EverfurDocumentContributionsProps, b as EverfurRecordDepth, c as EverfurRecordsDepthProps, d as EverfurRecordsTimeline } from '../../../DepthViews.d-CiU4f98J.js';
|
|
3
|
+
export { R as RecordsDepthStatus, U as UseRecordsDepthState, u as useEverfurRecordsDepthClient, a as useRecordsDepthRead } from '../../../useRecordsDepth.d-BilHZaR4.js';
|
|
4
|
+
export { T as TimelineRow, a as TimelineRowKind, b as buildTimelineRows } from '../../../timelineRows.d-B0XZevKx.js';
|
|
5
|
+
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 RecordsDepthClient, m as RecordsRequestDocument, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight, s as mapDocumentContributions, t as mapRecordDepth, u as mapRecordsTimeline } from '../../../depth.d-B_qNSgXr.js';
|
|
6
|
+
export { C as ClinicDraft, a as ClinicLocation, R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, d as RecordsUrlKind } from '../../../screenProps.d-DpMK2_gi.js';
|
|
7
7
|
export { R as RecordsAskEntityRef, a as RecordsAskHandler } from '../../../recordsAsk.d-C5CGSi3j.js';
|
|
8
8
|
export { R as RecordsClinic } from '../../../clinicModels.d-CaS64-P-.js';
|
|
9
9
|
export { B as Brand, P as PetRef, R as RecordsRequestId, _ as __brand } from '../../../ids.d-B2GAAifq.js';
|
|
@@ -13,8 +13,8 @@ export { E as EverfurResult } from '../../../EverfurResult.d-D_-254ZY.js';
|
|
|
13
13
|
export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin } from '../../../models.d-DOwnr8fi.js';
|
|
14
14
|
import 'react';
|
|
15
15
|
import '../../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
16
|
-
import '../../../requestFunnel.d-
|
|
17
|
-
import '../../../config.d-
|
|
18
|
-
import '../../../identity.d-
|
|
19
|
-
import '../../../clinicBatch.d-
|
|
16
|
+
import '../../../requestFunnel.d-DSvCGf4J.js';
|
|
17
|
+
import '../../../config.d-KX-EkQ9j.js';
|
|
18
|
+
import '../../../identity.d-CRVNfZzQ.js';
|
|
19
|
+
import '../../../clinicBatch.d-CcqnQ7-d.js';
|
|
20
20
|
import '../../../clinicRequestProps.d-CjsMg_OD.js';
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { R as RecordsController } from '../../useRecords.d-BYNX01El.cjs';
|
|
3
3
|
export { a as RecordsStatus, b as UploadDocumentInput, c as UploadQueueItem, d as UploadSkipReason, U as UseEverfurRecordsState, u as useEverfurRecords } from '../../useRecords.d-BYNX01El.cjs';
|
|
4
|
-
export { a as EverfurRecordsPage, E as EverfurRecordsPageProps } from '../../RecordsPage.d-
|
|
4
|
+
export { a as EverfurRecordsPage, E as EverfurRecordsPageProps } from '../../RecordsPage.d-CtNzoxre.cjs';
|
|
5
5
|
export { E as EverfurRecordsSheet, a as EverfurRecordsSheetLabRenderArgs, b as EverfurRecordsSheetRenderArgs } from '../../sheetSeam.d-BBuEIVsa.cjs';
|
|
6
6
|
import { CSSProperties, ReactNode, PointerEvent } from 'react';
|
|
7
7
|
import { P as PetRef, R as RecordsRequestId } from '../../ids.d-B2GAAifq.cjs';
|
|
8
8
|
export { B as Brand, D as DocumentId, _ as __brand } from '../../ids.d-B2GAAifq.cjs';
|
|
9
9
|
import { R as RecordsClinicController, C as CaptureRecordsSignature, a as ClinicRequestBaseProps, b as CapturedRecordsSignature } from '../../clinicRequestProps.d-1dCtouGA.cjs';
|
|
10
10
|
export { c as RecordsSignatureContext } from '../../clinicRequestProps.d-1dCtouGA.cjs';
|
|
11
|
-
import { R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, C as ClinicDraft, e as ClinicBatchBaseProps } from '../../screenProps.d-
|
|
12
|
-
export { a as ClinicLocation, f as RecordsNavAction, g as RecordsNavState, d as RecordsUrlKind, h as RegisterSignaturePng, i as currentRecordsScreen, j as initialRecordsNav, p as popRecordsNav, k as pushRecordsNav, r as recordsNavReducer, l as replaceRecordsNav, m as resetRecordsNav, t as transitionRecordsNav } from '../../screenProps.d-
|
|
11
|
+
import { R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, C as ClinicDraft, e as ClinicBatchBaseProps } from '../../screenProps.d-BW6PZh5k.cjs';
|
|
12
|
+
export { a as ClinicLocation, f as RecordsNavAction, g as RecordsNavState, d as RecordsUrlKind, h as RegisterSignaturePng, i as currentRecordsScreen, j as initialRecordsNav, p as popRecordsNav, k as pushRecordsNav, r as recordsNavReducer, l as replaceRecordsNav, m as resetRecordsNav, t as transitionRecordsNav } from '../../screenProps.d-BW6PZh5k.cjs';
|
|
13
13
|
import { d as RecordsRequestView } from '../../models.d-BSqvbTE1.cjs';
|
|
14
14
|
export { g as ConsentState, C as CreateUploadRequestInput, G as GrantConsentInput, k as RECORDS_TERMINAL, R as RecordDocumentMeta, a as RecordEntity, c as RecordForwardItem, l as RecordIdentityField, b as RecordOrigin, m as RecordSeries, n as RecordSeriesPoint, h as RecordsDenialReason, e as RecordsRequestGroupView, i as RecordsRequestStatus, j as RecordsSimpleStatus, f as RecordsView, U as UploadedDocument, o as isTerminalStatus, r as recordsDenialReasonOf } from '../../models.d-BSqvbTE1.cjs';
|
|
15
15
|
import { E as EverfurError } from '../../EverfurError.d-8NHtlgzA.cjs';
|
|
16
16
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.cjs';
|
|
17
|
-
export { w as FactFieldValue, 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, y as RecordFactEditInput, z as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, A as RecordMarker, B as RecordMarkerLatest, C as RecordMarkerPoint, D as RecordMarkerSummary, E as RecordMarkersView, k as RecordPhysicalExam, l as RecordsDepthClient, m as RecordsRequestDocument, G as RecordsSignatureSuggestion, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight } from '../../depth.d-
|
|
17
|
+
export { w as FactFieldValue, 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, y as RecordFactEditInput, z as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, A as RecordMarker, B as RecordMarkerLatest, C as RecordMarkerPoint, D as RecordMarkerSummary, E as RecordMarkersView, k as RecordPhysicalExam, l as RecordsDepthClient, m as RecordsRequestDocument, G as RecordsSignatureSuggestion, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight } from '../../depth.d-qVYPByPb.cjs';
|
|
18
18
|
export { b as RecordsAsk, R as RecordsAskEntityRef, a as RecordsAskHandler } from '../../recordsAsk.d-C5CGSi3j.cjs';
|
|
19
|
-
export { C as ClinicCall, F as FactOverlay, R as REQUEST_TIMELINE_TITLES, a as RecordSharesStatus, b as RecordsDashboardState, c as RecordsDashboardView, d as RecordsEmptyVariant, e as RequestTimelineEvent, f as RequestTimelineEventKey, g as RequestTimelineEventState, S as ShareRowView, U as UseRecordFactEditState, h as UseRecordPdfLinkState, i as UseRecordSharesState, j as UseRecordsMarkersState, k as applyFactOverlay, l as buildRequestTimeline, m as deriveRecordsDashboardState, n as isFactEditable, p as pickPetRecordsRequest, s as selectClinicCall, o as selectDashboardView, q as selectPrimaryLabel, r as selectRequestList, t as selectRequestTitle, u as useEverfurRecordsClinic, v as useEverfurRecordsClinicBatch, w as useRecordFactEdit, x as useRecordPdfLink, y as useRecordShares, z as useRecordsMarkers } from '../../view.d-
|
|
20
|
-
export { R as RecordsDepthStatus } from '../../useRecordsDepth.d-
|
|
19
|
+
export { C as ClinicCall, F as FactOverlay, R as REQUEST_TIMELINE_TITLES, a as RecordSharesStatus, b as RecordsDashboardState, c as RecordsDashboardView, d as RecordsEmptyVariant, e as RequestTimelineEvent, f as RequestTimelineEventKey, g as RequestTimelineEventState, S as ShareRowView, U as UseRecordFactEditState, h as UseRecordPdfLinkState, i as UseRecordSharesState, j as UseRecordsMarkersState, k as applyFactOverlay, l as buildRequestTimeline, m as deriveRecordsDashboardState, n as isFactEditable, p as pickPetRecordsRequest, s as selectClinicCall, o as selectDashboardView, q as selectPrimaryLabel, r as selectRequestList, t as selectRequestTitle, u as useEverfurRecordsClinic, v as useEverfurRecordsClinicBatch, w as useRecordFactEdit, x as useRecordPdfLink, y as useRecordShares, z as useRecordsMarkers } from '../../view.d-BTnjZu2S.cjs';
|
|
20
|
+
export { R as RecordsDepthStatus } from '../../useRecordsDepth.d-WW_2cWwU.cjs';
|
|
21
21
|
export { g as RecordPdfLink, f as RecordShare, R as RecordShareAudience, i as RecordShareAudienceScope, d as RecordShareEmailInput, e as RecordShareEmailReceipt, c as RecordShareLink, j as RecordShareRecipientKind, a as RecordsFeatures, q as RecordsPhotoContentType, b as RecordsUploadContentType, s as acceptsPhotos } from '../../features.d-DrQxTw3-.cjs';
|
|
22
|
-
export { a as EverfurDocumentContributionsProps, c as EverfurRecordsDepthProps } from '../../DepthViews.d-
|
|
23
|
-
export { C as CreateClinicRequestBatchInput, b as RECORDS_CLINIC_BATCH_MAX, R as RecordsClinicBatch, a as RecordsClinicBatchClient, c as RecordsClinicBatchItem, d as RecordsClinicBatchResult } from '../../clinicBatch.d-
|
|
22
|
+
export { a as EverfurDocumentContributionsProps, c as EverfurRecordsDepthProps } from '../../DepthViews.d-Chn2xwZu.cjs';
|
|
23
|
+
export { C as CreateClinicRequestBatchInput, b as RECORDS_CLINIC_BATCH_MAX, R as RecordsClinicBatch, a as RecordsClinicBatchClient, c as RecordsClinicBatchItem, d as RecordsClinicBatchResult } from '../../clinicBatch.d-DVahpaN3.cjs';
|
|
24
24
|
export { C as CreateClinicRequestInput, f as RecordsAuthorizationCopy, b as RecordsAuthorizationSignature, R as RecordsClinic, c as RecordsClinicSearchInput, d as RecordsClinicSearchPage, a as RecordsClinicTarget, e as RecordsRecentClinicsInput, g as RecordsSignatureUploadPolicy } from '../../clinicModels.d-BXgKZqDb.cjs';
|
|
25
25
|
export { WebRecordsUploadTransportOptions, createWebRecordsUploadTransport } from './upload/index.cjs';
|
|
26
26
|
import { F as FileHandle } from '../../ports.d-BX4f4UsB.cjs';
|
|
27
27
|
export { a as UploadPolicyWire, U as UploadTransport } from '../../ports.d-BX4f4UsB.cjs';
|
|
28
28
|
export { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
29
29
|
import '../../ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
30
|
-
import '../../requestFunnel.d-
|
|
31
|
-
import '../../config.d-
|
|
32
|
-
import '../../identity.d-
|
|
30
|
+
import '../../requestFunnel.d-CQX_Z1Hi.cjs';
|
|
31
|
+
import '../../config.d-Z_fyOZke.cjs';
|
|
32
|
+
import '../../identity.d-3ROlHbnP.cjs';
|
|
33
33
|
|
|
34
34
|
type RecordsHistoryMode = 'memory' | 'browser';
|
|
35
35
|
interface EverfurRecordsProps extends RecordsHostSeams {
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { R as RecordsController } from '../../useRecords.d-DWk61a4c.js';
|
|
3
3
|
export { a as RecordsStatus, b as UploadDocumentInput, c as UploadQueueItem, d as UploadSkipReason, U as UseEverfurRecordsState, u as useEverfurRecords } from '../../useRecords.d-DWk61a4c.js';
|
|
4
|
-
export { a as EverfurRecordsPage, E as EverfurRecordsPageProps } from '../../RecordsPage.d-
|
|
4
|
+
export { a as EverfurRecordsPage, E as EverfurRecordsPageProps } from '../../RecordsPage.d-CRRJM35Q.js';
|
|
5
5
|
export { E as EverfurRecordsSheet, a as EverfurRecordsSheetLabRenderArgs, b as EverfurRecordsSheetRenderArgs } from '../../sheetSeam.d-B09jf4YC.js';
|
|
6
6
|
import { CSSProperties, ReactNode, PointerEvent } from 'react';
|
|
7
7
|
import { P as PetRef, R as RecordsRequestId } from '../../ids.d-B2GAAifq.js';
|
|
8
8
|
export { B as Brand, D as DocumentId, _ as __brand } from '../../ids.d-B2GAAifq.js';
|
|
9
9
|
import { R as RecordsClinicController, C as CaptureRecordsSignature, a as ClinicRequestBaseProps, b as CapturedRecordsSignature } from '../../clinicRequestProps.d-CjsMg_OD.js';
|
|
10
10
|
export { c as RecordsSignatureContext } from '../../clinicRequestProps.d-CjsMg_OD.js';
|
|
11
|
-
import { R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, C as ClinicDraft, e as ClinicBatchBaseProps } from '../../screenProps.d-
|
|
12
|
-
export { a as ClinicLocation, f as RecordsNavAction, g as RecordsNavState, d as RecordsUrlKind, h as RegisterSignaturePng, i as currentRecordsScreen, j as initialRecordsNav, p as popRecordsNav, k as pushRecordsNav, r as recordsNavReducer, l as replaceRecordsNav, m as resetRecordsNav, t as transitionRecordsNav } from '../../screenProps.d-
|
|
11
|
+
import { R as RecordsHostSeams, b as RecordsScreen, c as RecordsScreenBaseProps, C as ClinicDraft, e as ClinicBatchBaseProps } from '../../screenProps.d-DpMK2_gi.js';
|
|
12
|
+
export { a as ClinicLocation, f as RecordsNavAction, g as RecordsNavState, d as RecordsUrlKind, h as RegisterSignaturePng, i as currentRecordsScreen, j as initialRecordsNav, p as popRecordsNav, k as pushRecordsNav, r as recordsNavReducer, l as replaceRecordsNav, m as resetRecordsNav, t as transitionRecordsNav } from '../../screenProps.d-DpMK2_gi.js';
|
|
13
13
|
import { d as RecordsRequestView } from '../../models.d-DOwnr8fi.js';
|
|
14
14
|
export { g as ConsentState, C as CreateUploadRequestInput, G as GrantConsentInput, k as RECORDS_TERMINAL, R as RecordDocumentMeta, a as RecordEntity, c as RecordForwardItem, l as RecordIdentityField, b as RecordOrigin, m as RecordSeries, n as RecordSeriesPoint, h as RecordsDenialReason, e as RecordsRequestGroupView, i as RecordsRequestStatus, j as RecordsSimpleStatus, f as RecordsView, U as UploadedDocument, o as isTerminalStatus, r as recordsDenialReasonOf } from '../../models.d-DOwnr8fi.js';
|
|
15
15
|
import { E as EverfurError } from '../../EverfurError.d-8NHtlgzA.js';
|
|
16
16
|
export { a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError.d-8NHtlgzA.js';
|
|
17
|
-
export { w as FactFieldValue, 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, y as RecordFactEditInput, z as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, A as RecordMarker, B as RecordMarkerLatest, C as RecordMarkerPoint, D as RecordMarkerSummary, E as RecordMarkersView, k as RecordPhysicalExam, l as RecordsDepthClient, m as RecordsRequestDocument, G as RecordsSignatureSuggestion, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight } from '../../depth.d-
|
|
17
|
+
export { w as FactFieldValue, 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, y as RecordFactEditInput, z as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, A as RecordMarker, B as RecordMarkerLatest, C as RecordMarkerPoint, D as RecordMarkerSummary, E as RecordMarkersView, k as RecordPhysicalExam, l as RecordsDepthClient, m as RecordsRequestDocument, G as RecordsSignatureSuggestion, n as RecordsTimelineMedication, o as RecordsTimelineVaccine, p as RecordsTimelineView, q as RecordsTimelineVisit, r as RecordsTimelineWeight } from '../../depth.d-B_qNSgXr.js';
|
|
18
18
|
export { b as RecordsAsk, R as RecordsAskEntityRef, a as RecordsAskHandler } from '../../recordsAsk.d-C5CGSi3j.js';
|
|
19
|
-
export { C as ClinicCall, F as FactOverlay, R as REQUEST_TIMELINE_TITLES, a as RecordSharesStatus, b as RecordsDashboardState, c as RecordsDashboardView, d as RecordsEmptyVariant, e as RequestTimelineEvent, f as RequestTimelineEventKey, g as RequestTimelineEventState, S as ShareRowView, U as UseRecordFactEditState, h as UseRecordPdfLinkState, i as UseRecordSharesState, j as UseRecordsMarkersState, k as applyFactOverlay, l as buildRequestTimeline, m as deriveRecordsDashboardState, n as isFactEditable, p as pickPetRecordsRequest, s as selectClinicCall, o as selectDashboardView, q as selectPrimaryLabel, r as selectRequestList, t as selectRequestTitle, u as useEverfurRecordsClinic, v as useEverfurRecordsClinicBatch, w as useRecordFactEdit, x as useRecordPdfLink, y as useRecordShares, z as useRecordsMarkers } from '../../view.d-
|
|
20
|
-
export { R as RecordsDepthStatus } from '../../useRecordsDepth.d-
|
|
19
|
+
export { C as ClinicCall, F as FactOverlay, R as REQUEST_TIMELINE_TITLES, a as RecordSharesStatus, b as RecordsDashboardState, c as RecordsDashboardView, d as RecordsEmptyVariant, e as RequestTimelineEvent, f as RequestTimelineEventKey, g as RequestTimelineEventState, S as ShareRowView, U as UseRecordFactEditState, h as UseRecordPdfLinkState, i as UseRecordSharesState, j as UseRecordsMarkersState, k as applyFactOverlay, l as buildRequestTimeline, m as deriveRecordsDashboardState, n as isFactEditable, p as pickPetRecordsRequest, s as selectClinicCall, o as selectDashboardView, q as selectPrimaryLabel, r as selectRequestList, t as selectRequestTitle, u as useEverfurRecordsClinic, v as useEverfurRecordsClinicBatch, w as useRecordFactEdit, x as useRecordPdfLink, y as useRecordShares, z as useRecordsMarkers } from '../../view.d-BtN_L_UF.js';
|
|
20
|
+
export { R as RecordsDepthStatus } from '../../useRecordsDepth.d-BilHZaR4.js';
|
|
21
21
|
export { g as RecordPdfLink, f as RecordShare, R as RecordShareAudience, i as RecordShareAudienceScope, d as RecordShareEmailInput, e as RecordShareEmailReceipt, c as RecordShareLink, j as RecordShareRecipientKind, a as RecordsFeatures, q as RecordsPhotoContentType, b as RecordsUploadContentType, s as acceptsPhotos } from '../../features.d-DrQxTw3-.js';
|
|
22
|
-
export { a as EverfurDocumentContributionsProps, c as EverfurRecordsDepthProps } from '../../DepthViews.d-
|
|
23
|
-
export { C as CreateClinicRequestBatchInput, b as RECORDS_CLINIC_BATCH_MAX, R as RecordsClinicBatch, a as RecordsClinicBatchClient, c as RecordsClinicBatchItem, d as RecordsClinicBatchResult } from '../../clinicBatch.d-
|
|
22
|
+
export { a as EverfurDocumentContributionsProps, c as EverfurRecordsDepthProps } from '../../DepthViews.d-CiU4f98J.js';
|
|
23
|
+
export { C as CreateClinicRequestBatchInput, b as RECORDS_CLINIC_BATCH_MAX, R as RecordsClinicBatch, a as RecordsClinicBatchClient, c as RecordsClinicBatchItem, d as RecordsClinicBatchResult } from '../../clinicBatch.d-CcqnQ7-d.js';
|
|
24
24
|
export { C as CreateClinicRequestInput, f as RecordsAuthorizationCopy, b as RecordsAuthorizationSignature, R as RecordsClinic, c as RecordsClinicSearchInput, d as RecordsClinicSearchPage, a as RecordsClinicTarget, e as RecordsRecentClinicsInput, g as RecordsSignatureUploadPolicy } from '../../clinicModels.d-CaS64-P-.js';
|
|
25
25
|
export { WebRecordsUploadTransportOptions, createWebRecordsUploadTransport } from './upload/index.js';
|
|
26
26
|
import { F as FileHandle } from '../../ports.d-BX4f4UsB.js';
|
|
27
27
|
export { a as UploadPolicyWire, U as UploadTransport } from '../../ports.d-BX4f4UsB.js';
|
|
28
28
|
export { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
29
29
|
import '../../ErrorPolicyPort.d-68yrE3BE.js';
|
|
30
|
-
import '../../requestFunnel.d-
|
|
31
|
-
import '../../config.d-
|
|
32
|
-
import '../../identity.d-
|
|
30
|
+
import '../../requestFunnel.d-DSvCGf4J.js';
|
|
31
|
+
import '../../config.d-KX-EkQ9j.js';
|
|
32
|
+
import '../../identity.d-CRVNfZzQ.js';
|
|
33
33
|
|
|
34
34
|
type RecordsHistoryMode = 'memory' | 'browser';
|
|
35
35
|
interface EverfurRecordsProps extends RecordsHostSeams {
|
|
@@ -97,7 +97,7 @@ return Object.freeze({features:/* @__PURE__ */Object.freeze({...parsed.data.feat
|
|
|
97
97
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",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",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
|
|
98
98
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
99
99
|
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
|
|
100
|
-
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var SDK_VERSION="0.18.
|
|
100
|
+
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var SDK_VERSION="0.18.3";function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base2=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base2,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
101
101
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
102
102
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function isNotFoundError(error){return error!=null&&(error.httpStatus===404||error.category==="notFound")}function plainNotFound(error){return error.code!=="conversationNotFound"?error:makeEverfurError("resourceNotFound",{retryable:false,...error.httpStatus===void 0?{}:{httpStatus:error.httpStatus},...error.requestId===void 0?{}:{requestId:error.requestId},...error.reasonCode===void 0?{}:{reasonCode:error.reasonCode},...error.wireMessage===void 0?{}:{wireMessage:error.wireMessage},...error.raw===void 0?{}:{raw:error.raw}})}function plainResult(res){return res.ok?res:err(plainNotFound(res.error))}function withPlainNotFound(funnel){return{send:async(...args)=>plainResult(await funnel.send(...args)),authorize:req=>funnel.authorize(req),stream:(call,req,signal)=>funnel.stream(call,req,signal)}}var str2=(value,max=4e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null;function httpsUrl(value){let s=str2(value,2048);return s===null?null:/^https:\/\/[^\s]+$/i.test(s)?s:null}var DETAIL_ROWS=6;function boundOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0&&value<=400?value:null}function rowsOf(value,each,max){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(out.length>=max)break;if(raw===null||typeof raw!="object"||Array.isArray(raw))continue;let row=each(raw);row!==null&&out.push(row)}/* @__PURE__ */
|
|
103
103
|
return Object.freeze(out)}function titledOf(o){let title=str2(o.title,80),body=str2(o.body,600);return title===null||body===null?null:/* @__PURE__ */Object.freeze({title:title,body:body})}function healthPlanItemDetailOf(value){if(value===null||typeof value!="object"||Array.isArray(value))return;let o=value,gallery=[];if(Array.isArray(o.gallery))for(let g of o.gallery){let url=httpsUrl(g);url!==null&&gallery.length<DETAIL_ROWS&&gallery.push(url)}let doses=rowsOf(o.doses,d=>{let label=str2(d.label,60),amount=str2(d.amount,60);return label===null||amount===null?null:/* @__PURE__ */Object.freeze({label:label,amount:amount,minLb:boundOf(d.minLb??d.min_lb),maxLb:boundOf(d.maxLb??d.max_lb)})},DETAIL_ROWS),details=rowsOf(o.details,titledOf,DETAIL_ROWS),fitRaw=o.fit,fitRow=fitRaw!==null&&typeof fitRaw=="object"&&!Array.isArray(fitRaw)?titledOf(fitRaw):null,fit=fitRow!==null&&fitRaw.pet===true?/* @__PURE__ */Object.freeze({...fitRow,pet:true}):fitRow,detail=/* @__PURE__ */Object.freeze({kicker:str2(o.kicker,80),gallery:/* @__PURE__ */Object.freeze(gallery),doses:doses,details:details,fine:str2(o.fine,300),fit:fit});return detail.kicker===null&&gallery.length===0&&doses.length===0&&details.length===0&&detail.fine===null&&fit===null?void 0:detail}var REF_MAX=128;var ICONS=/* @__PURE__ */new Set(["shield","arrow","check","star","truck","refresh","card","alert","x","chat","repeat","calendar","flame","box","cart","minus","plus","chev","pulse","file","kit","dna","heart","bottle","harness","ramp"]),TONES=/* @__PURE__ */new Set(["y","c","g","r"]),TRACK_STATES=/* @__PURE__ */new Set(["done","now","next"]),obj=value=>value!==null&&typeof value=="object"&&!Array.isArray(value)?value:null,str3=(value,max=1e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null,kindOf=value=>typeof value=="string"&&/^[A-Za-z0-9_-]{1,40}$/.test(value)?value:null,iconOf=value=>typeof value=="string"&&ICONS.has(value)?value:null;function imageOf(value){let s=str3(value,2048);return s===null||/\s/.test(s)?null:/^https:\/\/[^/]/i.test(s)||/^\/(?![/\\])/.test(s)?s:null}var idOf=value=>typeof value=="number"&&Number.isInteger(value)?String(value):str3(value,REF_MAX);function weightOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>0?value:null}function clean(fields){/* @__PURE__ */
|
|
@@ -97,7 +97,7 @@ return Object.freeze({features:/* @__PURE__ */Object.freeze({...parsed.data.feat
|
|
|
97
97
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__PURE__ */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",session_revoked:"authExpired",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",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",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"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 categoryFor(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:ACCESS_DENIED_COPY,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:VALIDATION_FAILED_COPY,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."}),SESSION_REVOKED_COPY="This session has ended. Please sign in again.",LINKED_ACCOUNT_READ_ONLY="linked_account_read_only";function displayFor(code,wireCode,reasonCode){return code==="conflict"&&reasonCode===LINKED_ACCOUNT_READ_ONLY?ACCESS_DENIED_COPY:(code==="authRejected"||code==="authExpired")&&typeof wireCode=="string"&&wireCode.trim().toLowerCase()==="session_revoked"?SESSION_REVOKED_COPY:userFacingError(code)}function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),linkedReadOnly=code==="conflict"&&opts?.reasonCode===LINKED_ACCOUNT_READ_ONLY,error={code:code,category:categoryFor(code),retryable:opts?.retryable??(linkedReadOnly?false:isRetryableCode(code)),displayMessage:displayFor(code,opts?.wireCode,linkedReadOnly?LINKED_ACCOUNT_READ_ONLY:null)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function ok(value,warning){/* @__PURE__ */
|
|
98
98
|
return Object.freeze({ok:true,value:value})}function err(error){/* @__PURE__ */
|
|
99
99
|
return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _EverfurConfigError extends Error{constructor(kind,message){super(message),this.name="EverfurConfigError",this.kind=kind,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function errorFrame(fields){/* @__PURE__ */
|
|
100
|
-
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var SDK_VERSION="0.18.
|
|
100
|
+
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}var SDK_VERSION="0.18.3";function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base2=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base2,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
101
101
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
102
102
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function isNotFoundError(error){return error!=null&&(error.httpStatus===404||error.category==="notFound")}function plainNotFound(error){return error.code!=="conversationNotFound"?error:makeEverfurError("resourceNotFound",{retryable:false,...error.httpStatus===void 0?{}:{httpStatus:error.httpStatus},...error.requestId===void 0?{}:{requestId:error.requestId},...error.reasonCode===void 0?{}:{reasonCode:error.reasonCode},...error.wireMessage===void 0?{}:{wireMessage:error.wireMessage},...error.raw===void 0?{}:{raw:error.raw}})}function plainResult(res){return res.ok?res:err(plainNotFound(res.error))}function withPlainNotFound(funnel){return{send:async(...args)=>plainResult(await funnel.send(...args)),authorize:req=>funnel.authorize(req),stream:(call,req,signal)=>funnel.stream(call,req,signal)}}var str2=(value,max=4e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null;function httpsUrl(value){let s=str2(value,2048);return s===null?null:/^https:\/\/[^\s]+$/i.test(s)?s:null}var DETAIL_ROWS=6;function boundOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0&&value<=400?value:null}function rowsOf(value,each,max){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(out.length>=max)break;if(raw===null||typeof raw!="object"||Array.isArray(raw))continue;let row=each(raw);row!==null&&out.push(row)}/* @__PURE__ */
|
|
103
103
|
return Object.freeze(out)}function titledOf(o){let title=str2(o.title,80),body=str2(o.body,600);return title===null||body===null?null:/* @__PURE__ */Object.freeze({title:title,body:body})}function healthPlanItemDetailOf(value){if(value===null||typeof value!="object"||Array.isArray(value))return;let o=value,gallery=[];if(Array.isArray(o.gallery))for(let g of o.gallery){let url=httpsUrl(g);url!==null&&gallery.length<DETAIL_ROWS&&gallery.push(url)}let doses=rowsOf(o.doses,d=>{let label=str2(d.label,60),amount=str2(d.amount,60);return label===null||amount===null?null:/* @__PURE__ */Object.freeze({label:label,amount:amount,minLb:boundOf(d.minLb??d.min_lb),maxLb:boundOf(d.maxLb??d.max_lb)})},DETAIL_ROWS),details=rowsOf(o.details,titledOf,DETAIL_ROWS),fitRaw=o.fit,fitRow=fitRaw!==null&&typeof fitRaw=="object"&&!Array.isArray(fitRaw)?titledOf(fitRaw):null,fit=fitRow!==null&&fitRaw.pet===true?/* @__PURE__ */Object.freeze({...fitRow,pet:true}):fitRow,detail=/* @__PURE__ */Object.freeze({kicker:str2(o.kicker,80),gallery:/* @__PURE__ */Object.freeze(gallery),doses:doses,details:details,fine:str2(o.fine,300),fit:fit});return detail.kicker===null&&gallery.length===0&&doses.length===0&&details.length===0&&detail.fine===null&&fit===null?void 0:detail}var REF_MAX=128;var ICONS=/* @__PURE__ */new Set(["shield","arrow","check","star","truck","refresh","card","alert","x","chat","repeat","calendar","flame","box","cart","minus","plus","chev","pulse","file","kit","dna","heart","bottle","harness","ramp"]),TONES=/* @__PURE__ */new Set(["y","c","g","r"]),TRACK_STATES=/* @__PURE__ */new Set(["done","now","next"]),obj=value=>value!==null&&typeof value=="object"&&!Array.isArray(value)?value:null,str3=(value,max=1e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null,kindOf=value=>typeof value=="string"&&/^[A-Za-z0-9_-]{1,40}$/.test(value)?value:null,iconOf=value=>typeof value=="string"&&ICONS.has(value)?value:null;function imageOf(value){let s=str3(value,2048);return s===null||/\s/.test(s)?null:/^https:\/\/[^/]/i.test(s)||/^\/(?![/\\])/.test(s)?s:null}var idOf=value=>typeof value=="number"&&Number.isInteger(value)?String(value):str3(value,REF_MAX);function weightOf(value){return typeof value=="number"&&Number.isFinite(value)&&value>0?value:null}function clean(fields){/* @__PURE__ */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { O as OmsClient, S as ShopPet, a as ShopPaymentsPort, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, g as ShopCardReturn, h as ShopProfileName, i as ShopOrdersV2Copy } from '../../idempotency.d-
|
|
4
|
-
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, t as ShopPaymentStepResult, u as ShopTabName, v as StripeJsLike, w as StripeJsPaymentsOptions, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, z as createStripeJsPayments, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../../idempotency.d-
|
|
3
|
+
import { O as OmsClient, S as ShopPet, a as ShopPaymentsPort, b as ShopPackageSource, c as ShopCopy, d as ShopV3Copy, e as ShopRoute, f as ShopCardHandoff, g as ShopCardReturn, h as ShopProfileName, i as ShopOrdersV2Copy } from '../../idempotency.d-BmYuCb-n.cjs';
|
|
4
|
+
export { j as OmsClientConfig, k as OmsConsumerAuth, l as OmsGetToken, m as SHOP_COPY, n as SHOP_COPY_PLACEHOLDERS, o as SHOP_ORDERS_V2_COPY, p as SHOP_V3_COPY, q as SHOP_V3_COPY_PLACEHOLDERS, r as ShopPackage, s as ShopPackageLine, t as ShopPaymentStepResult, u as ShopTabName, v as StripeJsLike, w as StripeJsPaymentsOptions, U as UNAVAILABLE_PACKAGE_SOURCE, x as createOmsClient, y as createOmsPackageSource, z as createStripeJsPayments, A as newIdempotencyKey, B as shopCopy, C as shopOrdersV2Copy, D as shopV3Copy } from '../../idempotency.d-BmYuCb-n.cjs';
|
|
5
5
|
export { o as OmsAddress, a as OmsBuyAgainItem, p as OmsCartLine, q as OmsCents, j as OmsError, r as OmsOffer, b as OmsOrder, c as OmsOrderSummary, f as OmsPlan, s as OmsPlanChangeOption, t as OmsPlanOperation, m as OmsPlanSkipWarning, u as OmsPlanSkipWarningKey, n as OmsPrescription, g as OmsQuote, v as OmsQuoteLine, h as OmsReceipt, w as OmsReceiptCard, x as OmsReceiptLine, y as OmsResult, i as OmsShopConfig, z as OmsSupply, A as isOmsRefusal, B as isOmsRetryable, C as isOmsUnavailable } from '../../omsErrors.d-VF5tnr20.cjs';
|
|
6
|
-
import '../../config.d-
|
|
6
|
+
import '../../config.d-Z_fyOZke.cjs';
|
|
7
7
|
import '../../EverfurError.d-8NHtlgzA.cjs';
|
|
8
8
|
import '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
9
9
|
|