1import{a as e}from"./chunk-BEqpzyXh.js";import{n as t,t as n}from"./createLucideIcon-CEDU0v2w.js";import{t as r}from"./jsx-runtime-DOlcsXOY.js";import{t as i}from"./link-B-tYfDFD.js";import{t as a}from"./button-gj4yBSBX.js";import{t as o}from"./arrow-up-right-BTwdHBOn.js";import{t as s}from"./check-CuPIAqPa.js";import{t as c}from"./dog-CsZwl1dx.js";import{t as l}from"./image-plus-CZopU5UH.js";import{t as u}from"./message-circle-D62-8eLb.js";import{m as d}from"./use-subscription-status-NObWgOyi.js";import{a as f,f as p,i as m,l as h,r as g,s as _,u as v}from"./contextual-usage-pack-CJ56omAw.js";var y=n(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),b=r();function x({products:e,onChoose:t,pendingSku:n,hideActions:r=!1,notice:i}){return(0,b.jsxs)(`div`,{children:[(0,b.jsxs)(`header`,{className:`mx-auto max-w-[650px] text-center`,children:[(0,b.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-brand-coral-text`,children:`A little more Voyage`}),(0,b.jsxs)(`h2`,{className:`mt-4 font-heading text-[34px] leading-[1.12] tracking-[-0.035em] text-text-primary sm:text-[46px]`,children:[`For the little questions.`,(0,b.jsx)(`br`,{}),`And the bigger worries.`]}),(0,b.jsxs)(`p`,{className:`mx-auto mt-5 max-w-[420px] text-[16px] leading-relaxed text-text-secondary`,children:[`Understand whatâs going on with your pet.`,(0,b.jsx)(`br`,{className:`hidden sm:block`}),` Choose a little extra support, whenever you need it.`]})]}),i,(0,b.jsx)(`div`,{className:`mt-9 grid gap-5 sm:grid-cols-2`,children:e.map(e=>{let i=e.sku===`assessment_3`,d=i?`Health Check`:`Voyage Chat`;return(0,b.jsxs)(`article`,{"aria-label":d,className:`flex min-w-0 flex-col overflow-hidden rounded-[24px] border border-[#ded9cf] bg-white`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between border-b border-black/5 px-6 py-4 ${i?`bg-[#e8eddf] text-[#425439]`:`bg-[#f7e8dc] text-[#875236]`}`,children:[(0,b.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-[0.12em]`,children:i?`When something feels off`:`When you want to talk it through`}),(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-9 shrink-0 items-center justify-center rounded-full border border-white/70 bg-white/45 shadow-[0_1px_0_rgba(255,255,255,0.7)]`,children:i?(0,b.jsx)(y,{className:`size-[21px]`,strokeWidth:1.45}):(0,b.jsx)(c,{className:`size-[21px]`,strokeWidth:1.45})})]}),(0,b.jsxs)(`div`,{className:`flex flex-1 flex-col p-6 sm:p-7`,children:[(0,b.jsx)(`h3`,{className:`font-heading text-[29px] leading-tight tracking-[-0.025em] text-text-primary`,children:d}),(0,b.jsx)(`p`,{className:`mt-3 text-[14px] leading-[1.7] text-text-secondary`,children:i?`Make sense of symptoms, understand how urgent they may be, and know what to do next.`:`Bring your questions, photos, and follow-ups. Get help making sense of the details, at your own pace.`}),(0,b.jsxs)(`div`,{className:`mt-6 flex items-baseline gap-2`,children:[(0,b.jsx)(`p`,{className:`font-heading text-[40px] leading-none tracking-[-0.04em] text-text-primary`,children:v(e.usdCents)}),(0,b.jsx)(`span`,{className:`text-[13px] text-text-secondary`,children:`one time`})]}),(0,b.jsxs)(`ul`,{className:`mt-6 space-y-3 border-t border-surface-border pt-5 text-[13px] leading-relaxed text-text-primary`,children:[(0,b.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,b.jsx)(s,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[#53694a]`}),i?`${e.assessmentUnits} health checks with a personal report`:`${e.textReplyUnits} replies from Voyage`]}),(0,b.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[i?(0,b.jsx)(u,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[#53694a]`}):(0,b.jsx)(l,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[#875236]`}),i?`${e.includedRepliesPerAssessment}
1 follow-up answers included per report`:`Share photos alongside your questions`]}),(0,b.jsxs)(`li`,{className:`flex items-start gap-2.5`,children:[(0,b.jsx)(s,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-[#53694a]`}),i?`Clear next steps, ready to revisit`:`Everyday questions or a deeper follow-up`]})]}),!r&&(0,b.jsx)(`div`,{className:`mt-auto pt-7`,children:(0,b.jsxs)(a,{className:`h-12 w-full justify-between rounded-xl px-5 text-[14px] shadow-none ${i?`bg-[#354a3c] hover:bg-[#293d30]`:`border border-[#d9c7b7] bg-[#faf4ee] text-text-primary hover:bg-[#f3e7da]`}`,disabled:!!n,loading:n===e.sku,onClick:()=>t(e.sku),children:[`Get `,d,(0,b.jsx)(o,{"aria-hidden":`true`,className:`size-4`})]})}),(0,b.jsx)(`p`,{className:`mt-3 text-center text-[11px] leading-relaxed text-text-secondary`,children:i?`Use a check whenever a new concern comes up.`:`One completed response uses one reply.`})]})]},e.sku)})}),(0,b.jsxs)(`footer`,{className:`mt-6 text-center text-[12px] leading-relaxed text-text-secondary`,children:[(0,b.jsx)(`p`,{className:`font-medium`,children:`No subscription. No expiry. Saved to your account.`}),(0,b.jsx)(`p`,{className:`mt-2`,children:`For use on the Voyage website, on your phone or computer. Prices in USD, before tax.`}),(0,b.jsxs)(`details`,{className:`mx-auto mt-4 max-w-[480px]`,children:[(0,b.jsx)(`summary`,{className:`cursor-pointer underline decoration-[#c5bcb0] underline-offset-4`,children:`Whatâs included`}),(0,b.jsx)(`p`,{className:`mt-3`,children:`Health Check follow-ups stay with their original report. Voyage Chat replies can be used across chats. Other subscription features are sold separately.`})]})]})]})}var S=e(t(),1);function C({subscribed:e,canceledIntentId:t,preferredSku:n}){let{query:r,userId:a}=f(),o=m(),[s]=(0,S.useState)(()=>d()),c=r.data;if((0,S.useEffect)(()=>{a&&p(a,c?.orders??[],e)},[c,a,e]),!c||!a)return null;let l=c.balances.assessmentUnits>0||c.balances.textReplyUnits>0||Object.values(c.balances.reportTextReplyUnits).some(e=>e>0),u=c.salesEnabled&&!e,_=!!(n&&(!u||!c.catalog.some(({sku:e})=>e===n))),y=n?[...c.catalog].sort((e,t)=>e.sku===n?-1:t.sku===n?1:0):c.catalog,C=c.orders.find(e=>e.status===`PENDING`);return!l&&!u&&!c.orders.length&&!t&&!_?null:(0,b.jsxs)(`section`,{id:`usage-packs`,"aria-label":`Usage packs`,"data-preferred-pack":n,className:`mx-auto mt-12 max-w-[840px] border-t border-surface-border pt-10`,children:[_&&n&&(0,b.jsxs)(`div`,{role:`status`,className:`mb-7 rounded-2xl border border-surface-border bg-white p-6 text-center`,children:[(0,b.jsx)(`h2`,{className:`font-heading text-[24px] font-normal text-text-primary`,children:`Pack availability`}),(0,b.jsx)(`p`,{className:`mt-3 text-[15px] leading-relaxed text-text-secondary`,children:e?`${h(n)} aren't available alongside an active membership.`:`${h(n)} aren't available to buy right now. Your account is ready, and no charge was made.`})]}),t&&(0,b.jsxs)(`p`,{role:`status`,className:`mb-6 text-[14px] text-text-secondary`,children:[`Checkout was closed. Your saved input is still there; you can continue checkout when youâre ready.`,` `,s&&(0,b.jsx)(i,{to:s,className:`underline underline-offset-2`,children:`Return to saved input`})]}),l&&(0,b.jsxs)(`div`,{className:`mb-7 rounded-2xl border border-surface-border bg-white p-5`,children:[(0,b.jsx)(`h2`,{className:`font-heading text-[22px] text-text-primary`,children:`Your unused packs`}),(0,b.jsxs)(`p`,{className:`mt-2 text-[15px] text-text-secondary`,children:[c.balances.assessmentUnits,` health checks ·`,` `,c.balances.textReplyUnits,` chat replies`]}),Object.values(c.balances.reportTextReplyUnits).some(e=>e>0)&&(0,b.jsx)(`p`,{className:`mt-2 text-[13px] text-text-secondary`,children:`Your included follow-up replies remain available in their original reports.`}),(0,b.jsxs)(`p`,{className:`mt-2 text-[13px] text-text-tertiary`,children:[`Unused balances do not expire.`,e?` Your subscription is used first, so these stay available for later.`:` Available on the Voyage website.`]})]}),u&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(x,{products:y,onChoose:e=>o.mutate(e),pendingSku:o.isPending?typeof o.variables==`string`?o.variables:o.variables?.sku:void 0,hideActions:!!C,notice:C?(0,b.jsx)(`div`,{className:`mt-5`,children:(0,b.jsx)(g,{order:C})}):void 0}),o.isError&&(0,b.jsx)(`p`,{role:`alert`,className:`mt-4 text-[14px] text-text-secondary`,children:`We couldnât open checkout. Please try again in this browser; your purchase request is saved. If it keeps happening, contact support.`})]}),!!c.orders.length&&(0,b.jsxs)(`details`,{className:`mt-7 text-[14px] text-text-secondary`,children:[(0,b.jsx)(`summary`,{className:`curs
1or-pointer font-medium`,children:`Recent pack purchases`}),(0,b.jsx)(`ul`,{className:`mt-3 space-y-3`,children:c.orders.map(e=>(0,b.jsxs)(`li`,{className:`border-b border-surface-border pb-3`,children:[(0,b.jsxs)(`span`,{children:[h(e.sku),` ·`,` `,v(e.amountCents),` ·`,` `,e.status===`PAID`?`Paid`:e.status===`PENDING`?`Awaiting confirmation`:e.status===`REFUNDED`?`Refunded`:`Not completed`]}),(0,b.jsxs)(`p`,{className:`mt-1 text-[12px] text-text-tertiary`,children:[`Order `,e.id]})]},e.id))}),(0,b.jsx)(`a`,{href:`mailto:[email protected]`,className:`mt-3 inline-block underline underline-offset-2`,children:`Contact support about a purchase`})]})]})}function w({sessionId:e}){let{query:t,isAnonymous:n}=f({sessionId:e,poll:!0}),[r]=(0,S.useState)(()=>d()),o=_(t.data?.orders??[],e),s=o?.status===`PAID`,c=o&&o.status!==`PAID`&&o.status!==`PENDING`;return(0,b.jsx)(`main`,{className:`min-h-svh bg-surface-cream`,children:(0,b.jsxs)(`div`,{className:`mx-auto max-w-[620px] px-6 py-20 text-center`,children:[(0,b.jsx)(`p`,{className:`mb-5 text-[12px] font-semibold uppercase tracking-[0.12em] text-brand-coral-text`,children:`One-time pack`}),(0,b.jsx)(`h1`,{className:`font-heading text-[36px] leading-tight text-text-primary`,children:s?`Your pack is ready to use`:c?`This checkout is closed`:`Confirming your payment`}),(0,b.jsx)(`p`,{role:`status`,className:`mt-5 text-[17px] leading-relaxed text-text-secondary`,children:s?`${h(o.sku)} have been added to your account. Continue when youâre ready; no assessment or reply starts automatically.`:c?o.status===`REFUNDED`?`This purchase was refunded. Your current available balance is saved in your account.`:`This checkout did not complete. Your existing balance is unchanged.`:`Weâre checking your account for payment confirmation. Please donât buy another pack while this is pending. You can close this page; confirmed purchases are saved to your account.`}),t.isError&&(0,b.jsx)(`p`,{className:`mt-4 text-[14px] text-text-secondary`,children:`We canât check the status right now. Weâll keep trying.`}),n?(0,b.jsx)(a,{asChild:!0,className:`mt-8 rounded-full`,children:(0,b.jsx)(i,{to:`/login`,search:{next:`/subscribe/success?kind=usage_pack${e?`&session_id=${encodeURIComponent(e)}`:``}`},children:`Log in to check your purchase`})}):s&&(0,b.jsx)(a,{asChild:!0,className:`mt-8 rounded-full`,children:(0,b.jsx)(i,{to:r??`/ai-vet`,children:`Continue where you left off`})}),(0,b.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3 text-[14px] text-text-secondary`,children:[(0,b.jsx)(i,{to:`/subscribe`,className:`underline underline-offset-2`,children:`View balances and purchases`}),(0,b.jsx)(`a`,{href:`mailto:[email protected]`,className:`underline underline-offset-2`,children:`Contact support`})]})]})})}function T({subscribed:e}){let{query:t,userId:n}=f();return(0,S.useEffect)(()=>{n&&t.data&&p(n,t.data.orders,e)},[n,t.data,e]),null}export{C as n,T as r,w as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.