PageSourceSearch

https://getvoltr.com/app/assets/PlanRequiredScreen-BNrOsAg6.js

js getvoltr.com collected 2026-10-02 05:03:11 UTC 5,944 bytes, 1 lines download raw bytes

1import{r as o,j as e}from"./react-BJCrwb27.js";import{b as P,a as R}from"./route-support-BEJAjkqU.js";import{bZ as T}from"./index-Cok8iJMB.js";import"./vendor-DIeMxnSD.js";import"./tanstack-BOscu_PA.js";const b={margin:"6px 0 18px",fontSize:13.5,lineHeight:1.55,color:"var(--text2)"},_={display:"grid",gridTemplateColumns:"1fr 1fr",gap:4,padding:4,background:"var(--s2)",borderRadius:11,marginBottom:14};function W(n){return{height:34,border:"none",borderRadius:8,cursor:"pointer",fontFamily:"var(--font)",fontSize:12.5,fontWeight:600,background:n?"var(--s1)":"transparent",color:n?"var(--text)":"var(--text3)",boxShadow:n?"0 1px 2px rgba(0,0,0,0.08)":"none",transition:"all .15s"}}function z(n){return{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,width:"100%",textAlign:"left",padding:"13px 16px",borderRadius:12,cursor:"pointer",fontFamily:"var(--font)",transition:"transform .15s, box-shadow .15s",border:n?"1px solid transparent":"1px solid var(--border)",background:n?"var(--btn-volt)":"var(--bg)",color:n?"#3d3d3d":"var(--text)",boxShadow:n?"var(--btn-volt-shadow)":"none"}}const A={fontSize:9.5,fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",padding:"2px 7px",borderRadius:999,background:"rgba(61,61,61,0.18)",color:"#2b2b2b"};function H({auth:n,reason:v,hasCheckout:w,initialPlanId:j,discountCode:k,onSignOut:h}){const[u,y]=o.useState(null),[f,s]=o.useState(""),[l,S]=o.useState(()=>new URLSearchParams(window.location.search).get("billing")==="success"),p=!n.role||n.role==="admin"||n.role==="owner",d=v==="seat_limit",[r]=o.useState(()=>({hasCheckout:w,planId:j,discountCode:k})),[a,C]=o.useState(()=>{var t;return(t=r.planId)!=null&&t.endsWith("_annual")?"annual":"monthly"}),x=o.useRef(!1),m=o.useCallback(async(t,g=r.discountCode)=>{y(t),s("");try{const c=await P("/api/billing?action=checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plan_id:t,discount_code:g||void 0})}),i=await c.json().catch(()=>({}));if(c.ok&&i.url){window.location.assign(i.url);return}s(i.error||"Could not start checkout. Please try again.")}catch{s("Could not start checkout. Please try again.")}finally{y(null)}},[r.discountCode]);o.useEffect(()=>{if(!(d||!r.hasCheckout||x.current||!p)){if(x.current=!0,!r.planId){s("That plan is not available.");return}m(r.planId,r.discountCode)}},[p,r,d,m]),o.useEffect(()=>{if(d||!l)return;let t=!1;const g=[0,700,1100,1600,2200,3e3,4e3];return(async()=>{for(const c of g){if(c&&await new Promise(i=>window.setTimeout(i,c)),t)return;try{if((await R("/api/auth?action=me")).billing_entitled===!0){T(),window.location.reload();return}}catch{}}t||(S(!1),s("Checkout completed, but activation is still processing. Refresh in a moment if access does not update."))})(),()=>{t=!0}},[l,d]);const $=[{id:`starter_49_${a}`,name:"Starter",recommended:!1,price:a==="annual"?"$468/yr":"$49/mo",note:a==="annual"?"$39/mo billed annually · 1 seat":"7-day trial · 1 included seat"},{id:`growth_149_${a}`,name:"Growth",recommended:!0,price:a==="annual"?"$1,428/yr":"$149/mo",note:a==="annual"?"$119/mo billed annually · 3 seats":"7-day trial · 3 included seats"},{id:`pro_${a}`,name:"Pro",recommended:!1,price:a==="annual"?"$4,308/yr":"$449/mo",note:a==="annual"?"$359/mo billed annually · 10 seats":"7-day trial · 10 included seats"}];return e.jsx("div",{id:"login-screen",style:{display:"flex",overflowY:"auto",touchAction:"auto"},children:e.jsx("div",{className:"login-card",style:{margin:"auto",width:460,maxWidth:"100%"},children:d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"login-heading",children:"Workspace is full"}),e.jsx("p",{style:b,children:"The workspace you were invited to has no seats left. Ask its admin to add a seat or remove a member, then open your invite link again."}),e.jsx("div",{className:"login-toggle",style:{marginTop:20},children:e.jsxs("button",{type:"button",onClick:h,style:{cursor:"pointer",background:"none",border:0,padding:"8px 12px",minHeight:44,color:"var(--volt)",font:"inherit"},children:["Sign out ",n.email?`(${n.email})`:""]})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"login-heading",children:l?"Activating your plan…":"Choose a plan to continue"}),e.jsx("p",{style:b,children:"Choose Starter, Growth, or Pro. First-time subscriptions include the standard 7-day trial; extra seats can be added later in Settings."}),p?e.jsxs(e.Fragment,{children:[e.jsx("div",{role:"group","aria-label":"Billing cadence",style:_,children:["monthly","annual"].map(t=>e.jsx("button",{type:"button","aria-pressed":a===t,disabled:!!u||l,onClick:()=>C(t),style:W(a===t),children:t==="monthly"?"Monthly":"Annual · save 20%"},t))}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:$.map(t=>e.jsxs("button",{type:"button",disabled:!!u||l,onClick:()=>m(t.id),style:z(t.recommended),children:[e.jsxs("span",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",ga
1p:3},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontWeight:700,fontSize:15},children:t.name}),t.recommended?e.jsx("span",{style:A,children:"Recommended"}):null]}),e.jsx("span",{style:{fontSize:12,color:t.recommended?"rgba(61,61,61,0.7)":"var(--text3)"},children:t.note})]}),e.jsx("span",{style:{fontWeight:700,fontSize:15,whiteSpace:"nowrap"},children:u===t.id?"Starting…":t.price})]},t.id))})]}):e.jsx("p",{style:{fontSize:14,color:"var(--text)"},children:"Ask your workspace admin to activate a plan for this workspace."}),f?e.jsx("div",{className:"login-err",style:{display:"block"},children:f}):null,e.jsx("div",{className:"login-toggle",style:{marginTop:18},children:e.jsxs("button",{type:"button",onClick:h,style:{cursor:"pointer",background:"none",border:0,padding:"8px 12px",minHeight:44,color:"var(--volt)",font:"inherit"},children:["Sign out ",n.email?`(${n.email})`:""]})})]})})})}export{H as PlanRequiredScreen};

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.