@everfur/sdk 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/{Chat.d-D61LLPJh.d.ts → Chat.d-CoGJrK3t.d.ts} +1 -1
- package/dist/{Chat.d-IpxKa9gS.d.cts → Chat.d-JDtlG_EW.d.cts} +1 -1
- package/dist/{DepthViews.d-C8EsR8Gq.d.ts → DepthViews.d-CNQn-eEr.d.ts} +1 -1
- package/dist/{DepthViews.d-w2o4Nf7r.d.ts → DepthViews.d-D31VlFKU.d.ts} +1 -1
- package/dist/{DepthViews.d-CDIL4mPa.d.cts → DepthViews.d-XTv4s3ru.d.cts} +1 -1
- package/dist/{DepthViews.d-Q1nqdH8n.d.cts → DepthViews.d-zxM_xbP9.d.cts} +1 -1
- package/dist/{RecordsPage.d-BSjZOHu8.d.cts → RecordsPage.d-CSZHrtWJ.d.cts} +1 -1
- package/dist/{RecordsPage.d-DqhM_rCr.d.ts → RecordsPage.d-D_y-ZB3S.d.ts} +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/{attachments.d-BviU_Tja.d.cts → attachments.d-D74wbmQU.d.cts} +1 -1
- package/dist/{attachments.d-DZVfHHnY.d.ts → attachments.d-Dm6NUJTR.d.ts} +1 -1
- package/dist/{bookingCopy.d-5V3erfXD.d.ts → bookingCopy.d-DMmLKY5Q.d.ts} +2 -2
- package/dist/{bookingCopy.d-DlzUPsFE.d.cts → bookingCopy.d-iaYDPvPd.d.cts} +2 -2
- package/dist/{casesRepository.d-Dqg-KbpA.d.ts → casesRepository.d-CCJJQXnl.d.ts} +1 -1
- package/dist/{casesRepository.d-7Us2O-z8.d.cts → casesRepository.d-G2dahIKO.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/{chatHandoffToken.d-TYcD8NIi.d.ts → chatHandoffToken.d-DVv9tl8h.d.ts} +5 -5
- package/dist/{chatHandoffToken.d-B9pjkEfl.d.cts → chatHandoffToken.d-xmnHrTA5.d.cts} +5 -5
- package/dist/{chatTypes.d-RnQ5R4zP.d.cts → chatTypes.d-CQC7GTdE.d.cts} +4 -4
- package/dist/{chatTypes.d-DPALEQoW.d.ts → chatTypes.d-hS1AilYl.d.ts} +4 -4
- package/dist/chunk-2NA7TPUA.js +5 -0
- package/dist/chunk-IJU5TV5N.js +12 -0
- package/dist/chunk-TFX6WMDN.js +30 -0
- package/dist/chunk-WZNPR5TY.js +34 -0
- 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-C6MzLj3X.d.cts → clinicBatch.d-4PFwKJfw.d.cts} +2 -2
- package/dist/{clinicBatch.d-t9hkown2.d.ts → clinicBatch.d-BpP2NBb3.d.ts} +2 -2
- package/dist/{config.d-BnZkxI5a.d.ts → config.d-D9igq-vT.d.ts} +1 -1
- package/dist/{config.d-DoC-XaJ0.d.cts → config.d-cX5E6DAw.d.cts} +1 -1
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/{context.d-BAh7C7T4.d.cts → context.d-BrRRNw9I.d.cts} +4 -4
- package/dist/{context.d-z2zIjKEb.d.ts → context.d-hPfsEsNf.d.ts} +4 -4
- package/dist/{copy.d-DLxgHsZZ.d.ts → copy.d-CDlirTR4.d.ts} +2 -2
- package/dist/{copy.d-BkX6G-Ws.d.cts → copy.d-DWjSkbrZ.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-z2FlzY3x.d.ts → depth.d-CfBorxcQ.d.ts} +2 -2
- package/dist/{depth.d-aXddCjyh.d.cts → depth.d-KkrGx98U.d.cts} +2 -2
- package/dist/{entitlementRepository.d-CDCF8eFx.d.cts → entitlementRepository.d-BvnWpcQH.d.cts} +2 -2
- package/dist/{entitlementRepository.d-Cgmy4Opa.d.ts → entitlementRepository.d-DpQrIgW6.d.ts} +2 -2
- package/dist/{focus.d-q_sXGhLn.d.cts → focus.d-9loikWy8.d.cts} +2 -2
- package/dist/{focus.d-C2fd_5MW.d.ts → focus.d-CYwVLDvR.d.ts} +2 -2
- package/dist/health-plan/index.cjs +53 -37
- package/dist/health-plan/index.d.cts +9 -9
- package/dist/health-plan/index.d.ts +9 -9
- package/dist/health-plan/index.js +54 -38
- package/dist/{idempotency.d-Bqdyv_yn.d.cts → idempotency.d-CVKkUhY4.d.cts} +1 -1
- package/dist/{idempotency.d-DlAPAxD5.d.ts → idempotency.d-DGQ_xML5.d.ts} +1 -1
- package/dist/{identity.d-CooKscNj.d.cts → identity.d-Bnl5Z0MM.d.cts} +1 -1
- package/dist/{identity.d-BWZiaByn.d.ts → identity.d-DR5YwO6E.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-baVM016i.d.ts → introEvents.d-D_yL7lnE.d.ts} +1 -1
- package/dist/{introEvents.d-C8bDDiK6.d.cts → introEvents.d-JmPqEqMQ.d.cts} +1 -1
- package/dist/notifications/inbox/index.d.cts +4 -4
- package/dist/notifications/inbox/index.d.ts +4 -4
- package/dist/notifications/index.d.cts +7 -7
- package/dist/notifications/index.d.ts +7 -7
- package/dist/{optInView.d-D_D7fs6C.d.cts → optInView.d-BizcW_QG.d.cts} +2 -2
- package/dist/{optInView.d-C04aX0Hs.d.ts → optInView.d-CZvKlq-o.d.ts} +2 -2
- package/dist/{pets.d-oJ2OIY22.d.cts → pets.d-C4CWxQPh.d.cts} +1 -1
- package/dist/{pets.d-CkFNO-x-.d.ts → pets.d-uCzgFbGi.d.ts} +1 -1
- package/dist/{petsRepository.d-VWMyIeIJ.d.cts → petsRepository.d-DOcVv9bd.d.cts} +1 -1
- package/dist/{petsRepository.d-CKCi6rtp.d.ts → petsRepository.d-DRW7NkKm.d.ts} +1 -1
- 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-DVCytzTE.d.ts → requestFunnel.d-BYLycQMI.d.ts} +2 -2
- package/dist/{requestFunnel.d-By0-I8Cp.d.cts → requestFunnel.d-CQ0O8fMG.d.cts} +2 -2
- package/dist/{route.d-Ay-lRct1.d.ts → route.d-DFJ0gXj8.d.ts} +2 -2
- package/dist/{route.d-DQDX6QFn.d.cts → route.d-q9yndhFy.d.cts} +2 -2
- package/dist/{runtimeTypes.d-DUVNpR6g.d.cts → runtimeTypes.d-3LRuzxr7.d.cts} +4 -4
- package/dist/{runtimeTypes.d-C49Cgb9c.d.ts → runtimeTypes.d-BJHYj2MI.d.ts} +4 -4
- package/dist/{screenProps.d-BgxlmfG5.d.cts → screenProps.d-DfAmuKkr.d.cts} +1 -1
- package/dist/{screenProps.d-B_arD3Lh.d.ts → screenProps.d-tVzlXGaN.d.ts} +1 -1
- package/dist/server/events/index.cjs +1 -1
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +1 -1
- package/dist/shop/index.cjs +187 -145
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/shop/index.js +188 -146
- package/dist/tabs/index.d.cts +6 -6
- package/dist/tabs/index.d.ts +6 -6
- package/dist/televet/booking/index.d.cts +6 -6
- package/dist/televet/booking/index.d.ts +6 -6
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/rn/index.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-Cbhjjb9_.d.ts → threadOptions.d-DfH26dy7.d.ts} +2 -2
- package/dist/{threadOptions.d-pZXzsd2d.d.cts → threadOptions.d-I6G3BdlP.d.cts} +2 -2
- package/dist/{timelineRows.d-BHxMeZzl.d.ts → timelineRows.d-CugnCOfZ.d.ts} +1 -1
- package/dist/{timelineRows.d-DlMs82N1.d.cts → timelineRows.d-uSfr2IP3.d.cts} +1 -1
- package/dist/{types.d-d3RdaeAA.d.cts → types.d-BOKzNuuF.d.cts} +87 -85
- package/dist/{types.d-d3RdaeAA.d.ts → types.d-BOKzNuuF.d.ts} +87 -85
- package/dist/ui/index.cjs +98 -46
- package/dist/ui/index.d.cts +4 -3
- package/dist/ui/index.d.ts +4 -3
- package/dist/ui/index.js +98 -46
- package/dist/{useHealthPlanSubscription.d-BoC7H85G.d.ts → useHealthPlanSubscription.d-CVVQIFpG.d.ts} +2 -2
- package/dist/{useHealthPlanSubscription.d-CZn06-lu.d.cts → useHealthPlanSubscription.d-DylPMm_m.d.cts} +2 -2
- package/dist/{useInboxUnread.d-vYpOXVRv.d.ts → useInboxUnread.d-DDoSII8D.d.ts} +1 -1
- package/dist/{useInboxUnread.d-DW0dpWdv.d.cts → useInboxUnread.d-Dq3CCAa3.d.cts} +1 -1
- package/dist/{usePresentation.d-CgvwGb2A.d.ts → usePresentation.d-CDNK4MDY.d.ts} +1 -1
- package/dist/{usePresentation.d-CyCEJ6nj.d.cts → usePresentation.d-CrobH0d_.d.cts} +1 -1
- package/dist/{useRecordsDepth.d-CbXhWbx7.d.ts → useRecordsDepth.d-BvBYIPii.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-CcbL98FD.d.cts → useRecordsDepth.d-Cd5Vyb7D.d.cts} +1 -1
- package/dist/{useUnread.d-CfF2Cx-q.d.cts → useUnread.d-B4Yqcteg.d.cts} +3 -3
- package/dist/{useUnread.d-BsZKbLp9.d.ts → useUnread.d-ElAEfgl1.d.ts} +3 -3
- package/dist/{view.d-DdyOf0T0.d.ts → view.d-2RWoY9kd.d.ts} +3 -3
- package/dist/{view.d-CF3AP3T7.d.cts → view.d-utmOR2ee.d.cts} +3 -3
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/health-plan/index.cjs +43 -16
- package/dist/web/health-plan/index.d.cts +11 -11
- package/dist/web/health-plan/index.d.ts +11 -11
- package/dist/web/health-plan/index.js +32 -27
- package/dist/web/health-plan/styles.css +160 -1
- package/dist/web/inbox/index.d.cts +5 -5
- package/dist/web/inbox/index.d.ts +5 -5
- 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 +6 -6
- package/dist/web/notifications/index.d.ts +6 -6
- 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.cjs +110 -88
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/shop/index.js +67 -81
- package/dist/web/televet/booking/index.d.cts +6 -6
- package/dist/web/televet/booking/index.d.ts +6 -6
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/dist/web/ui/index.cjs +96 -57
- package/dist/web/ui/index.d.cts +4 -3
- package/dist/web/ui/index.d.ts +4 -3
- package/dist/web/ui/index.js +41 -46
- package/dist/web/ui/styles.css +481 -1
- package/package.json +5 -5
- package/dist/chunk-Y3Q4GW47.js +0 -31
|
@@ -1,9 +1,7 @@
|
|
|
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
|
"use client";
|
|
3
|
-
import{useEverfurTheme,cssMonoFamily,headingFaceCss,faceCss,EVERFUR_LIGHT,EVERFUR_DARK,Toast,useDsStyles,buttonCss,segmentedTabsCss,summaryListCss,toastCss,ThemeProvider,Button,SummaryList,SegmentedTabs,resolveTheme,everfurWebTheme}from"../../chunk-Y3Q4GW47.js";import{createContext,lazy,useMemo,useEffect,useRef,useId,useState,useContext,useCallback,useLayoutEffect,createElement,useSyncExternalStore,Fragment as Fragment$1,Suspense,Component}from"react";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{createPortal}from"react-dom";function toRgba(value){if(typeof value=="number")return argbIntToRgba(value);if(typeof value!="string")return null;let s=value.trim();if(s.length===0)return null;if(s.startsWith("#"))return fromHex(s.slice(1));if(s.toLowerCase().startsWith("0x"))return fromHex(s.slice(2));if(s.toLowerCase().startsWith("rgb"))return fromRgbFunc(s);if(/^[0-9a-fA-F]+$/.test(s)){let hex=fromHex(s);if(hex!==null)return hex}return/^\d+$/.test(s)?argbIntToRgba(Number.parseInt(s,10)):null}function fromHex(hex){let h=hex.trim();if(!/^[0-9a-fA-F]+$/.test(h))return null;if(h.length===3)return{r:dup(h[0]),g:dup(h[1]),b:dup(h[2]),a:1};if(h.length===6)return{r:byte(h,0),g:byte(h,2),b:byte(h,4),a:1};if(h.length===8){let a=byte(h,0);return{r:byte(h,2),g:byte(h,4),b:byte(h,6),a:a/255}}return null}function fromRgbFunc(input){let open=input.indexOf("("),close=input.indexOf(")");if(open<0||close<0||close<open)return null;let parts=input.slice(open+1,close).split(",").map(p=>p.trim());if(parts.length<3)return null;let r=clampByte(Number(parts[0])),g=clampByte(Number(parts[1])),b=clampByte(Number(parts[2]));if(r===null||g===null||b===null)return null;let a=1;if(parts.length>=4){let alpha=Number(parts[3]);if(!Number.isFinite(alpha))return null;a=Math.min(1,Math.max(0,alpha))}return{r:r,g:g,b:b,a:a}}function argbIntToRgba(n){if(!Number.isFinite(n))return null;let int2=Math.trunc(n)>>>0,a=int2>>>24&255;return{r:int2>>>16&255,g:int2>>>8&255,b:int2&255,a:a===0?1:a/255}}function byte(hex,at){return Number.parseInt(hex.slice(at,at+2),16)}function dup(nibble){return Number.parseInt(`${nibble??"0"}${nibble??"0"}`,16)}function clampByte(n){return Number.isFinite(n)?Math.min(255,Math.max(0,Math.round(n))):null}function rgbToHex(r,g,b){return`#${hex2(r)}${hex2(g)}${hex2(b)}`.toUpperCase()}function hex2(n){return n.toString(16).padStart(2,"0")}var NEAR_BLACK="#111111",WHITE="#FFFFFF",BLACK="#000000";function readableOn(background){let rgba=toRgba(background);if(rgba===null)return WHITE;let bg=relativeLuminance(rgba),black=relativeLuminance({r:17,g:17,b:17}),white=relativeLuminance({r:255,g:255,b:255});return luminanceContrast(bg,white)>=luminanceContrast(bg,black)?WHITE:NEAR_BLACK}function legibleOn(background,target){let first=readableOn(background);return contrastRatio(first,background)>=target?first:contrastRatio(WHITE,background)>=contrastRatio(BLACK,background)?WHITE:BLACK}function poleForGrounds(grounds){let worst=ink=>grounds.reduce((low,ground)=>Math.min(low,contrastRatio(ink,ground)),Number.POSITIVE_INFINITY);return worst(WHITE)>=worst(BLACK)?WHITE:BLACK}function relativeLuminance(rgba){let r=linearize(rgba.r/255),g=linearize(rgba.g/255),b=linearize(rgba.b/255);return.2126*r+.7152*g+.0722*b}function linearize(channel){return channel<=.03928?channel/12.92:Math.pow((channel+.055)/1.055,2.4)}function luminanceContrast(l1,l2){let lighter=Math.max(l1,l2),darker=Math.min(l1,l2);return(lighter+.05)/(darker+.05)}function contrastRatio(a,b){let fg=toRgba(a),bg=toRgba(b);if(fg===null||bg===null)return 1;let ground=bg.a>=1?bg:{...bg},fore=fg.a>=1?fg:composite(fg,ground);return luminanceContrast(relativeLuminance(fore),relativeLuminance(ground))}function composite(fg,bg){let a=fg.a,mix=(f,g)=>Math.round(f*a+g*(1-a));return{r:mix(fg.r,bg.r),g:mix(fg.g,bg.g),b:mix(fg.b,bg.b),a:1}}function flattenOnto(color,background){let fg=toRgba(color),bg=toRgba(background);if(fg===null||bg===null)return null;let out=fg.a>=1?fg:composite(fg,{...bg});return rgbToHex(out.r,out.g,out.b)}function withAlpha(color,alpha){let rgba=toRgba(color);if(rgba===null)return null;let a=Math.min(1,Math.max(0,alpha));return`rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${a})`}var PUSH_STEP=.05;function pushToContrast(color,grounds,pole,target){let first=grounds[0];if(first===void 0)return pole;let reads=candidate=>grounds.every(ground=>contrastRatio(candidate,ground)>=target);if(toRgba(color)===null)return pole;if(reads(color))return color;let flat=flattenOnto(color,first),from=flat===null?null:toRgba(flat),to=toRgba(pole);if(from===null||to===null)return pole;for(let step=1;step<1/PUSH_STEP;step+=1){let t=step*PUSH_STEP,mix=(a,b)=>Math.round(a+(b-a)*t),candidate=rgbToHex(mix(from.r,to.r),mix(from.g,to.g),mix(from.b,to.b));if(reads(candidate))return candidate}return pole}var PLAN_DS_PRESET={ink:"#10462E",go:"#07C168",alert:"#C03410",tintSage:"#E6ECE8"},DS_THEME_CONTEXT=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1");function dsThemeContext(){let host=globalThis,ctx=host[DS_THEME_CONTEXT];return ctx===void 0&&(ctx=createContext(null),ctx.displayName="EverfurThemeContext",host[DS_THEME_CONTEXT]=ctx),ctx}var same=(a,b)=>a.toUpperCase()===b.toUpperCase();function isDark(bg){let rgba=toRgba(bg);return rgba!==null&&relativeLuminance(rgba)<.18}var cache=/* @__PURE__ */new WeakMap;function planThemeWithHost(theme,host){if(host===null)return theme;let byHost=cache.get(theme);byHost===void 0&&(byHost=/* @__PURE__ */new WeakMap,cache.set(theme,byHost));let out=byHost.get(host);return out===void 0&&(out=overlay(theme,host),byHost.set(host,out)),out}function overlay(theme,host){let h=host.colors,inkMoved=!same(h.ink,PLAN_DS_PRESET.ink),goMoved=!same(h.go,PLAN_DS_PRESET.go),darkHost=theme===EVERFUR_LIGHT&&isDark(h.bg),base3=darkHost?EVERFUR_DARK:theme,c=base3.color,free=key=>darkHost||c[key]===EVERFUR_LIGHT.color[key],color={};inkMoved&&free("primary")&&(Object.assign(color,{primary:h.ink,onPrimary:h.onInk,brand:h.ink,brandInk:h.ink}),free("linkInk")&&(color.linkInk=h.ink),!goMoved&&free("accent")&&Object.assign(color,{accent:h.ink,onAccent:h.onInk})),goMoved&&free("accent")&&Object.assign(color,{accent:h.go,onAccent:h.onGo}),!same(h.alert,PLAN_DS_PRESET.alert)&&free("danger")&&(color.danger=h.alert),!same(h.tintSage,PLAN_DS_PRESET.tintSage)&&free("brandSoft")&&(color.brandSoft=h.tintSage,free("brandSofter")&&(color.brandSofter=h.tintSage)),darkHost&&Object.assign(color,{background:h.bg,surface:h.surface,text:{...c.text,primary:h.text,muted:h.muted},borderRingCream:h.line});let reduced=host.motion?.reduced===true&&!base3.motion.reducedMotion;return!darkHost&&!reduced&&Object.keys(color).length===0?theme:{...base3,color:{...c,...color},...reduced?{motion:{...base3.motion,reducedMotion:true}}:{}}}function usePlanTheme(){let theme=useEverfurTheme(),host=useContext(dsThemeContext());return useMemo(()=>planThemeWithHost(theme,host),[theme,host])}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function healthPlanLength(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function healthPlanTitleOffset(titleGap,sectionGap){let gap=healthPlanLength(titleGap);return gap===null?0:gap-sectionGap}function isHealthPlanSessionRequired(error){return error!==null&&(error.reasonCode==="session_required"||error.code==="sessionRequired")}var DockContext=createContext(null);function HealthPlanCartScope({children:children}){let[dock,setDock]=useState(null),store=useMemo(()=>({dock:dock,publish:setDock}),[dock]);return createElement(DockContext.Provider,{value:store},children)}function useHealthPlanCartDock(){return useContext(DockContext)?.dock??null}function usePublishHealthPlanCart(enabled,cart,busy,petRef,plan,setInPlan){let publish=useContext(DockContext)?.publish,latest=useRef(setInPlan);useEffect(()=>{latest.current=setInPlan},[setInPlan]);let writes=useMemo(()=>healthPlanWrites(plan,(productId,inPlan)=>latest.current(productId,inPlan)),[plan]);useEffect(()=>{if(!(publish===void 0||!enabled))return publish(/* @__PURE__ */Object.freeze({cart:cart,busy:busy,petRef:petRef,plan:plan,...writes})),()=>publish(null)},[publish,enabled,cart,busy,petRef,plan,writes])}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,HEALTH_PLAN_NO_SHIP_DAY_COPY=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:cartRenewal,startedWhat:()=>""});function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`,todayLabel:`${w.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${w.poss} report`,askReport:"Ask about it",fullOpen:`See ${w.poss} full plan`,fullOpenLine:`${w.Poss} vet, reviews and ${w.poss} checkup`,fullClose:`Show ${w.poss} brief plan`,fullCloseLine:`${w.Poss} risk, tips, pick and signs`,hopeNoted:phrases=>`Noted. When ${w.poss} results land, we'll start with ${phrases}.`,productLink:product=>`${product}, see the product`,productPhotos:product=>`${product} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${w.name}`,ratingLine:count=>`· ${count} reviews`,productOffer:p=>`${p.discountPercent}% off ${w.poss} first box`,productEvery:p=>`Every ${p.intervalDays} days`,productOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:p=>`On ${w.poss} plan, every ${p.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:count=>`${count} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:count=>`Read all ${count} reviews`,starsLabel:rating=>`${rating} out of 5 stars`,buyNow:"Buy now"});return copy}var HEALTH_PLAN_FOCUS_COPY=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(iso,locale){if(iso===null||!/^\d{4}-\d{2}-\d{2}$/.test(iso))return null;let d=/* @__PURE__ */new Date(`${iso}T00:00:00Z`);if(Number.isNaN(d.getTime()))return null;try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(d)}catch{return iso}}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});function ok(value,warning){/* @__PURE__ */
|
|
4
|
-
return Object.freeze({
|
|
5
|
-
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)}};var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=useContext(PlanPetContext),ctx=useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=useRef(null);useEffect(()=>{if(!drawn||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__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",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),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 assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
6
|
-
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function parseUrl(raw,base3){let Url=globalThis.URL;if(typeof Url=="function"){let url;try{url=base3===void 0?new Url(raw):new Url(raw,base3)}catch{return null}try{if(url.protocol)return url}catch{}}return parseByPattern(raw)}var WHOLE_URL=/^([a-z][a-z0-9+.-]*):\/\/(?:([^:@/?#]*)(?::([^@/?#]*))?@)?(\[[0-9a-f:.]+\]|[\w.~-]+)(?::(\d*))?(\/[^?#]*)?(\?[^#]*)?(#.*)?$/i,REWRITTEN_BY_STANDARD_PARSER=/[\s\u0000-\u001f\u007f\\]/,DEFAULT_PORTS={"http:":"80","https:":"443"};function parseByPattern(raw,base3){let input=raw.trim();let match=REWRITTEN_BY_STANDARD_PARSER.test(input)?null:WHOLE_URL.exec(input);if(match===null)return null;let[,scheme="",username="",password="",host="",portText="",path="",query="",fragment=""]=match,protocol=`${scheme.toLowerCase()}:`,portNumber=Number(portText);if(portNumber>65535)return null;let port=portText===""||String(portNumber)===DEFAULT_PORTS[protocol]?"":String(portNumber),special=DEFAULT_PORTS[protocol]!==void 0,hostPort=host.toLowerCase()+(port&&`:${port}`),pathname=path||(special?"/":""),credentials=username||password?`${username}${password&&`:${password}`}@`:"";return{href:`${protocol}//${credentials}${hostPort}${pathname}${query}${fragment}`,protocol:protocol,username:username,password:password,hostname:host.toLowerCase(),port:port,origin:special?`${protocol}//${hostPort}`:"null",pathname:pathname,search:query==="?"?"":query,hash:fragment==="#"?"":fragment}}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,base3=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({...base3,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(
|
|
3
|
+
import{PlanNeedCard,TipCard,buttonCss,planNeedCardCss,tipCardCss,Button}from"../../chunk-WZNPR5TY.js";import{PLAN_CLASS_PREFIX,planTokens,PLAN_PRESS,PLAN_ICONS,PLAN_RULES,err,ok,PLAN_CONTEXT,EverfurConfigError,parseUrl,PLAN_BEFORE_CLASS}from"../../chunk-2NA7TPUA.js";import{useEverfurTheme,EVERFUR_LIGHT,EVERFUR_DARK,toRgba,relativeLuminance,faceCss,readableOn,withAlpha,headingFaceCss,useDsStyles,summaryListCss,ThemeProvider,useEfdsPart,cx,dataOf,SummaryList,resolveTheme,usePressFeedback,webPressOf,v3Palette,everfurWebTheme}from"../../chunk-IJU5TV5N.js";import{createContext,lazy,useMemo,useEffect,useRef,useId,useState,useContext,useCallback,useLayoutEffect,createElement,useSyncExternalStore,Fragment as Fragment$1,isValidElement,cloneElement,forwardRef,Suspense,Component,useImperativeHandle}from"react";import{jsx,jsxs,Fragment}from"react/jsx-runtime";import{createPortal}from"react-dom";var PLAN_DS_PRESET={ink:"#10462E",go:"#07C168",alert:"#C03410",tintSage:"#E6ECE8"},DS_THEME_CONTEXT=/* @__PURE__ */Symbol.for("@everfur-health/ui-core#ThemeContext@v1");function dsThemeContext(){let host=globalThis,ctx=host[DS_THEME_CONTEXT];return ctx===void 0&&(ctx=createContext(null),ctx.displayName="EverfurThemeContext",host[DS_THEME_CONTEXT]=ctx),ctx}var same=(a,b)=>a.toUpperCase()===b.toUpperCase();function isDark(bg){let rgba=toRgba(bg);return rgba!==null&&relativeLuminance(rgba)<.18}var cache=/* @__PURE__ */new WeakMap;function planThemeWithHost(theme,host){if(host===null)return theme;let byHost=cache.get(theme);byHost===void 0&&(byHost=/* @__PURE__ */new WeakMap,cache.set(theme,byHost));let out=byHost.get(host);return out===void 0&&(out=overlay(theme,host),byHost.set(host,out)),out}function overlay(theme,host){let h=host.colors,inkMoved=!same(h.ink,PLAN_DS_PRESET.ink),goMoved=!same(h.go,PLAN_DS_PRESET.go),darkHost=theme===EVERFUR_LIGHT&&isDark(h.bg),base3=darkHost?EVERFUR_DARK:theme,c=base3.color,free=key=>darkHost||c[key]===EVERFUR_LIGHT.color[key],color={};inkMoved&&free("primary")&&(Object.assign(color,{primary:h.ink,onPrimary:h.onInk,brand:h.ink,brandInk:h.ink}),free("linkInk")&&(color.linkInk=h.ink),!goMoved&&free("accent")&&Object.assign(color,{accent:h.ink,onAccent:h.onInk})),goMoved&&free("accent")&&Object.assign(color,{accent:h.go,onAccent:h.onGo}),!same(h.alert,PLAN_DS_PRESET.alert)&&free("danger")&&(color.danger=h.alert),!same(h.tintSage,PLAN_DS_PRESET.tintSage)&&free("brandSoft")&&(color.brandSoft=h.tintSage,free("brandSofter")&&(color.brandSofter=h.tintSage)),darkHost&&Object.assign(color,{background:h.bg,surface:h.surface,text:{...c.text,primary:h.text,muted:h.muted},borderRingCream:h.line});let reduced=host.motion?.reduced===true&&!base3.motion.reducedMotion;return!darkHost&&!reduced&&Object.keys(color).length===0?theme:{...base3,color:{...c,...color},...reduced?{motion:{...base3.motion,reducedMotion:true}}:{}}}function usePlanTheme(){let theme=useEverfurTheme(),host=useContext(dsThemeContext());return useMemo(()=>planThemeWithHost(theme,host),[theme,host])}var HEALTH_PLAN_COPY=/* @__PURE__ */Object.freeze({loading:"Loading",retry:"Try again",signedOut:"Sign in required",addToCart:"Add to cart",added:"Added",remove:"Remove",checkout:"Checkout",subtotal:"Subtotal",sample:"Sample",cartEmpty:"Your cart is empty.",choosePet:"Choose a pet",emptyTitle:"",emptyBody:"",emptyAsk:""}),COPY_ASKS=/* @__PURE__ */Object.freeze({emptyTitle:true,emptyBody:true,emptyAsk:true}),HEALTH_PLAN_REASON_LABELS=/* @__PURE__ */Object.freeze({dna:"",records:"Records",inside:"Inside",profile:""}),HEALTH_PLAN_TEMPLATES=/* @__PURE__ */Object.freeze({planTitle:petName=>`${petName}'s care plan`,cartLabel:brand=>`${brand} cart`}),HEALTH_PLAN_COPY_PLACEHOLDERS=/* @__PURE__ */Object.freeze([...Object.keys(HEALTH_PLAN_COPY).filter(key=>COPY_ASKS[key]===true&&HEALTH_PLAN_COPY[key]==="").map(key=>`HEALTH_PLAN_COPY.${key}`),...["profile"].filter(kind=>HEALTH_PLAN_REASON_LABELS[kind]==="").map(kind=>`HEALTH_PLAN_REASON_LABELS.${kind}`)]);var HEALTH_PLAN_LAYOUT_DEFAULTS=/* @__PURE__ */Object.freeze({imageVariant:"wide",reasonVariant:"pills",cartBarVisibility:"whenItems",cartBarPlacement:"sticky",addButtonSize:"full",addedVariant:"link",categoryVariant:"text",showCategory:false,cardShadow:false,cardBorder:true});function healthPlanWrites(plan,setInPlan){return{setInPlan:setInPlan,addAll:async()=>{let missing=(plan?.items??[]).filter(item=>!item.inPlan);return(await Promise.all(missing.map(item=>setInPlan(item.productId,true)))).every(Boolean)}}}function showHealthPlanCartBar(visibility,count){return(visibility??HEALTH_PLAN_LAYOUT_DEFAULTS.cartBarVisibility)==="always"||count>0}var HEALTH_PLAN_CARD_OPTION_KEYS=/* @__PURE__ */Object.freeze(["showCategory","cardShadow","cardBorder","addButtonSize","addButtonFontSize","addedVariant","categoryVariant","cardPadding","itemTitleSize","itemTitleWeight","priceSize","priceWeight","reasonTextSize","reasonLabelWidth","reasonGap"]);function pickHealthPlanCardOptions(props){let out={};for(let key of HEALTH_PLAN_CARD_OPTION_KEYS)props[key]!==void 0&&(out[key]=props[key]);return out}function healthPlanAddButtonHeight(size){let height=typeof size=="number"&&Number.isFinite(size)&&size>0?size:size==="compact"?32:44;return{height:height,hit:Math.max(44,height)}}function healthPlanLength(value){return typeof value=="number"&&Number.isFinite(value)&&value>=0?value:null}function healthPlanTitleOffset(titleGap,sectionGap){let gap=healthPlanLength(titleGap);return gap===null?0:gap-sectionGap}function isHealthPlanSessionRequired(error){return error!==null&&(error.reasonCode==="session_required"||error.code==="sessionRequired")}var DockContext=createContext(null);function HealthPlanCartScope({children:children}){let[dock,setDock]=useState(null),store=useMemo(()=>({dock:dock,publish:setDock}),[dock]);return createElement(DockContext.Provider,{value:store},children)}function useHealthPlanCartDock(){return useContext(DockContext)?.dock??null}function usePublishHealthPlanCart(enabled,cart,busy,petRef,plan,setInPlan){let publish=useContext(DockContext)?.publish,latest=useRef(setInPlan);useEffect(()=>{latest.current=setInPlan},[setInPlan]);let writes=useMemo(()=>healthPlanWrites(plan,(productId,inPlan)=>latest.current(productId,inPlan)),[plan]);useEffect(()=>{if(!(publish===void 0||!enabled))return publish(/* @__PURE__ */Object.freeze({cart:cart,busy:busy,petRef:petRef,plan:plan,...writes})),()=>publish(null)},[publish,enabled,cart,busy,petRef,plan,writes])}function healthPlanPetWords(name,sex){let n=name?.trim()??"",named=n===""?"your pet":n,Named=n===""?"Your pet":n;return sex==="female"?{name:named,Name:Named,poss:"her",Poss:"Her",obj:"her"}:sex==="male"?{name:named,Name:Named,poss:"his",Poss:"His",obj:"him"}:{name:named,Name:Named,poss:`${named}'s`,Poss:`${Named}'s`,obj:named}}var cartRenewal=p=>p===null?"":`${p.productName} renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,HEALTH_PLAN_NO_SHIP_DAY_COPY=/* @__PURE__ */Object.freeze({onceFine:"",cartFine:cartRenewal,startedWhat:()=>""});function healthPlanFocusCopyFor(pet){let w=healthPlanPetWords(pet.name,pet.sex),nameOf=p=>p.petName?.trim()||w.name,NameOf=p=>p.petName?.trim()||w.Name,copy=/* @__PURE__ */Object.freeze({jumpKicker:(p,subscribed)=>subscribed?`In ${w.poss} plan, every ${p.intervalDays} days`:p.offer?`${p.discountPercent}% off ${w.poss} first box`:p.intervalDays>0?`Ships every ${p.intervalDays} days`:copy.onceLine(p),optionsLabel:"How to buy",subscribe:"Subscribe",bestValue:"Best value",subscribeLine:p=>p.offer?`First box, then ${p.box??""}`:`${p.box??""} every ${p.intervalDays} days`,priceLine:p=>p.offer?`${p.discountPercent}% off the first box. Ships every ${p.intervalDays} days.`:p.intervalDays>0?`Ships every ${p.intervalDays} days.`:copy.onceOffer(p),once:"One box",onceLine:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once`:"Ships once",buyOnce:p=>`Buy one box, ${p.once??p.box??""}`,subscribed:"Subscribed",subscribedLine:(p,next)=>next===null?`Every ${p.intervalDays} days`:`Every ${p.intervalDays} days · next box ${next}`,manage:"Manage",checkoutKicker:"Checkout",checkoutTitle:p=>`Checkout: ${p.productName}`,checkoutOffer:p=>`${p.discountPercent}% off your first box.`,shipsEvery:"Ships every",days:n=>`${n} days`,buyOnceOption:"Buy once",checkoutGo:(_p,subscribe,today)=>`${subscribe?"Subscribe":"Buy now"} · ${today} today`,renews:p=>`Renews every ${p.intervalDays} days at ${p.box??""} until you cancel; skip or cancel anytime in the app.`,onceFine:"One box, ships tomorrow.",onceOffer:p=>p.onceDiscountPercent>0?`${p.onceDiscountPercent}% off, ships once.`:"Ships once.",checkoutNote:"",close:"Close",startedTitle:p=>`${NameOf(p)}'s plan has started.`,orderedTitle:()=>"Order placed.",startedWhat:p=>`${p.productName} ships tomorrow.`,startedNote:"",startedSteps:"What happens next",tomorrow:"Tomorrow",firstBoxShips:`${w.Poss} first box ships.`,trackingComesByText:"Tracking comes by text.",checkin:q=>q===null?"A 2-week check-in by text.":`A 2-week check-in by text: ${q}`,refill:`A text 3 days before ${w.poss} next box. Reply SKIP to skip it.`,nextBoxShips:p=>`${w.Poss} next box ships, ${p.box??""}.`,startedDone:`Back to ${w.poss} plan`,manageKicker:"Your subscription",manageTitle:p=>`Manage ${p.productName}`,skip:"Skip the next box",cancel:"Cancel subscription",skipped:(_p,next)=>next===null?"Skipped.":`Skipped. ${w.Poss} next box ships ${next}.`,cancelled:p=>`${p.productName} is cancelled. Restart it from ${w.poss} plan anytime.`,orders:"Orders",startedHeader:"Subscribed",placedHeader:"Order placed",cartCheckoutTitle:"Checkout",orderNote:"",cartLabel:n=>n>0?`Cart, ${n} item${n>1?"s":""}`:"Cart, empty",addToCart:price=>`Add to cart · ${price}`,viewCart:"View cart",addedToCart:(p,subscription)=>`${p.productName} is in your cart${subscription?", as a subscription":""}.`,removedFromCart:name=>`${name} is out of your cart.`,cartTitle:"Cart",cartEmptyTitle:"Your cart is empty",cartEmptyBody:p=>`${NameOf(p)}'s plan pick lands here when you add it.`,seeOrders:`See ${w.poss} orders`,quantityLabel:name=>`How many: ${name}`,fewer:"One fewer",more:"One more",remove:"Remove",cartSubLine:p=>p.offer?`First box ${p.discountPercent}% off, then ${p.box??""} every ${p.intervalDays} days`:`Every ${p.intervalDays} days`,cartOnceLine:(p,subscribed)=>subscribed?`An extra box. ${w.Poss} plan keeps shipping.`:p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",cartModeLabel:name=>`How to buy ${name}`,cartModeSubscribe:p=>p.offer?`Subscribe, ${p.discountPercent}% off the first box`:"Subscribe",cartModeOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",subtotal:"Subtotal",shipping:"Shipping",shippingValue:"",shippingTag:"",total:"Total",dueToday:"Due today",thenRenews:p=>`Then ${p.productName}`,renewsEvery:p=>`${p.box??""} every ${p.intervalDays} days`,checkoutCart:total=>`Checkout · ${total}`,cartOneAtATime:"",cartSubscriptionApart:"",cartItemSubscription:p=>`Subscription, every ${p.intervalDays} days`,cartItemQuantity:n=>`Qty ${n}`,placeOrder:(total,subscribe)=>`${subscribe?"Place order and subscribe":"Place order"} · ${total}`,cartFine:p=>`${p===null?"":`${cartRenewal(p)} `}Ships tomorrow.`,placedSteps:"What's coming",placedShips:"It ships.",placedArrives:"It arrives at home.",viewOrder:"View order",herSubscription:`${w.Poss} subscription`,nextBox:day=>`Next box ${day}`,everyDays:n=>`Every ${n} days`,ordersHeading:afterSubscription=>afterSubscription?"Orders":`${w.Poss} orders`,ordersFine:"",ordersEmptyTitle:"No orders yet",ordersEmptyBody:p=>`The boxes from ${nameOf(p)}'s plan show up here.`,moreOrders:"",orderSteps:["Ordered","Shipped","Out for delivery","Delivered"],subscriptionBox:"Subscription box",orderTitle:n=>n===null?"Order":`Order ${n}`,arrivesBy:day=>`Arrives by ${day}`,deliveredOn:day=>`Delivered ${day}`,expected:day=>`Expected ${day}`,tracking:"Tracking",trackingByText:"The tracking number comes by text when it ships.",trackOn:carrier=>`Track on ${carrier}`,trackLink:"",inThisOrder:"In this order",orderItemLine:(n,box)=>`Qty ${n}${box?" · subscription box":""}`,paidWith:"Paid with",buyAgain:"Buy again",orderHelp:"Get help with this order",addWeightTitle:`Add ${w.poss} weight to size ${w.poss} dose`,addWeightBody:`From a home scale or ${w.poss} last vet visit.`,connectRecordsTitle:`Connect ${w.poss} vet records`,connectRecordsBody:`${w.Poss} weight, visits and labs make ${w.poss} plan sharper.`,weightKicker:`${w.Poss} weight`,weightTitle:p=>`Add ${nameOf(p)}'s weight`,weightBody:`From a home scale or ${w.poss} last vet visit. ${w.Poss} plan uses it to size ${w.poss} dose.`,weightField:`${w.Poss} weight`,weightUnit:"lb",weightUnitKg:"kg",weightErrorKg:"Enter your pet’s weight",weightError:`Enter ${w.poss} weight in pounds, like 14.1.`,weightSave:`Save ${w.poss} weight`,weightSaved:lb=>`Saved: ${lb} lb. ${w.Poss} dose is sized for ${w.obj}.`,weightSavedKg:kg=>`Saved: ${kg} kg. ${w.Poss} dose is sized for ${w.obj}.`,checkoutFailed:"That didn't go through. Please try again.",builtWith:vet=>`Built with ${vet}`,fromVet:shortName=>`From ${shortName}`,waitVetTips:vet=>`Free tips from ${vet}, built around that risk`,signalsFit:count=>`${count} of ${count} signals fit ${w.Name}`,signalsValue:count=>`${count}/${count}`,noPick:`No supplement for this one. ${w.Poss} vet comes first.`,callYourVet:"Call your vet today",callAVet:"Call a vet today",saveForCheckup:`Save for ${w.poss} next checkup`,savedForCheckup:`Saved for ${w.poss} next checkup`,blanksLabel:`${w.Poss} three blanks`,blanksAsked:clinic=>`Asked ${clinic}`,blanksAskedNoClinic:"",blanksWaitPill:"2 to 5 days",blanksFilledKicker:`From ${w.poss} vet records`,blanksFilled:(filled,total)=>`${filled} of ${total} filled`,blanksWeight:`Keep ${w.obj} at `,blanksWeightSource:`From ${w.poss} vet visits`,blanksDose:(dose,product)=>`${dose} of ${product}`,blanksDoseSource:`Sized to ${w.poss} weight`,blanksShots:`${w.Poss} next shots are due `,blanksShotsSource:`From ${w.poss} clinic`,blankEmpty:"blank",recordsLanded:`${w.Poss} records are in. ${w.Poss} plan now uses ${w.poss} weight and ${w.poss} visits.`,todayLabel:`${w.Poss} Health Plan`,poweredBy:"powered by",poweredByName:"Everfur",seeMore:"See more",seeLess:"See less",reportActions:"Actions to take",openReport:`Open it in ${w.poss} report`,askReport:"Ask about it",fullOpen:`See ${w.poss} full plan`,fullOpenLine:`${w.Poss} vet, reviews and ${w.poss} checkup`,fullClose:`Show ${w.poss} brief plan`,fullCloseLine:`${w.Poss} risk, tips, pick and signs`,hopeNoted:phrases=>`Noted. When ${w.poss} results land, we'll start with ${phrases}.`,productLink:product=>`${product}, see the product`,productPhotos:product=>`${product} photos, swipe for more`,shopAll:"Shop all",madeFor:`Made for ${w.name}`,ratingLine:count=>`· ${count} reviews`,productOffer:p=>`${p.discountPercent}% off ${w.poss} first box`,productEvery:p=>`Every ${p.intervalDays} days`,productOnce:p=>p.onceDiscountPercent>0?`One box, ${p.onceDiscountPercent}% off`:"One box",productExtraBox:"An extra box",productOnPlan:p=>`On ${w.poss} plan, every ${p.intervalDays} days. This adds one extra box.`,quantity:"Quantity",description:"Description",readMore:"Read more",readLess:"Read less",whatsInside:"What's inside",howMuch:"How much",reviewsTitle:"Reviews",reviewCount:count=>`${count} reviews`,reviewsSwipe:"Reviews, swipe for more",readAllReviews:count=>`Read all ${count} reviews`,starsLabel:rating=>`${rating} out of 5 stars`,buyNow:"Buy now"});return copy}var HEALTH_PLAN_FOCUS_COPY=healthPlanFocusCopyFor({sex:"female"});function formatHealthPlanDay(iso,locale){if(iso===null||!/^\d{4}-\d{2}-\d{2}$/.test(iso))return null;let d=/* @__PURE__ */new Date(`${iso}T00:00:00Z`);if(Number.isNaN(d.getTime()))return null;try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(d)}catch{return iso}}function healthPlanPageDrawsWithoutItems(design){return design!=null&&(design.wait!==void 0||design.pick.hidden===true)}function withoutProductPart(design){return{...design,pick:{...design.pick,none:true,hidden:true}}}var NO_PLAN_ITEM=/* @__PURE__ */Object.freeze({productId:"",partnerSku:null,title:"",description:null,category:null,price:null,currency:null,imageUrl:null,url:null,reasons:[],inPlan:false,sample:false});var noopTelemetry=/* @__PURE__ */Object.freeze({track(){},trackExpectedFailure(){}});var EVERFUR_CONTEXT_SYMBOL=/* @__PURE__ */Symbol.for("@everfur/sdk#EverfurContext@v1"),globalContextHost=globalThis,EverfurContext=globalContextHost[EVERFUR_CONTEXT_SYMBOL]??(globalContextHost[EVERFUR_CONTEXT_SYMBOL]=createContext(null));EverfurContext.displayName??="EverfurContext";function useEverfurContext(){let ctx=useContext(EverfurContext);if(ctx===null)throw new EverfurConfigError("not-initialized","Everfur hooks must be called inside <EverfurProvider>. Wrap your tree once, high.");return ctx}var HEALTH_PLAN_EVENTS=/* @__PURE__ */Object.freeze({opened:"health_plan.opened",productClicked:"health_plan.product_clicked",checkoutStarted:"health_plan.checkout_started"});function useHealthPlanTelemetry(){return useContext(EverfurContext)?.runtime.registry.services.telemetry??noopTelemetry}var PlanPetContext=createContext(null);function HealthPlanPetScope({petRef:petRef,children:children}){return createElement(PlanPetContext.Provider,{value:petRef},children)}function useHealthPlanBarPet(dockPet){let page=useContext(PlanPetContext),ctx=useContext(EverfurContext);return page??dockPet??ctx?.activePet??null}function useHealthPlanOpened(drawn,petRef,plan){let telemetry=useHealthPlanTelemetry(),sent=useRef(null);useEffect(()=>{if(!drawn||petRef===null||sent.current===petRef)return;sent.current=petRef;let items=plan?.items??[];telemetry.track(HEALTH_PLAN_EVENTS.opened,{petRef:petRef,itemsCount:items.length,inPlanCount:items.filter(item=>item.inPlan).length})},[drawn,petRef,plan,telemetry])}function trackProductClicked(telemetry,petRef,productId,inPlan){telemetry.track(HEALTH_PLAN_EVENTS.productClicked,{petRef:petRef,productId:productId,inPlan:inPlan})}function trackCheckoutStarted(telemetry,petRef,cart){telemetry.track(HEALTH_PLAN_EVENTS.checkoutStarted,{petRef:petRef,itemsCount:cart.count,subtotal:cart.subtotal,currency:cart.currency})}var RETRYABILITY_ROWS=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],CONTRACT_RETRYABILITY=/* @__PURE__ */Object.freeze(RETRYABILITY_ROWS.map(row=>/* @__PURE__ */Object.freeze(row)));/* @__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",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable"}),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 assertNever(x){throw new Error(`assertNever: unhandled discriminated-union member ${JSON.stringify(x)}`)}function errorFrame(fields){/* @__PURE__ */
|
|
4
|
+
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function mintFailedError(cause,refusal){let message=cause instanceof Error?cause.message:typeof cause=="string"?cause:null;return makeEverfurError("authRejected",{retryable:false,...refusal?.wireCode?{wireCode:refusal.wireCode}:{},...refusal?.requestId?{requestId:refusal.requestId}:{},...message?{wireMessage:message}:{},...cause!=null?{raw:cause}:{}})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause))}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch(cause){return ctx.identity.reportRejected?.(),err(mintFailedError(cause,{wireCode:wireCodeOf(first.error.raw),requestId:first.error.requestId}))}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?(ctx.identity.reportRejected?.(),err(refusedAfterRemintError(retry.error))):retry}function refusedAfterRemintError(refusal){let raw=refusal.raw,wireCode=wireCodeOf(raw);return makeEverfurError("authRejected",{retryable:false,...refusal.httpStatus!==void 0?{httpStatus:refusal.httpStatus}:{},...refusal.requestId?{requestId:refusal.requestId}:{},...wireCode?{wireCode:wireCode}:{},...refusal.reasonCode?{reasonCode:refusal.reasonCode}:{},...refusal.wireMessage?{wireMessage:refusal.wireMessage}:{},...raw!=null?{raw:raw}:{}})}function wireCodeOf(body){if(typeof body!="object"||body===null)return null;let b=body,code=(typeof b.error=="object"&&b.error!==null?b.error.code:void 0)??b.code;return typeof code=="string"&&code.length>0?code:null}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base3=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({...base3,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(
|
|
7
5
|
/* @__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__ */
|
|
8
6
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop2=()=>{};if(!caller)return{signal:deadline,dispose:noop2};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop2};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}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 HEALTH_PLAN_REASON_KINDS=/* @__PURE__ */Object.freeze(["dna","records","inside","profile"]),REF_MAX=128;function invalid(wireMessage){return makeEverfurError("validationFailed",{retryable:false,wireMessage:wireMessage})}function disposed(verb){return makeEverfurError("runtimeDisposed",{retryable:false,wireMessage:`the Everfur runtime is disposed; ${verb} was called after unmount`})}function malformed(call){return makeEverfurError("internalError",{retryable:false,httpStatus:502,wireMessage:`${call}: the response carried no plan`})}var str=(value,max=4e3)=>typeof value=="string"&&value.trim().length>0&&value.length<=max?value.trim():null;function httpsUrl(value){let s=str(value,2048);return s===null?null:/^https:\/\/[^\s]+$/i.test(s)?s:null}function priceOf(value){let n=typeof value=="number"?value:typeof value=="string"&&/^\d+(\.\d+)?$/.test(value.trim())?Number(value):Number.NaN;return Number.isFinite(n)&&n>=0?n:null}function currencyOf(value){return typeof value=="string"&&/^[A-Za-z]{3}$/.test(value)?value.toUpperCase():null}function reasonsOf(value){if(!Array.isArray(value))/* @__PURE__ */return Object.freeze([]);let out=[];for(let raw of value){if(raw===null||typeof raw!="object")continue;let o=raw,text2=str(o.text,1e3);if(text2===null)continue;let kind=typeof o.kind=="string"&&HEALTH_PLAN_REASON_KINDS.includes(o.kind)?o.kind:"profile";out.push(/* @__PURE__ */Object.freeze({kind:kind,text:text2}))}/* @__PURE__ */
|
|
9
7
|
return Object.freeze(out)}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__ */
|
|
@@ -29,8 +27,8 @@ return jsx("div",{role:"status","aria-busy":"true","aria-label":`Loading ${capab
|
|
|
29
27
|
return jsx("div",{className:className,style:{...styles2.offstate,...style},children:message.length>0?/* @__PURE__ */jsx("p",{style:styles2.offstateText,children:message}):null})}function makeStyles(theme){let{color:color,space:space,radius:radius,type:type}=theme;return{offstate:{...SURFACE_ROOT_RESET,boxSizing:"border-box",minHeight:MIN_OFFSTATE_HEIGHT,display:"flex",flexDirection:"column",justifyContent:"center",padding:`${space.md}px ${space.lg}px`,backgroundColor:color.surfaceCream,borderRadius:radius.md,border:`1px solid ${color.brandBorder}`},offstateText:{margin:0,...faceCss(theme,"regular"),fontSize:type.size.body,lineHeight:`${Math.round(type.size.body*type.lineHeight.normal)}px`,color:color.text.muted},skeletonBar:{height:space.md,borderRadius:radius.xs,backgroundColor:color.brandSofter}}}function slotBox(slot,borderWidth){if(slot===void 0)return{};let out={};return slot.backgroundColor!==void 0&&(out.backgroundColor=slot.backgroundColor),slot.borderColor!==void 0&&(out.borderColor=slot.borderColor,out.borderWidth=borderWidth??1),slot.borderRadius!==void 0&&(out.borderRadius=slot.borderRadius),out}function slotText(slot){return slot?.textColor===void 0?{}:{color:slot.textColor}}function slotBoxCss(slot,borderWidth){let box=slotBox(slot,borderWidth),out={};return box.backgroundColor!==void 0&&(out.backgroundColor=box.backgroundColor),box.borderColor!==void 0&&(out.border=`${box.borderWidth??1}px solid ${box.borderColor}`),box.borderRadius!==void 0&&(out.borderRadius=box.borderRadius),out}function slotCss(slot,borderWidth){return{...slotBoxCss(slot,borderWidth),...slotText(slot)}}function HealthPlanCartBar(props){let{cart:cart,onCheckout:onCheckout,busy:busy=false,priceFormat:priceFormat,style:style,className:className}=guardHostProps(props,["onCheckout"]),theme=usePlanTheme(),styles2=useMemo(()=>makeStyles2(theme),[theme]),subtotal=formatHealthPlanPriceWith(cart.subtotal,cart.currency,priceFormat),telemetry=useHealthPlanTelemetry(),petRef=useHealthPlanBarPet(useHealthPlanCartDock()?.petRef);/* @__PURE__ */
|
|
30
28
|
return jsxs("div",{className:className,style:{...styles2.bar,...style},role:"region","aria-label":HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),children:[
|
|
31
29
|
/* @__PURE__ */jsxs("div",{style:styles2.copy,children:[
|
|
32
|
-
/* @__PURE__ */jsxs("p",{style:styles2.label,children:[HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),cart.count>0?/* @__PURE__ */jsx("span",{style:styles2.count,"aria-hidden":"true",children:cart.count}):null]}),cart.count===0?/* @__PURE__ */jsx("p",{style:styles2.line,children:HEALTH_PLAN_COPY.cartEmpty}):subtotal===null?null:/* @__PURE__ */jsxs("p",{style:styles2.line,children:[HEALTH_PLAN_COPY.subtotal," ",subtotal]})]}),onCheckout===void 0?null:/* @__PURE__ */jsx("button",{type:"button",disabled:cart.count===0||busy,"aria-busy":busy?"true":void 0,onClick:()=>{trackCheckoutStarted(telemetry,petRef,cart),onCheckout(cart.items)},style:styles2.checkout,children:HEALTH_PLAN_COPY.checkout})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,ink=slots.cartBar?.textColor??color.text.onBrand,fill2=slots.cartBar?.backgroundColor??color.brandInk,line=size=>`${Math.round(size*type.lineHeight.snug)}px`;return{bar:{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"space-between",gap:space.md,padding:`${space.md}px ${space.lg}px`,borderRadius:radius.lg,backgroundColor:color.brand,color:color.text.onBrand,...slotCss(slots.cartBar)},copy:{display:"flex",flexDirection:"column",gap:2,minWidth:0},label:{margin:0,display:"flex",alignItems:"center",gap:space.sm,...faceCss(theme,"bold"),fontSize:type.size.body,lineHeight:line(type.size.body),color:ink},count:{minWidth:22,height:22,padding:`0 ${space.xs}px`,boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:radius.pill,backgroundColor:ink,color:fill2,...faceCss(theme,"bold"),fontSize:type.size.caption},line:{margin:0,...faceCss(theme,"regular"),fontSize:type.size.caption,lineHeight:line(type.size.caption),color:ink},checkout:{minHeight:44,padding:`0 ${space.lg}px`,borderRadius:radius.pill,border:"none",backgroundColor:ink,color:fill2,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.body}}}var FOCUS_RING_WIDTH=2,SELF_FOCUS_RING_ATTRIBUTE="data-ef-focus-ring",FOCUS_VISIBLE_ATTRIBUTE="data-ef-focus-visible",FOCUS_RING_COLOR_ATTRIBUTE="data-ef-focus-ring-color";function focusRingStyle(color){return{outline:`${FOCUS_RING_WIDTH}px solid ${color}`,outlineOffset:FOCUS_RING_WIDTH}}var keyboardDriving=false,bound=0;function onKeyDown(event){event.metaKey||event.ctrlKey||event.altKey||(keyboardDriving=true)}function onPointerDown(){keyboardDriving=false}function bindModality(){return typeof document>"u"?()=>{}:(bound===0&&(document.addEventListener("keydown",onKeyDown,true),document.addEventListener("pointerdown",onPointerDown,true),document.addEventListener("mousedown",onPointerDown,true),document.addEventListener("touchstart",onPointerDown,true)),bound+=1,()=>{bound-=1,!(bound>0)&&(document.removeEventListener("keydown",onKeyDown,true),document.removeEventListener("pointerdown",onPointerDown,true),document.removeEventListener("mousedown",onPointerDown,true),document.removeEventListener("touchstart",onPointerDown,true),keyboardDriving=false)})}var TEXT_INPUT_TYPES=/* @__PURE__ */new Set(["","text","search","email","tel","url","password","number"]);function isTextField(element){return element.tagName==="TEXTAREA"||element.isContentEditable?true:element.tagName!=="INPUT"?false:TEXT_INPUT_TYPES.has((element.getAttribute("type")??"").toLowerCase())}function useKeyboardFocusRing(root,color){useEffect(()=>{let node=root.current;if(node!==null)return bindKeyboardFocusRing(node,color)},[root,color])}function bindKeyboardFocusRing(node,color){let unbind=bindModality(),painted=/* @__PURE__ */new Map,onFocusIn=event=>{let target=event.target;if(!(target instanceof HTMLElement)||painted.has(target)||target.closest(`[${SELF_FOCUS_RING_ATTRIBUTE}="self"]`)!==null||!keyboardDriving&&!isTextField(target))return;painted.set(target,{outline:target.style.outline,outlineOffset:target.style.outlineOffset});let region=target.closest(`[${FOCUS_RING_COLOR_ATTRIBUTE}]`),ring=focusRingStyle(region?.getAttribute(FOCUS_RING_COLOR_ATTRIBUTE)||color);target.style.outline=ring.outline,target.style.outlineOffset=`${ring.outlineOffset}px`,target.setAttribute(FOCUS_VISIBLE_ATTRIBUTE,"")},onFocusOut=event=>{let target=event.target;if(!(target instanceof HTMLElement))return;let before=painted.get(target);before!==void 0&&(painted.delete(target),target.style.outline=before.outline,target.style.outlineOffset=before.outlineOffset,target.removeAttribute(FOCUS_VISIBLE_ATTRIBUTE))};return node.addEventListener("focusin",onFocusIn),node.addEventListener("focusout",onFocusOut),()=>{node.removeEventListener("focusin",onFocusIn),node.removeEventListener("focusout",onFocusOut);for(let[element,before]of painted)element.style.outline=before.outline,element.style.outlineOffset=before.outlineOffset,element.removeAttribute(FOCUS_VISIBLE_ATTRIBUTE);painted.clear(),unbind()}}var DESIGN_V3_LIGHT=/* @__PURE__ */Object.freeze({ink:"#262523",ink2:"#4A4845",ink3:"#6B6863",paper:"#F8F7F4",card:"#FFFFFF",line:"#E7E6E2",tile:"#F2F1EE",shadow:"rgba(38, 37, 35, .07)",riskBg:"#FFE3E1",riskInk:"#B0231B",riskDot:"#E5372B",clearBg:"#E6F4D3",clearInk:"#2F6A12",clearDot:"#5FA82B",watchDot:"#E5A000"}),cache2=/* @__PURE__ */new WeakMap;function v3Palette(theme){let hit=cache2.get(theme);if(hit!==void 0)return hit;let c=theme.color,dark=theme.brightness==="dark",neutrals=dark?{dark:dark,ink:c.text.primary,ink2:c.text.secondary,ink3:c.text.muted,paper:c.background,card:c.surface,line:c.borderRingCream,tile:c.surfaceSubtle,shadow:c.shadow,riskBg:c.badgeBgCritical,riskInk:c.danger,riskDot:c.danger,clearBg:c.badgeBgPositive,clearInk:c.success,clearDot:c.success,watchDot:c.warningStrong}:{dark:dark,...DESIGN_V3_LIGHT},textOn=(ink,grounds)=>pushToContrast(ink,grounds,poleForGrounds(grounds),V3_TEXT_CONTRAST),labelOn=(ink,fill2)=>contrastRatio(ink,fill2)>=V3_TEXT_CONTRAST?ink:legibleOn(fill2,V3_TEXT_CONTRAST),badgeGrounds=[neutrals.card,neutrals.paper].map(under=>flattenOnto(c.brandSoft,under)??under),brand={primary:c.primary,onPrimary:labelOn(c.onPrimary,c.primary),accent:c.accent,onAccent:labelOn(c.onAccent,c.accent),link:textOn(c.linkInk,[neutrals.card,neutrals.paper,neutrals.tile]),badge:c.brandSoft,onBadge:textOn(c.brandInk,badgeGrounds)},palette=/* @__PURE__ */Object.freeze({...neutrals,...brand});return cache2.set(theme,palette),palette}var V3_TEXT_CONTRAST=4.5;var PLAN_CLASS_PREFIX="efp-",PLAN_CONTEXT=[["font-family","$sans"],["color","$ink"],["font-size","17px"],["line-height","1.5"]],PLAN_RULES=[["h1",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h2",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h3",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],["h4",[0,0,1],[["color","$n_10462E"],["line-height","1.15"],["font-weight","700"]]],[".efp-ph-sheet > h3.efp-serif",[0,2,1],[["font-size","24px"]]],["*",[0,0,0],[["box-sizing","border-box"]]],["* > .efp-before",[0,1,0],[["box-sizing","border-box"]]],["[hidden]",[0,1,0],[["display","none",1]]],["h1",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h2",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h3",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["h4",[0,0,1],[["color","inherit"],["margin","0"],["font-weight","700"],["line-height","1.15"]]],["p",[0,0,1],[["margin","0"]]],["ul",[0,0,1],[["margin","0"]]],["ol",[0,0,1],[["margin","0"]]],["button",[0,0,1],[["font","inherit"],["color","inherit"]]],["input",[0,0,1],[["font","inherit"],["color","inherit"]]],["textarea",[0,0,1],[["font","inherit"],["color","inherit"]]],["button",[0,0,1],[["background","none"],["border","0"],["padding","0"],["cursor","pointer"],["text-align","inherit"],["-webkit-tap-highlight-color","transparent"],["touch-action","manipulation"]]],["img",[0,0,1],[["display","block"]]],["svg",[0,0,1],[["display","block"]]],["a",[0,0,1],[["color","inherit"]]],[".efp-sr-only",[0,1,0],[["position","absolute"],["width","1px"],["height","1px"],["overflow","hidden"],["clip","rect(0 0 0 0)"],["white-space","nowrap"]]],[".efp-serif",[0,1,0],[["font-family","$serif"],["font-weight","800"],["font-variation-settings",'"SOFT" 0, "WONK" 0'],["letter-spacing","-0.01em"],["text-wrap","balance"]]],[".efp-emb-btn",[0,1,0],[["display","inline-flex"],["align-items","center"],["justify-content","center"],["gap","8px"],["min-height","48px"],["padding","0 22px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-weight","700"],["font-size","16px"],["text-decoration","none"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms ease"]]],[".efp-emb-btn svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-emb-btn--block",[0,1,0],[["width","100%"]]],[".efp-emb-btn--ghost",[0,1,0],[["background","transparent"],["color","$ink"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-emb-btn--sm",[0,1,0],[["min-height","40px"],["padding","0 16px"],["font-size","15px"]]],[".efp-emb-btn--lg",[0,1,0],[["min-height","56px"],["padding","0 28px"],["font-size","17px"]]],[".efp-emb-btn[disabled]",[0,2,0],[["opacity",".32"],["pointer-events","none"]]],[".efp-dot",[0,1,0],[["display","inline-block"],["width","9px"],["height","9px"],["border-radius","50%"],["flex","none"]]],[".efp-dot--risk",[0,1,0],[["background","$riskDot"]]],[".efp-ph-scroll",[0,1,0],[["flex","1"],["min-height","0"],["overflow-y","auto"],["overscroll-behavior","contain"],["scrollbar-width","none"]]],[".efp-emb-tile",[0,1,0],[["width","46px"],["height","46px"],["border-radius","13px"],["background","$tile"],["display","grid"],["place-items","center"],["flex","none"],["font-size","22px"]]],[".efp-emb-tile svg",[0,1,1],[["width","23px"],["height","23px"]]],[".efp-emb-tile--cyan",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-ph-push",[0,1,0],[["position","absolute"],["inset","0"],["display","flex"],["flex-direction","column"],["background","$paper"],["pointer-events","auto"],["transform","translateX(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-push.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 300ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-bk__radio",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["box-shadow","inset 0 0 0 2px $n_BDB9B2"],["display","grid"],["place-items","center"]]],[".efp-bk__foot",[0,1,0],[["flex","none"],["padding","12px 18px 34px"],["background","$paper"],["box-shadow","0 -1px 0 $line"]]],[".efp-bk__done",[0,1,0],[["padding","40px 22px 20px"],["text-align","center"]]],[".efp-bk__check",[0,1,0],[["width","76px"],["height","76px"],["border-radius","50%"],["background","$accent"],["display","grid"],["place-items","center"],["margin","0 auto"]]],[".efp-bk__check svg",[0,1,1],[["width","38px"],["height","38px"]]],[".efp-bk__done .efp-bk__title",[0,2,0],[["margin-top","20px"],["font-size","34px"]]],[".efp-bk__when",[0,1,0],[["font-size","16px"],["margin-top","10px"],["font-weight","700"]]],[".efp-bk__who",[0,1,0],[["font-size","15px"],["color","$ink2"],["margin-top","2px"]]],[".efp-ph-scrim",[0,1,0],[["position","absolute"],["inset","0"],["z-index","40"],["background","$scrim"],["opacity","0"],["visibility","hidden"],["transition","opacity 200ms ease, visibility 0s linear 200ms"]]],[".efp-ph-scrim.efp-is-on",[0,2,0],[["opacity","1"],["visibility","visible"],["transition","opacity 240ms ease, visibility 0s"]]],[".efp-ph-sheet",[0,1,0],[["overscroll-behavior","contain"],["position","absolute"],["left","0"],["right","0"],["bottom","0"],["z-index","41"],["max-height","80%"],["overflow-y","auto"],["scrollbar-width","none"],["background","$card"],["border-radius","28px 28px 0 0"],["padding","10px 20px 40px"],["transform","translateY(100%)"],["visibility","hidden"],["transition","transform 220ms cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 220ms"]]],[".efp-ph-sheet.efp-is-on",[0,2,0],[["transform","none"],["visibility","visible"],["transition","transform 320ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s"]]],[".efp-sheet__grab",[0,1,0],[["width","40px"],["height","5px"],["border-radius","3px"],["background","$n_DAD7D1"],["margin","0 auto 10px"]]],[".efp-sheet__top",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"]]],[".efp-sheet__kicker",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".08em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-sheet__x",[0,1,0],[["width","40px"],["height","40px"],["margin-right","-8px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-sheet__x svg",[0,1,1],[["width","22px"],["height","22px"]]],[".efp-ph-sheet .efp-sheet__body",[0,2,0],[["display","grid"],["gap","10px"],["margin-top","12px"],["font-size","16px"],["line-height","1.5"],["color","$black"]]],[".efp-ph-toast",[0,1,0],[["position","absolute"],["left","16px"],["right","16px"],["top","112px"],["z-index","50"],["background","$ink"],["color","$onInk"],["border-radius","16px"],["padding","12px 15px"],["font-size","14.5px"],["line-height","1.4"],["opacity","0"],["transform","translateY(-8px)"],["pointer-events","none"],["transition","opacity 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-ph-toast.efp-is-on",[0,2,0],[["opacity","1"],["transform","none"],["transition-duration","220ms"]]],[".efp-plan__fine",[0,1,0],[["font-size","12.5px"],["color","$ink3"],["text-align","center"],["margin-top","16px"],["line-height","1.45"]]],[".efp-cp-tag",[0,1,0],[["font-family","$mono"],["font-size","10px"],["letter-spacing",".06em"],["text-transform","uppercase"],["background","$ink"],["color","$onInk"],["padding","2px 6px"],["border-radius","5px"]]],[".efp-cp-tag--s",[0,1,0],[["background","$card"],["color","$ink"]]],[".efp-hp",[0,1,0],[["padding","16px 16px 28px"]]],[".efp-hp-head",[0,1,0],[["display","grid"],["grid-template-columns","minmax(0, 1fr) 56px"],["gap","12px"],["align-items","center"],["padding","2px 2px 0"]]],[".efp-hp-head h2",[0,1,1],[["font-size","29px"],["line-height","1.06"]]],[".efp-hp-head p",[0,1,1],[["font-size","15px"],["color","$ink2"],["margin-top","6px"]]],[".efp-hp-head img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"],["box-shadow","0 0 0 3px $paper, 0 0 0 5.5px $accent"]]],[".efp-hp-need",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-need__k",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","15px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"],["width","24px"],["height","24px"],["border-radius","50%"],["background","$primary"],["color","$onPrimary"],["display","grid"],["place-items","center"],["font-size","12.5px"],["font-weight","800"]]],[".efp-hp-srcs",[0,1,0],[["margin-left","auto"],["display","flex"],["gap","4px"]]],[".efp-hp-src",[0,1,0],[["height","24px"],["padding","0 9px"],["border-radius","999px"],["background","$tile"],["color","$ink2"],["font-size","12px"],["font-weight","700"],["display","inline-flex"],["align-items","center"],["white-space","nowrap"]]],[".efp-hp-src--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-need h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.22"],["margin-top","12px"]]],[".efp-hp-need__s",[0,1,0],[["display","grid"],["grid-template-columns","9px minmax(0, 1fr)"],["gap","9px"],["align-items","baseline"],["margin-top","6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-need__s b",[0,1,1],[["color","$ink"],["font-weight","800"]]],[".efp-hp-need__s .efp-dot",[0,2,0],[["transform","translateY(-1px)"]]],[".efp-hp-odds",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"],["padding","10px 14px"],["border-radius","14px"],["background","$accent4"]]],[".efp-hp-odds__k",[0,1,0],[["font-size","13.5px"],["font-weight","600"],["line-height","1.35"],["color","$ink2"],["max-width","10em"]]],[".efp-hp-odds__k .efp-cp-tag",[0,2,0],[["display","inline-block"],["margin-top","3px"]]],[".efp-hp-odds__n",[0,1,0],[["display","grid"],["grid-template-columns","auto auto auto"],["align-items","center"],["justify-items","end"],["gap","0 6px"]]],[".efp-hp-odds__n s",[0,1,1],[["font-size","17px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-odds__n svg",[0,1,1],[["width","16px"],["height","16px"],["color","$ink3"]]],[".efp-hp-odds__n b",[0,1,1],[["font-family","$serif"],["font-size","28px"],["font-weight","800"],["line-height","1"]]],[".efp-hp-odds__n span",[0,1,1],[["grid-column","1 / -1"],["font-size","12.5px"],["font-weight","700"],["color","$link"],["margin-top","3px"]]],[".efp-hp-pick",[0,1,0],[["margin-top","12px"],["padding","12px"],["border-radius","16px"],["background","$paper"]]],[".efp-hp-pick__top",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-pick__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["background","$card"],["overflow","hidden"]]],[".efp-hp-pick__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-hp-pick h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-stars",[0,1,0],[["display","flex"],["align-items","center"],["gap","4px"],["margin-top","2px"],["font-size","13.5px"],["font-weight","800"]]],[".efp-hp-stars svg",[0,1,1],[["width","14px"],["height","14px"],["color","$watchDot"]]],[".efp-hp-stars span",[0,1,1],[["font-weight","500"],["color","$ink3"]]],[".efp-hp-pick__line",[0,1,0],[["margin-top","3px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-buy",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["margin-top","12px"]]],[".efp-hp-price",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","baseline"],["gap","0 8px"],["min-width","0"]]],[".efp-hp-price b",[0,1,1],[["font-size","24px"],["font-weight","800"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-price s",[0,1,1],[["font-size","15px"],["font-weight","700"],["color","$riskInk"],["text-decoration-thickness","2px"]]],[".efp-hp-price small",[0,1,1],[["flex-basis","100%"],["margin-top","3px"],["font-size","12.5px"],["line-height","1.35"],["color","$ink3"]]],[".efp-hp-buy .efp-emb-btn",[0,2,0],[["flex","none"],["min-height","46px"],["padding","0 20px"]]],[".efp-hp-more",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","0 18px"],["margin-top","8px"]]],[".efp-hp-more button",[0,1,1],[["min-height","34px"],["font-size","14px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-hp-need > .efp-hp-more",[0,2,0],[["margin-top","10px"]]],[".efp-hp-on",[0,1,0],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr) auto"],["gap","10px"],["align-items","center"],["margin-top","12px"],["padding","10px 10px 10px 12px"],["border-radius","14px"],["background","$clearBg"]]],[".efp-hp-on__ic",[0,1,0],[["width","34px"],["height","34px"],["border-radius","50%"],["background","$clearDot"],["color","$card"],["display","grid"],["place-items","center"]]],[".efp-hp-on__ic svg",[0,1,1],[["width","18px"],["height","18px"]]],[".efp-hp-on strong",[0,1,1],[["display","block"],["font-size","15px"],["color","$clearInk"],["line-height","1.25"]]],[".efp-hp-on small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","13px"],["line-height","1.35"],["color","$ink2"]]],[".efp-hp-on button",[0,1,1],[["min-height","38px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-is-on > .efp-hp-buy",[0,2,0],[["display","none"]]],[".efp-is-on [data-once]",[0,2,0],[["display","none"]]],[".efp-hp-by",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["margin-top","14px"],["padding","0 2px"]]],[".efp-hp-by img",[0,1,1],[["width","40px"],["height","40px"],["border-radius","50%"],["object-fit","cover"],["background","$tile"]]],[".efp-hp-by strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-by small",[0,1,1],[["display","block"],["margin-top","2px"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-steps",[0,1,0],[["margin-top","14px"],["padding","16px 12px 12px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-steps__head",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","baseline"],["gap","12px"],["padding","0 4px"]]],[".efp-hp-steps__head h3",[0,1,1],[["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-steps__head p",[0,1,1],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"],["white-space","nowrap"]]],[".efp-hp-list",[0,1,0],[["list-style","none"],["margin","6px 0 0"],["padding","0"],["display","grid"],["gap","2px"]]],[".efp-hp-swipe",[0,1,0],[["display","flex"],["gap","10px"],["overflow-x","auto"],["scroll-snap-type","x mandatory"],["overscroll-behavior-x","contain"],["scrollbar-width","none"],["-webkit-overflow-scrolling","touch"]]],[".efp-hp-swipe[data-ef-focus-visible]",[0,2,0],[["border-radius","18px"]]],[".efp-hp-swipe > *",[0,1,0],[["flex","0 0 78%"],["max-width","280px"],["scroll-snap-align","start"]]],[".efp-hp-steps .efp-hp-swipe",[0,2,0],[["margin","10px -12px 0"],["padding","0 12px 2px"],["scroll-padding-inline","12px"]]],[".efp-hp-tip",[0,1,0],[["display","flex"],["flex-direction","column"],["padding","14px 14px 12px"],["border-radius","18px"]]],[".efp-hp-tip--y",[0,1,0],[["background","$accentChip"]]],[".efp-hp-tip--c",[0,1,0],[["background","$linkChip"]]],[".efp-hp-tip--g",[0,1,0],[["background","$clearChip"]]],[".efp-hp-tip--r",[0,1,0],[["background","$riskChip"]]],[".efp-hp-tip__top",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"]]],[".efp-hp-tip__top svg",[0,1,1],[["width","26px"],["height","26px"],["color","$ink"]]],[".efp-hp-tip__n",[0,1,0],[["font-family","$serif"],["font-size","30px"],["font-weight","900"],["line-height","1"]]],[".efp-hp-tip strong",[0,1,1],[["display","block"],["margin-top","14px"],["font-size","17px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-tip small",[0,1,1],[["display","block"],["margin-top","4px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-tip em",[0,1,1],[["display","block"],["margin-top","auto"],["padding-top","10px"],["font-style","normal"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".04em"],["text-transform","uppercase"],["color","$link"]]],[".efp-hp-eyebrow",[0,1,0],[["font-family","$mono"],["font-size","11px"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-hp-head .efp-hp-eyebrow + h2",[0,2,1],[["margin-top","0"]]],[".efp-hp-by",[0,1,0],[["grid-template-columns","40px minmax(0, 1fr) 22px"],["margin-top","14px"],["padding","10px 12px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-by__ok",[0,1,0],[["width","22px"],["height","22px"],["color","$link"]]],[".efp-hp-says",[0,1,0],[["display","grid"],["grid-template-columns","32px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin","12px 0 0"],["padding","10px 12px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-says img",[0,1,1],[["width","32px"],["height","32px"],["border-radius","50%"],["object-fit","cover"]]],[".efp-hp-says p",[0,1,1],[["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-says b",[0,1,1],[["color","$ink"],["font-weight","800"],["margin-right","2px"]]],[".efp-hp-jump",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["margin-top","12px"],["padding","8px 14px 8px 8px"],["border-radius","14px"],["background","$primary"],["color","$onPrimary"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-jump img",[0,1,1],[["width","44px"],["height","44px"],["border-radius","10px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-jump small",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","800"],["color","$accent"]]],[".efp-hp-jump strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-jump__go",[0,1,0],[["font-size","14px"],["font-weight","800"]]],[".efp-hp-n",[0,1,0],[["flex","none"]]],[".efp-hp-steps__head h3",[0,1,1],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec__h",[0,1,0],[["display","flex"],["align-items","center"],["gap","10px"],["font-size","19px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-sec",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["scroll-margin-top","12px"]]],[".efp-hp-sec .efp-hp-pick",[0,2,0],[["margin-top","14px"],["padding","0"],["background","none"]]],[".efp-hp-sec .efp-hp-pick__top",[0,2,0],[["grid-template-columns","76px minmax(0, 1fr)"]]],[".efp-hp-sec .efp-hp-pick__img",[0,2,0],[["width","76px"],["height","76px"],["background","$paper"]]],[".efp-hp-mini",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-why",[0,1,0],[["margin-top","14px"],["padding","12px 14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $ink"]]],[".efp-hp-why ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-dose ul",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-hp-why li",[0,1,1],[["display","grid"],["grid-template-columns","58px minmax(0, 1fr)"],["gap","10px"],["align-items","start"],["margin-top","10px"]]],[".efp-hp-why strong",[0,1,1],[["display","block"],["font-size","15px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-why small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-chip",[0,1,0],[["height","22px"],["border-radius","6px"],["display","grid"],["place-items","center"],["font-family","$mono"],["font-size","10.5px"],["font-weight","700"],["letter-spacing",".04em"],["text-transform","uppercase"]]],[".efp-hp-chip--dna",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-hp-chip--ask",[0,1,0],[["background","$accent4"],["color","$ink"]]],[".efp-hp-chip--rec",[0,1,0],[["background","$tile"],["color","$ink2"]]],[".efp-hp-dose",[0,1,0],[["margin-top","10px"],["padding","12px 14px 14px"],["border-radius","16px"],["background","$linkWash"]]],[".efp-hp-dose .efp-hp-mini",[0,2,0],[["color","$link"]]],[".efp-hp-dose ul",[0,1,1],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-dose li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","2px"],["padding","10px 4px"],["border-radius","12px"],["background","$card"],["text-align","center"]]],[".efp-hp-dose b",[0,1,1],[["font-family","$mono"],["font-size","21px"],["font-weight","700"],["line-height","1.1"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-dose small",[0,1,1],[["font-size","12.5px"],["line-height","1.3"],["color","$ink2"]]],[".efp-hp-dose > p:last-child",[0,2,1],[["margin-top","10px"],["font-size","14px"],["line-height","1.45"],["color","$link"]]],[".efp-hp-in",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["gap","6px"],["margin-top","12px"]]],[".efp-hp-in span",[0,1,1],[["padding","6px 10px"],["border-radius","999px"],["background","$tile"],["font-size","13.5px"],["font-weight","600"]]],[".efp-hp-opts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"]]],[".efp-hp-opt",[0,1,0],[["width","100%"],["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["padding","14px"],["border-radius","16px"],["background","$card"],["text-align","left"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-hp-opt[aria-checked="true"]',[0,2,0],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-hp-opt__t",[0,1,0],[["display","grid"],["justify-items","start"],["gap","2px"]]],[".efp-hp-opt__t strong",[0,1,1],[["font-size","16px"],["font-weight","800"]]],[".efp-hp-opt__t small",[0,1,1],[["font-size","13.5px"],["color","$ink2"]]],[".efp-hp-opt__tag",[0,1,0],[["margin-bottom","4px"],["padding","2px 8px"],["border-radius","6px"],["background","$riskInk"],["color","$card"],["font-size","12px"],["font-weight","800"]]],[".efp-hp-opt__p",[0,1,0],[["font-size","18px"],["font-weight","800"]]],[".efp-hp-opt .efp-hp-price",[0,2,0],[["display","flex"],["flex-direction","column"],["align-items","flex-end"],["flex-wrap","nowrap"]]],[".efp-hp-opt .efp-hp-price s",[0,2,1],[["order","-1"]]],[".efp-hp-opt .efp-hp-price small",[0,2,1],[["display","none"]]],[".efp-hp-sec .efp-hp-buy",[0,2,0],[["display","block"],["margin-top","12px"]]],[".efp-hp-sec .efp-hp-buy .efp-emb-btn",[0,3,0],[["width","100%"],["min-height","52px"],["font-size","17px"]]],[".efp-hp-trust",[0,1,0],[["list-style","none"],["margin","12px 0 0"],["padding","0"],["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","6px"]]],[".efp-hp-trust li",[0,1,1],[["display","grid"],["justify-items","center"],["gap","4px"],["font-size","12.5px"],["font-weight","600"],["line-height","1.3"],["text-align","center"],["color","$ink2"]]],[".efp-hp-trust svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"]]],[".efp-is-on > .efp-hp-opts",[0,2,0],[["display","none"]]],[".efp-is-on > .efp-hp-trust",[0,2,0],[["display","none"]]],[".efp-hp-fine",[0,1,0],[["margin-top","8px"],["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-hp-sign",[0,1,0],[["margin-top","12px"],["padding","14px"],["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DEDCD7"]]],[".efp-hp-sign h4",[0,1,1],[["display","flex"],["align-items","center"],["gap","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-sign p",[0,1,1],[["margin-top","4px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-hp-sign--er",[0,1,0],[["background","$riskBg"],["box-shadow","none"]]],[".efp-hp-sign--er h4",[0,1,1],[["color","$riskInk"]]],[".efp-hp-sign--er h4 svg",[0,1,2],[["width","20px"],["height","20px"]]],[".efp-hp-sign--er p",[0,1,1],[["color","$ink"]]],[".efp-hp-qs",[0,1,0],[["margin","10px 0 0"],["padding-left","22px"],["display","grid"],["gap","6px"],["font-size","15px"],["line-height","1.45"]]],[".efp-hp-sec .efp-hp-add",[0,2,0],[["display","flex"],["align-items","center"],["justify-content","center"],["width","100%"],["padding","0 16px"],["min-height","48px"],["margin-top","14px"],["border-radius","999px"],["font-size","16px"],["font-weight","800"],["box-shadow","inset 0 0 0 2px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-sec .efp-hp-add[aria-pressed="true"]',[0,3,0],[["background","$clearBg"],["color","$clearInk"],["box-shadow","none"]]],[".efp-hp-revs",[0,1,0],[["margin","12px -16px 0"],["padding","0 16px"],["scroll-padding-inline","16px"]]],[".efp-hp-rev",[0,1,0],[["margin","0"],["padding","12px 14px"],["border-radius","14px"],["background","$paper"]]],[".efp-hp-rev__s",[0,1,0],[["display","flex"],["gap","1px"],["color","$watchDot"]]],[".efp-hp-rev__s svg",[0,1,1],[["width","13px"],["height","13px"]]],[".efp-hp-rev blockquote",[0,1,1],[["margin","5px 0 0"],["font-size","15px"],["line-height","1.4"]]],[".efp-hp-rev figcaption",[0,1,1],[["margin-top","4px"],["font-size","13px"],["color","$ink3"]]],[".efp-hp-score",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","8px"],["margin-top","12px"],["padding","11px 12px 11px 14px"],["border-radius","12px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-score b",[0,1,1],[["flex","none"],["font-family","$mono"],["font-size","16px"],["font-weight","700"],["color","$accent"]]],[".efp-hp-opt--once",[0,1,0],[["padding","10px 14px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-opt--once .efp-hp-opt__t strong",[0,2,1],[["font-size","15px"],["font-weight","700"]]],[".efp-hp-opt--once .efp-hp-opt__t small",[0,2,1],[["font-size","13px"]]],[".efp-hp-opt--once .efp-hp-opt__p",[0,2,0],[["font-size","15px"],["font-weight","700"],["color","$ink2"]]],['.efp-hp-opt--once[aria-checked="true"]',[0,2,0],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-hp-proof",[0,1,0],[["display","flex"],["justify-content","center"],["align-items","center"],["gap","6px"],["margin-top","10px"],["font-size","14.5px"],["font-weight","800"],["color","$riskInk"]]],[".efp-hp-proof svg",[0,1,1],[["width","21px"],["height","21px"],["flex","none"],["margin-top","-2px"]]],[".efp-is-on > .efp-hp-proof",[0,2,0],[["display","none"]]],[".efp-hp-qs__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-hp-qs__k + .efp-hp-qs",[0,2,0],[["margin-top","6px"]]],[".efp-hp-xs",[0,1,0],[["margin-top","22px"],["display","grid"],["gap","10px"]]],[".efp-hp-xs .efp-hp-eyebrow",[0,2,0],[["margin","0 4px"],["font-weight","400"]]],[".efp-hp-x",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","start"],["padding","14px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-x > img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-hp-x__ic",[0,1,0],[["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-hp-x__ic svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-x h4",[0,1,1],[["font-size","17px"],["font-weight","800"],["line-height","1.2"]]],[".efp-hp-x h4.efp-serif",[0,2,1],[["font-size","21px"]]],[".efp-hp-x p",[0,1,1],[["margin-top","3px"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-x .efp-hp-x__p",[0,2,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","0 8px"],["margin-top","6px"],["color","$ink"]]],[".efp-hp-x__p b",[0,1,1],[["font-size","19px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-hp-x__p s",[0,1,1],[["font-size","14px"],["font-weight","700"],["color","$ink3"]]],[".efp-hp-x__go",[0,1,0],[["grid-column","2"],["justify-self","start"],["margin-top","8px"],["min-height","40px"],["padding","0 18px"],["border-radius","999px"],["background","$primary"],["color","$onPrimary"],["font-size","14.5px"],["font-weight","800"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms ease"]]],['.efp-hp-x__go[aria-pressed="true"]',[0,2,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-hp-x--kit",[0,1,0],[["background","$linkWash"],["box-shadow","none"]]],[".efp-hp-x--kit > img",[0,1,1],[["background","$card"]]],[".efp-hp-next",[0,1,0],[["list-style","none"],["margin","22px 0 0"],["padding","4px 16px"],["border-radius","18px"],["background","$card"],["text-align","left"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-next li",[0,1,1],[["display","grid"],["grid-template-columns","36px minmax(0, 1fr)"],["gap","12px"],["align-items","center"],["padding","10px 0"]]],[".efp-hp-next__ic",[0,1,0],[["width","36px"],["height","36px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-next__ic svg",[0,1,1],[["width","19px"],["height","19px"]]],[".efp-hp-next small",[0,1,1],[["display","block"],["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".05em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-hp-next span",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","15px"],["font-weight","600"],["line-height","1.35"]]],[".efp-co",[0,1,0],[["display","grid"],["gap","10px"],["margin-top","2px"]]],[".efp-co-prod",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-co-prod__img",[0,1,0],[["width","56px"],["height","56px"],["border-radius","14px"],["background","$accent3"],["color","$ink"],["overflow","hidden"],["display","grid"],["place-items","center"]]],[".efp-co-prod__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-co-prod__img svg",[0,1,1],[["width","30px"],["height","30px"]]],[".efp-co-prod p",[0,1,1],[["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-co-prod__t",[0,1,0],[["font-size","20px"],["font-weight","800"],["line-height","1.2"],["color","$ink"]]],[".efp-co-prod .efp-co-prod__t",[0,2,0],[["margin-top","0"]]],[".efp-co-opts",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-co-opt",[0,1,0],[["border-radius","16px"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["transition","box-shadow 160ms ease, background-color 160ms ease"]]],[".efp-co-opt.efp-is-on",[0,2,0],[["background","$accent4"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-co-opt.efp-is-on .efp-bk__radio",[0,3,0],[["box-shadow","inset 0 0 0 7px $ink"]]],[".efp-co-opt__hit",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr) auto"],["gap","2px 12px"],["align-items","start"],["padding","12px 14px"],["border-radius","16px"],["text-align","left"]]],[".efp-co-opt__hit strong",[0,1,1],[["font-size","16px"],["line-height","1.35"]]],[".efp-co-opt__p",[0,1,0],[["text-align","right"],["font-size","16px"],["font-weight","800"],["line-height","1.35"],["font-variant-numeric","tabular-nums"]]],[".efp-co-opt__p s",[0,1,1],[["display","block"],["font-size","13px"],["font-weight","600"],["color","$riskInk"]]],[".efp-co-opt__hit small",[0,1,1],[["grid-column","2 / -1"],["font-size","13px"],["line-height","1.4"],["color","$ink2"]]],[".efp-co-k",[0,1,0],[["font-family","$mono"],["font-size","10.5px"],["letter-spacing",".06em"],["text-transform","uppercase"],["color","$ink3"],["margin-bottom","6px"]]],[".efp-co-every",[0,1,0],[["display","grid"],["grid-template-columns","repeat(3, minmax(0, 1fr))"],["gap","4px"],["padding","4px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-co-when",[0,1,0],[["padding","0 14px 12px 48px"]]],[".efp-co-every button",[0,1,1],[["min-height","36px"],["padding","0 6px"],["border-radius","999px"],["font-size","14px"],["font-weight","700"],["text-align","center"],["white-space","nowrap"],["transition","background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-co-every button[aria-checked="true"]',[0,2,1],[["background","$primary"],["color","$onPrimary"]]],[".efp-co-rows",[0,1,0],[["list-style","none"],["margin","0"],["padding","2px 14px"],["border-radius","16px"],["background","$paper"]]],[".efp-co-rows li",[0,1,1],[["display","grid"],["grid-template-columns","20px 4.6rem minmax(0, 1fr)"],["gap","10px"],["align-items","center"],["min-height","40px"],["font-size","14.5px"]]],[".efp-co-rows svg",[0,1,1],[["width","20px"],["height","20px"],["color","$ink2"]]],[".efp-co-rows span",[0,1,1],[["color","$ink3"]]],[".efp-co-rows b",[0,1,1],[["font-weight","700"]]],[".efp-co-fine",[0,1,0],[["font-size","12.5px"],["line-height","1.45"],["color","$ink3"],["text-align","center"]]],[".efp-mg-cancel",[0,1,0],[["justify-self","center"],["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$riskInk"]]],[".efp-hp-tools",[0,1,0],[["display","flex"],["align-items","center"],["justify-content","space-between"],["gap","8px"],["margin","-8px -6px 2px 2px"]]],[".efp-hp-tools .efp-hp-eyebrow",[0,2,0],[["margin","0"]]],[".efp-hp-tools__end",[0,1,0],[["display","flex"],["align-items","center"],["gap","2px"]]],[".efp-hp-orders",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","44px"],["padding","0 8px"],["border-radius","999px"],["font-size","15px"],["font-weight","700"]]],[".efp-hp-orders svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-cart",[0,1,0],[["position","relative"],["width","44px"],["height","44px"],["display","grid"],["place-items","center"],["border-radius","50%"]]],[".efp-hp-cart svg",[0,1,1],[["width","26px"],["height","26px"]]],[".efp-hp-cart__n",[0,1,0],[["position","absolute"],["top","3px"],["right","1px"],["min-width","20px"],["height","20px"],["padding","0 5px"],["border-radius","999px"],["background","$riskDot"],["color","$card"],["font-size","12px"],["font-weight","800"],["line-height","20px"],["text-align","center"],["font-variant-numeric","tabular-nums"],["box-shadow","0 0 0 2px $paper"]]],[".efp-hp-ask-row",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","40px minmax(0, 1fr) 18px"],["gap","12px"],["align-items","center"],["margin-top","10px"],["padding","12px 14px 12px 12px"],["border-radius","16px"],["background","$linkWash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-hp-ask-row__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$card"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-hp-ask-row__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-hp-ask-row strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-hp-ask-row small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.4"],["color","$ink2"]]],[".efp-hp-ask-row > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink2"]]],[".efp-hp-sec .efp-hp-ask-row",[0,2,0],[["margin-top","12px"]]],[".efp-hp-wait",[0,1,0],[["margin-top","14px"],["padding","16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-wait__top",[0,1,0],[["display","grid"],["grid-template-columns","46px minmax(0, 1fr)"],["gap","12px"],["align-items","center"]]],[".efp-hp-wait__top h3",[0,1,1],[["font-size","26px"],["line-height","1.05"],["margin-top","2px"]]],[".efp-hp-wait .efp-sh-track",[0,2,0],[["margin-top","14px"]]],[".efp-hp-wait__k",[0,1,0],[["margin-top","18px"],["font-size","16px"],["font-weight","800"]]],[".efp-hp-next--in",[0,1,0],[["margin-top","8px"],["background","$paper"],["box-shadow","none"]]],[".efp-hp-wait__text",[0,1,0],[["display","flex"],["align-items","center"],["gap","8px"],["margin","16px 0 12px"],["font-size","15.5px"],["font-weight","700"]]],[".efp-hp-wait__text svg",[0,1,1],[["width","20px"],["height","20px"],["color","$link"],["flex","none"]]],[".efp-sh-track",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"]]],[".efp-sh-track li",[0,1,1],[["position","relative"],["display","grid"],["grid-template-columns","22px minmax(0, 1fr)"],["gap","12px"],["padding-bottom","16px"]]],[".efp-sh-track li:last-child",[0,2,1],[["padding-bottom","0"]]],[".efp-sh-track li > .efp-before",[0,2,1],[["position","absolute"],["left","10px"],["top","20px"],["bottom","-2px"],["width","2px"],["border-radius","1px"],["background","$n_E2DFD9"]]],[".efp-sh-track li:last-child > .efp-before",[0,3,1],[["display","none"]]],[".efp-sh-track li.efp-is-done:has(+ li.efp-is-done) > .efp-before",[0,4,2],[["background","$primary"]]],[".efp-sh-track__dot",[0,1,0],[["width","22px"],["height","22px"],["border-radius","50%"],["display","grid"],["place-items","center"],["background","$card"],["box-shadow","inset 0 0 0 2px $n_CFCBC4"],["position","relative"],["z-index","1"]]],[".efp-sh-track__dot svg",[0,1,1],[["width","13px"],["height","13px"],["color","$card"]]],[".efp-sh-track .efp-is-done .efp-sh-track__dot",[0,3,0],[["background","$primary"],["box-shadow","none"]]],[".efp-sh-track .efp-is-now .efp-sh-track__dot",[0,3,0],[["background","$accent"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-track strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-track small",[0,1,1],[["display","block"],["margin-top","1px"],["font-size","14px"],["line-height","1.35"],["color","$ink3"]]],[".efp-sh-track li:not(.efp-is-done):not(.efp-is-now) strong",[0,3,2],[["color","$ink3"],["font-weight","700"]]],[".efp-sh",[0,1,0],[["display","grid"],["gap","12px"],["padding","8px 18px 28px"]]],[".efp-sh-title",[0,1,0],[["font-size","29px"],["line-height","1.08"]]],[".efp-sh-sub2",[0,1,0],[["margin-top","-6px"],["font-size","15px"],["line-height","1.45"],["color","$ink2"]]],[".efp-sh-k",[0,1,0],[["margin","6px 2px -4px"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-card",[0,1,0],[["padding","14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","18px"]]],[".efp-sh-item",[0,1,0],[["display","grid"],["grid-template-columns","64px minmax(0, 1fr)"],["gap","12px"],["align-items","start"]]],[".efp-sh-item__img",[0,1,0],[["width","64px"],["height","64px"],["border-radius","14px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-item__img img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-item__img svg",[0,1,1],[["width","28px"],["height","28px"]]],[".efp-sh-item h3",[0,1,1],[["font-size","16.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-item__p",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","3px"]]],[".efp-sh-item__p b",[0,1,1],[["font-size","16px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item__p s",[0,1,1],[["font-size","14px"],["font-weight","600"],["color","$ink3"]]],[".efp-sh-item__p small",[0,1,1],[["font-size","14px"],["color","$ink3"]]],[".efp-sh-item__acts",[0,1,0],[["display","flex"],["align-items","center"],["gap","16px"],["margin-top","8px"]]],[".efp-sh-step",[0,1,0],[["display","inline-grid"],["grid-template-columns","40px 30px 40px"],["align-items","center"],["height","40px"],["border-radius","999px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"]]],[".efp-sh-step button",[0,1,1],[["height","40px"],["display","grid"],["place-items","center"],["border-radius","999px"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-step button svg",[0,1,2],[["width","16px"],["height","16px"]]],[".efp-sh-step button[disabled]",[0,2,1],[["opacity",".3"],["cursor","default"]]],[".efp-sh-step output",[0,1,1],[["text-align","center"],["font-size","15.5px"],["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-rm",[0,1,0],[["min-height","40px"],["font-size","14.5px"],["font-weight","700"],["color","$ink2"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-mode",[0,1,0],[["display","grid"],["gap","6px"],["margin-top","8px"]]],[".efp-sh-mode button",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["min-height","44px"],["padding","8px 12px"],["border-radius","12px"],["background","$paper"],["font-size","14.5px"],["font-weight","700"],["line-height","1.3"],["text-align","left"],["transition","box-shadow 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],['.efp-sh-mode button[aria-checked="true"]',[0,2,1],[["background","$card"],["box-shadow","inset 0 0 0 2px $ink"]]],[".efp-sh-mode b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-item .efp-co-every",[0,2,0],[["margin-top","8px"]]],[".efp-sh-sum li.efp-is-renew",[0,2,1],[["min-height","28px"],["margin-top","-6px"],["font-size","14px"]]],[".efp-sh-sum",[0,1,0],[["list-style","none"],["margin","0"],["padding","6px 16px"],["border-radius","16px"],["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-sh-sum li",[0,1,1],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","12px"],["min-height","34px"],["font-size","15px"],["font-variant-numeric","tabular-nums"]]],[".efp-sh-sum li > span:first-child",[0,2,2],[["color","$ink2"],["display","inline-flex"],["align-items","center"],["gap","8px"]]],[".efp-sh-sum li.efp-is-total",[0,2,1],[["min-height","42px"],["font-size","17px"],["font-weight","800"]]],[".efp-sh-sum li.efp-is-total span:first-child",[0,3,2],[["color","$ink"]]],[".efp-sh-foot",[0,1,0],[["display","grid"],["gap","8px"]]],[".efp-sh-foot .efp-sh-fine",[0,2,0],[["text-align","center"]]],[".efp-sh-fine",[0,1,0],[["font-size","13px"],["line-height","1.45"],["color","$ink3"]]],[".efp-sh-fine--c",[0,1,0],[["margin-top","14px"],["text-align","center"]]],[".efp-sh-empty",[0,1,0],[["display","grid"],["justify-items","center"],["gap","8px"],["padding","48px 12px 8px"],["text-align","center"]]],[".efp-sh-empty .efp-emb-tile",[0,2,0],[["width","72px"],["height","72px"],["border-radius","20px"],["margin-bottom","8px"]]],[".efp-sh-empty .efp-emb-tile svg",[0,2,1],[["width","34px"],["height","34px"]]],[".efp-sh-empty h2",[0,1,1],[["font-size","28px"],["line-height","1.1"]]],[".efp-sh-empty p",[0,1,1],[["max-width","30ch"],["font-size","15.5px"],["line-height","1.45"],["color","$ink2"],["text-wrap","pretty"]]],[".efp-sh-empty .efp-emb-btn",[0,2,0],[["margin-top","12px"]]],[".efp-sh-link",[0,1,0],[["min-height","40px"],["font-size","15px"],["font-weight","700"],["color","$link"],["text-decoration","underline"],["text-decoration-thickness","1.5px"],["text-underline-offset","3px"]]],[".efp-sh-subc",[0,1,0],[["display","grid"],["grid-template-columns","56px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["padding","12px 14px 12px 12px"],["border-radius","22px"],["background","$clearBg"]]],[".efp-sh-subc img",[0,1,1],[["width","56px"],["height","56px"],["border-radius","14px"],["object-fit","cover"],["background","$card"]]],[".efp-sh-subc strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"],["line-height","1.25"]]],[".efp-sh-subc small",[0,1,1],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.35"],["color","$ink2"]]],[".efp-sh-subc button",[0,1,1],[["min-height","40px"],["padding","0 14px"],["border-radius","999px"],["background","$card"],["font-size","14px"],["font-weight","800"],["box-shadow","inset 0 0 0 1.5px $ink"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-orders",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-sh-order",[0,1,0],[["width","100%"],["display","grid"],["grid-template-columns","minmax(0, 1fr) 18px"],["gap","10px"],["align-items","center"],["padding","14px 14px 14px 16px"],["border-radius","22px"],["background","$card"],["box-shadow","0 1px 3px $wash"],["text-align","left"],["transition","transform 160ms cubic-bezier(0.23, 1, 0.32, 1)"]]],[".efp-sh-order > svg",[0,1,1],[["width","18px"],["height","18px"],["color","$ink3"]]],[".efp-sh-order__top",[0,1,0],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","4px 10px"]]],[".efp-sh-order__no",[0,1,0],[["font-family","$mono"],["font-size","12px"],["letter-spacing",".04em"],["color","$ink3"]]],[".efp-sh-order__what",[0,1,0],[["display","block"],["margin-top","8px"],["font-size","16px"],["font-weight","800"],["line-height","1.3"]]],[".efp-sh-order__meta",[0,1,0],[["display","block"],["margin-top","2px"],["font-size","14px"],["line-height","1.4"],["color","$ink3"]]],[".efp-sh-order__pics",[0,1,0],[["display","flex"],["gap","6px"],["margin-top","10px"]]],[".efp-sh-order__pics span",[0,1,1],[["width","40px"],["height","40px"],["border-radius","10px"],["overflow","hidden"],["display","grid"],["place-items","center"],["background","$linkWash"],["color","$link"]]],[".efp-sh-order__pics img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"]]],[".efp-sh-order__pics svg",[0,1,1],[["width","20px"],["height","20px"]]],[".efp-sh-pill",[0,1,0],[["display","inline-flex"],["align-items","center"],["gap","6px"],["min-height","26px"],["padding","0 10px"],["border-radius","999px"],["font-size","13px"],["font-weight","800"],["background","$accent3"],["color","$ink"]]],[".efp-sh-pill--done",[0,1,0],[["background","$clearBg"],["color","$clearInk"]]],[".efp-sh-pill--sub",[0,1,0],[["background","$linkWash"],["color","$link"]]],[".efp-sh-carrier",[0,1,0],[["display","grid"],["grid-template-columns","40px minmax(0, 1fr)"],["gap","4px 12px"],["align-items","center"]]],[".efp-sh-carrier__ic",[0,1,0],[["width","40px"],["height","40px"],["border-radius","11px"],["background","$linkWash"],["color","$link"],["display","grid"],["place-items","center"]]],[".efp-sh-carrier__ic svg",[0,1,1],[["width","21px"],["height","21px"]]],[".efp-sh-carrier strong",[0,1,1],[["display","block"],["font-size","16px"],["font-weight","800"]]],[".efp-sh-carrier small",[0,1,1],[["display","flex"],["flex-wrap","wrap"],["align-items","center"],["gap","2px 8px"],["margin-top","1px"],["font-family","$mono"],["font-size","13px"],["letter-spacing",".02em"],["color","$ink2"]]],[".efp-sh-carrier .efp-emb-btn",[0,2,0],[["grid-column","1 / -1"],["margin-top","10px"]]],[".efp-sh-carrier__wait",[0,1,0],[["grid-column","2"],["font-size","14.5px"],["line-height","1.4"],["color","$ink2"]]],[".efp-sh-acts",[0,1,0],[["display","grid"],["gap","4px"],["justify-items","center"],["margin-top","4px"]]],[".efp-hp-next__ic img",[0,1,1],[["width","100%"],["height","100%"],["object-fit","cover"],["border-radius","11px"]]],[".efp-co-items",[0,1,0],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","10px"]]],[".efp-co-items li",[0,1,1],[["display","grid"],["grid-template-columns","44px minmax(0, 1fr) auto"],["gap","12px"],["align-items","center"],["font-size","15px"]]],[".efp-co-items .efp-sh-order__pics",[0,2,0],[["margin","0"]]],[".efp-co-items strong",[0,1,1],[["display","block"],["font-size","15.5px"],["font-weight","800"],["line-height","1.25"]]],[".efp-co-items small",[0,1,1],[["display","block"],["font-size","13.5px"],["color","$ink3"]]],[".efp-co-items b",[0,1,1],[["font-weight","800"],["font-variant-numeric","tabular-nums"]]],[".efp-co .efp-sh-sum",[0,2,0],[["background","$paper"],["box-shadow","none"]]],[".efp-co-items .efp-sh-order__pics span",[0,2,1],[["width","44px"],["height","44px"]]],[".efp-sh .efp-co-rows",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-wt-f",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","14px"],["font-size","15px"],["font-weight","700"]]],[".efp-wt-f__in",[0,1,0],[["position","relative"]]],[".efp-wt-f input",[0,1,1],[["width","100%"],["height","58px"],["border","0"],["border-radius","16px"],["padding","0 56px 0 18px"],["background","$card"],["box-shadow","inset 0 0 0 1.5px $n_DAD7D1"],["font-size","24px"],["font-weight","800"],["font-variant-numeric","tabular-nums"],["outline","none"]]],[".efp-wt-f input[data-ef-focus]",[0,2,1],[["box-shadow","inset 0 0 0 2.5px $ink"]]],[".efp-wt-f__u",[0,1,0],[["position","absolute"],["right","18px"],["top","50%"],["translate","0 -50%"],["font-size","17px"],["font-weight","700"],["color","$ink3"],["pointer-events","none"]]],[".efp-wt-err",[0,1,0],[["min-height","20px"],["margin-top","6px"],["font-size","14px"],["font-weight","700"],["color","$riskInk"]]],[".efp-wt-acts",[0,1,0],[["display","grid"],["gap","8px"],["margin-top","10px"]]],[".efp-hp-ask-row strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-order__what",[0,1,0],[["text-wrap","balance"]]],[".efp-sh-item h3",[0,1,1],[["text-wrap","balance"]]],[".efp-co-items strong",[0,1,1],[["text-wrap","balance"]]],[".efp-sh-subc strong",[0,1,1],[["text-wrap","balance"]]],[".efp-hp-ask-row small",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-tip small",[0,1,1],[["text-wrap","pretty"]]],[".efp-sh-carrier__wait",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-fine",[0,1,0],[["text-wrap","pretty"]]],[".efp-sh-sub2",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-next span",[0,1,1],[["text-wrap","pretty"]]],[".efp-hp-wait__text",[0,1,0],[["text-wrap","pretty"]]],[".efp-wt-err",[0,1,0],[["text-wrap","pretty"]]],[".efp-hp-foot-stack",[0,1,0],[["display","grid"],["gap","10px"]]],[".efp-blanks",[0,1,0],[["display","grid"],["gap","8px"],["background","$paper"],["border-radius","20px"],["padding","12px 12px 13px"]]],[".efp-blanks__h",[0,1,0],[["display","flex"],["justify-content","space-between"],["align-items","center"],["gap","10px"],["padding","0 2px 2px"],["font-size","12.5px"],["font-weight","800"],["letter-spacing",".07em"],["text-transform","uppercase"],["color","$ink3"]]],[".efp-blanks__h em",[0,1,1],[["font-style","normal"],["letter-spacing",".01em"],["text-transform","none"],["font-size","13px"],["font-weight","800"],["color","$ink"],["background","$accent"],["border-radius","999px"],["padding","2px 10px"],["white-space","nowrap"]]],['.efp-blanks[data-st="filled"] .efp-blanks__h em',[0,3,1],[["background","$clearBg"],["color","$clearInk"]]],[".efp-blanks ol",[0,1,1],[["list-style","none"],["margin","0"],["padding","0"],["display","grid"],["gap","7px"]]],[".efp-blanks li",[0,1,1],[["display","grid"],["grid-template-columns","34px minmax(0, 1fr)"],["column-gap","11px"],["align-items","center"],["background","$card"],["border-radius","15px"],["padding","9px 12px 9px 9px"]]],[".efp-blanks li > b",[0,1,2],[["grid-row","span 2"],["width","34px"],["height","40px"],["border-radius","11px"],["display","grid"],["place-items","center"],["font-family","$serif"],["font-size","22px"],["font-weight","800"]]],[".efp-blanks li > b",[0,1,2],[["background","$accentChip"]]],[".efp-blanks li > span",[0,1,2],[["font-size","16px"],["font-weight","700"],["line-height","1.35"]]],[".efp-blanks li > small",[0,1,2],[["font-size","13.5px"],["color","$ink3"]]],[".efp-blank",[0,1,0],[["display","inline-block"],["min-width","36px"],["height","20px"],["vertical-align","-3px"],["border-radius","6px"],["background","$accent4"],["box-shadow","inset 0 0 0 1.5px $accent"],["font-style","normal"]]],[".efp-blank--s",[0,1,0],[["min-width","24px"]]],[".efp-blank--l",[0,1,0],[["min-width","64px"]]],['.efp-blanks[data-st="filled"] .efp-blank',[0,3,0],[["height","auto"],["min-width","0"],["vertical-align","0"],["background","none"],["box-shadow","none"],["padding","0 3px"],["margin","0 -3px"],["border-radius","6px"]]],[".efp-hp-blanks",[0,1,0],[["margin-top","14px"]]],[".efp-hp-blanks .efp-blanks",[0,2,0],[["background","$card"],["box-shadow","0 1px 3px $wash"]]],[".efp-hp-blanks .efp-blanks li",[0,2,1],[["background","$paper"]]],[".efp-mg-orders",[0,1,0],[["justify-self","center"]]],[".efp-hp",[0,1,0],[["background","$paper"]]],[".efp-ph-toast",[0,1,0],[["top","calc(112px - 50px)"]]],[".efp-hp-jump:not(:has(> img))",[0,1,1],[["grid-template-columns","minmax(0, 1fr) auto"]]],[".efp-hp-by:not(:has(> img))",[0,1,1],[["grid-template-columns","minmax(0, 1fr) 22px"],["grid-template-rows","minmax(40px, auto)"]]],[".efp-hp-others",[0,1,0],[["list-style","none"],["margin-bottom","0"]]],[".efp-hp-today .efp-hp-odds__k",[0,2,0],[["text-wrap","balance"]]],[".efp-co-opts",[0,1,0],[["list-style","none"],["padding","0"]]],[".efp-sheet__x",[0,1,0],[["position","relative"]]],[".efp-ph-sheet",[0,2,0],[["max-height","calc(100% - 8px)"],["padding","8px 20px 14px"]],1],[".efp-sheet__grab",[0,2,0],[["display","none"]],1],[".efp-co",[0,2,0],[["gap","8px"]],1],[".efp-co-rows li",[0,2,1],[["min-height","36px"]],1],[".efp-hp-swipe",[0,2,0],[["scrollbar-width","thin"],["scrollbar-color","$n_CFCBC4 transparent"],["padding-bottom","10px"]],1],[".efp-ph-toast.efp-ph-toast--card",[0,2,0],[["background","none"],["padding","0"],["border-radius","0"]]]],PLAN_PRESS=[[".efp-emb-btn","scale(.97)"],[".efp-hp-on button","scale(.96)"],[".efp-hp-jump","scale(.98)"],[".efp-hp-opt","scale(.98)"],[".efp-hp-sec .efp-hp-add","scale(.98)"],[".efp-hp-x__go","scale(.96)"],[".efp-co-every button","scale(.96)"],[".efp-hp-ask-row","scale(.98)"],[".efp-sh-step button","scale(.9)"],[".efp-sh-mode button","scale(.98)"],[".efp-sh-subc button","scale(.96)"],[".efp-sh-order","scale(.98)"]],PLAN_ICONS={shield:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6z"},[]],["path",{d:"m9 12 2 2 4-4"},[]]]]],arrow:[["path",{d:"M4.5 12h14.5M13.5 6.5 19 12l-5.5 5.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[]]],check:[["path",{d:"m5 12.6 4.4 4.4L19 7.4",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"},[]]],star:[["path",{d:"m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z",fill:"currentColor"},[]]],truck:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[["path",{d:"M2.8 6.5h11.4v9.5H2.8zM14.2 9.5h3.6l3.4 3.4v3.1h-7"},[]],["circle",{cx:"6.8",cy:"17.6",r:"1.8"},[]],["circle",{cx:"17.2",cy:"17.6",r:"1.8"},[]]]]],refresh:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M4 12a8 8 0 1 0 3-6.2"},[]],["path",{d:"M4 4v4h4"},[]]]]],card:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[["rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.2"},[]],["path",{d:"M3 9.5h18M6.5 15h4",strokeLinecap:"round"},[]]]]],alert:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M12 3.5 21.5 20h-19z"},[]],["path",{d:"M12 10v4.5M12 17.2h.01"},[]]]]],x:[["path",{d:"M6.5 6.5l11 11M17.5 6.5l-11 11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"},[]]],chat:[["path",{d:"M5 5.2h14a1.6 1.6 0 0 1 1.6 1.6v8.6a1.6 1.6 0 0 1-1.6 1.6h-8.7l-4.8 3.6v-3.6H5a1.6 1.6 0 0 1-1.6-1.6V6.8A1.6 1.6 0 0 1 5 5.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[]]],repeat:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M4.5 11a7.5 7.5 0 0 1 12.8-5.3L19.5 8M19.5 3.5V8H15M19.5 13a7.5 7.5 0 0 1-12.8 5.3L4.5 16M4.5 20.5V16H9"},[]]]]],calendar:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"},[["rect",{x:"4",y:"5.5",width:"16",height:"15",rx:"2.5"},[]],["path",{d:"M4 10h16M8.5 3.5v4M15.5 3.5v4"},[]]]]],flame:[["path",{fillRule:"evenodd",d:"M12 2.5c.4 2.9-1.3 4.6-2.9 6.3C7.6 10.4 6 12.2 6 14.9 6 18.3 8.7 21 12 21s6-2.7 6-6.1c0-2.3-1-4.1-2.3-5.6-.1 1.5-.9 2.6-2 3.1.6-3.9-.5-7.3-1.7-8.9zM12 19.2c-1.5 0-2.6-1.1-2.6-2.5 0-1.5 1.2-2.4 2.1-3.4.3 1 .9 1.6 1.6 1.9.1-.5.1-1 0-1.5 1 .9 1.6 1.9 1.6 3 0 1.4-1.2 2.5-2.7 2.5z",fill:"currentColor"},[]]],box:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[["path",{d:"M3.8 7.8 12 4l8.2 3.8v8.6L12 20l-8.2-3.6z"},[]],["path",{d:"m3.8 7.8 8.2 3.8 8.2-3.8M12 11.6V20"},[]]]]],cart:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},[["path",{d:"M2.8 4h2.6l2.3 10.6a1.4 1.4 0 0 0 1.4 1.1h8.2a1.4 1.4 0 0 0 1.4-1.1L20.4 7.6H6.3"},[]],["circle",{cx:"9.6",cy:"19.6",r:"1.3"},[]],["circle",{cx:"17.1",cy:"19.6",r:"1.3"},[]]]]],minus:[["path",{d:"M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"},[]]],plus:[["path",{d:"M12 6v12M6 12h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"},[]]],chev:[["path",{d:"m9 5.5 6.5 6.5L9 18.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},[]]],pulse:[["path",{d:"M3 12.5h3.8l2.4-5.6 4.2 10.6 2.4-5h5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},[]]],file:[["path",{d:"M7 3.5h7.2l4.3 4.3v12.2a.6.6 0 0 1-.6.6H7a.6.6 0 0 1-.6-.6V4.1a.6.6 0 0 1 .6-.6zM14 3.6V8h4.4M9.4 12.4h5.2M9.4 15.8h5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"},[]]],kit:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[["path",{d:"M4 7.6 12 3.6l8 4v8.8l-8 4-8-4z"},[]],["path",{d:"m4 7.6 8 4 8-4M12 11.6v8.8"},[]]]]],dna:[["path",{d:"M7 3.5c0 4.2 10 4.3 10 8.5s-10 4.3-10 8.5M17 3.5c0 4.2-10 4.3-10 8.5s10 4.3 10 8.5M8.6 6.3h6.8M8.6 17.7h6.8M10.4 9.6h3.2M10.4 14.4h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"},[]]],heart:[["path",{d:"M12 20.2s-7.6-4.6-7.6-10.1A4.3 4.3 0 0 1 12 7.6a4.3 4.3 0 0 1 7.6 2.5c0 5.5-7.6 10.1-7.6 10.1z",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"},[]]],bottle:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"},[["rect",{x:"8",y:"2.8",width:"8",height:"3.4",rx:"1"},[]],["path",{d:"M7.2 6.2h9.6a1 1 0 0 1 1 1v12.3a1.7 1.7 0 0 1-1.7 1.7H7.9a1.7 1.7 0 0 1-1.7-1.7V7.2a1 1 0 0 1 1-1z"},[]],["path",{d:"M9 11h6v5H9z"},[]]]]],harness:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"},[["path",{d:"M7.5 4.5c0 4.2 2 6.8 4.5 6.8s4.5-2.6 4.5-6.8"},[]],["path",{d:"M5 12.6h14v4.6a2.3 2.3 0 0 1-2.3 2.3H7.3A2.3 2.3 0 0 1 5 17.2z"},[]],["circle",{cx:"12",cy:"10.2",r:"1.3"},[]],["path",{d:"M8.2 15.3h7.6"},[]]]]],ramp:[["g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"},[["path",{d:"M2.5 19.5h19"},[]],["path",{d:"M3.5 19.5v-3h4.5v-3h4.5v-3H17V7.5h3.5v12"},[]],["path",{d:"M3.5 16.5 20.5 7.5",opacity:".35"},[]]]]]};var DESIGN_PLAN_CLASSES={root:"hp",head:"hp-head",eyebrow:"hp-eyebrow",serif:"serif",by:"hp-by",byOk:"hp-by__ok",need:"hp-need",needKicker:"hp-need__k",sources:"hp-srcs",source:"hp-src","source:dna":"hp-src--dna",needRisk:"hp-need__s",dot:"dot","dot:risk":"dot--risk",odds:"hp-odds",oddsKicker:"hp-odds__k",oddsNumbers:"hp-odds__n",tag:"cp-tag cp-tag--s",says:"hp-says",saysKicker:"hp-says__k",jump:"hp-jump",jumpGo:"hp-jump__go",steps:"hp-steps",stepsHead:"hp-steps__head",n:"hp-n",list:"hp-list hp-swipe",tip:"hp-tip",tipN:"hp-tip__n",section:"hp-sec",sectionTitle:"hp-sec__h",pick:"hp-pick",others:"hp-sec hp-others",other:"hp-pick",pickTop:"hp-pick__top",pickImage:"hp-pick__img",stars:"hp-stars",pickLine:"hp-pick__line",reviews:"hp-revs hp-swipe",review:"hp-rev",reviewStars:"hp-rev__s",score:"hp-score",why:"hp-why",mini:"hp-mini",chip:"hp-chip","chip:dna":"hp-chip--dna","chip:rec":"hp-chip--rec","chip:ask":"hp-chip--ask",dose:"hp-dose",ingredients:"hp-in",opts:"hp-opts",opt:"hp-opt","opt:once":"hp-opt--once",optText:"hp-opt__t",optTag:"hp-opt__tag",price:"hp-price",optPrice:"hp-opt__p",buy:"hp-buy",button:"emb-btn emb-btn--block",proof:"hp-proof",trust:"hp-trust",on:"hp-on",onIcon:"hp-on__ic",more:"hp-more",fine:"hp-fine",sign:"hp-sign","sign:urgent":"hp-sign--er",questionsKicker:"hp-qs__k",questions:"hp-qs",add:"hp-add",extras:"hp-xs",extrasTitle:"hp-eyebrow",extra:"hp-x","extra:kit":"hp-x--kit",extraIcon:"hp-x__ic",extraTitle:"","extraTitle:kit":"serif",extraPrice:"hp-x__p",extraGo:"hp-x__go",pageFine:"plan__fine",stateOn:"is-on",scrim:"ph-scrim",sheet:"ph-sheet",sheetGrab:"sheet__grab",sheetTop:"sheet__top",sheetKicker:"sheet__kicker",sheetClose:"sheet__x",srOnly:"sr-only",co:"co",coProd:"co-prod",coProdImage:"co-prod__img",coProdTitle:"co-prod__t",coOpts:"co-opts",coOpt:"co-opt",coHit:"co-opt__hit",radio:"bk__radio",coPrice:"co-opt__p",coWhen:"co-when",coKey:"co-k",coEvery:"co-every",coRows:"co-rows",buttonLarge:"emb-btn emb-btn--block emb-btn--lg",buttonGhost:"emb-btn emb-btn--ghost emb-btn--block",coFine:"co-fine",mgCancel:"mg-cancel",started:"ph-push",startedScroll:"ph-scroll",done:"bk__done",doneCheck:"bk__check",doneTitle:"serif bk__title",doneWhen:"bk__when",doneWho:"bk__who",next:"hp-next",nextIcon:"hp-next__ic",foot:"bk__foot",toast:"ph-toast",tipTop:"hp-tip__top","tip:y":"hp-tip--y","tip:c":"hp-tip--c","tip:g":"hp-tip--g","tip:r":"hp-tip--r",tools:"hp-tools",toolsEnd:"hp-tools__end",ordersButton:"hp-orders",cartButton:"hp-cart",cartCount:"hp-cart__n",askRow:"hp-ask-row",askRowIcon:"hp-ask-row__ic",wait:"hp-wait",waitTop:"hp-wait__top",waitTile:"emb-tile emb-tile--cyan",waitKey:"hp-wait__k",waitText:"hp-wait__text","next:in":"hp-next--in",track:"sh-track","track:kit":"sh-track--kit",trackDot:"sh-track__dot",shopTag:"cp-tag",trackStep:"","trackStep:done":"is-done","trackStep:now":"is-now",push:"ph-push",sheetBody:"sheet__body",shop:"sh",shopTitle:"serif sh-title",shopSub:"sh-sub2",shopKey:"sh-k",shopCard:"sh-card","shopCard:carrier":"sh-carrier",shopItems:"sh-items",shopItem:"sh-item",shopItemImage:"sh-item__img",shopItemPrice:"sh-item__p",shopItemActions:"sh-item__acts",stepper:"sh-step",shopRemove:"sh-rm",shopMode:"sh-mode",summary:"sh-sum",summaryRow:"","summaryRow:total":"is-total","summaryRow:renew":"is-renew",shopFine:"sh-fine","shopFine:center":"sh-fine--c",shopEmpty:"sh-empty",shopTile:"emb-tile emb-tile--cyan",shopLink:"sh-link",shopActions:"sh-acts",subCard:"sh-subc",orderList:"sh-orders",order:"sh-order",orderTop:"sh-order__top",orderPill:"sh-pill","orderPill:done":"sh-pill--done","orderPill:sub":"sh-pill--sub",orderNo:"sh-order__no",orderWhat:"sh-order__what",orderMeta:"sh-order__meta",orderPics:"sh-order__pics",carrierIcon:"sh-carrier__ic",carrierWait:"sh-carrier__wait",buttonSmall:"emb-btn emb-btn--ghost emb-btn--sm",coItems:"co-items","foot:shop":"sh-foot","foot:stack":"hp-foot-stack",weightField:"wt-f",weightInput:"wt-f__in",weightUnit:"wt-f__u",weightError:"wt-err",weightActions:"wt-acts",blanks:"hp-blanks",blanksCard:"blanks",blanksHead:"blanks__h",blank:"blank","blank:s":"blank--s","blank:l":"blank--l",noPick:"",mgOrders:"sh-link mg-orders",today:"hp-today",todayLabel:"emb-label hp-today__k",todayBy:"hp-today__by",poweredBy:"by","root:brief":"is-brief",seeMore:"hp-seemore",report:"hp-rep","report:in":"is-in",reportText:"hp-rep__t",reportList:"hp-rep__l",reportActions:"hp-rep__acts",buttonSmallSolid:"emb-btn emb-btn--sm",askLink:"ask-focus__q",fullToggle:"hp-full",learn:"hp-swipe hp-learn",hope:"hp-hope",hopeChips:"hp-hope__chips",hopeChip:"chip","hopeChip:y":"chip--y","hopeChip:c":"chip--c","hopeChip:g":"chip--g","hopeChip:r":"chip--r",hopeOk:"hp-hope__ok",waitAsk:"emb-btn emb-btn--block hp-wait__ask",productLink:"pd-link",productCard:"pd-in",product:"pd",productGallery:"pd-gal",productGalleryRow:"pd-gal__row",productDots:"pd-dots",productMain:"pd-main",productStore:"pd-store",productStoreMark:"pd-store__mark",productTitle:"serif pd-title",productKicker:"pd-kick",productPrice:"pd-price",productFit:"pd-fit","productFit:plain":"pd-fit--plain",productFitKicker:"pd-fit__k",productFitScore:"pd-fit__n",productFitIcon:"pd-fit__ic",productOn:"pd-on",productQuantity:"pd-qty",productHeading:"pd-h",productDescription:"pd-desc",productRead:"pd-read",productRows:"pd-rows",productRow:"pd-row",productDoses:"pd-dose",productReviews:"pd-revs",productReviewsTop:"pd-revs__top",productStars:"pd-stars",productReviewsRow:"hp-revs hp-swipe pd-revs__row",productMore:"pd-more",productMoreImage:"pd-more__img","foot:product":"pd-foot",productClamp:"is-clamp",productStarOff:"is-off",buttonSmallBlock:"emb-btn emb-btn--ghost emb-btn--block emb-btn--sm",productBuy:"emb-btn emb-btn--ghost",productAdd:"emb-btn","productAdd:in":"is-in",productDoseHer:"is-her"},prefix=classes=>classes.split(/\s+/).filter(c=>c!=="").map(c=>`${PLAN_CLASS_PREFIX}${c}`).join(" "),PLAN_DEFAULT_CLASS_NAMES=/* @__PURE__ */Object.freeze(Object.fromEntries(Object.entries(DESIGN_PLAN_CLASSES).map(([part,classes])=>[part,prefix(classes)]))),PLAN_BEFORE_CLASS=`${PLAN_CLASS_PREFIX}before`,PLAN_TOAST_CARD_CLASS=`${PLAN_CLASS_PREFIX}ph-toast--card`,DESIGN_PLAN_LIGHT=/* @__PURE__ */Object.freeze({black:"#000000",onInk:"#FFFFFF",wash:"rgba(38, 37, 35, 0.06)",scrim:"rgba(38, 37, 35, 0.38)",riskChip:"#FFD8D6",clearChip:"#DDEFC4"});function rgb(color){let c=color.trim(),h=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(c);if(h!==null){let x=h[1].length===3?h[1].split("").map(d=>d+d).join(""):h[1];return[0,2,4].map(k=>parseInt(x.slice(k,k+2),16))}let r=/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(c);return r===null?null:[Number(r[1]),Number(r[2]),Number(r[3])]}function mixPlanColor(color,share,ground){let a=rgb(color),b=rgb(ground);if(a===null||b===null)return ground;let to=k=>Math.round(a[k]*share+b[k]*(1-share)).toString(16).padStart(2,"0");return`#${to(0)}${to(1)}${to(2)}`.toUpperCase()}function planTokens(theme){let c=theme.color,v=v3Palette(theme),neutral={ink:v.ink,ink2:v.ink2,ink3:v.ink3,paper:v.paper,tile:v.tile,line:v.line,card:v.card,riskBg:v.riskBg,riskInk:v.riskInk,riskDot:v.riskDot,clearBg:v.clearBg,clearInk:v.clearInk,clearDot:v.clearDot,watchDot:v.watchDot,...v.dark?{black:c.text.primary,onInk:c.background,wash:mixPlanColor(c.text.primary,.08,c.surface),scrim:"rgba(0, 0, 0, 0.6)",riskChip:c.badgeBgCritical,clearChip:c.badgeBgPositive}:DESIGN_PLAN_LIGHT},link=v.link,card=neutral.card;return{...neutral,primary:v.primary,onPrimary:v.onPrimary,accent:v.accent,accent4:mixPlanColor(c.accent,.17,card),accent3:mixPlanColor(c.accent,.25,card),accentChip:mixPlanColor(c.accent,.47,card),link:link,linkWash:(v.dark?void 0:theme.slots.planWash?.backgroundColor)??mixPlanColor(link,.12,card),linkChip:(v.dark?void 0:theme.slots.planChip?.backgroundColor)??mixPlanColor(link,.2,card),sans:faceCss(theme,"regular").fontFamily,serif:headingFaceCss(theme,"bold").fontFamily,mono:cssMonoFamily(theme.type.mono)}}var WIDE_QUERY="(min-width: 900px)",wideNow=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(WIDE_QUERY).matches;function fill(value,tokens,dark,line){return value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?line:`#${key.slice(2)}`:tokens[key]??whole)}function keyOf(selector){let depth=0,start=0;for(let i=0;i<selector.length;i+=1){let ch=selector[i];ch==="("?depth+=1:ch===")"?depth-=1:depth===0&&(ch===" "||ch===">"||ch==="+"||ch==="~")&&(start=i+1)}let last=selector.slice(start).replace(/\([^)]*\)/g,""),cls=/\.([\w-]+)/.exec(last);if(cls!==null)return`.${cls[1]}`;let tag=/^([a-z][a-z0-9]*)/i.exec(last);return tag===null?"*":tag[1].toLowerCase()}function compile(decls,tokens,dark){return decls.map(d=>[d[0],fill(d[1],tokens,dark,tokens.line??""),d[2]===1])}function buildIndex(theme,extra){let tokens=planTokens(theme),dark=theme.brightness==="dark",index=/* @__PURE__ */new Map;return PLAN_RULES.forEach(([selector,[a,b,c],decls,wide],order)=>{let key=keyOf(selector),list=index.get(key)??[];list.push({selector:selector,specificity:a*1e4+b*100+c,order:order,decls:compile(decls,tokens,dark),...wide===1?{wide:true}:{}}),index.set(key,list)}),extra?.rules.forEach(([selector,[a,b,c],decls,wide],i)=>{let key=keyOf(selector),list=index.get(key)??[];list.push({selector:selector,specificity:a*1e4+b*100+c,order:extra.at-1+(i+1)/(extra.rules.length+1),decls:compile(decls,tokens,dark),...wide===1?{wide:true}:{}}),index.set(key,list)}),theme.motion.reducedMotion&&REDUCED_MOTION.forEach(([selector,classes,decls],i)=>{let prefixedSelector=selector.replace(/\.([\w-]+)/g,(_,c)=>`.${PLAN_CLASS_PREFIX}${c}`),key=keyOf(prefixedSelector),list=index.get(key)??[];list.push({selector:prefixedSelector,specificity:classes*100,order:PLAN_RULES.length+i,decls:decls.map(([prop,value,important])=>[prop,value,important===1])}),index.set(key,list)}),{index:index,context:{selector:"",specificity:-1,order:-1,decls:compile(PLAN_CONTEXT,tokens,dark)}}}var REDUCED_MOTION=[...[".ph-push",".ph-push.is-on",".ph-sheet",".ph-sheet.is-on"].map(selector=>[selector,selector.split(".").length-1,[["transform","none"],["transition","opacity 160ms ease, visibility 0s linear 160ms"],["opacity","0"]]]),...[".ph-push.is-on",".ph-sheet.is-on"].map(selector=>[selector,2,[["opacity","1"],["transition","opacity 160ms ease, visibility 0s"]]]),[".ph-toast",1,[["transform","none",1]]]],matches=(el,selector)=>{try{return el.matches(selector)}catch{return false}};function cascade(el,index,extra,wide){let hits=[...extra],keys=["*",el.tagName.toLowerCase(),...Array.from(el.classList,c=>`.${c}`)];for(let key of keys)for(let rule of index.get(key)??[])(wide||rule.wide!==true)&&matches(el,rule.selector)&&hits.push(rule);let entries=[];for(let rule of hits)for(let[prop,value,important]of rule.decls)entries.push({prop:prop,value:value,important:important,spec:rule.specificity,order:rule.order});entries.sort((x,y)=>Number(x.important)-Number(y.important)||x.spec-y.spec||x.order-y.order);let out=/* @__PURE__ */new Map;for(let e of entries)out.delete(e.prop),out.set(e.prop,[e.prop,e.value,e.important]);return[...out.values()]}var LIBRARY_PARTS=":scope [data-efds-theme], :scope [data-efds-theme] *",FIXED={selector:"",specificity:1e6,order:0,decls:[["position","fixed",true]]},NOOP=/* @__PURE__ */Object.freeze({root:()=>{},layer:()=>{},repaint:()=>{}});function playPresses(root,list){let held=null,release=()=>{if(held===null)return;let{el:el,value:value,priority:priority}=held;held=null,value===""?el.style.removeProperty("transform"):el.style.setProperty("transform",value,priority)},down=event=>{if(release(),!((event.button??0)>0||!(event.target instanceof Element)))for(let[selector,transform]of list()){let el=event.target.closest(selector);if(!(!(el instanceof HTMLElement)||!root.contains(el)||el.disabled===true)){held={el:el,value:el.style.getPropertyValue("transform"),priority:el.style.getPropertyPriority("transform")},el.style.setProperty("transform",transform,"important");return}}},doc=root.ownerDocument;return root.addEventListener("pointerdown",down),doc.addEventListener("pointerup",release),doc.addEventListener("pointercancel",release),root.addEventListener("pointerleave",release),()=>{release(),root.removeEventListener("pointerdown",down),doc.removeEventListener("pointerup",release),doc.removeEventListener("pointercancel",release),root.removeEventListener("pointerleave",release)}}var OBSERVED=["class","hidden","disabled","aria-checked","aria-pressed","aria-selected","aria-expanded","open","data-once","data-st","data-ef-focus","data-ef-focus-visible"];function usePlanStyles(theme,rootStyle,extra=null){let built=useMemo(()=>theme===null?null:buildIndex(theme,extra),[theme,extra]),state2=useRef({roots:/* @__PURE__ */new Set,applied:/* @__PURE__ */new WeakMap,observer:null,rootEl:null,built:built,keep:/* @__PURE__ */new Set,presses:/* @__PURE__ */new Map,pressList:PLAN_PRESS});state2.current.built=built,state2.current.pressList=extra===null?PLAN_PRESS:[...PLAN_PRESS,...extra.press],state2.current.keep=new Set(Object.keys(rootStyle??{}).map(k=>k.replace(/[A-Z]/g,m=>`-${m.toLowerCase()}`)));let paint=useCallback(root=>{let s=state2.current;if(s.built===null||!root.isConnected)return;let{index:index,context:context}=s.built,fixed=root.parentElement!==null&&root.parentElement===root.ownerDocument.body&&root!==s.rootEl,library=new Set(Array.from(root.querySelectorAll(LIBRARY_PARTS))),tree=[root,...Array.from(root.querySelectorAll("*")).filter(el=>!library.has(el))],wide=wideNow();for(let el of tree){let all=cascade(el,index,el===root?fixed?[context,FIXED]:[context]:[],wide),list=el===s.rootEl?all.filter(([p])=>!s.keep.has(p)):all,key=list.map(([p,v,i])=>`${p}:${v}${i?"!":""}`).join(";"),before=s.applied.get(el);if(before!==void 0&&before.key===key)continue;let style=el.style;if(style!==void 0){if(before!==void 0)for(let prop of before.props)style.removeProperty(prop);for(let[prop,value,important]of list)style.setProperty(prop,value,important?"important":"");s.applied.set(el,{key:key,props:list.map(([p])=>p)})}}},[]),paintAll=useCallback(()=>{let{roots:roots,presses:presses}=state2.current;for(let root of[...roots])root.isConnected?paint(root):(roots.delete(root),presses.get(root)?.(),presses.delete(root))},[paint]),watch=useCallback(el=>{let s=state2.current;s.built===null||typeof MutationObserver>"u"||(s.observer??=new MutationObserver(()=>paintAll()),s.observer.observe(el,{subtree:true,childList:true,attributes:true,attributeFilter:OBSERVED}))},[paintAll]),press=useCallback(el=>{let s=state2.current;!s.presses.has(el)&&typeof el.addEventListener=="function"&&s.presses.set(el,playPresses(el,()=>s.pressList))},[]),register=useCallback((el,isRoot)=>{let s=state2.current;el===null||s.built===null||(isRoot&&(s.rootEl=el),s.roots.add(el),watch(el),paint(el),press(el))},[paint,watch,press]);useLayoutEffect(()=>{paintAll()},[built,paintAll]),useEffect(()=>{let s=state2.current;for(let root of s.roots)root.isConnected&&(watch(root),press(root));return paintAll(),()=>{s.observer?.disconnect();for(let stop of s.presses.values())stop();s.presses.clear()}},[watch,press,paintAll]),useEffect(()=>{if(built===null||typeof window>"u"||typeof window.matchMedia!="function")return;let list=window.matchMedia(WIDE_QUERY),onChange=()=>paintAll();return list.addEventListener?.("change",onChange),()=>list.removeEventListener?.("change",onChange)},[built,paintAll]);let handles=useMemo(()=>({root:el=>register(el,true),layer:el=>register(el,false),repaint:paintAll}),[register,paintAll]);return built===null?NOOP:handles}var HealthPlanKitContext=createContext(null);HealthPlanKitContext.displayName="HealthPlanKitContext";function cx(...names){let out=names.filter(n=>n!==void 0&&n!=="").join(" ");return out===""?void 0:out}function classProp(className){return className===void 0?{}:{className:className}}function mergeRoot(part,className,style){let cls=cx(part.className,className),st=part.style===void 0&&style===void 0?void 0:{...part.style,...style};return{...cls===void 0?{}:{className:cls},...st===void 0?{}:{style:st}}}function partProps(base3,b){if(b===void 0||b.className===void 0&&b.style===void 0&&b.testID===void 0)return base3;let cls=cx(base3.className,b.className);return{...cls===void 0?{}:{className:cls},...b.style===void 0?{}:{style:b.style},...b.testID===void 0?{}:{"data-testid":b.testID}}}function partClasses(classNames){return(part,kind)=>{let base3=classNames[part],mod=kind===void 0?void 0:classNames[`${part}:${kind}`],cls=[base3,mod].filter(c=>c!==void 0&&c!=="").join(" ");return cls===""?{}:{className:cls}}}function iconNode([tag,attrs,children],key){return createElement(tag,{key:key,...attrs},...children.map(iconNode))}function DefaultIcon({name:name,className:className}){/* @__PURE__ */
|
|
33
|
-
return jsx("svg",{className:className,"aria-hidden":"true",viewBox:"0 0 24 24",width:
|
|
30
|
+
/* @__PURE__ */jsxs("p",{style:styles2.label,children:[HEALTH_PLAN_TEMPLATES.cartLabel(theme.meta.displayName),cart.count>0?/* @__PURE__ */jsx("span",{style:styles2.count,"aria-hidden":"true",children:cart.count}):null]}),cart.count===0?/* @__PURE__ */jsx("p",{style:styles2.line,children:HEALTH_PLAN_COPY.cartEmpty}):subtotal===null?null:/* @__PURE__ */jsxs("p",{style:styles2.line,children:[HEALTH_PLAN_COPY.subtotal," ",subtotal]})]}),onCheckout===void 0?null:/* @__PURE__ */jsx("button",{type:"button",disabled:cart.count===0||busy,"aria-busy":busy?"true":void 0,onClick:()=>{trackCheckoutStarted(telemetry,petRef,cart),onCheckout(cart.items)},style:styles2.checkout,children:HEALTH_PLAN_COPY.checkout})]})}function makeStyles2(theme){let{color:color,radius:radius,space:space,type:type,slots:slots}=theme,ink=slots.cartBar?.textColor??color.text.onBrand,fill2=slots.cartBar?.backgroundColor??color.brandInk,line=size=>`${Math.round(size*type.lineHeight.snug)}px`;return{bar:{boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"space-between",gap:space.md,padding:`${space.md}px ${space.lg}px`,borderRadius:radius.lg,backgroundColor:color.brand,color:color.text.onBrand,...slotCss(slots.cartBar)},copy:{display:"flex",flexDirection:"column",gap:2,minWidth:0},label:{margin:0,display:"flex",alignItems:"center",gap:space.sm,...faceCss(theme,"bold"),fontSize:type.size.body,lineHeight:line(type.size.body),color:ink},count:{minWidth:22,height:22,padding:`0 ${space.xs}px`,boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:radius.pill,backgroundColor:ink,color:fill2,...faceCss(theme,"bold"),fontSize:type.size.caption},line:{margin:0,...faceCss(theme,"regular"),fontSize:type.size.caption,lineHeight:line(type.size.caption),color:ink},checkout:{minHeight:44,padding:`0 ${space.lg}px`,borderRadius:radius.pill,border:"none",backgroundColor:ink,color:fill2,cursor:"pointer",...faceCss(theme,"bold"),fontSize:type.size.body}}}var FOCUS_RING_WIDTH=2,SELF_FOCUS_RING_ATTRIBUTE="data-ef-focus-ring",FOCUS_VISIBLE_ATTRIBUTE="data-ef-focus-visible",FOCUS_RING_COLOR_ATTRIBUTE="data-ef-focus-ring-color";function focusRingStyle(color){return{outline:`${FOCUS_RING_WIDTH}px solid ${color}`,outlineOffset:FOCUS_RING_WIDTH}}var keyboardDriving=false,bound=0;function onKeyDown(event){event.metaKey||event.ctrlKey||event.altKey||(keyboardDriving=true)}function onPointerDown(){keyboardDriving=false}function bindModality(){return typeof document>"u"?()=>{}:(bound===0&&(document.addEventListener("keydown",onKeyDown,true),document.addEventListener("pointerdown",onPointerDown,true),document.addEventListener("mousedown",onPointerDown,true),document.addEventListener("touchstart",onPointerDown,true)),bound+=1,()=>{bound-=1,!(bound>0)&&(document.removeEventListener("keydown",onKeyDown,true),document.removeEventListener("pointerdown",onPointerDown,true),document.removeEventListener("mousedown",onPointerDown,true),document.removeEventListener("touchstart",onPointerDown,true),keyboardDriving=false)})}var TEXT_INPUT_TYPES=/* @__PURE__ */new Set(["","text","search","email","tel","url","password","number"]);function isTextField(element){return element.tagName==="TEXTAREA"||element.isContentEditable?true:element.tagName!=="INPUT"?false:TEXT_INPUT_TYPES.has((element.getAttribute("type")??"").toLowerCase())}function useKeyboardFocusRing(root,color){useEffect(()=>{let node=root.current;if(node!==null)return bindKeyboardFocusRing(node,color)},[root,color])}function bindKeyboardFocusRing(node,color){let unbind=bindModality(),painted=/* @__PURE__ */new Map,onFocusIn=event=>{let target=event.target;if(!(target instanceof HTMLElement)||painted.has(target)||target.closest(`[${SELF_FOCUS_RING_ATTRIBUTE}="self"]`)!==null||!keyboardDriving&&!isTextField(target))return;painted.set(target,{outline:target.style.outline,outlineOffset:target.style.outlineOffset});let region=target.closest(`[${FOCUS_RING_COLOR_ATTRIBUTE}]`),ring=focusRingStyle(region?.getAttribute(FOCUS_RING_COLOR_ATTRIBUTE)||color);target.style.outline=ring.outline,target.style.outlineOffset=`${ring.outlineOffset}px`,target.setAttribute(FOCUS_VISIBLE_ATTRIBUTE,"")},onFocusOut=event=>{let target=event.target;if(!(target instanceof HTMLElement))return;let before=painted.get(target);before!==void 0&&(painted.delete(target),target.style.outline=before.outline,target.style.outlineOffset=before.outlineOffset,target.removeAttribute(FOCUS_VISIBLE_ATTRIBUTE))};return node.addEventListener("focusin",onFocusIn),node.addEventListener("focusout",onFocusOut),()=>{node.removeEventListener("focusin",onFocusIn),node.removeEventListener("focusout",onFocusOut);for(let[element,before]of painted)element.style.outline=before.outline,element.style.outlineOffset=before.outlineOffset,element.removeAttribute(FOCUS_VISIBLE_ATTRIBUTE);painted.clear(),unbind()}}var DESIGN_PLAN_CLASSES={root:"hp",head:"hp-head",eyebrow:"hp-eyebrow",serif:"serif",by:"hp-by",byOk:"hp-by__ok",need:"hp-need",needKicker:"hp-need__k",sources:"hp-srcs",source:"hp-src","source:dna":"hp-src--dna",needRisk:"hp-need__s",dot:"dot","dot:risk":"dot--risk",odds:"hp-odds",oddsKicker:"hp-odds__k",oddsNumbers:"hp-odds__n",tag:"cp-tag cp-tag--s",says:"hp-says",saysKicker:"hp-says__k",jump:"hp-jump",jumpGo:"hp-jump__go",steps:"hp-steps",stepsHead:"hp-steps__head",n:"hp-n",list:"hp-list hp-swipe",tip:"hp-tip",tipN:"hp-tip__n",section:"hp-sec",sectionTitle:"hp-sec__h",pick:"hp-pick",others:"hp-sec hp-others",other:"hp-pick",pickTop:"hp-pick__top",pickImage:"hp-pick__img",stars:"hp-stars",pickLine:"hp-pick__line",reviews:"hp-revs hp-swipe",review:"hp-rev",reviewStars:"hp-rev__s",score:"hp-score",why:"hp-why",mini:"hp-mini",chip:"hp-chip","chip:dna":"hp-chip--dna","chip:rec":"hp-chip--rec","chip:ask":"hp-chip--ask",dose:"hp-dose",ingredients:"hp-in",opts:"hp-opts",opt:"hp-opt","opt:once":"hp-opt--once",optText:"hp-opt__t",optTag:"hp-opt__tag",price:"hp-price",optPrice:"hp-opt__p",buy:"hp-buy",button:"emb-btn emb-btn--block",proof:"hp-proof",trust:"hp-trust",on:"hp-on",onIcon:"hp-on__ic",more:"hp-more",fine:"hp-fine",sign:"hp-sign","sign:urgent":"hp-sign--er",questionsKicker:"hp-qs__k",questions:"hp-qs",add:"hp-add",extras:"hp-xs",extrasTitle:"hp-eyebrow",extra:"hp-x","extra:kit":"hp-x--kit",extraIcon:"hp-x__ic",extraTitle:"","extraTitle:kit":"serif",extraPrice:"hp-x__p",extraGo:"hp-x__go",pageFine:"plan__fine",stateOn:"is-on",scrim:"ph-scrim",sheet:"ph-sheet",sheetGrab:"sheet__grab",sheetTop:"sheet__top",sheetKicker:"sheet__kicker",sheetClose:"sheet__x",srOnly:"sr-only",co:"co",coProd:"co-prod",coProdImage:"co-prod__img",coProdTitle:"co-prod__t",coOpts:"co-opts",coOpt:"co-opt",coHit:"co-opt__hit",radio:"bk__radio",coPrice:"co-opt__p",coWhen:"co-when",coKey:"co-k",coEvery:"co-every",coRows:"co-rows",buttonLarge:"emb-btn emb-btn--block emb-btn--lg",buttonGhost:"emb-btn emb-btn--ghost emb-btn--block",coFine:"co-fine",mgCancel:"mg-cancel",started:"ph-push",startedScroll:"ph-scroll",done:"bk__done",doneCheck:"bk__check",doneTitle:"serif bk__title",doneWhen:"bk__when",doneWho:"bk__who",next:"hp-next",nextIcon:"hp-next__ic",foot:"bk__foot",toast:"ph-toast",tipTop:"hp-tip__top","tip:y":"hp-tip--y","tip:c":"hp-tip--c","tip:g":"hp-tip--g","tip:r":"hp-tip--r",tools:"hp-tools",toolsEnd:"hp-tools__end",ordersButton:"hp-orders",cartButton:"hp-cart",cartCount:"hp-cart__n",askRow:"hp-ask-row",askRowIcon:"hp-ask-row__ic",wait:"hp-wait",waitTop:"hp-wait__top",waitTile:"emb-tile emb-tile--cyan",waitKey:"hp-wait__k",waitText:"hp-wait__text","next:in":"hp-next--in",track:"sh-track","track:kit":"sh-track--kit",trackDot:"sh-track__dot",shopTag:"cp-tag",trackStep:"","trackStep:done":"is-done","trackStep:now":"is-now",push:"ph-push",sheetBody:"sheet__body",shop:"sh",shopTitle:"serif sh-title",shopSub:"sh-sub2",shopKey:"sh-k",shopCard:"sh-card","shopCard:carrier":"sh-carrier",shopItems:"sh-items",shopItem:"sh-item",shopItemImage:"sh-item__img",shopItemPrice:"sh-item__p",shopItemActions:"sh-item__acts",stepper:"sh-step",shopRemove:"sh-rm",shopMode:"sh-mode",summary:"sh-sum",summaryRow:"","summaryRow:total":"is-total","summaryRow:renew":"is-renew",shopFine:"sh-fine","shopFine:center":"sh-fine--c",shopEmpty:"sh-empty",shopTile:"emb-tile emb-tile--cyan",shopLink:"sh-link",shopActions:"sh-acts",subCard:"sh-subc",orderList:"sh-orders",order:"sh-order",orderTop:"sh-order__top",orderPill:"sh-pill","orderPill:done":"sh-pill--done","orderPill:sub":"sh-pill--sub",orderNo:"sh-order__no",orderWhat:"sh-order__what",orderMeta:"sh-order__meta",orderPics:"sh-order__pics",carrierIcon:"sh-carrier__ic",carrierWait:"sh-carrier__wait",buttonSmall:"emb-btn emb-btn--ghost emb-btn--sm",coItems:"co-items","foot:shop":"sh-foot","foot:stack":"hp-foot-stack",weightField:"wt-f",weightInput:"wt-f__in",weightUnit:"wt-f__u",weightError:"wt-err",weightActions:"wt-acts",blanks:"hp-blanks",blanksCard:"blanks",blanksHead:"blanks__h",blank:"blank","blank:s":"blank--s","blank:l":"blank--l",noPick:"",mgOrders:"sh-link mg-orders",today:"hp-today",todayLabel:"emb-label hp-today__k",todayBy:"hp-today__by",poweredBy:"by","root:brief":"is-brief",seeMore:"hp-seemore",report:"hp-rep","report:in":"is-in",reportText:"hp-rep__t",reportList:"hp-rep__l",reportActions:"hp-rep__acts",buttonSmallSolid:"emb-btn emb-btn--sm",askLink:"ask-focus__q",fullToggle:"hp-full",learn:"hp-swipe hp-learn",hope:"hp-hope",hopeChips:"hp-hope__chips",hopeChip:"chip","hopeChip:y":"chip--y","hopeChip:c":"chip--c","hopeChip:g":"chip--g","hopeChip:r":"chip--r",hopeOk:"hp-hope__ok",waitAsk:"emb-btn emb-btn--block hp-wait__ask",productLink:"pd-link",productCard:"pd-in",product:"pd",productGallery:"pd-gal",productGalleryRow:"pd-gal__row",productDots:"pd-dots",productMain:"pd-main",productStore:"pd-store",productStoreMark:"pd-store__mark",productTitle:"serif pd-title",productKicker:"pd-kick",productPrice:"pd-price",productFit:"pd-fit","productFit:plain":"pd-fit--plain",productFitKicker:"pd-fit__k",productFitScore:"pd-fit__n",productFitIcon:"pd-fit__ic",productOn:"pd-on",productQuantity:"pd-qty",productHeading:"pd-h",productDescription:"pd-desc",productRead:"pd-read",productRows:"pd-rows",productRow:"pd-row",productDoses:"pd-dose",productReviews:"pd-revs",productReviewsTop:"pd-revs__top",productStars:"pd-stars",productReviewsRow:"hp-revs hp-swipe pd-revs__row",productMore:"pd-more",productMoreImage:"pd-more__img","foot:product":"pd-foot",productClamp:"is-clamp",productStarOff:"is-off",buttonSmallBlock:"emb-btn emb-btn--ghost emb-btn--block emb-btn--sm",productBuy:"emb-btn emb-btn--ghost",productAdd:"emb-btn","productAdd:in":"is-in",productDoseHer:"is-her"},prefix=classes=>classes.split(/\s+/).filter(c=>c!=="").map(c=>`${PLAN_CLASS_PREFIX}${c}`).join(" "),PLAN_DEFAULT_CLASS_NAMES=/* @__PURE__ */Object.freeze(Object.fromEntries(Object.entries(DESIGN_PLAN_CLASSES).map(([part,classes])=>[part,prefix(classes)]))),PLAN_TOAST_CARD_CLASS=`${PLAN_CLASS_PREFIX}ph-toast--card`,WIDE_QUERY="(min-width: 900px)",wideNow=()=>typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia(WIDE_QUERY).matches;function fill(value,tokens,dark,line){return value.replace(/\$(n_[0-9A-F]{6}|[a-zA-Z0-9]+)/g,(whole,key)=>key.startsWith("n_")?dark?line:`#${key.slice(2)}`:tokens[key]??whole)}function keyOf(selector){let depth=0,start=0;for(let i=0;i<selector.length;i+=1){let ch=selector[i];ch==="("?depth+=1:ch===")"?depth-=1:depth===0&&(ch===" "||ch===">"||ch==="+"||ch==="~")&&(start=i+1)}let last=selector.slice(start).replace(/\([^)]*\)/g,""),cls=/\.([\w-]+)/.exec(last);if(cls!==null)return`.${cls[1]}`;let tag=/^([a-z][a-z0-9]*)/i.exec(last);return tag===null?"*":tag[1].toLowerCase()}function compile(decls,tokens,dark){return decls.map(d=>[d[0],fill(d[1],tokens,dark,tokens.line??""),d[2]===1])}function buildIndex(theme,extra){let tokens=planTokens(theme),dark=theme.brightness==="dark",index=/* @__PURE__ */new Map;return PLAN_RULES.forEach(([selector,[a,b,c],decls,wide],order)=>{let key=keyOf(selector),list=index.get(key)??[];list.push({selector:selector,specificity:a*1e4+b*100+c,order:order,decls:compile(decls,tokens,dark),...wide===1?{wide:true}:{}}),index.set(key,list)}),extra?.rules.forEach(([selector,[a,b,c],decls,wide],i)=>{let key=keyOf(selector),list=index.get(key)??[];list.push({selector:selector,specificity:a*1e4+b*100+c,order:extra.at-1+(i+1)/(extra.rules.length+1),decls:compile(decls,tokens,dark),...wide===1?{wide:true}:{}}),index.set(key,list)}),theme.motion.reducedMotion&&REDUCED_MOTION.forEach(([selector,classes,decls],i)=>{let prefixedSelector=selector.replace(/\.([\w-]+)/g,(_,c)=>`.${PLAN_CLASS_PREFIX}${c}`),key=keyOf(prefixedSelector),list=index.get(key)??[];list.push({selector:prefixedSelector,specificity:classes*100,order:PLAN_RULES.length+i,decls:decls.map(([prop,value,important])=>[prop,value,important===1])}),index.set(key,list)}),{index:index,context:{selector:"",specificity:-1,order:-1,decls:compile(PLAN_CONTEXT,tokens,dark)}}}var REDUCED_MOTION=[...[".ph-push",".ph-push.is-on",".ph-sheet",".ph-sheet.is-on"].map(selector=>[selector,selector.split(".").length-1,[["transform","none"],["transition","opacity 160ms ease, visibility 0s linear 160ms"],["opacity","0"]]]),...[".ph-push.is-on",".ph-sheet.is-on"].map(selector=>[selector,2,[["opacity","1"],["transition","opacity 160ms ease, visibility 0s"]]]),[".ph-toast",1,[["transform","none",1]]]],matches=(el,selector)=>{try{return el.matches(selector)}catch{return false}};function cascade(el,index,extra,wide){let hits=[...extra],keys=["*",el.tagName.toLowerCase(),...Array.from(el.classList,c=>`.${c}`)];for(let key of keys)for(let rule of index.get(key)??[])(wide||rule.wide!==true)&&matches(el,rule.selector)&&hits.push(rule);let entries=[];for(let rule of hits)for(let[prop,value,important]of rule.decls)entries.push({prop:prop,value:value,important:important,spec:rule.specificity,order:rule.order});entries.sort((x,y)=>Number(x.important)-Number(y.important)||x.spec-y.spec||x.order-y.order);let out=/* @__PURE__ */new Map;for(let e of entries)out.delete(e.prop),out.set(e.prop,[e.prop,e.value,e.important]);return[...out.values()]}var LIBRARY_PARTS=":scope [data-efds-theme], :scope [data-efds-theme] *",FIXED={selector:"",specificity:1e6,order:0,decls:[["position","fixed",true]]},NOOP=/* @__PURE__ */Object.freeze({root:()=>{},layer:()=>{},repaint:()=>{}});function playPresses(root,list){let held=null,release=()=>{if(held===null)return;let{el:el,value:value,priority:priority}=held;held=null,value===""?el.style.removeProperty("transform"):el.style.setProperty("transform",value,priority)},down=event=>{if(release(),!((event.button??0)>0||!(event.target instanceof Element)))for(let[selector,transform]of list()){let el=event.target.closest(selector);if(!(!(el instanceof HTMLElement)||!root.contains(el)||el.disabled===true)){held={el:el,value:el.style.getPropertyValue("transform"),priority:el.style.getPropertyPriority("transform")},el.style.setProperty("transform",transform,"important");return}}},doc=root.ownerDocument;return root.addEventListener("pointerdown",down),doc.addEventListener("pointerup",release),doc.addEventListener("pointercancel",release),root.addEventListener("pointerleave",release),()=>{release(),root.removeEventListener("pointerdown",down),doc.removeEventListener("pointerup",release),doc.removeEventListener("pointercancel",release),root.removeEventListener("pointerleave",release)}}var OBSERVED=["class","hidden","disabled","aria-checked","aria-pressed","aria-selected","aria-expanded","open","data-once","data-st","data-ef-focus","data-ef-focus-visible"];function usePlanStyles(theme,rootStyle,extra=null){let built=useMemo(()=>theme===null?null:buildIndex(theme,extra),[theme,extra]),state2=useRef({roots:/* @__PURE__ */new Set,applied:/* @__PURE__ */new WeakMap,observer:null,rootEl:null,built:built,keep:/* @__PURE__ */new Set,presses:/* @__PURE__ */new Map,pressList:PLAN_PRESS});state2.current.built=built,state2.current.pressList=extra===null?PLAN_PRESS:[...PLAN_PRESS,...extra.press],state2.current.keep=new Set(Object.keys(rootStyle??{}).map(k=>k.replace(/[A-Z]/g,m=>`-${m.toLowerCase()}`)));let paint=useCallback(root=>{let s=state2.current;if(s.built===null||!root.isConnected)return;let{index:index,context:context}=s.built,fixed=root.parentElement!==null&&root.parentElement===root.ownerDocument.body&&root!==s.rootEl,library=new Set(Array.from(root.querySelectorAll(LIBRARY_PARTS))),tree=[root,...Array.from(root.querySelectorAll("*")).filter(el=>!library.has(el))],wide=wideNow();for(let el of tree){let all=cascade(el,index,el===root?fixed?[context,FIXED]:[context]:[],wide),list=el===s.rootEl?all.filter(([p])=>!s.keep.has(p)):all,key=list.map(([p,v,i])=>`${p}:${v}${i?"!":""}`).join(";"),before=s.applied.get(el);if(before!==void 0&&before.key===key)continue;let style=el.style;if(style!==void 0){if(before!==void 0)for(let prop of before.props)style.removeProperty(prop);for(let[prop,value,important]of list)style.setProperty(prop,value,important?"important":"");s.applied.set(el,{key:key,props:list.map(([p])=>p)})}}},[]),paintAll=useCallback(()=>{let{roots:roots,presses:presses}=state2.current;for(let root of[...roots])root.isConnected?paint(root):(roots.delete(root),presses.get(root)?.(),presses.delete(root))},[paint]),watch=useCallback(el=>{let s=state2.current;s.built===null||typeof MutationObserver>"u"||(s.observer??=new MutationObserver(()=>paintAll()),s.observer.observe(el,{subtree:true,childList:true,attributes:true,attributeFilter:OBSERVED}))},[paintAll]),press=useCallback(el=>{let s=state2.current;!s.presses.has(el)&&typeof el.addEventListener=="function"&&s.presses.set(el,playPresses(el,()=>s.pressList))},[]),register=useCallback((el,isRoot)=>{let s=state2.current;el===null||s.built===null||(isRoot&&(s.rootEl=el),s.roots.add(el),watch(el),paint(el),press(el))},[paint,watch,press]);useLayoutEffect(()=>{paintAll()},[built,paintAll]),useEffect(()=>{let s=state2.current;for(let root of s.roots)root.isConnected&&(watch(root),press(root));return paintAll(),()=>{s.observer?.disconnect();for(let stop of s.presses.values())stop();s.presses.clear()}},[watch,press,paintAll]),useEffect(()=>{if(built===null||typeof window>"u"||typeof window.matchMedia!="function")return;let list=window.matchMedia(WIDE_QUERY),onChange=()=>paintAll();return list.addEventListener?.("change",onChange),()=>list.removeEventListener?.("change",onChange)},[built,paintAll]);let handles=useMemo(()=>({root:el=>register(el,true),layer:el=>register(el,false),repaint:paintAll}),[register,paintAll]);return built===null?NOOP:handles}var HealthPlanKitContext=createContext(null);HealthPlanKitContext.displayName="HealthPlanKitContext";function cx2(...names){let out=names.filter(n=>n!==void 0&&n!=="").join(" ");return out===""?void 0:out}function classProp(className){return className===void 0?{}:{className:className}}function mergeRoot(part,className,style){let cls=cx2(part.className,className),st=part.style===void 0&&style===void 0?void 0:{...part.style,...style};return{...cls===void 0?{}:{className:cls},...st===void 0?{}:{style:st}}}function partProps(base3,b){if(b===void 0||b.className===void 0&&b.style===void 0&&b.testID===void 0)return base3;let cls=cx2(base3.className,b.className);return{...cls===void 0?{}:{className:cls},...b.style===void 0?{}:{style:b.style},...b.testID===void 0?{}:{"data-testid":b.testID}}}function partClasses(classNames){return(part,kind)=>{let base3=classNames[part],mod=kind===void 0?void 0:classNames[`${part}:${kind}`],cls=[base3,mod].filter(c=>c!==void 0&&c!=="").join(" ");return cls===""?{}:{className:cls}}}function iconNode([tag,attrs,children],key){return createElement(tag,{key:key,...attrs},...children.map(iconNode))}function DefaultIcon({name:name,className:className,size:size}){let side=size??(className?void 0:18);/* @__PURE__ */
|
|
31
|
+
return jsx("svg",{className:className,"aria-hidden":"true",viewBox:"0 0 24 24",width:side,height:side,children:PLAN_ICONS[name].map(iconNode)})}function blockIcon(k,name,className,size){let el=k.icon(name,className);return isValidElement(el)&&el.type===DefaultIcon?cloneElement(el,{size:size}):el}function iconDrawer(renderIcon){return(name,cls)=>renderIcon?renderIcon(name,cls):/* @__PURE__ */jsx(DefaultIcon,{name:name,className:cls})}function defaultBlocksCopy(){return{...healthPlanFocusCopyFor({name:null,sex:null}),trackingComesByText:"",trackingByText:""}}function useBlockKit(props){let kit=useContext(HealthPlanKitContext),{copy:copy,renderIcon:renderIcon}=props;return useMemo(()=>kit===null||copy===void 0&&renderIcon===void 0?kit:{...kit,copy:copy===void 0?kit.copy:{...kit.copy,...copy},icon:renderIcon===void 0?kit.icon:iconDrawer(renderIcon)},[kit,copy,renderIcon])}function defineBlock(name,draw){let Block=props=>{let uid=useId(),k=useBlockKit(props);return k===null?/* @__PURE__ */jsx(HealthPlanBlocksScope,{children:/* @__PURE__ */jsx(Block,{...props})}):draw(k,props,uid)};return Object.defineProperty(Block,"name",{value:name}),Block.displayName=name,Block}function HealthPlanBlocksScope(props){let parent=useContext(HealthPlanKitContext),theme=usePlanTheme(),{classNames:ownClasses,copy:copy,renderIcon:renderIcon}=props,ownSheetTitleId=useId(),kit=useMemo(()=>{let hostClasses=ownClasses!==void 0||(parent?.hostClasses??false),classNames=ownClasses??parent?.classNames??PLAN_DEFAULT_CLASS_NAMES,baseCopy=parent?.copy??defaultBlocksCopy();return{p:ownClasses===void 0&&parent!==null?parent.p:partClasses(classNames),icon:renderIcon!==void 0?iconDrawer(renderIcon):parent?.icon??iconDrawer(void 0),copy:copy===void 0?baseCopy:{...baseCopy,...copy},trackLine:!hostClasses,library:!hostClasses,classNames:classNames,on:classNames.stateOn??"is-on",hostClasses:hostClasses,sheetTitleId:parent?.sheetTitleId??ownSheetTitleId}},[parent,ownClasses,copy,renderIcon,ownSheetTitleId]),styles2=usePlanStyles(kit.hostClasses?null:theme,props.style),ringInk=useMemo(()=>planTokens(theme).ink??theme.color.brandInk,[theme]),rootEl=useRef(null),rootRef=useCallback(el=>{rootEl.current=el,styles2.root(el)},[styles2]);return useKeyboardFocusRing(rootEl,ringInk),/* @__PURE__ */jsx(HealthPlanKitContext.Provider,{value:kit,children:/* @__PURE__ */jsx("div",{ref:rootRef,...mergeRoot(kit.p("root"),props.className,props.style),"data-testid":props.testID,children:props.children})})}function sizedImg(src,size){return src?/* @__PURE__ */jsx("img",{src:src,alt:"",width:size,height:size}):null}function tagNode(k,label){return label===void 0?null:/* @__PURE__ */jsxs(Fragment,{children:[" ",
|
|
34
32
|
/* @__PURE__ */jsx("span",{...k.p("tag"),children:label})]})}function numberNode(k,n){/* @__PURE__ */
|
|
35
33
|
return jsx("span",{...k.p("n"),children:n})}var FLASH_MS=900,FLASH_STEP_MS=80;function HealthPlanBlanks(props){let{phase:phase,rows:rows,p:p,flashKey:flashKey,flashColor:flashColor}=props,card=useRef(null),flashed=useRef(null),all=rows.every(r=>r.value!==null),st=phase==="filled"&&!all?"partial":phase;return useLayoutEffect(()=>{if(flashKey==null||flashed.current===flashKey||phase!=="filled")return;flashed.current=flashKey,(card.current===null?[]:Array.from(card.current.querySelectorAll("ol > li > span > i"))).forEach((el,i)=>{rows[i]?.value===null||typeof el.animate!="function"||el.animate([{background:flashColor,easing:"ease-out"},{background:flashColor,offset:.4,easing:"ease-out"},{background:"transparent"}],{duration:FLASH_MS,delay:i*FLASH_STEP_MS,easing:"linear",fill:"backwards"})})},[flashKey,flashColor,phase]),/* @__PURE__ */jsx("section",{...p("blanks"),"aria-label":props.label,children:/* @__PURE__ */jsxs("div",{ref:card,...p("blanksCard"),"data-st":st,children:[
|
|
36
34
|
/* @__PURE__ */jsxs("p",{...p("blanksHead"),children:[
|
|
@@ -46,7 +44,7 @@ return jsx("p",{...p("todayBy"),children:/* @__PURE__ */jsxs("span",{...p("power
|
|
|
46
44
|
return jsxs(Fragment,{children:[
|
|
47
45
|
/* @__PURE__ */jsxs("button",{type:"button",...p("seeMore"),"aria-expanded":seeMore,"aria-controls":"everfur-hp-report",onClick:()=>setSeeMore(!seeMore),children:[
|
|
48
46
|
/* @__PURE__ */jsx("span",{children:seeMore?copy.seeLess:copy.seeMore}),icon("chev")]}),
|
|
49
|
-
/* @__PURE__ */jsxs("div",{id:"everfur-hp-report",className:
|
|
47
|
+
/* @__PURE__ */jsxs("div",{id:"everfur-hp-report",className:cx2(classNames.report,seeMore?classNames["report:in"]:void 0),hidden:!seeMore,children:[
|
|
50
48
|
/* @__PURE__ */jsx("p",{...p("mini"),children:report.label}),
|
|
51
49
|
/* @__PURE__ */jsx("p",{...p("reportText"),children:report.text}),report.actions&&report.actions.length>0?/* @__PURE__ */jsxs(Fragment,{children:[
|
|
52
50
|
/* @__PURE__ */jsx("p",{...p("mini"),children:copy.reportActions}),
|
|
@@ -54,7 +52,13 @@ return jsxs(Fragment,{children:[
|
|
|
54
52
|
return jsxs("button",{type:"button",...p("fullToggle"),"aria-expanded":fullPlan,onClick:()=>setFullPlan(!fullPlan),children:[
|
|
55
53
|
/* @__PURE__ */jsxs("span",{children:[
|
|
56
54
|
/* @__PURE__ */jsx("strong",{children:fullPlan?copy.fullClose:copy.fullOpen}),
|
|
57
|
-
/* @__PURE__ */jsx("small",{children:fullPlan?copy.fullCloseLine:copy.fullOpenLine})]}),icon("chev")]})}var PAY_WITH="Pay with";function toolbarProps(m){let hp=m.state;if(!hp.shop)return null;let label=todayLabel(m);return{eyebrow:m.props.design.eyebrow,cartCount:hp.lineCount,onOpenOrders:()=>hp.push({kind:"orders"}),onOpenCart:()=>hp.push({kind:"cart"}),...label===null?{}:{label:label}}}function headerProps(m){let d=m.props.design,after=todayPoweredBy(m);return{eyebrow:m.state.shop||m.isToday?void 0:d.eyebrow,title:d.title,subtitle:m.noRecords&&d.subtitleNoRecords?d.subtitleNoRecords:d.subtitle||void 0,imageUrl:d.headImageUrl,...after===null?{}:{after:after}}}function blanksProps(m){let blanksFacts=m.blanksFacts;if(blanksFacts===null||!m.blanksShown)return null;let{copy:copy,noPick:noPick,kg:inKg}=m,pk=m.props.design.pick,filled=blanksFacts.phase==="filled",kg=blanksFacts.weightKg,marked=pk.dose?.stats.some(x=>x.kind!==void 0)===true,daily=(noPick?void 0:marked?pk.dose?.stats.find(x=>x.kind==="dose"):pk.dose?.stats[0])??(noPick||pk.doseLabel===void 0?void 0:{value:null,label:pk.doseLabel}),rows=[{key:"weight",lead:copy.blanksWeight,value:!filled||kg===null?null:String(inKg?Math.round(kg*10)/10:Math.round(kg*LB_PER_KG)),trail:` ${inKg?copy.weightUnitKg:copy.weightUnit}`,source:copy.blanksWeightSource},...daily===void 0?[]:[{key:"dose",lead:"",value:filled&&m.state.weightKnown?daily.value:null,trail:` ${copy.blanksDose(daily.label,m.props.item.title)}`,source:copy.blanksDoseSource,width:"s"}],{key:"shots",lead:copy.blanksShots,value:filled&&blanksFacts.nextShotsAt!==null?blanksDay(blanksFacts.nextShotsAt,m.props.locale):null,trail:"",source:copy.blanksShotsSource,width:"l"}],count=rows.filter(r=>r.value!==null).length;return{phase:blanksFacts.phase,kicker:filled?copy.blanksFilledKicker:blanksFacts.clinicName!==null?copy.blanksAsked(blanksFacts.clinicName):copy.blanksAskedNoClinic,pill:filled?copy.blanksFilled(count,rows.length):copy.blanksWaitPill,rows:rows,blankLabel:copy.blankEmpty,label:copy.blanksLabel,flashKey:m.state.flashKey,flashColor:m.flashColor,p:m.kit.p}}function waitCardProps(m){let w=m.props.design.wait;if(!w)return null;let{today:today}=m;return{wait:w,onAction:m.props.onWaitAction,vetName:m.vet?.name??null,...today===void 0?{}:{today:{icon:name=>m.todayIcon(name),hoped:m.hoped,onHope:m.toggleHope,onLearn:today.onLearn}}}}function bylineProps(m){let b=m.props.design.byline;return b&&!m.waiting?{vet:b}:null}function focusCardProps(m){let f=m.props.design.focus;if(!f||m.waiting)return null;let{pickRef:pickRef,still:still}=m,report=todayReport(m);return{focus:f,vet:m.isToday?null:m.vet,...report===null?{}:{report:report},jump:f.jump&&!m.noPick?{title:f.jump.title,go:f.jump.go,kicker:m.copy.jumpKicker(m.state.pr,m.active),imageUrl:m.props.item.imageUrl,onJump:()=>m.productOn?m.openProduct(m.props.item.productId):pickRef.current?.scrollIntoView({behavior:still?"auto":"smooth",block:"start"})}:null}}function tipsProps(m){let r=m.props.design.routine;return r&&!m.waiting?{routine:r,number:m.sections.routine,vetShortName:m.vet?.shortName}:null}function noPickProps(m){return m.waiting||m.pickHidden||!m.noPick||m.copy.noPick===""?null:{text:m.copy.noPick}}function productPickProps(m){if(m.waiting||m.pickHidden||m.noPick)return null;let{item:item,design:design,onMore:onMore}=m.props,pk=design.pick,link=productLink(m,item);return{item:item,pick:pk,number:m.sections.pick,onMore:pk.more&&onMore?()=>onMore(item):void 0,active:m.active,sectionRef:m.pickRef,...link===null?{}:{productLink:link}}}function reviewsProps(m){let r=m.props.design.pick.reviews;return r&&r.items.length>0?{reviews:r}:null}function whyProps(m){let w=m.props.design.pick.why;return w?{why:w}:null}function weightAskProps(m){return m.state.weightKnown?null:{icon:"pulse",title:m.copy.addWeightTitle,body:m.copy.addWeightBody,onPress:m.state.openWeight}}function recordsAskProps(m){let onConnect=m.props.onConnectRecords;return(m.noRecords||m.state.noVet)&&onConnect&&!m.blanksShown?{icon:"file",title:m.copy.connectRecordsTitle,body:m.copy.connectRecordsBody,onPress:onConnect,inSection:true}:null}function doseProps(m){let d=m.props.design.pick.dose;return m.state.weightKnown&&d?{dose:d}:null}function ingredientsProps(m){let x=m.props.design.pick.ingredients;return x&&x.items.length>0?{ingredients:x}:null}function buyOptionsProps(m){let hp=m.state;return hp.canSubscribe?{mode:hp.buyMode,onModeChange:hp.setMode,prices:hp.pr,offer:hp.offer}:null}function buyButtonProps(m){let hp=m.state,{item:item,subscriptions:subscriptions}=m.props,{pr:pr,priced:priced,buyMode:buyMode}=hp,loading=hp.sub.phase==="loading"&&subscriptions!==false;return hp.shop?{label:m.pickInCart?m.copy.viewCart:priced?m.copy.addToCart((buyMode==="sub"?pr.first:pr.once)??""):HEALTH_PLAN_COPY.addToCart,onPress:()=>hp.addToCart(item,buyMode),disabled:loading||!priced&&!m.pickInCart}:{label:buyMode==="sub"?m.copy.subscribe:priced?m.copy.buyOnce(pr):m.copy.buyOnceOption,onPress:hp.press,disabled:loading||hp.redirecting||hp.everfur&&!priced}}function proofProps(m){let t=m.props.design.pick.proof;return t?{text:t}:null}function trustProps(m){let t=m.props.design.pick.trust;return t&&t.length>0?{items:t}:null}function subscribedProps(m){let hp=m.state,s=hp.subscription;return{prices:hp.pr,nextBoxDay:m.active&&s!==null?hp.nextBoxDay(s):null,onManage:()=>hp.openSheet({kind:"manage"}),hidden:!m.active}}function otherItemsProps(m){let{others:others,copy:copy}=m;if(others.length===0||m.waiting||m.noPick||m.curated)return null;let hp=m.state;return{items:others.map(o=>{let once=hp.fmt(o.price,o.currency);if(hp.shop)return{item:o,buyLabel:hp.inCart(o.productId)?copy.viewCart:once===null?HEALTH_PLAN_COPY.addToCart:copy.addToCart(once),buyDisabled:once===null,onBuy:()=>hp.addToCart(o,"once")};let op={petName:m.props.petName,productName:o.title,first:once,box:once,once:once,onceDiscountPercent:0,intervalDays:0,discountPercent:0,offer:false};return{item:o,buyLabel:once===null?copy.buyOnceOption:copy.buyOnce(op),buyDisabled:hp.redirecting||hp.everfur&&once===null,onBuy:()=>hp.pressOther(o)}}),showCategory:m.props.showCategory===true}}function signsProps(m){let s=m.props.design.signs;return m.waiting||!s?null:{signs:s,number:m.sections.signs,callVetTitle:m.state.noVet?m.copy.callAVet:m.noRecords?m.copy.callYourVet:void 0}}function checkupProps(m,variant){let c=m.props.design.checkup;if(c===void 0||variant==="section"&&(m.waiting||m.props.design.signs))return null;let hp=m.state,{copy:copy,noRecords:noRecords}=m,added=hp.added;return{checkup:c,added:added,addLabel:noRecords||hp.noVet?added?copy.savedForCheckup:copy.saveForCheckup:added?c.added:c.add,onToggle:hp.toggleAdded,variant:variant,...variant==="section"?{number:m.sections.checkup}:{}}}function extrasProps(m){let x=m.props.design.extras;if(!x||m.extraItems.length===0)return null;let hp=m.state,{shop:shop,everfur:everfur}=hp,{onBuy:onBuy,onCheckout:onCheckout}=m.props,productOf=e=>e.productId!==void 0&&(shop||everfur||onBuy!==void 0||onCheckout!==void 0)?hp.itemOf(e.productId):void 0;return{title:x.title,...m.productOn?{linkOf:key=>{let e=m.extraItems.find(y=>y.key===key),product=e===void 0?void 0:productOf(e);return product===void 0?null:productLink(m,product)}}:{},items:m.extraItems.map(e=>{let product=productOf(e),on=product!==void 0?shop&&hp.inCart(product.productId)!==void 0:hp.extras.has(e.key),price=e.price??(product!==void 0?hp.fmtWhole(product.price,product.currency):null);return{extra:e,price:price,on:on,label:product!==void 0&&on?m.copy.viewCart:on?e.added:e.action,onPress:()=>hp.pressExtra(e.key,product,on)}})}}function fineProps(m){let t=m.props.design.fine;return t?{text:t}:null}function toastProps(m){return m.state.toast===null?null:{message:m.state.toast}}function sheetOf(m){let{sheet:sheet,quote:quote,subscription:subscription,batch:batch}=m.state;return sheet?.kind==="checkout"&"e!==null?{kind:"checkout",kicker:m.copy.checkoutKicker}:sheet?.kind==="manage"&&subscription!==null&&m.active?{kind:"manage",kicker:m.copy.manageKicker}:sheet?.kind==="cartCheckout"&&batch.length>0?{kind:"cartCheckout",kicker:m.copy.checkoutKicker}:sheet?.kind==="weight"?{kind:"weight",kicker:m.copy.weightKicker}:null}var intervalsOf2=m=>m.state.quote?.intervalOptions??m.state.subscription?.intervalOptions??[];function checkoutSheetProps(m){let hp=m.state,sheet=hp.sheet;if(sheet?.kind!=="checkout"||hp.quote===null)return null;let{item:item,design:design}=m.props,pk=design.pick;return{item:item,line:pk.checkoutLine??pk.line??item.description??"",prices:hp.prices(sheet.every),mode:sheet.mode,every:sheet.every,intervals:intervalsOf2(m),offer:hp.offer,oneBoxOffer:hp.oneBox!==null,rows:design.checkoutRows??[],busy:hp.sub.busy,confirmDisabled:hp.sub.busy||hp.redirecting,onModeChange:mode=>hp.openSheet({...sheet,mode:mode}),onEveryChange:d=>hp.openSheet({...sheet,every:d}),onConfirm:()=>{hp.confirmCheckout()}}}function manageSheetProps(m){let hp=m.state,s=hp.subscription;return hp.sheet?.kind!=="manage"||s===null||!m.active?null:{item:m.props.item,prices:hp.prices(s.intervalDays),nextBoxDay:hp.nextBoxDay(s),every:s.intervalDays,intervals:intervalsOf2(m),busy:hp.sub.busy,onEveryChange:hp.changeInterval,onSkip:()=>{hp.skip()},onCancel:()=>{hp.cancel()},onSeeOrders:hp.shop?hp.seeOrdersFromManage:null}}function cartCheckoutProps(m){let hp=m.state;if(hp.sheet?.kind!=="cartCheckout"||hp.batch.length===0)return null;let{copy:copy}=m,{fmt:fmt,currency:currency,lines:lines,unitOf:unitOf,isPick:isPick,itemOf:itemOf2}=hp,total=fmt(hp.batchTotal,currency)??"";return{lines:hp.batch.map(hp.lineView),lineTotal:x=>{let line=lines.find(l=>l.productId===x.key),unit=line===void 0?null:unitOf(line);return unit===null||line===void 0?null:fmt(Math.round(unit*line.qty*100)/100,isPick(line.productId)?currency:itemOf2(line.productId)?.currency??currency)},rows:m.props.design.checkoutRows??[],total:total,renew:hp.batchRenew,place:{label:copy.placeOrder(total,hp.batchSub!==null),disabled:!hp.cartReady||hp.sub.busy||hp.redirecting,onPress:()=>{hp.placeCart()}},fine:[copy.cartFine(hp.batchRenew),hp.apart?copy.cartSubscriptionApart:"",copy.checkoutNote].filter(x=>x!=="").join(" ")}}function weightSheetProps(m){let hp=m.state;return hp.sheet?.kind!=="weight"?null:{prices:hp.pr,value:hp.weightInput,onChange:hp.setWeightInput,error:hp.weightError,saving:hp.savingWeight,unit:m.kg?"kg":"lb",onSave:()=>{hp.saveWeight()},focused:m.weightFocused,onFocusedChange:m.setWeightFocused}}function startedProps(m){let hp=m.state,started=hp.started;if(started===null)return null;let{copy:copy,withTracking:withTracking}=m,{item:item,design:design}=m.props,pk=design.pick,run=started.kind==="sub"?started.sub:null,boughtId=started.kind==="sub"?started.sub.productId:started.order.productId,bought=[item,...m.others].find(x=>x.productId===boughtId)??item,sp=hp.prices(run?.intervalDays??hp.every,bought.title),label=(step,first)=>step.step==="first_box_ships"&&first?copy.tomorrow:hp.day(step.on)??step.on,rows=run===null?[{icon:"truck",when:copy.tomorrow,what:withTracking(copy.firstBoxShips)}]:run.timeline.map((step,i)=>{switch(step.step){case"first_box_ships":return{icon:"truck",when:label(step,i===0),what:withTracking(copy.firstBoxShips)};case"checkin":return{icon:"chat",when:label(step,false),what:copy.checkin(pk.checkin??null)};case"refill_reminder":return{icon:"repeat",when:label(step,false),what:copy.refill};default:return{icon:"calendar",when:label(step,false),what:copy.nextBoxShips(sp)}}});return{title:run===null?copy.orderedTitle(sp):copy.startedTitle(sp),what:copy.startedWhat(sp).trim(),note:copy.startedNote,steps:rows.map(r=>({key:`${r.icon}${r.when}`,...r}))}}function topOf(m){return m.state.started===null?m.state.top:void 0}var shopDay=m=>iso=>formatShopDay(iso,m.props.locale);function cartProps(m){let hp=m.state;return topOf(m)?.kind!=="cart"?null:{lines:hp.views,subtotal:hp.fmt(hp.cartTotal,hp.currency)??"",renew:hp.renewPrices,petPrices:hp.pr,handlers:{onQuantity:hp.stepQuantity,onRemove:hp.removeLine,onMode:(key,mode)=>hp.editLine(key,x=>({...x,mode:mode,qty:1})),onEvery:(key,d)=>hp.editLine(key,x=>({...x,every:d})),onOrders:()=>hp.push({kind:"orders"}),...m.productOn?{onOpen:m.openProduct}:{}}}}function ordersProps(m){let hp=m.state;if(topOf(m)?.kind!=="orders")return null;let s=hp.subscription,item=m.props.item;return{subscription:s!==null&&m.active?{name:s.title??item.title,imageUrl:item.imageUrl??null,next:hp.nextBoxDay(s),every:s.intervalDays,onManage:()=>hp.openSheet({kind:"manage"})}:null,orders:m.allOrders,loaded:hp.everfurOrders.loaded,fmt:(n,cur)=>hp.fmt(n,cur),day:shopDay(m),onOpen:key=>hp.push({kind:"order",key:key}),onBack:()=>hp.closeOverlays(),petPrices:hp.pr,more:hp.everfurOrders.next===null?null:{onMore:hp.moreOrders,loading:hp.everfurOrders.loading}}}function openOrder(m){let top=topOf(m);return top?.kind==="order"?m.allOrders.find(o=>o.key===top.key):void 0}function orderProps(m){let hp=m.state,order=openOrder(m);if(order===void 0)return null;let again=order.everfur&&order.productId!==null?hp.itemOf(order.productId):void 0,onHelp=m.props.onOrderHelp;return{order:order,fmt:(n,cur)=>hp.fmt(n,cur),day:shopDay(m),rows:(m.props.design.checkoutRows??[]).map(r=>r.label===PAY_WITH?{...r,label:m.copy.paidWith}:r),onBuyAgain:again===void 0?null:()=>hp.addToCart(again,"once"),onHelp:onHelp?()=>onHelp(order.key):null}}function placedProps(m){let hp=m.state,top=topOf(m);if(top?.kind!=="placed")return null;let{copy:copy,withTracking:withTracking}=m,placedOrders=top.orders,first=placedOrders[0],op=hp.prices(hp.every,first?.title??(first?hp.itemOf(first.productId)?.title:void 0)??m.props.item.title),one=xs=>{let known=[...new Set(xs.filter(x=>x!=null))];return known.length===1?known[0]??null:null},day=shopDay(m),placedNo=one(placedOrders.map(o=>o.tracking?.orderNumber)),arrives=placedOrders.length>0&&placedOrders.every(o=>o.tracking?.estimatedDelivery)?one(placedOrders.map(o=>o.tracking?.estimatedDelivery)):null,arrivesDay=day(arrives),placedCurrency=one(placedOrders.map(o=>o.currency)),placedTotal=placedCurrency===null?null:hp.fmt(Math.round(placedOrders.reduce((n,o)=>n+(o.total??o.price),0)*100)/100,placedCurrency),rows=[...placedOrders.map(o=>{let it=hp.itemOf(o.productId);return{key:o.orderId,icon:"box",imageUrl:it?.imageUrl??null,when:copy.cartItemQuantity(o.quantity??1),what:o.title??it?.title??"",product:true}}),{key:"ships",icon:"truck",when:copy.tomorrow,what:withTracking(copy.placedShips)},...arrivesDay===null?[]:[{key:"arrives",icon:"calendar",when:arrivesDay,what:copy.placedArrives}]];return{title:copy.orderedTitle(op),arrives:arrivesDay,orderNumber:placedNo,rows:rows,total:placedOrders.length>1&&placedTotal!==null?placedTotal:null,note:copy.startedNote}}function blanksDay(ms,locale){let d=new Date(ms);try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(d)}catch{return d.toISOString().slice(0,10)}}var GRAB="#DAD7D1";function planDsInput(p,outline=false){let r=role=>p.roles[role]??role,neutral=hex=>p.dark?r("line"):hex,box=(bg,extra={})=>({bg:bg,...extra}),words2=color=>({color:color}),noShadow={color:"",x:0,y:0,blur:0,spread:0};return{colors:{bg:r("paper"),surface:r("card"),text:r("black"),ink:r(outline?"ink":"primary"),onInk:r("onPrimary"),muted:r("ink3"),line:r("line"),scrim:r("scrim"),grab:neutral(GRAB),focus:r("ink")},type:p.type,motion:{reduced:p.reduced},metrics:{variants:{drawer:{frame:box(r("card"),{color:r("ink")}),grab:box(neutral(GRAB)),kicker:words2(r("ink3")),close:{color:r("ink")},title:{color:r("ink"),wrap:"auto"},text:words2(r("black")),scrim:r("scrim")},segmented:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),label:words2(r("ink")),chosen:box(r("primary")),chosenLabel:words2(r("onPrimary"))},stepper:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),button:{color:r("ink")},value:words2(r("ink"))},summary:{box:box(r("card"),p.dark?{shadow:noShadow}:{}),term:words2(r("ink2")),value:words2(r("ink")),totalTerm:words2(r("ink")),total:words2(r("ink")),renewTerm:words2(r("ink2")),renew:words2(r("ink")),inset:box(r("paper"))},toast:{box:box(r("ink")),text:words2(r("onInk"))},focus:{color:r("ink")}}}}}var caches=/* @__PURE__ */new WeakMap;function planDsTheme(key,preset,input,outline=false){let byPreset=caches.get(preset);byPreset===void 0&&(byPreset={fill:/* @__PURE__ */new WeakMap,outline:/* @__PURE__ */new WeakMap},caches.set(preset,byPreset));let cache3=byPreset[outline?"outline":"fill"],t=cache3.get(key);return t===void 0&&(t=resolveTheme(planDsInput(input(),outline),preset),cache3.set(key,t)),t}var PLAN_CSS_PARTS=[buttonCss,segmentedTabsCss,summaryListCss,toastCss];function webPlanDsTheme(theme,outline=false){return planDsTheme(theme,everfurWebTheme,()=>{let tokens=planTokens(theme);return{roles:tokens,dark:v3Palette(theme).dark,type:{family:tokens.sans??"",mono:tokens.mono??"",serif:tokens.serif??""},reduced:theme.motion.reducedMotion}},outline)}function PlanDs(props){let theme=usePlanTheme(),scope=useDsStyles(PLAN_CSS_PARTS,"health-plan");/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */jsx("small",{children:fullPlan?copy.fullCloseLine:copy.fullOpenLine})]}),icon("chev")]})}var PAY_WITH="Pay with";function toolbarProps(m){let hp=m.state;if(!hp.shop)return null;let label=todayLabel(m);return{eyebrow:m.props.design.eyebrow,cartCount:hp.lineCount,onOpenOrders:()=>hp.push({kind:"orders"}),onOpenCart:()=>hp.push({kind:"cart"}),...label===null?{}:{label:label}}}function headerProps(m){let d=m.props.design,after=todayPoweredBy(m);return{eyebrow:m.state.shop||m.isToday?void 0:d.eyebrow,title:d.title,subtitle:m.noRecords&&d.subtitleNoRecords?d.subtitleNoRecords:d.subtitle||void 0,imageUrl:d.headImageUrl,...after===null?{}:{after:after}}}function blanksProps(m){let blanksFacts=m.blanksFacts;if(blanksFacts===null||!m.blanksShown)return null;let{copy:copy,noPick:noPick,kg:inKg}=m,pk=m.props.design.pick,filled=blanksFacts.phase==="filled",kg=blanksFacts.weightKg,marked=pk.dose?.stats.some(x=>x.kind!==void 0)===true,daily=(noPick?void 0:marked?pk.dose?.stats.find(x=>x.kind==="dose"):pk.dose?.stats[0])??(noPick||pk.doseLabel===void 0?void 0:{value:null,label:pk.doseLabel}),rows=[{key:"weight",lead:copy.blanksWeight,value:!filled||kg===null?null:String(inKg?Math.round(kg*10)/10:Math.round(kg*LB_PER_KG)),trail:` ${inKg?copy.weightUnitKg:copy.weightUnit}`,source:copy.blanksWeightSource},...daily===void 0?[]:[{key:"dose",lead:"",value:filled&&m.state.weightKnown?daily.value:null,trail:` ${copy.blanksDose(daily.label,m.props.item.title)}`,source:copy.blanksDoseSource,width:"s"}],{key:"shots",lead:copy.blanksShots,value:filled&&blanksFacts.nextShotsAt!==null?blanksDay(blanksFacts.nextShotsAt,m.props.locale):null,trail:"",source:copy.blanksShotsSource,width:"l"}],count=rows.filter(r=>r.value!==null).length;return{phase:blanksFacts.phase,kicker:filled?copy.blanksFilledKicker:blanksFacts.clinicName!==null?copy.blanksAsked(blanksFacts.clinicName):copy.blanksAskedNoClinic,pill:filled?copy.blanksFilled(count,rows.length):copy.blanksWaitPill,rows:rows,blankLabel:copy.blankEmpty,label:copy.blanksLabel,flashKey:m.state.flashKey,flashColor:m.flashColor,p:m.kit.p}}function waitCardProps(m){let w=m.props.design.wait;if(!w)return null;let{today:today}=m;return{wait:w,onAction:m.props.onWaitAction,vetName:m.vet?.name??null,...today===void 0?{}:{today:{icon:name=>m.todayIcon(name),hoped:m.hoped,onHope:m.toggleHope,onLearn:today.onLearn}}}}function bylineProps(m){let b=m.props.design.byline;return b&&!m.waiting?{vet:b}:null}function withoutOdds(f){let rest={...f};return delete rest.odds,rest}function focusCardProps(m){let f=m.props.design.focus;if(!f||m.waiting)return null;let{pickRef:pickRef,still:still}=m,report=todayReport(m),brief=report===null&&m.isToday&&!m.fullPlan&&!m.kit.hostClasses;return{focus:brief?withoutOdds(f):f,vet:m.isToday?null:m.vet,...report===null?{}:{report:report},jump:f.jump&&!m.noPick&&!brief?{title:f.jump.title,go:f.jump.go,kicker:m.copy.jumpKicker(m.state.pr,m.active),imageUrl:m.props.item.imageUrl,onJump:()=>m.productOn?m.openProduct(m.props.item.productId):pickRef.current?.scrollIntoView({behavior:still?"auto":"smooth",block:"start"})}:null}}function tipsProps(m){let r=m.props.design.routine;return r&&!m.waiting?{routine:r,number:m.sections.routine,vetShortName:m.vet?.shortName}:null}function noPickProps(m){return m.waiting||m.pickHidden||!m.noPick||m.copy.noPick===""?null:{text:m.copy.noPick}}function productPickProps(m){if(m.waiting||m.pickHidden||m.noPick)return null;let{item:item,design:design,onMore:onMore}=m.props,pk=design.pick,link=productLink(m,item);return{item:item,pick:pk,number:m.sections.pick,onMore:pk.more&&onMore?()=>onMore(item):void 0,active:m.active,sectionRef:m.pickRef,...link===null?{}:{productLink:link}}}function reviewsProps(m){let r=m.props.design.pick.reviews;return r&&r.items.length>0?{reviews:r}:null}function whyProps(m){let w=m.props.design.pick.why;return w?{why:w}:null}function weightAskProps(m){return m.state.weightKnown?null:{icon:"pulse",title:m.copy.addWeightTitle,body:m.copy.addWeightBody,onPress:m.state.openWeight}}function recordsAskProps(m){let onConnect=m.props.onConnectRecords;return(m.noRecords||m.state.noVet)&&onConnect&&!m.blanksShown?{icon:"file",title:m.copy.connectRecordsTitle,body:m.copy.connectRecordsBody,onPress:onConnect,inSection:true}:null}function doseProps(m){let d=m.props.design.pick.dose;return m.state.weightKnown&&d?{dose:d}:null}function ingredientsProps(m){let x=m.props.design.pick.ingredients;return x&&x.items.length>0?{ingredients:x}:null}function buyOptionsProps(m){let hp=m.state;return hp.canSubscribe?{mode:hp.buyMode,onModeChange:hp.setMode,prices:hp.pr,offer:hp.offer}:null}function buyButtonProps(m){let hp=m.state,{item:item,subscriptions:subscriptions}=m.props,{pr:pr,priced:priced,buyMode:buyMode}=hp,loading=hp.sub.phase==="loading"&&subscriptions!==false;return hp.shop?{label:m.pickInCart?m.copy.viewCart:priced?m.copy.addToCart((buyMode==="sub"?pr.first:pr.once)??""):HEALTH_PLAN_COPY.addToCart,onPress:()=>hp.addToCart(item,buyMode),disabled:loading||!priced&&!m.pickInCart}:{label:buyMode==="sub"?m.copy.subscribe:priced?m.copy.buyOnce(pr):m.copy.buyOnceOption,onPress:hp.press,disabled:loading||hp.redirecting||hp.everfur&&!priced}}function proofProps(m){let t=m.props.design.pick.proof;return t?{text:t}:null}function trustProps(m){let t=m.props.design.pick.trust;return t&&t.length>0?{items:t}:null}function subscribedProps(m){let hp=m.state,s=hp.subscription;return{prices:hp.pr,nextBoxDay:m.active&&s!==null?hp.nextBoxDay(s):null,onManage:()=>hp.openSheet({kind:"manage"}),hidden:!m.active}}function otherItemsProps(m){let{others:others,copy:copy}=m;if(others.length===0||m.waiting||m.noPick||m.curated)return null;let hp=m.state;return{items:others.map(o=>{let once=hp.fmt(o.price,o.currency);if(hp.shop)return{item:o,buyLabel:hp.inCart(o.productId)?copy.viewCart:once===null?HEALTH_PLAN_COPY.addToCart:copy.addToCart(once),buyDisabled:once===null,onBuy:()=>hp.addToCart(o,"once")};let op={petName:m.props.petName,productName:o.title,first:once,box:once,once:once,onceDiscountPercent:0,intervalDays:0,discountPercent:0,offer:false};return{item:o,buyLabel:once===null?copy.buyOnceOption:copy.buyOnce(op),buyDisabled:hp.redirecting||hp.everfur&&once===null,onBuy:()=>hp.pressOther(o)}}),showCategory:m.props.showCategory===true}}function signsProps(m){let s=m.props.design.signs;return m.waiting||!s?null:{signs:s,number:m.sections.signs,callVetTitle:m.state.noVet?m.copy.callAVet:m.noRecords?m.copy.callYourVet:void 0}}function checkupProps(m,variant){let c=m.props.design.checkup;if(c===void 0||variant==="section"&&(m.waiting||m.props.design.signs))return null;let hp=m.state,{copy:copy,noRecords:noRecords}=m,added=hp.added;return{checkup:c,added:added,addLabel:noRecords||hp.noVet?added?copy.savedForCheckup:copy.saveForCheckup:added?c.added:c.add,onToggle:hp.toggleAdded,variant:variant,...variant==="section"?{number:m.sections.checkup}:{}}}function extrasProps(m){let x=m.props.design.extras;if(!x||m.extraItems.length===0)return null;let hp=m.state,{shop:shop,everfur:everfur}=hp,{onBuy:onBuy,onCheckout:onCheckout}=m.props,productOf=e=>e.productId!==void 0&&(shop||everfur||onBuy!==void 0||onCheckout!==void 0)?hp.itemOf(e.productId):void 0;return{title:x.title,...m.productOn?{linkOf:key=>{let e=m.extraItems.find(y=>y.key===key),product=e===void 0?void 0:productOf(e);return product===void 0?null:productLink(m,product)}}:{},items:m.extraItems.map(e=>{let product=productOf(e),on=product!==void 0?shop&&hp.inCart(product.productId)!==void 0:hp.extras.has(e.key),price=e.price??(product!==void 0?hp.fmtWhole(product.price,product.currency):null);return{extra:e,price:price,on:on,label:product!==void 0&&on?m.copy.viewCart:on?e.added:e.action,onPress:()=>hp.pressExtra(e.key,product,on)}})}}function fineProps(m){let t=m.props.design.fine;return t?{text:t}:null}function toastProps(m){return m.state.toast===null?null:{message:m.state.toast}}function sheetOf(m){let{sheet:sheet,quote:quote,subscription:subscription,batch:batch}=m.state;return sheet?.kind==="checkout"&"e!==null?{kind:"checkout",kicker:m.copy.checkoutKicker}:sheet?.kind==="manage"&&subscription!==null&&m.active?{kind:"manage",kicker:m.copy.manageKicker}:sheet?.kind==="cartCheckout"&&batch.length>0?{kind:"cartCheckout",kicker:m.copy.checkoutKicker}:sheet?.kind==="weight"?{kind:"weight",kicker:m.copy.weightKicker}:null}var intervalsOf2=m=>m.state.quote?.intervalOptions??m.state.subscription?.intervalOptions??[];function checkoutSheetProps(m){let hp=m.state,sheet=hp.sheet;if(sheet?.kind!=="checkout"||hp.quote===null)return null;let{item:item,design:design}=m.props,pk=design.pick;return{item:item,line:pk.checkoutLine??pk.line??item.description??"",prices:hp.prices(sheet.every),mode:sheet.mode,every:sheet.every,intervals:intervalsOf2(m),offer:hp.offer,oneBoxOffer:hp.oneBox!==null,rows:design.checkoutRows??[],busy:hp.sub.busy,confirmDisabled:hp.sub.busy||hp.redirecting,onModeChange:mode=>hp.openSheet({...sheet,mode:mode}),onEveryChange:d=>hp.openSheet({...sheet,every:d}),onConfirm:()=>{hp.confirmCheckout()}}}function manageSheetProps(m){let hp=m.state,s=hp.subscription;return hp.sheet?.kind!=="manage"||s===null||!m.active?null:{item:m.props.item,prices:hp.prices(s.intervalDays),nextBoxDay:hp.nextBoxDay(s),every:s.intervalDays,intervals:intervalsOf2(m),busy:hp.sub.busy,onEveryChange:hp.changeInterval,onSkip:()=>{hp.skip()},onCancel:()=>{hp.cancel()},onSeeOrders:hp.shop?hp.seeOrdersFromManage:null}}function cartCheckoutProps(m){let hp=m.state;if(hp.sheet?.kind!=="cartCheckout"||hp.batch.length===0)return null;let{copy:copy}=m,{fmt:fmt,currency:currency,lines:lines,unitOf:unitOf,isPick:isPick,itemOf:itemOf2}=hp,total=fmt(hp.batchTotal,currency)??"";return{lines:hp.batch.map(hp.lineView),lineTotal:x=>{let line=lines.find(l=>l.productId===x.key),unit=line===void 0?null:unitOf(line);return unit===null||line===void 0?null:fmt(Math.round(unit*line.qty*100)/100,isPick(line.productId)?currency:itemOf2(line.productId)?.currency??currency)},rows:m.props.design.checkoutRows??[],total:total,renew:hp.batchRenew,place:{label:copy.placeOrder(total,hp.batchSub!==null),disabled:!hp.cartReady||hp.sub.busy||hp.redirecting,onPress:()=>{hp.placeCart()}},fine:[copy.cartFine(hp.batchRenew),hp.apart?copy.cartSubscriptionApart:"",copy.checkoutNote].filter(x=>x!=="").join(" ")}}function weightSheetProps(m){let hp=m.state;return hp.sheet?.kind!=="weight"?null:{prices:hp.pr,value:hp.weightInput,onChange:hp.setWeightInput,error:hp.weightError,saving:hp.savingWeight,unit:m.kg?"kg":"lb",onSave:()=>{hp.saveWeight()},focused:m.weightFocused,onFocusedChange:m.setWeightFocused}}function startedProps(m){let hp=m.state,started=hp.started;if(started===null)return null;let{copy:copy,withTracking:withTracking}=m,{item:item,design:design}=m.props,pk=design.pick,run=started.kind==="sub"?started.sub:null,boughtId=started.kind==="sub"?started.sub.productId:started.order.productId,bought=[item,...m.others].find(x=>x.productId===boughtId)??item,sp=hp.prices(run?.intervalDays??hp.every,bought.title),label=(step,first)=>step.step==="first_box_ships"&&first?copy.tomorrow:hp.day(step.on)??step.on,rows=run===null?[{icon:"truck",when:copy.tomorrow,what:withTracking(copy.firstBoxShips)}]:run.timeline.map((step,i)=>{switch(step.step){case"first_box_ships":return{icon:"truck",when:label(step,i===0),what:withTracking(copy.firstBoxShips)};case"checkin":return{icon:"chat",when:label(step,false),what:copy.checkin(pk.checkin??null)};case"refill_reminder":return{icon:"repeat",when:label(step,false),what:copy.refill};default:return{icon:"calendar",when:label(step,false),what:copy.nextBoxShips(sp)}}});return{title:run===null?copy.orderedTitle(sp):copy.startedTitle(sp),what:copy.startedWhat(sp).trim(),note:copy.startedNote,steps:rows.map(r=>({key:`${r.icon}${r.when}`,...r}))}}function topOf(m){return m.state.started===null?m.state.top:void 0}var shopDay=m=>iso=>formatShopDay(iso,m.props.locale);function cartProps(m){let hp=m.state;return topOf(m)?.kind!=="cart"?null:{lines:hp.views,subtotal:hp.fmt(hp.cartTotal,hp.currency)??"",renew:hp.renewPrices,petPrices:hp.pr,handlers:{onQuantity:hp.stepQuantity,onRemove:hp.removeLine,onMode:(key,mode)=>hp.editLine(key,x=>({...x,mode:mode,qty:1})),onEvery:(key,d)=>hp.editLine(key,x=>({...x,every:d})),onOrders:()=>hp.push({kind:"orders"}),...m.productOn?{onOpen:m.openProduct}:{}}}}function ordersProps(m){let hp=m.state;if(topOf(m)?.kind!=="orders")return null;let s=hp.subscription,item=m.props.item;return{subscription:s!==null&&m.active?{name:s.title??item.title,imageUrl:item.imageUrl??null,next:hp.nextBoxDay(s),every:s.intervalDays,onManage:()=>hp.openSheet({kind:"manage"})}:null,orders:m.allOrders,loaded:hp.everfurOrders.loaded,fmt:(n,cur)=>hp.fmt(n,cur),day:shopDay(m),onOpen:key=>hp.push({kind:"order",key:key}),onBack:()=>hp.closeOverlays(),petPrices:hp.pr,more:hp.everfurOrders.next===null?null:{onMore:hp.moreOrders,loading:hp.everfurOrders.loading}}}function openOrder(m){let top=topOf(m);return top?.kind==="order"?m.allOrders.find(o=>o.key===top.key):void 0}function orderProps(m){let hp=m.state,order=openOrder(m);if(order===void 0)return null;let again=order.everfur&&order.productId!==null?hp.itemOf(order.productId):void 0,onHelp=m.props.onOrderHelp;return{order:order,fmt:(n,cur)=>hp.fmt(n,cur),day:shopDay(m),rows:(m.props.design.checkoutRows??[]).map(r=>r.label===PAY_WITH?{...r,label:m.copy.paidWith}:r),onBuyAgain:again===void 0?null:()=>hp.addToCart(again,"once"),onHelp:onHelp?()=>onHelp(order.key):null}}function placedProps(m){let hp=m.state,top=topOf(m);if(top?.kind!=="placed")return null;let{copy:copy,withTracking:withTracking}=m,placedOrders=top.orders,first=placedOrders[0],op=hp.prices(hp.every,first?.title??(first?hp.itemOf(first.productId)?.title:void 0)??m.props.item.title),one=xs=>{let known=[...new Set(xs.filter(x=>x!=null))];return known.length===1?known[0]??null:null},day=shopDay(m),placedNo=one(placedOrders.map(o=>o.tracking?.orderNumber)),arrives=placedOrders.length>0&&placedOrders.every(o=>o.tracking?.estimatedDelivery)?one(placedOrders.map(o=>o.tracking?.estimatedDelivery)):null,arrivesDay=day(arrives),placedCurrency=one(placedOrders.map(o=>o.currency)),placedTotal=placedCurrency===null?null:hp.fmt(Math.round(placedOrders.reduce((n,o)=>n+(o.total??o.price),0)*100)/100,placedCurrency),rows=[...placedOrders.map(o=>{let it=hp.itemOf(o.productId);return{key:o.orderId,icon:"box",imageUrl:it?.imageUrl??null,when:copy.cartItemQuantity(o.quantity??1),what:o.title??it?.title??"",product:true}}),{key:"ships",icon:"truck",when:copy.tomorrow,what:withTracking(copy.placedShips)},...arrivesDay===null?[]:[{key:"arrives",icon:"calendar",when:arrivesDay,what:copy.placedArrives}]];return{title:copy.orderedTitle(op),arrives:arrivesDay,orderNumber:placedNo,rows:rows,total:placedOrders.length>1&&placedTotal!==null?placedTotal:null,note:copy.startedNote}}function blanksDay(ms,locale){let d=new Date(ms);try{return new Intl.DateTimeFormat(locale??"en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}).format(d)}catch{return d.toISOString().slice(0,10)}}var Toast=/* @__PURE__ */forwardRef(function({message:message,action:action,variant:variant="pill",testID:testID,className:className,style:style,...rest},ref){return useEfdsPart("toast"),/* @__PURE__ */jsxs("div",{ref:ref,...dataOf(rest),"data-testid":testID,className:cx("efds-toast",variant==="card"&&"efds-toast--card",className),style:style,children:[
|
|
56
|
+
/* @__PURE__ */jsx("span",{className:"efds-toast__message",children:message}),action?/* @__PURE__ */jsxs("button",{type:"button",onClick:action.onPress,"data-testid":testID?`${testID}-action`:void 0,className:"efds-toast__action",children:[action.label,
|
|
57
|
+
/* @__PURE__ */jsx("span",{"aria-hidden":"true","data-hit":"",className:"efds-hit efds-hit--x"})]}):null]})});function labelLines(lines){let wrap={minWidth:0,whiteSpace:"normal",textAlign:"center"};return lines<=0?wrap:lines===1?{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{...wrap,display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:lines,overflow:"hidden"}}function isRtl(el){let dir=getComputedStyle(el).direction;return dir?dir==="rtl":el.closest("[dir]")?.getAttribute("dir")==="rtl"}function Tab({on:on,reach:reach,label:label,dot:dot,dotLabel:dotLabel,lines:lines,onPress:onPress,onPointerDown:onPointerDown2,onKeyDown:onKeyDown2,testID:testID}){/* @__PURE__ */
|
|
58
|
+
return jsxs("button",{type:"button",role:"tab","aria-selected":on,tabIndex:reach?0:-1,"data-testid":testID,className:"efds-tabs__tab",onClick:onPress,onPointerDown:onPointerDown2,onKeyDown:onKeyDown2,children:[lines===void 0?label:/* @__PURE__ */jsx("span",{style:labelLines(lines),children:label}),dot?/* @__PURE__ */jsxs(Fragment,{children:[
|
|
59
|
+
/* @__PURE__ */jsx("span",{"aria-hidden":"true",className:"efds-tabs__dot"}),dotLabel?/* @__PURE__ */jsx("span",{className:"efds-visually-hidden",children:`, ${dotLabel}`}):null]}):null]})}function SegmentedTabsImpl({tabs:tabs,value:value,onChange:onChange,onReselect:onReselect,numberOfLines:numberOfLines,label:label,activation:activation="auto",variant:variant="tabs",trackId:trackId,haptic:_haptic,testID:testID,className:className,style:style,...rest},ref){useEfdsPart("segmentedTabs");let list=useRef(null),feedback=usePressFeedback();useImperativeHandle(ref,()=>list.current);let reachable=tabs.some(tab=>tab.key===value)?value:tabs[0]?.key,segmented=variant==="segmented",onKeyDown2=index=>e=>{let rtl=isRtl(e.currentTarget),back=e.key===(rtl?"ArrowRight":"ArrowLeft")||segmented&&e.key==="ArrowUp",step=e.key===(rtl?"ArrowLeft":"ArrowRight")||segmented&&e.key==="ArrowDown"?1:back?-1:0,to=e.key==="Home"?0:e.key==="End"?tabs.length-1:step?(index+step+tabs.length)%tabs.length:-1,next=tabs[to];next&&(e.preventDefault(),(segmented||activation==="auto")&&onChange(next.key),list.current?.querySelectorAll(segmented?'[role="radio"]':'[role="tab"]')[to]?.focus())};return segmented?/* @__PURE__ */jsx("div",{ref:list,role:"radiogroup","aria-label":label,...dataOf(rest),"data-testid":testID,className:cx("efds-segmented",className),style:style,children:tabs.map((tab,i)=>{let id=testID?`${testID}-${tab.key}`:void 0,press=webPressOf(feedback,"SegmentedTabs",{testID:id,item:tab.key,label:tab.label,trackId:trackId},()=>{tab.key!==value&&onChange(tab.key)});/* @__PURE__ */
|
|
60
|
+
return jsx("button",{type:"button",role:"radio","aria-checked":tab.key===value,tabIndex:tab.key===reachable?0:-1,"data-testid":id,className:"efds-segmented__option",onClick:press.onPress,onPointerDown:press.onPointerDown,onKeyDown:onKeyDown2(i),children:numberOfLines===void 0?tab.label:/* @__PURE__ */jsx("span",{style:labelLines(numberOfLines),children:tab.label})},tab.key)})}):/* @__PURE__ */jsx("div",{ref:list,role:"tablist","aria-label":label,...dataOf(rest),"data-testid":testID,className:cx("efds-tabs",className),style:style,children:tabs.map((tab,i)=>{let id=testID?`${testID}-${tab.key}`:void 0,press=webPressOf(feedback,"SegmentedTabs",{testID:id,item:tab.key,label:tab.dot&&tab.dotLabel?`${tab.label}, ${tab.dotLabel}`:tab.label,trackId:trackId},()=>{tab.key!==value?onChange(tab.key):onReselect?.(tab.key)});/* @__PURE__ */
|
|
61
|
+
return jsx(Tab,{on:tab.key===value,reach:tab.key===reachable,label:tab.label,dot:tab.dot===true,dotLabel:tab.dotLabel,lines:numberOfLines,onPress:press.onPress,onPointerDown:press.onPointerDown,onKeyDown:onKeyDown2(i),testID:id},tab.key)})})}var SegmentedTabs=/* @__PURE__ */forwardRef(SegmentedTabsImpl);var GRAB="#DAD7D1";function planDsInput(p,outline=false){let r=role=>p.roles[role]??role,neutral=hex=>p.dark?r("line"):hex,box=(bg,extra={})=>({bg:bg,...extra}),words2=color=>({color:color}),noShadow={color:"",x:0,y:0,blur:0,spread:0},plan=Object.fromEntries(Object.entries({planInk:"primary",planOnInk:"onPrimary",planAccent:"accent",planLink:"link",planAccentWash:"accent4",planAccentChip:"accentChip",planLinkWash:"linkWash",planLinkChip:"linkChip"}).flatMap(([k,role])=>p.roles[role]===void 0?[]:[[k,p.roles[role]]]));return{colors:{bg:r("paper"),surface:r("card"),text:r("black"),ink:r(outline?"ink":"primary"),onInk:r("onPrimary"),muted:r("ink3"),line:r("line"),scrim:r("scrim"),grab:neutral(GRAB),focus:r("ink"),...plan},type:p.type,motion:{reduced:p.reduced},metrics:{variants:{drawer:{frame:box(r("card"),{color:r("ink")}),grab:box(neutral(GRAB)),kicker:words2(r("ink3")),close:{color:r("ink")},title:{color:r("ink"),wrap:"auto"},text:words2(r("black")),scrim:r("scrim")},segmented:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),label:words2(r("ink")),chosen:box(r("primary")),chosenLabel:words2(r("onPrimary"))},stepper:{track:box(r("card"),{edge:{color:neutral(GRAB)}}),button:{color:r("ink")},value:words2(r("ink"))},summary:{box:box(r("card"),p.dark?{shadow:noShadow}:{}),term:words2(r("ink2")),value:words2(r("ink")),totalTerm:words2(r("ink")),total:words2(r("ink")),renewTerm:words2(r("ink2")),renew:words2(r("ink")),inset:box(r("paper"))},toast:{box:box(r("ink")),text:words2(r("onInk"))},focus:{color:r("ink")}}}}}var caches=/* @__PURE__ */new WeakMap;function planDsTheme(key,preset,input,outline=false){let byPreset=caches.get(preset);byPreset===void 0&&(byPreset={fill:/* @__PURE__ */new WeakMap,outline:/* @__PURE__ */new WeakMap},caches.set(preset,byPreset));let cache2=byPreset[outline?"outline":"fill"],t=cache2.get(key);return t===void 0&&(t=resolveTheme(planDsInput(input(),outline),preset),cache2.set(key,t)),t}var segmentedTabsCss={name:"segmentedTabs",props:[12,"--ef-ui-t-metrics-tabs-min-height:44px;--ef-ui-t-metrics-tabs-gap:6px;--ef-ui-t-metrics-tabs-font-size:15px;--ef-ui-t-metrics-tabs-font-weight:500;--ef-ui-t-metrics-tabs-current-weight:700;--ef-ui-t-metrics-tabs-line-height:1.55;--ef-ui-t-metrics-tabs-indicator:3px;--ef-ui-t-metrics-tabs-hairline:1px;--ef-ui-t-metrics-tabs-dot:7px;--ef-ui-t-metrics-variants-segmented-track-padding-0:4px;--ef-ui-t-metrics-variants-segmented-track-padding-1:4px;--ef-ui-t-metrics-variants-segmented-track-padding-2:4px;--ef-ui-t-metrics-variants-segmented-track-padding-3:4px;--ef-ui-t-metrics-variants-segmented-track-gap-0:4px;--ef-ui-t-metrics-variants-segmented-track-gap-1:4px;--ef-ui-t-metrics-variants-segmented-track-radius-0:22px;--ef-ui-t-metrics-variants-segmented-track-radius-1:22px;--ef-ui-t-metrics-variants-segmented-track-bg:var(--ef-ui-color-surface);--ef-ui-t-metrics-variants-segmented-track-edge-width:1.5px;--ef-ui-t-metrics-variants-segmented-track-edge-color:#DAD7D1;--ef-ui-t-metrics-variants-segmented-track-shadow-x:0px;--ef-ui-t-metrics-variants-segmented-track-shadow-y:0px;--ef-ui-t-metrics-variants-segmented-track-shadow-blur:0px;--ef-ui-t-metrics-variants-segmented-track-shadow-spread:0px;--ef-ui-t-metrics-variants-segmented-option-padding-1:6px;--ef-ui-t-metrics-variants-segmented-option-min-height:36px;--ef-ui-t-metrics-variants-segmented-option-radius-0:18px;--ef-ui-t-metrics-variants-segmented-label-size:14px;--ef-ui-t-metrics-variants-segmented-label-weight:700;--ef-ui-t-metrics-variants-segmented-label-line-height:21px;--ef-ui-t-metrics-variants-segmented-label-color:var(--ef-ui-color-ink);--ef-ui-t-metrics-variants-segmented-chosen-padding-1:6px;--ef-ui-t-metrics-variants-segmented-chosen-min-height:36px;--ef-ui-t-metrics-variants-segmented-chosen-radius-0:18px;--ef-ui-t-metrics-variants-segmented-chosen-bg:var(--ef-ui-color-ink);--ef-ui-t-metrics-variants-segmented-chosen-label-size:14px;--ef-ui-t-metrics-variants-segmented-chosen-label-weight:700;--ef-ui-t-metrics-variants-segmented-chosen-label-line-height:21px;--ef-ui-t-metrics-variants-segmented-chosen-label-color:var(--ef-ui-color-on-ink);--ef-ui-t-metrics-variants-segmented-press:0.96;--ef-ui-tabs-background:var(--ef-ui-color-surface);--ef-ui-tabs-box-shadow:0 var(--ef-ui-t-metrics-tabs-hairline) 0 var(--ef-ui-color-line);--ef-ui-tabs-tab-gap:var(--ef-ui-t-metrics-tabs-gap);--ef-ui-tabs-tab-min-height:var(--ef-ui-t-metrics-tabs-min-height);--ef-ui-tabs-tab-font-family:var(--ef-ui-font-family);--ef-ui-tabs-tab-font-weight:var(--ef-ui-t-metrics-tabs-font-weight);--ef-ui-tabs-tab-font-size:var(--ef-ui-t-metrics-tabs-font-size);--ef-ui-tabs-tab-line-height:calc(var(--ef-ui-t-metrics-tabs-font-size) * var(--ef-ui-t-metrics-tabs-line-height));--ef-ui-tabs-tab-color:var(--ef-ui-color-muted);--ef-ui-tabs-tab-on-font-weight:var(--ef-ui-t-metrics-tabs-current-weight);--ef-ui-tabs-tab-on-color:var(--ef-ui-color-ink);--ef-ui-tabs-tab-on-box-shadow:inset 0 calc(-1 * var(--ef-ui-t-metrics-tabs-indicator)) 0 var(--ef-ui-color-go);--ef-ui-tabs-focus-outline-color:var(--ef-ui-color-focus);--ef-ui-tabs-hover-color:var(--ef-ui-color-ink);--ef-ui-tabs-dot-width:var(--ef-ui-t-metrics-tabs-dot);--ef-ui-tabs-dot-height:var(--ef-ui-t-metrics-tabs-dot);--ef-ui-tabs-dot-background:var(--ef-ui-color-go);--ef-ui-segmented-padding:var(--ef-ui-t-metrics-variants-segmented-track-padding-0) var(--ef-ui-t-metrics-variants-segmented-track-padding-1) var(--ef-ui-t-metrics-variants-segmented-track-padding-2) var(--ef-ui-t-metrics-variants-segmented-track-padding-3);--ef-ui-segmented-margin-top:initial;--ef-ui-segmented-column-gap:var(--ef-ui-t-metrics-variants-segmented-track-gap-0);--ef-ui-segmented-row-gap:var(--ef-ui-t-metrics-variants-segmented-track-gap-1);--ef-ui-segmented-border-radius:var(--ef-ui-t-metrics-variants-segmented-track-radius-0) var(--ef-ui-t-metrics-variants-segmented-track-radius-0) var(--ef-ui-t-metrics-variants-segmented-track-radius-1) var(--ef-ui-t-metrics-variants-segmented-track-radius-1);--ef-ui-segmented-background:var(--ef-ui-t-metrics-variants-segmented-track-bg);--ef-ui-segmented-border:initial;--ef-ui-segmented-box-shadow:var(--ef-ui-t-metrics-variants-segmented-track-shadow-x) var(--ef-ui-t-metrics-variants-segmented-track-shadow-y) var(--ef-ui-t-metrics-variants-segmented-track-shadow-blur) var(--ef-ui-t-metrics-variants-segmented-track-shadow-spread), inset 0 0 0 var(--ef-ui-t-metrics-variants-segmented-track-edge-width) var(--ef-ui-t-metrics-variants-segmented-track-edge-color);--ef-ui-segmented-min-height:initial;--ef-ui-segmented-option-padding:0 var(--ef-ui-t-metrics-variants-segmented-option-padding-1);--ef-ui-segmented-option-color:var(--ef-ui-t-metrics-variants-segmented-label-color);--ef-ui-segmented-option-min-height:var(--ef-ui-t-metrics-variants-segmented-option-min-height);--ef-ui-segmented-option-border-radius:var(--ef-ui-t-metrics-variants-segmented-option-radius-0);--ef-ui-segmented-option-font-family:var(--ef-ui-font-family);--ef-ui-segmented-option-font-weight:var(--ef-ui-t-metrics-variants-segmented-label-weight);--ef-ui-segmented-option-font-size:var(--ef-ui-t-metrics-variants-segmented-label-size);--ef-ui-segmented-option-line-height:var(--ef-ui-t-metrics-variants-segmented-label-line-height);--ef-ui-segmented-option-letter-spacing:initial;--ef-ui-segmented-option-text-transform:initial;--ef-ui-segmented-option-font-variant-numeric:initial;--ef-ui-segmented-option-transition:background-color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1);--ef-ui-segmented-chosen-padding:0 var(--ef-ui-t-metrics-variants-segmented-chosen-padding-1);--ef-ui-segmented-chosen-background:var(--ef-ui-t-metrics-variants-segmented-chosen-bg);--ef-ui-segmented-chosen-color:var(--ef-ui-t-metrics-variants-segmented-chosen-label-color);--ef-ui-segmented-chosen-min-height:var(--ef-ui-t-metrics-variants-segmented-chosen-min-height);--ef-ui-segmented-chosen-border-radius:var(--ef-ui-t-metrics-variants-segmented-chosen-radius-0);--ef-ui-segmented-chosen-font-weight:var(--ef-ui-t-metrics-variants-segmented-chosen-label-weight);--ef-ui-segmented-chosen-font-size:var(--ef-ui-t-metrics-variants-segmented-chosen-label-size);--ef-ui-segmented-chosen-line-height:var(--ef-ui-t-metrics-variants-segmented-chosen-label-line-height);--ef-ui-segmented-chosen-letter-spacing:initial;--ef-ui-segmented-press-transform:scale(var(--ef-ui-t-metrics-variants-segmented-press));--ef-ui-segmented-focus-outline:var(--ef-ui-t-metrics-variants-focus-width) solid var(--ef-ui-t-metrics-variants-focus-color);--ef-ui-segmented-focus-outline-offset:var(--ef-ui-t-metrics-variants-focus-offset)","--ef-ui-t-metrics-tabs-dot:0px"],segments:[[180,`.efds-tabs{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0, 1fr);background:var(--ef-ui-tabs-background);box-shadow:var(--ef-ui-tabs-box-shadow)}\n.efds-tabs__tab{font:inherit;text-decoration:none;white-space:nowrap;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;box-sizing:border-box;border-style:solid;appearance:none;display:flex;align-items:center;justify-content:center;gap:var(--ef-ui-tabs-tab-gap);min-height:var(--ef-ui-tabs-tab-min-height);padding:0px;border-width:0px;background:transparent;font-family:var(--ef-ui-tabs-tab-font-family);font-weight:var(--ef-ui-tabs-tab-font-weight);font-size:var(--ef-ui-tabs-tab-font-size);line-height:var(--ef-ui-tabs-tab-line-height);color:var(--ef-ui-tabs-tab-color);outline:var(--ef-ui-focus-width) solid transparent;outline-offset:var(--ef-ui-focus-offset)}\n.efds-tabs__tab[aria-selected="true"]{font-weight:var(--ef-ui-tabs-tab-on-font-weight);color:var(--ef-ui-tabs-tab-on-color);box-shadow:var(--ef-ui-tabs-tab-on-box-shadow)}\n.efds-tabs__tab:focus-visible{outline-color:var(--ef-ui-tabs-focus-outline-color)}\n@media (hover: hover) and (pointer: fine){\n.efds-tabs__tab:not([aria-selected="true"]):hover{color:var(--ef-ui-tabs-hover-color)}\n}\n.efds-tabs__dot{width:var(--ef-ui-tabs-dot-width);height:var(--ef-ui-tabs-dot-height);border-radius:50%;background:var(--ef-ui-tabs-dot-background);flex:none}\n`],[496,`.efds-segmented{box-sizing:border-box;padding:var(--ef-ui-segmented-padding);margin-top:var(--ef-ui-segmented-margin-top);column-gap:var(--ef-ui-segmented-column-gap);row-gap:var(--ef-ui-segmented-row-gap);border-radius:var(--ef-ui-segmented-border-radius);background:var(--ef-ui-segmented-background);border:var(--ef-ui-segmented-border);box-shadow:var(--ef-ui-segmented-box-shadow);min-height:var(--ef-ui-segmented-min-height);display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0, 1fr)}\n.efds-segmented__option{margin:0px;padding:var(--ef-ui-segmented-option-padding);border:0px;background:transparent;font:inherit;color:var(--ef-ui-segmented-option-color);text-align:center;text-decoration:none;cursor:pointer;appearance:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;position:relative;display:flex;align-items:center;justify-content:center;min-height:var(--ef-ui-segmented-option-min-height);border-radius:var(--ef-ui-segmented-option-border-radius);white-space:nowrap;font-family:var(--ef-ui-segmented-option-font-family);font-weight:var(--ef-ui-segmented-option-font-weight);font-size:var(--ef-ui-segmented-option-font-size);line-height:var(--ef-ui-segmented-option-line-height);letter-spacing:var(--ef-ui-segmented-option-letter-spacing);text-transform:var(--ef-ui-segmented-option-text-transform);font-variant-numeric:var(--ef-ui-segmented-option-font-variant-numeric);transition:var(--ef-ui-segmented-option-transition);outline:none}\n.efds-segmented__option[aria-checked="true"]{padding:var(--ef-ui-segmented-chosen-padding);background:var(--ef-ui-segmented-chosen-background);color:var(--ef-ui-segmented-chosen-color);min-height:var(--ef-ui-segmented-chosen-min-height);border-radius:var(--ef-ui-segmented-chosen-border-radius);font-weight:var(--ef-ui-segmented-chosen-font-weight);font-size:var(--ef-ui-segmented-chosen-font-size);line-height:var(--ef-ui-segmented-chosen-line-height);letter-spacing:var(--ef-ui-segmented-chosen-letter-spacing)}\n.efds-segmented__option:active:not(:disabled):not([aria-disabled="true"]){transform:var(--ef-ui-segmented-press-transform)}\n.efds-segmented__option:focus-visible{outline:var(--ef-ui-segmented-focus-outline);outline-offset:var(--ef-ui-segmented-focus-outline-offset)}\n.efds-segmented__option:disabled{cursor:default}\n`],[523,`@media (prefers-reduced-motion: reduce){\n.efds-segmented__option{transition:none !important}\n}\n`],[526,`@media (prefers-reduced-motion: reduce){\n.efds-segmented__option:active:not(:disabled):not([aria-disabled="true"]){transform:none}\n}\n`],[987,`@media (forced-colors: active){\n.efds-tabs__tab:not(:focus-visible){outline-style:none}\n}\n`],[1020,`@media (forced-colors: active){\n.efds-segmented__option[aria-checked="true"], .efds-tabs__tab[aria-selected="true"]{forced-color-adjust:none;background:Highlight;color:HighlightText;border-color:Highlight;box-shadow:none}\n}\n`],[1025,`@media (forced-colors: active){\n.efds-segmented__option[aria-checked="true"]:focus-visible, .efds-tabs__tab[aria-selected="true"]:focus-visible{outline-color:CanvasText}\n}\n`]],needs:[]};var toastCss={name:"toast",props:[30,"--ef-ui-t-metrics-lists-toast-box-padding-0:10px;--ef-ui-t-metrics-lists-toast-box-padding-1:16px;--ef-ui-t-metrics-lists-toast-box-padding-2:10px;--ef-ui-t-metrics-lists-toast-box-padding-3:16px;--ef-ui-t-metrics-lists-toast-box-radius-0:999px;--ef-ui-t-metrics-lists-toast-box-bg:var(--ef-ui-color-ink);--ef-ui-t-metrics-lists-toast-text-size:15px;--ef-ui-t-metrics-lists-toast-text-weight:400;--ef-ui-t-metrics-lists-toast-text-line-height:20.25px;--ef-ui-t-metrics-lists-toast-text-color:var(--ef-ui-color-on-ink);--ef-ui-t-metrics-lists-toast-inset:16px;--ef-ui-t-metrics-lists-toast-rise:8px;--ef-ui-t-metrics-lists-toast-fade:200ms;--ef-ui-t-metrics-variants-toast-box-padding-0:12px;--ef-ui-t-metrics-variants-toast-box-padding-1:15px;--ef-ui-t-metrics-variants-toast-box-padding-2:12px;--ef-ui-t-metrics-variants-toast-box-padding-3:15px;--ef-ui-t-metrics-variants-toast-box-radius-0:16px;--ef-ui-t-metrics-variants-toast-box-bg:var(--ef-ui-color-ink);--ef-ui-t-metrics-variants-toast-box-x:16px;--ef-ui-t-metrics-variants-toast-box-y:62px;--ef-ui-t-metrics-variants-toast-text-size:14.5px;--ef-ui-t-metrics-variants-toast-text-weight:400;--ef-ui-t-metrics-variants-toast-text-line-height:20.3px;--ef-ui-t-metrics-variants-toast-text-color:var(--ef-ui-color-on-ink);--ef-ui-t-metrics-variants-toast-motion-enter-ms:220ms;--ef-ui-t-metrics-variants-toast-motion-exit-ms:160ms;--ef-ui-t-metrics-variants-toast-motion-easing-0:0.23;--ef-ui-t-metrics-variants-toast-motion-easing-1:1;--ef-ui-t-metrics-variants-toast-motion-easing-2:0.32;--ef-ui-t-metrics-variants-toast-motion-easing-3:1;--ef-ui-t-metrics-variants-toast-motion-rise:-8px;--ef-ui-toast-max-width:calc(100% - calc(var(--ef-ui-t-metrics-lists-toast-inset) * 2));--ef-ui-toast-padding:var(--ef-ui-t-metrics-lists-toast-box-padding-0) var(--ef-ui-t-metrics-lists-toast-box-padding-1) var(--ef-ui-t-metrics-lists-toast-box-padding-2) var(--ef-ui-t-metrics-lists-toast-box-padding-3);--ef-ui-toast-border-radius:var(--ef-ui-t-metrics-lists-toast-box-radius-0);--ef-ui-toast-background:var(--ef-ui-t-metrics-lists-toast-box-bg);--ef-ui-toast-message-font-family:var(--ef-ui-font-family);--ef-ui-toast-message-font-weight:var(--ef-ui-t-metrics-lists-toast-text-weight);--ef-ui-toast-message-font-size:var(--ef-ui-t-metrics-lists-toast-text-size);--ef-ui-toast-message-line-height:var(--ef-ui-t-metrics-lists-toast-text-line-height);--ef-ui-toast-message-color:var(--ef-ui-t-metrics-lists-toast-text-color);--ef-ui-toast-message-letter-spacing:initial;--ef-ui-toast-message-text-transform:initial;--ef-ui-toast-message-font-variant-numeric:initial;--ef-ui-toast-action-color:var(--ef-ui-t-metrics-lists-toast-text-color);--ef-ui-toast-action-margin-inline-start:var(--ef-ui-t-metrics-lists-banner-acts-gap-0);--ef-ui-toast-action-font-family:var(--ef-ui-font-family);--ef-ui-toast-action-font-weight:var(--ef-ui-t-metrics-lists-banner-link-weight);--ef-ui-toast-action-font-size:var(--ef-ui-t-metrics-lists-toast-text-size);--ef-ui-toast-action-line-height:var(--ef-ui-t-metrics-lists-toast-text-line-height);--ef-ui-toast-action-letter-spacing:initial;--ef-ui-toast-action-text-transform:initial;--ef-ui-toast-action-font-variant-numeric:initial;--ef-ui-toast-action-press-opacity:var(--ef-ui-t-metrics-lists-link-pressed-opacity);--ef-ui-toast-action-focus-outline-color:var(--ef-ui-t-metrics-lists-toast-text-color);--ef-ui-toast-host-transform:translateY(var(--ef-ui-t-metrics-lists-toast-rise));--ef-ui-toast-host-transition:opacity var(--ef-ui-t-metrics-lists-toast-fade) cubic-bezier(var(--ef-ui-t-motion-easing-out-0), var(--ef-ui-t-motion-easing-out-1), var(--ef-ui-t-motion-easing-out-2), var(--ef-ui-t-motion-easing-out-3)), transform var(--ef-ui-t-metrics-lists-toast-fade) cubic-bezier(var(--ef-ui-t-motion-easing-out-0), var(--ef-ui-t-motion-easing-out-1), var(--ef-ui-t-motion-easing-out-2), var(--ef-ui-t-motion-easing-out-3));--ef-ui-toast-card-padding:var(--ef-ui-t-metrics-variants-toast-box-padding-0) var(--ef-ui-t-metrics-variants-toast-box-padding-1) var(--ef-ui-t-metrics-variants-toast-box-padding-2) var(--ef-ui-t-metrics-variants-toast-box-padding-3);--ef-ui-toast-card-border-radius:var(--ef-ui-t-metrics-variants-toast-box-radius-0);--ef-ui-toast-card-background:var(--ef-ui-t-metrics-variants-toast-box-bg);--ef-ui-toast-card-font-family:var(--ef-ui-font-family);--ef-ui-toast-card-font-weight:var(--ef-ui-t-metrics-variants-toast-text-weight);--ef-ui-toast-card-font-size:var(--ef-ui-t-metrics-variants-toast-text-size);--ef-ui-toast-card-line-height:var(--ef-ui-t-metrics-variants-toast-text-line-height);--ef-ui-toast-card-color:var(--ef-ui-t-metrics-variants-toast-text-color);--ef-ui-toast-card-letter-spacing:initial;--ef-ui-toast-card-text-transform:initial;--ef-ui-toast-card-font-variant-numeric:initial;--ef-ui-toast-card-message-font-family:var(--ef-ui-font-family);--ef-ui-toast-card-message-font-weight:var(--ef-ui-t-metrics-variants-toast-text-weight);--ef-ui-toast-card-message-font-size:var(--ef-ui-t-metrics-variants-toast-text-size);--ef-ui-toast-card-message-line-height:var(--ef-ui-t-metrics-variants-toast-text-line-height);--ef-ui-toast-card-message-color:var(--ef-ui-t-metrics-variants-toast-text-color);--ef-ui-toast-card-message-letter-spacing:initial;--ef-ui-toast-card-message-text-transform:initial;--ef-ui-toast-card-message-font-variant-numeric:initial;--ef-ui-toast-region-card-top:calc(var(--ef-ui-t-metrics-variants-toast-box-y) + var(--ef-ui-toast-top, 0px));--ef-ui-toast-region-card-left:var(--ef-ui-t-metrics-variants-toast-box-x);--ef-ui-toast-region-card-right:var(--ef-ui-t-metrics-variants-toast-box-x);--ef-ui-toast-card-host-transform:translateY(var(--ef-ui-t-metrics-variants-toast-motion-rise));--ef-ui-toast-card-host-transition:opacity var(--ef-ui-t-metrics-variants-toast-motion-exit-ms) ease, transform var(--ef-ui-t-metrics-variants-toast-motion-exit-ms) cubic-bezier(var(--ef-ui-t-metrics-variants-toast-motion-easing-0), var(--ef-ui-t-metrics-variants-toast-motion-easing-1), var(--ef-ui-t-metrics-variants-toast-motion-easing-2), var(--ef-ui-t-metrics-variants-toast-motion-easing-3));--ef-ui-toast-card-host-open-transition:opacity var(--ef-ui-t-metrics-variants-toast-motion-enter-ms) ease, transform var(--ef-ui-t-metrics-variants-toast-motion-enter-ms) cubic-bezier(var(--ef-ui-t-metrics-variants-toast-motion-easing-0), var(--ef-ui-t-metrics-variants-toast-motion-easing-1), var(--ef-ui-t-metrics-variants-toast-motion-easing-2), var(--ef-ui-t-metrics-variants-toast-motion-easing-3))",""],segments:[[455,`.efds-toast{box-sizing:border-box;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;width:max-content;max-width:var(--ef-ui-toast-max-width);margin:0 auto;padding:var(--ef-ui-toast-padding);border-radius:var(--ef-ui-toast-border-radius);background:var(--ef-ui-toast-background);pointer-events:auto}\n.efds-toast__message{flex:0 1 auto;min-width:0px;margin:0px;text-align:center;font-family:var(--ef-ui-toast-message-font-family);font-weight:var(--ef-ui-toast-message-font-weight);font-size:var(--ef-ui-toast-message-font-size);line-height:var(--ef-ui-toast-message-line-height);color:var(--ef-ui-toast-message-color);letter-spacing:var(--ef-ui-toast-message-letter-spacing);text-transform:var(--ef-ui-toast-message-text-transform);font-variant-numeric:var(--ef-ui-toast-message-font-variant-numeric);text-wrap:pretty}\n.efds-toast__action{margin:0px;padding:0px;background:none;border:0px;font:inherit;color:var(--ef-ui-toast-action-color);text-align:inherit;text-decoration:none;cursor:pointer;appearance:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent;position:relative;margin-inline-start:var(--ef-ui-toast-action-margin-inline-start);font-family:var(--ef-ui-toast-action-font-family);font-weight:var(--ef-ui-toast-action-font-weight);font-size:var(--ef-ui-toast-action-font-size);line-height:var(--ef-ui-toast-action-line-height);letter-spacing:var(--ef-ui-toast-action-letter-spacing);text-transform:var(--ef-ui-toast-action-text-transform);font-variant-numeric:var(--ef-ui-toast-action-font-variant-numeric);text-wrap:pretty;outline:var(--ef-ui-focus-width) solid transparent;outline-offset:var(--ef-ui-focus-offset)}\n.efds-toast__action:active{opacity:var(--ef-ui-toast-action-press-opacity)}\n.efds-toast__action:focus-visible{outline-color:var(--ef-ui-toast-action-focus-outline-color)}\n.efds-toast-region{position:fixed;left:0px;right:0px;bottom:0px;z-index:1002;pointer-events:none}\n.efds-toast-host{opacity:0;transform:var(--ef-ui-toast-host-transform);transition:var(--ef-ui-toast-host-transition)}\n.efds-toast-host[data-state="open"]{opacity:1;transform:none}\n`],[475,`@media (prefers-reduced-motion: reduce){\n.efds-toast-host{transition:none !important}\n}\n`],[477,`@media (prefers-reduced-motion: reduce){\n.efds-toast-host{transform:none}\n}\n`],[518,`.efds-toast--card{display:block;width:auto;max-width:none;margin:0px;padding:var(--ef-ui-toast-card-padding);border-radius:var(--ef-ui-toast-card-border-radius);background:var(--ef-ui-toast-card-background);font-family:var(--ef-ui-toast-card-font-family);font-weight:var(--ef-ui-toast-card-font-weight);font-size:var(--ef-ui-toast-card-font-size);line-height:var(--ef-ui-toast-card-line-height);color:var(--ef-ui-toast-card-color);letter-spacing:var(--ef-ui-toast-card-letter-spacing);text-transform:var(--ef-ui-toast-card-text-transform);font-variant-numeric:var(--ef-ui-toast-card-font-variant-numeric);text-align:start}\n.efds-toast--card > .efds-toast__message{display:inline;text-align:start;font-family:var(--ef-ui-toast-card-message-font-family);font-weight:var(--ef-ui-toast-card-message-font-weight);font-size:var(--ef-ui-toast-card-message-font-size);line-height:var(--ef-ui-toast-card-message-line-height);color:var(--ef-ui-toast-card-message-color);letter-spacing:var(--ef-ui-toast-card-message-letter-spacing);text-transform:var(--ef-ui-toast-card-message-text-transform);font-variant-numeric:var(--ef-ui-toast-card-message-font-variant-numeric)}\n.efds-toast-region--card{top:var(--ef-ui-toast-region-card-top);bottom:auto;left:var(--ef-ui-toast-region-card-left);right:var(--ef-ui-toast-region-card-right)}\n.efds-toast-region--card .efds-toast-host{opacity:0;transform:var(--ef-ui-toast-card-host-transform);transition:var(--ef-ui-toast-card-host-transition)}\n.efds-toast-region--card .efds-toast-host[data-state="open"]{opacity:1;transform:none;transition:var(--ef-ui-toast-card-host-open-transition)}\n`],[525,`@media (prefers-reduced-motion: reduce){\n.efds-toast-region--card .efds-toast-host{transition:none !important}\n}\n`],[997,`@media (forced-colors: active){\n.efds-toast__action:not(:focus-visible){outline-style:none}\n}\n`]],needs:[]};var PLAN_CSS_PARTS=[buttonCss,planNeedCardCss,segmentedTabsCss,summaryListCss,tipCardCss,toastCss];function webPlanDsTheme(theme,outline=false){return planDsTheme(theme,everfurWebTheme,()=>{let tokens=planTokens(theme);return{roles:tokens,dark:v3Palette(theme).dark,type:{family:tokens.sans??"",mono:tokens.mono??"",serif:tokens.serif??""},reduced:theme.motion.reducedMotion}},outline)}function PlanDs(props){let theme=usePlanTheme(),scope=useDsStyles(PLAN_CSS_PARTS,"health-plan");/* @__PURE__ */
|
|
58
62
|
return jsx(ThemeProvider,{ref:scope,theme:webPlanDsTheme(theme,props.outline===true),children:props.children})}var img=(k,src,fallback="box")=>src?/* @__PURE__ */jsx("img",{alt:"",src:src}):k.icon(fallback),EVERY_IN_ITEM={marginTop:8};function planButton(k,part,label,onPress,opts={}){let focus=opts.autoFocus===true?{"data-ef-autofocus":""}:{};if(k.library!==true)/* @__PURE__ */
|
|
59
63
|
return jsx("button",{type:"button",...focus,...k.p(part),disabled:opts.disabled===true||void 0,onClick:onPress,children:label});let ghost=part==="buttonGhost";/* @__PURE__ */
|
|
60
64
|
return jsx(PlanDs,{outline:ghost,children:/* @__PURE__ */jsx(Button,{...focus,label:label,onPress:onPress,tone:ghost?"outline":"ink",size:part==="buttonLarge"?"compactLg":"compact",fullWidth:true,disabled:opts.disabled===true})})}function shopSummary(k,total,opts={}){let{copy:copy}=k,renew=opts.renew??null,shipping=copy.shippingValue!=="";return k.library!==true||shipping&&opts.tag===true&©.shippingTag!==""?planSummary(k,total,opts):/* @__PURE__ */jsx(PlanDs,{children:/* @__PURE__ */jsx(SummaryList,{variant:opts.inCheckout===true?"inset":"card",rows:[{key:"subtotal",term:copy.subtotal,value:total},...shipping?[{key:"shipping",term:copy.shipping,value:copy.shippingValue}]:[]],total:{key:"total",term:renew===null?copy.total:copy.dueToday,value:total},...renew===null?{}:{note:{key:"renew",term:copy.thenRenews(renew),value:copy.renewsEvery(renew)}},testID:"health-plan-summary"})})}function planSummary(k,total,opts){let{p:p,copy:copy}=k,renew=opts.renew??null;/* @__PURE__ */
|
|
@@ -184,7 +188,9 @@ return jsxs("p",{...partProps(p("by"),props),children:[sizedImg(vet.imageUrl,40)
|
|
|
184
188
|
/* @__PURE__ */jsx("p",{...p("serif"),children:quote.text})]})}var HealthPlanVetQuote=defineBlock("HealthPlanVetQuote",drawVetQuote);function drawJumpStrip(k,props){let{p:p}=k,inner=/* @__PURE__ */jsxs(Fragment,{children:[sizedImg(props.imageUrl,44),
|
|
185
189
|
/* @__PURE__ */jsxs("span",{children:[props.kicker===null?null:/* @__PURE__ */jsx("small",{children:props.kicker}),
|
|
186
190
|
/* @__PURE__ */jsx("strong",{children:props.title})]}),
|
|
187
|
-
/* @__PURE__ */jsx("span",{...p("jumpGo"),children:props.go})]});return props.onJump===void 0?/* @__PURE__ */jsx("div",{...partProps(p("jump"),props),children:inner}):/* @__PURE__ */jsx("button",{type:"button",...partProps(p("jump"),props),onClick:props.onJump,children:inner})}var HealthPlanJumpStrip=defineBlock("HealthPlanJumpStrip",drawJumpStrip),HealthPlanFocusCard=defineBlock("HealthPlanFocusCard",(k,props)=>{let{
|
|
191
|
+
/* @__PURE__ */jsx("span",{...p("jumpGo"),children:props.go})]});return props.onJump===void 0?/* @__PURE__ */jsx("div",{...partProps(p("jump"),props),children:inner}):/* @__PURE__ */jsx("button",{type:"button",...partProps(p("jump"),props),onClick:props.onJump,children:inner})}var HealthPlanJumpStrip=defineBlock("HealthPlanJumpStrip",drawJumpStrip),HealthPlanFocusCard=defineBlock("HealthPlanFocusCard",(k,props)=>props.report===void 0||props.report===null?drawFocusCardDs(k,props):drawFocusCardOwn(k,props));function dsParts(k,parts){let out={},names=k.classNames;for(let[key,cls]of Object.entries(names)){let part=key.split(":")[0];cls!==void 0&&cls!==""&&parts.includes(part)&&(out[key]=cls)}return out}function withoutKinds(classNames,part){return Object.fromEntries(Object.entries(classNames).filter(([key])=>!key.startsWith(`${part}:`)))}var NEED_PARTS=["need","needKicker","sources","source","needRisk","dot","odds","oddsKicker","oddsNumbers","oddsIcon","tag","says","saysKicker","serif","jump","jumpGo"],TIP_PARTS=["tip","tipTop","tipN","tipIcon"];function planBlock(k,block){return k.hostClasses?block:/* @__PURE__ */jsx(PlanDs,{children:block})}function drawFocusCardDs(k,props){let f=props.focus,{vet:vet,jump:jump}=props,kind=f.risk?.kind,tone=kind==="risk"||kind==="watch"||kind==="clear"?kind:void 0;/* @__PURE__ */
|
|
192
|
+
return jsx("section",{"aria-label":f.title,style:{display:"contents"},children:planBlock(k,
|
|
193
|
+
/* @__PURE__ */jsx(PlanNeedCard,{variant:"plan",classNames:dsParts(k,NEED_PARTS),className:props.className,style:k.hostClasses?props.style:{marginTop:14,...props.style},testID:props.testID,kicker:f.kicker,sources:f.sources?.map(s=>({label:s.label,kind:s.kind==="dna"||s.kind==="records"?s.kind:void 0})),title:f.title,signals:f.risk?[{key:"risk",lead:f.risk.lead,text:f.risk.body??"",tone:tone,dot:tone===void 0?"space":true}]:[],score:f.odds?{label:f.odds.label,tag:f.odds.tag,was:f.odds.from,now:f.odds.to,since:f.odds.toLabel,icon:({className:className})=>k.icon("arrow",className)}:void 0,quote:f.quote&&vet!==null?{text:f.quote.text,by:vet.shortName||void 0,image:vet.imageUrl??null,tag:f.quote.tag}:void 0,jump:jump?{kicker:jump.kicker??"",title:jump.title,go:jump.go,image:jump.imageUrl??null,onPress:jump.onJump}:void 0}))})}function drawFocusCardOwn(k,props){let{p:p,icon:icon}=k,f=props.focus;/* @__PURE__ */
|
|
188
194
|
return jsxs("section",{...partProps(p("need"),props),"aria-label":f.title,children:[
|
|
189
195
|
/* @__PURE__ */jsxs("p",{...p("needKicker"),children:[f.kicker,f.sources&&f.sources.length>0?/* @__PURE__ */jsx("span",{...p("sources"),children:f.sources.map(s=>/* @__PURE__ */jsx("span",{...p("source",s.kind),children:s.label},s.label))}):null]}),
|
|
190
196
|
/* @__PURE__ */jsx("h3",{children:f.title}),f.risk?/* @__PURE__ */jsxs("p",{...p("needRisk"),children:[
|
|
@@ -194,14 +200,13 @@ return jsxs("section",{...partProps(p("need"),props),"aria-label":f.title,childr
|
|
|
194
200
|
/* @__PURE__ */jsxs("p",{...p("oddsKicker"),children:[f.odds.label,tagNode(k,f.odds.tag)]}),
|
|
195
201
|
/* @__PURE__ */jsxs("p",{...p("oddsNumbers"),children:[
|
|
196
202
|
/* @__PURE__ */jsx("s",{children:f.odds.from}),icon("arrow"),
|
|
197
|
-
/* @__PURE__ */jsx("b",{children:f.odds.to}),f.odds.toLabel?/* @__PURE__ */jsx("span",{children:f.odds.toLabel}):null]})]}):null,f.quote&&props.vet!==null?drawVetQuote(k,{quote:f.quote,vet:props.vet}):null,props.jump?drawJumpStrip(k,props.jump):null]})}
|
|
203
|
+
/* @__PURE__ */jsx("b",{children:f.odds.to}),f.odds.toLabel?/* @__PURE__ */jsx("span",{children:f.odds.toLabel}):null]})]}):null,f.quote&&props.vet!==null?drawVetQuote(k,{quote:f.quote,vet:props.vet}):null,props.jump?drawJumpStrip(k,props.jump):null]})}var HealthPlanTips=defineBlock("HealthPlanTips",(k,props)=>{let{p:p,copy:copy}=k,{routine:routine,vetShortName:vetShortName}=props,own=!k.hostClasses,tipParts=dsParts(k,TIP_PARTS);/* @__PURE__ */
|
|
198
204
|
return jsxs("section",{...partProps(p("steps"),props),"aria-label":routine.title,children:[
|
|
199
205
|
/* @__PURE__ */jsxs("div",{...p("stepsHead"),children:[
|
|
200
206
|
/* @__PURE__ */jsxs("h3",{children:[numberNode(k,props.number),routine.title]}),routine.label?/* @__PURE__ */jsx("p",{children:routine.label}):null]}),
|
|
201
|
-
/* @__PURE__ */jsx("ol",{...p("list"),children:routine.steps.map((s,i)
|
|
202
|
-
|
|
203
|
-
/* @__PURE__ */jsx(
|
|
204
|
-
/* @__PURE__ */jsx("strong",{children:s.title}),s.body?/* @__PURE__ */jsx("small",{children:s.body}):null,s.fromVet?vetShortName?/* @__PURE__ */jsx("em",{children:copy.fromVet(vetShortName)}):null:s.source?/* @__PURE__ */jsx("em",{children:s.source}):null]},s.title))})]})}),HealthPlanNoPick=defineBlock("HealthPlanNoPick",(k,props)=>/* @__PURE__ */jsx("p",{...partProps(k.p("noPick"),props),children:props.text})),HealthPlanOtherItems=defineBlock("HealthPlanOtherItems",(k,props,uid)=>{let{p:p}=k;/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */jsx("ol",{...p("list"),children:routine.steps.map((s,i)=>{let tipIcon=s.icon,foot=s.fromVet?vetShortName?copy.fromVet(vetShortName):void 0:s.source??void 0,classNames=s.tone===void 0?withoutKinds(tipParts,"tip"):tipParts;/* @__PURE__ */
|
|
208
|
+
return jsx("li",{...own?{style:{display:"flex",flexDirection:"column"}}:{},children:planBlock(k,
|
|
209
|
+
/* @__PURE__ */jsx(TipCard,{variant:"plan",classNames:classNames,number:String(i+1),title:s.title,text:s.body||void 0,foot:foot,tone:s.tone??"y",icon:({className:className,size:size})=>tipIcon?blockIcon(k,tipIcon,className,size):null,...own?{style:{flex:1}}:{}}))},s.title)})})]})}),HealthPlanNoPick=defineBlock("HealthPlanNoPick",(k,props)=>/* @__PURE__ */jsx("p",{...partProps(k.p("noPick"),props),children:props.text})),HealthPlanOtherItems=defineBlock("HealthPlanOtherItems",(k,props,uid)=>{let{p:p}=k;/* @__PURE__ */
|
|
205
210
|
return jsx("ul",{...partProps(p("others"),props),children:props.items.map((row,i)=>{let o=row.item,otherId=`${uid}-other-${i}`;/* @__PURE__ */
|
|
206
211
|
return jsx("li",{children:/* @__PURE__ */jsxs("article",{...p("other"),"aria-labelledby":otherId,children:[
|
|
207
212
|
/* @__PURE__ */jsxs("div",{...p("pickTop"),children:[
|
|
@@ -217,16 +222,16 @@ return jsxs("section",{...partProps(p("section"),props),"aria-label":signs.title
|
|
|
217
222
|
/* @__PURE__ */jsx("button",{type:"button",...p("add"),"aria-pressed":props.added,onClick:()=>props.onToggle(c.questions),children:props.addLabel})]});return kicker?body:/* @__PURE__ */jsxs("section",{...partProps(p("section"),props),"aria-label":c.title,children:[body,props.children]})}),HealthPlanExtras=defineBlock("HealthPlanExtras",(k,props,uid)=>{let{p:p,icon:icon}=k;/* @__PURE__ */
|
|
218
223
|
return jsxs("section",{...partProps(p("extras"),props),"aria-labelledby":`${uid}-extras`,children:[
|
|
219
224
|
/* @__PURE__ */jsx("h3",{id:`${uid}-extras`,...p("extrasTitle"),children:props.title}),props.items.map(({extra:x,price:price,on:on,label:label,onPress:onPress})=>{let link=props.linkOf?.(x.key)??null;/* @__PURE__ */
|
|
220
|
-
return jsxs("article",{...classProp(
|
|
225
|
+
return jsxs("article",{...classProp(cx2(p("extra",x.kind).className,link===null?void 0:k.classNames.productCard)),children:[link,x.imageUrl?/* @__PURE__ */jsx("img",{src:x.imageUrl,alt:"",width:64,height:64}):x.icon?/* @__PURE__ */jsx("span",{...p("extraIcon"),children:icon(x.icon)}):null,
|
|
221
226
|
/* @__PURE__ */jsxs("div",{children:[
|
|
222
227
|
/* @__PURE__ */jsx("h4",{...p("extraTitle",x.kind),children:x.title}),x.body?/* @__PURE__ */jsx("p",{children:x.body}):null,price?/* @__PURE__ */jsxs("p",{...p("extraPrice"),children:[
|
|
223
228
|
/* @__PURE__ */jsx("b",{children:price}),x.was?/* @__PURE__ */jsx("s",{children:x.was}):null,tagNode(k,x.tag)]}):null]}),
|
|
224
229
|
/* @__PURE__ */jsx("button",{type:"button",...p("extraGo"),"aria-pressed":on,onClick:onPress,children:label})]},x.key)})]})}),HealthPlanFine=defineBlock("HealthPlanFine",(k,props)=>/* @__PURE__ */jsx("p",{...partProps(k.p("pageFine"),props),children:props.text})),HealthPlanToast=defineBlock("HealthPlanToast",(k,props)=>{if(props.message===null)return null;let shown=props.shown!==false,card=k.library===true;/* @__PURE__ */
|
|
225
|
-
return jsx("div",{ref:props.layerRef,...partProps(classProp(
|
|
230
|
+
return jsx("div",{ref:props.layerRef,...partProps(classProp(cx2(k.classNames.toast,card?PLAN_TOAST_CARD_CLASS:void 0,shown?k.on:void 0)),props),role:"status","aria-live":"polite",children:card?/* @__PURE__ */jsx(PlanDs,{children:/* @__PURE__ */jsx(Toast,{variant:"card",message:props.message})}):props.message})});var HealthPlanProductPick=defineBlock("HealthPlanProductPick",(k,props)=>{let{p:p,icon:icon}=k,{item:item,pick:pk}=props;/* @__PURE__ */
|
|
226
231
|
return jsxs("section",{...partProps(p("section"),props),ref:props.sectionRef,"aria-label":pk.title,children:[
|
|
227
232
|
/* @__PURE__ */jsxs("h3",{...p("sectionTitle"),children:[numberNode(k,props.number),pk.title]}),
|
|
228
|
-
/* @__PURE__ */jsxs("article",{...classProp(
|
|
229
|
-
/* @__PURE__ */jsxs("div",{...classProp(
|
|
233
|
+
/* @__PURE__ */jsxs("article",{...classProp(cx2(k.classNames.pick,props.active===true?k.on:void 0)),children:[
|
|
234
|
+
/* @__PURE__ */jsxs("div",{...classProp(cx2(k.classNames.pickTop,props.productLink==null?void 0:k.classNames.productCard)),children:[props.productLink,
|
|
230
235
|
/* @__PURE__ */jsx("span",{...p("pickImage"),children:item.imageUrl?/* @__PURE__ */jsx("img",{src:item.imageUrl,alt:"",width:64,height:64}):null}),
|
|
231
236
|
/* @__PURE__ */jsxs("div",{children:[
|
|
232
237
|
/* @__PURE__ */jsx("h4",{children:item.title}),pk.rating?/* @__PURE__ */jsxs("p",{...p("stars"),children:[icon("star"),pk.rating.value,pk.rating.label?/* @__PURE__ */jsx("span",{children:pk.rating.label}):null]}):null,pk.line??item.description?/* @__PURE__ */jsx("p",{...p("pickLine"),children:pk.line??item.description}):null]})]}),props.children,pk.more&&props.onMore?/* @__PURE__ */jsx("p",{...p("more"),children:/* @__PURE__ */jsx("button",{type:"button",onClick:props.onMore,children:pk.more})}):null,pk.fine?/* @__PURE__ */jsx("p",{...p("fine"),children:pk.fine}):null]})]})}),HealthPlanReviews=defineBlock("HealthPlanReviews",(k,props)=>{let{p:p,icon:icon}=k,{reviews:reviews}=props;return reviews.items.length===0?null:/* @__PURE__ */jsx("div",{...partProps(p("reviews"),props),role:"group","aria-label":reviews.label,tabIndex:0,children:reviews.items.map(r=>{let stars=Math.max(1,Math.min(5,Math.round(r.stars)));/* @__PURE__ */
|
|
@@ -277,13 +282,13 @@ return jsxs(Fragment,{children:[
|
|
|
277
282
|
/* @__PURE__ */jsx("h3",{id:k.sheetTitleId,tabIndex:-1,...p("srOnly"),children:copy.checkoutTitle(cp)}),
|
|
278
283
|
/* @__PURE__ */jsxs("div",{...partProps(p("co"),props),children:[productBlock(k,props.item,props.line),
|
|
279
284
|
/* @__PURE__ */jsxs("div",{...p("coOpts"),role:"radiogroup","aria-label":copy.optionsLabel,children:[
|
|
280
|
-
/* @__PURE__ */jsxs("div",{...classProp(
|
|
285
|
+
/* @__PURE__ */jsxs("div",{...classProp(cx2(k.classNames.coOpt,isSub?k.on:void 0)),children:[
|
|
281
286
|
/* @__PURE__ */jsxs("button",{type:"button",...p("coHit"),role:"radio","aria-checked":isSub,onClick:()=>props.onModeChange("sub"),children:[
|
|
282
287
|
/* @__PURE__ */jsx("span",{...p("radio")}),
|
|
283
288
|
/* @__PURE__ */jsx("strong",{children:copy.subscribe}),
|
|
284
289
|
/* @__PURE__ */jsxs("span",{...p("coPrice"),children:[cp.first,offer?/* @__PURE__ */jsx("s",{children:cp.box}):null]}),offer?/* @__PURE__ */jsx("small",{children:copy.checkoutOffer(cp)}):null]}),isSub?/* @__PURE__ */jsxs("div",{...p("coWhen"),children:[
|
|
285
290
|
/* @__PURE__ */jsx("p",{...p("coKey"),id:`${uid}-co-every`,children:copy.shipsEvery}),intervalChips(k,props.intervals,props.every,props.busy,props.onEveryChange,`${uid}-co-every`)]}):null]}),
|
|
286
|
-
/* @__PURE__ */jsx("div",{...classProp(
|
|
291
|
+
/* @__PURE__ */jsx("div",{...classProp(cx2(k.classNames.coOpt,isSub?void 0:k.on)),children:/* @__PURE__ */jsxs("button",{type:"button",...p("coHit"),role:"radio","aria-checked":!isSub,onClick:()=>props.onModeChange("once"),children:[
|
|
287
292
|
/* @__PURE__ */jsx("span",{...p("radio")}),
|
|
288
293
|
/* @__PURE__ */jsx("strong",{children:copy.buyOnceOption}),
|
|
289
294
|
/* @__PURE__ */jsxs("span",{...p("coPrice"),children:[cp.once,cp.onceDiscountPercent>0?/* @__PURE__ */jsx("s",{children:cp.box}):null]}),props.oneBoxOffer?/* @__PURE__ */jsx("small",{children:copy.onceOffer(cp)}):null]})})]}),rows.length>0?/* @__PURE__ */jsx("ul",{...p("coRows"),children:rows.map(r=>/* @__PURE__ */jsxs("li",{children:[icon(r.icon),
|
|
@@ -385,7 +390,7 @@ return jsxs("div",{...p("product"),children:[gallery.length>0?/* @__PURE__ */jsx
|
|
|
385
390
|
/* @__PURE__ */jsx("ul",{children:whyRows.map(r=>/* @__PURE__ */jsxs("li",{children:[
|
|
386
391
|
/* @__PURE__ */jsx("span",{...p("chip",r.kind),children:r.chip}),
|
|
387
392
|
/* @__PURE__ */jsxs("span",{children:[
|
|
388
|
-
/* @__PURE__ */jsx("strong",{children:r.title}),r.body?/* @__PURE__ */jsx("small",{children:r.body}):null]})]},r.title))})]}):fitPlain!==null?/* @__PURE__ */jsxs("section",{className:
|
|
393
|
+
/* @__PURE__ */jsx("strong",{children:r.title}),r.body?/* @__PURE__ */jsx("small",{children:r.body}):null]})]},r.title))})]}):fitPlain!==null?/* @__PURE__ */jsxs("section",{className:cx2(classNames.productFit,classNames["productFit:plain"]),"aria-labelledby":"everfur-hp-pd-fit",children:[
|
|
389
394
|
/* @__PURE__ */jsxs("p",{...p("productFitKicker"),children:[fitPlain.pet===true&&design.headImageUrl?/* @__PURE__ */jsx("img",{src:design.headImageUrl,alt:""}):/* @__PURE__ */jsx("span",{...p("productFitIcon"),children:todayIcon("paw")}),
|
|
390
395
|
/* @__PURE__ */jsx("strong",{id:"everfur-hp-pd-fit",children:fitPlain.title})]}),
|
|
391
396
|
/* @__PURE__ */jsx("p",{children:fitPlain.body})]}):null,pick2&&active&&subscription!==null?/* @__PURE__ */jsxs("p",{...p("productOn"),children:[icon("check"),copy.productOnPlan(prices(subscription.intervalDays))]}):pick2&&canSubscribe?/* @__PURE__ */jsxs("div",{...p("opts"),role:"radiogroup","aria-label":copy.optionsLabel,children:[
|
|
@@ -423,17 +428,17 @@ return jsx("li",{children:/* @__PURE__ */jsxs("button",{type:"button",onClick:()
|
|
|
423
428
|
return jsx("div",{...p("foot"),children:/* @__PURE__ */jsx("button",{type:"button",...p("button"),disabled:redirecting||void 0,onClick:()=>pick2?press():pressOther(target),children:pick2?buyMode==="sub"?copy.subscribe:pr.once!==null?copy.buyOnce(pr):copy.buyOnceOption:copy.buyOnceOption})});let there=inCart(target.productId)!==void 0,unit=pick2?active||mode==="once"?oneBox?.price??boxPrice:offer&"e?quote.firstBoxPrice:boxPrice:target.price,now=unit===null?null:fmt(Math.round(unit*(pick2?1:qty)*100)/100,pick2?currency:target.currency),toCart=showCart;/* @__PURE__ */
|
|
424
429
|
return jsxs("div",{...p("foot","product"),children:[
|
|
425
430
|
/* @__PURE__ */jsx("button",{type:"button",...p("productBuy"),disabled:now===null&&!there?true:void 0,onClick:()=>{there||addToCart(target,mode,qty,true),openSheet({kind:"cartCheckout"})},children:copy.buyNow}),
|
|
426
|
-
/* @__PURE__ */jsx("button",{type:"button",className:
|
|
427
|
-
return jsx(HealthPlanFocusProvider,{...props,children:/* @__PURE__ */jsx(FocusLayout,{})})}function FocusLayout(){let model=useHealthPlanFocusContext();return model===null?null:/* @__PURE__ */jsx(FocusFrame,{m:model})}function FocusFrame({m:m}){let{props:props,state:hp,classNames:classNames,hostClasses:hostClasses,theme:theme,kit:kit,copy:copy}=m,{p:p,icon:icon,on:on}=kit,{todayLoad:todayLoad,todayKit:todayKit,isToday:isToday,fullPlan:fullPlan}=m,styles2=usePlanStyles(hostClasses?null:theme,props.style,todayKit?.styles??null),ringInk=useMemo(()=>planTokens(theme).ink??theme.color.brandInk,[theme]),rootEl=useRef(null),modelRoot=m.rootEl,rootRef=useCallback(el=>{rootEl.current=el,modelRoot.current=el,styles2.root(el)},[styles2,modelRoot]);useKeyboardFocusRing(rootEl,ringInk);let layerRings=useRef(/* @__PURE__ */new Map),ringLayer=useCallback(el=>{let rings=layerRings.current,purge=()=>{for(let[node,unbind]of rings)node.isConnected||(unbind(),rings.delete(node))};if(el===null){queueMicrotask(purge);return}purge(),rings.has(el)||rings.set(el,bindKeyboardFocusRing(el,ringInk))},[ringInk]);useEffect(()=>{let rings=layerRings.current;return()=>{for(let unbind of rings.values())unbind();rings.clear()}},[]);let{sheet:sheet,started:started,top:top,lineCount:lineCount,back:back,closeOverlays:closeOverlays}=hp,backRef=useRef(back);backRef.current=back;let layered=sheet!==null||started!==null||top!==void 0;useEffect(()=>{if(!layered||typeof document>"u")return;let onKey=e=>{e.key==="Escape"&&!e.defaultPrevented&&backRef.current()};return document.addEventListener("keydown",onKey),()=>document.removeEventListener("keydown",onKey)},[layered]);let sheetEl=useRef(null),screenEl=m.screenEl,sheetRef=useCallback(el=>{sheetEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer]),screenRef=useCallback(el=>{screenEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer,screenEl]),startedEl=useRef(null),startedRef=useCallback(el=>{startedEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer]),sheetKind=sheet?.kind??null,screenKey=started!==null||top===void 0?null:top.kind==="order"?`order:${top.key}`:top.kind==="product"?`product:${top.productId}`:top.kind,sheetTitleId=m.kit.sheetTitleId,focusSheet=useCallback(()=>focusIn(sheetEl.current,el=>el.querySelector(`[id="${sheetTitleId}"]`)),[sheetTitleId]),focusScreen=useCallback(()=>focusIn(screenEl.current,el=>el),[screenEl]),focusStarted=useCallback(()=>focusIn(startedEl.current,()=>null),[]);useEffect(()=>{sheetKind!==null&&focusSheet()},[sheetKind,focusSheet]),useEffect(()=>{screenKey!==null&&focusScreen()},[screenKey,focusScreen]);let cartCountEl=useRef(null),lastCount=useRef(lineCount),still=m.still;useEffect(()=>{let grew=lineCount>lastCount.current;lastCount.current=lineCount;let el=cartCountEl.current;!grew||still||el===null||typeof el.animate!="function"||el.animate([{transform:"scale(1)",easing:EASE_OUT},{transform:"scale(1.25)",offset:.4,easing:EASE_OUT},{transform:"scale(1)"}],{duration:CART_BUMP_MS,easing:"linear"})},[lineCount,still]);let page=isToday?/* @__PURE__ */jsx("section",{ref:rootRef,...mergeRoot(p("today"),props.className,props.style),"aria-labelledby":"everfur-hp-today",children:/* @__PURE__ */jsx("div",{className:
|
|
428
|
-
/* @__PURE__ */jsx("div",{ref:styles2.layer,className:
|
|
429
|
-
/* @__PURE__ */jsxs("section",{ref:sheetRef,className:
|
|
431
|
+
/* @__PURE__ */jsx("button",{type:"button",className:cx2(classNames.productAdd,there?classNames["productAdd:in"]:void 0),disabled:now===null&&!there?true:void 0,onClick:()=>there?toCart():addToCart(target,mode,qty),children:there?copy.viewCart:now===null?HEALTH_PLAN_COPY.addToCart:copy.addToCart(now)})]})}var CART_BUMP_MS=320,EASE_OUT="cubic-bezier(0.23, 1, 0.32, 1)";function HealthPlanFocus(props){/* @__PURE__ */
|
|
432
|
+
return jsx(HealthPlanFocusProvider,{...props,children:/* @__PURE__ */jsx(FocusLayout,{})})}function FocusLayout(){let model=useHealthPlanFocusContext();return model===null?null:/* @__PURE__ */jsx(FocusFrame,{m:model})}function FocusFrame({m:m}){let{props:props,state:hp,classNames:classNames,hostClasses:hostClasses,theme:theme,kit:kit,copy:copy}=m,{p:p,icon:icon,on:on}=kit,{todayLoad:todayLoad,todayKit:todayKit,isToday:isToday,fullPlan:fullPlan}=m,styles2=usePlanStyles(hostClasses?null:theme,props.style,todayKit?.styles??null),ringInk=useMemo(()=>planTokens(theme).ink??theme.color.brandInk,[theme]),rootEl=useRef(null),modelRoot=m.rootEl,rootRef=useCallback(el=>{rootEl.current=el,modelRoot.current=el,styles2.root(el)},[styles2,modelRoot]);useKeyboardFocusRing(rootEl,ringInk);let layerRings=useRef(/* @__PURE__ */new Map),ringLayer=useCallback(el=>{let rings=layerRings.current,purge=()=>{for(let[node,unbind]of rings)node.isConnected||(unbind(),rings.delete(node))};if(el===null){queueMicrotask(purge);return}purge(),rings.has(el)||rings.set(el,bindKeyboardFocusRing(el,ringInk))},[ringInk]);useEffect(()=>{let rings=layerRings.current;return()=>{for(let unbind of rings.values())unbind();rings.clear()}},[]);let{sheet:sheet,started:started,top:top,lineCount:lineCount,back:back,closeOverlays:closeOverlays}=hp,backRef=useRef(back);backRef.current=back;let layered=sheet!==null||started!==null||top!==void 0;useEffect(()=>{if(!layered||typeof document>"u")return;let onKey=e=>{e.key==="Escape"&&!e.defaultPrevented&&backRef.current()};return document.addEventListener("keydown",onKey),()=>document.removeEventListener("keydown",onKey)},[layered]);let sheetEl=useRef(null),screenEl=m.screenEl,sheetRef=useCallback(el=>{sheetEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer]),screenRef=useCallback(el=>{screenEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer,screenEl]),startedEl=useRef(null),startedRef=useCallback(el=>{startedEl.current=el,styles2.layer(el),ringLayer(el)},[styles2,ringLayer]),sheetKind=sheet?.kind??null,screenKey=started!==null||top===void 0?null:top.kind==="order"?`order:${top.key}`:top.kind==="product"?`product:${top.productId}`:top.kind,sheetTitleId=m.kit.sheetTitleId,focusSheet=useCallback(()=>focusIn(sheetEl.current,el=>el.querySelector(`[id="${sheetTitleId}"]`)),[sheetTitleId]),focusScreen=useCallback(()=>focusIn(screenEl.current,el=>el),[screenEl]),focusStarted=useCallback(()=>focusIn(startedEl.current,()=>null),[]);useEffect(()=>{sheetKind!==null&&focusSheet()},[sheetKind,focusSheet]),useEffect(()=>{screenKey!==null&&focusScreen()},[screenKey,focusScreen]);let cartCountEl=useRef(null),lastCount=useRef(lineCount),still=m.still;useEffect(()=>{let grew=lineCount>lastCount.current;lastCount.current=lineCount;let el=cartCountEl.current;!grew||still||el===null||typeof el.animate!="function"||el.animate([{transform:"scale(1)",easing:EASE_OUT},{transform:"scale(1.25)",offset:.4,easing:EASE_OUT},{transform:"scale(1)"}],{duration:CART_BUMP_MS,easing:"linear"})},[lineCount,still]);let page=isToday?/* @__PURE__ */jsx("section",{ref:rootRef,...mergeRoot(p("today"),props.className,props.style),"aria-labelledby":"everfur-hp-today",children:/* @__PURE__ */jsx("div",{className:cx2(classNames.root,fullPlan?void 0:classNames["root:brief"]),children:/* @__PURE__ */jsx(HealthPlanFocusPage,{cartCountRef:cartCountEl})})}):/* @__PURE__ */jsx("div",{ref:rootRef,...mergeRoot(p("root"),props.className,props.style),children:/* @__PURE__ */jsx(HealthPlanFocusPage,{cartCountRef:cartCountEl})}),layer=kind=>typeof document>"u"?null:props.overlayContainer?.(kind)??document.body,close=hp.closeSheet,open=sheetOf(m),sheetNode=open===null?null:shown=>/* @__PURE__ */jsxs(HealthPlanFocusSnapshot,{model:m,children:[
|
|
433
|
+
/* @__PURE__ */jsx("div",{ref:styles2.layer,className:cx2(classNames.scrim,shown?on:void 0),onClick:close}),
|
|
434
|
+
/* @__PURE__ */jsxs("section",{ref:sheetRef,className:cx2(classNames.sheet,shown?on:void 0),role:"dialog","aria-modal":"true","aria-labelledby":sheetTitleId,children:[
|
|
430
435
|
/* @__PURE__ */jsx("div",{...p("sheetGrab"),"aria-hidden":"true"}),
|
|
431
436
|
/* @__PURE__ */jsxs("div",{...p("sheetTop"),children:[
|
|
432
437
|
/* @__PURE__ */jsx("p",{...p("sheetKicker"),children:open.kicker}),
|
|
433
438
|
/* @__PURE__ */jsx("button",{type:"button",...p("sheetClose"),"aria-label":copy.close,onClick:close,children:icon("x")})]}),
|
|
434
|
-
/* @__PURE__ */jsx("div",{children:open.kind==="checkout"?/* @__PURE__ */jsx(ConnectedHealthPlanCheckoutSheet,{}):open.kind==="manage"?/* @__PURE__ */jsx(ConnectedHealthPlanManageSheet,{}):open.kind==="cartCheckout"?/* @__PURE__ */jsx(ConnectedHealthPlanCartCheckout,{}):/* @__PURE__ */jsx(ConnectedHealthPlanWeightSheet,{})})]})]}),startedTitle=startedProps(m)?.title??null,startedNode=startedTitle===null?null:shown=>/* @__PURE__ */jsx(HealthPlanFocusSnapshot,{model:m,children:/* @__PURE__ */jsxs("section",{ref:startedRef,className:
|
|
439
|
+
/* @__PURE__ */jsx("div",{children:open.kind==="checkout"?/* @__PURE__ */jsx(ConnectedHealthPlanCheckoutSheet,{}):open.kind==="manage"?/* @__PURE__ */jsx(ConnectedHealthPlanManageSheet,{}):open.kind==="cartCheckout"?/* @__PURE__ */jsx(ConnectedHealthPlanCartCheckout,{}):/* @__PURE__ */jsx(ConnectedHealthPlanWeightSheet,{})})]})]}),startedTitle=startedProps(m)?.title??null,startedNode=startedTitle===null?null:shown=>/* @__PURE__ */jsx(HealthPlanFocusSnapshot,{model:m,children:/* @__PURE__ */jsxs("section",{ref:startedRef,className:cx2(classNames.started,shown?on:void 0),"aria-label":startedTitle,children:[
|
|
435
440
|
/* @__PURE__ */jsx("div",{...p("startedScroll"),children:/* @__PURE__ */jsx(ConnectedHealthPlanStarted,{})}),
|
|
436
|
-
/* @__PURE__ */jsx("div",{...p("foot"),children:planButton(kit,"button",copy.startedDone,hp.closeStarted,{autoFocus:true})})]})}),screenNode=null,screen=topOf(m);if(screen!==void 0){let toPlan=()=>closeOverlays(),label="",body=null,foot=null;if(screen.kind==="cart"){label=copy.cartTitle,body=/* @__PURE__ */jsx(ConnectedHealthPlanCartScreen,{});let total=hp.fmt(hp.cartTotal,hp.currency)??"";foot=hp.views.length===0?/* @__PURE__ */jsx("div",{...p("foot"),children:planButton(kit,"button",copy.startedDone,toPlan)}):/* @__PURE__ */jsxs("div",{...p("foot","shop"),children:[planButton(kit,"buttonLarge",copy.checkoutCart(total),()=>hp.openSheet({kind:"cartCheckout"}),{disabled:!hp.cartReady}),!hp.cartReady&©.cartOneAtATime!==""?/* @__PURE__ */jsx("p",{...p("shopFine","center"),children:copy.cartOneAtATime}):null]})}else if(screen.kind==="orders")label=copy.orders,body=/* @__PURE__ */jsx(ConnectedHealthPlanOrders,{});else if(screen.kind==="order")label=copy.orderTitle(openOrder(m)?.number??null),body=/* @__PURE__ */jsx(ConnectedHealthPlanOrder,{});else if(screen.kind==="product"){let target=hp.itemOf(screen.productId)??props.item;label=target.title,body=productPageBody(m,target),foot=productPageFoot(m,target)}else{let placedOrders=screen.orders,first=placedOrders[0];label=copy.placedHeader,body=/* @__PURE__ */jsx(ConnectedHealthPlanPlaced,{}),foot=/* @__PURE__ */jsxs("div",{...p("foot","stack"),children:[planButton(kit,"button",placedOrders.length===1?copy.viewOrder:copy.seeOrders,()=>hp.replaceScreens(placedOrders.length===1&&first!==void 0?[{kind:"order",key:first.orderId}]:[{kind:"orders"}]),{autoFocus:true}),planButton(kit,"buttonGhost",copy.startedDone,toPlan)]})}screenNode=shown=>/* @__PURE__ */jsx(HealthPlanFocusSnapshot,{model:m,children:/* @__PURE__ */jsxs("section",{ref:screenRef,className:
|
|
441
|
+
/* @__PURE__ */jsx("div",{...p("foot"),children:planButton(kit,"button",copy.startedDone,hp.closeStarted,{autoFocus:true})})]})}),screenNode=null,screen=topOf(m);if(screen!==void 0){let toPlan=()=>closeOverlays(),label="",body=null,foot=null;if(screen.kind==="cart"){label=copy.cartTitle,body=/* @__PURE__ */jsx(ConnectedHealthPlanCartScreen,{});let total=hp.fmt(hp.cartTotal,hp.currency)??"";foot=hp.views.length===0?/* @__PURE__ */jsx("div",{...p("foot"),children:planButton(kit,"button",copy.startedDone,toPlan)}):/* @__PURE__ */jsxs("div",{...p("foot","shop"),children:[planButton(kit,"buttonLarge",copy.checkoutCart(total),()=>hp.openSheet({kind:"cartCheckout"}),{disabled:!hp.cartReady}),!hp.cartReady&©.cartOneAtATime!==""?/* @__PURE__ */jsx("p",{...p("shopFine","center"),children:copy.cartOneAtATime}):null]})}else if(screen.kind==="orders")label=copy.orders,body=/* @__PURE__ */jsx(ConnectedHealthPlanOrders,{});else if(screen.kind==="order")label=copy.orderTitle(openOrder(m)?.number??null),body=/* @__PURE__ */jsx(ConnectedHealthPlanOrder,{});else if(screen.kind==="product"){let target=hp.itemOf(screen.productId)??props.item;label=target.title,body=productPageBody(m,target),foot=productPageFoot(m,target)}else{let placedOrders=screen.orders,first=placedOrders[0];label=copy.placedHeader,body=/* @__PURE__ */jsx(ConnectedHealthPlanPlaced,{}),foot=/* @__PURE__ */jsxs("div",{...p("foot","stack"),children:[planButton(kit,"button",placedOrders.length===1?copy.viewOrder:copy.seeOrders,()=>hp.replaceScreens(placedOrders.length===1&&first!==void 0?[{kind:"order",key:first.orderId}]:[{kind:"orders"}]),{autoFocus:true}),planButton(kit,"buttonGhost",copy.startedDone,toPlan)]})}screenNode=shown=>/* @__PURE__ */jsx(HealthPlanFocusSnapshot,{model:m,children:/* @__PURE__ */jsxs("section",{ref:screenRef,className:cx2(classNames.push??classNames.started,shown?on:void 0),"aria-label":label,tabIndex:-1,children:[
|
|
437
442
|
/* @__PURE__ */jsx("div",{...p("startedScroll"),children:body},screen.kind==="product"?`product:${screen.productId}`:screen.kind),foot]})})}let toastNode=hp.toast===null?null:shown=>/* @__PURE__ */jsx(HealthPlanFocusSnapshot,{model:m,children:/* @__PURE__ */jsx(ConnectedHealthPlanToast,{shown:shown,layerRef:styles2.layer})});/* @__PURE__ */
|
|
438
443
|
return jsxs(Fragment,{children:[todayLoad.kind==="pending"?/* @__PURE__ */jsx("div",{ref:rootRef,...mergeRoot(p("root"),props.className,props.style),"aria-busy":"true"}):page,
|
|
439
444
|
/* @__PURE__ */jsx(Linger,{draw:sheetNode,exitMs:SHEET_EXIT_MS,into:()=>layer("sheet"),repaint:styles2.repaint,onShown:focusSheet}),
|