1import{j as e,a as _,u as U,e as Q,f as H}from"./@react-query-B7aWO4oz.js";import{fS as W,D as N,f7 as Y,f8 as K,aO as $,ar as C,fT as q,ae as w,ap as J,fU as X,a0 as Z,d8 as ee,aM as se,fV as te}from"./main-D6lnA1fr.js";import{f as R,u as ae,a as re,c as ne}from"./format-currency-mWHgvevq.js";import{C as D,f as V,g as G,c as ie}from"./index-8ntJgCKG.js";import{b as le,c as oe,d as ce,e as de,f as ue,g as me}from"./item-FDmN-bgh.js";import{T as pe,a as xe,b as A}from"./tabs-gXCSaTLD.js";import{F as fe}from"./index.esm-C_kJsCpU.js";import{B as he}from"./badge-51NKKn01.js";import{T,a as I,b as S}from"./tooltip-B-boOwwp.js";import{R as k}from"./agent-role-v1-Aud3X7dn.js";import{U as ge,i as F,m as je}from"./license-entitlements-DBuA4ind.js";import{S as ye}from"./settings-upgrade-banner-y29RUpnw.js";import{u as _e}from"./use-meeting-url-B4xCriJY.js";import{u as Ne}from"./use-user-profile-D6uX20Dn.js";import{r as be}from"./refetch-interval-Bo3ZCMgs.js";import{I as ve}from"./feature-flags-DquS3z1b.js";import{u as Ce}from"./useTitle-CsdsS0pb.js";import"./@tanstack-router-C5q29I5r.js";import"./@radix-ui-CWA3xdIh.js";import"./zod-FlNnpX36.js";import"./use-analytics-iGz9imuP.js";import"./separator-BYTuZ_4Q.js";import"./collapsible-CTmYfjg1.js";import"./switch-DbZN7Fxs.js";import"./toggle-group-BFhgky20.js";import"./broker-utils-BynWou9B.js";const Te="An Agent that can start Incredibuild executions and distribute tasks across available Helper Agents",Ie="Cores available to accelerate builds by running tasks in parallel",Se="Upgrade the grid before purchasing this plan",ke={starter:"For small teams getting started",team:"For teams with regular build workloads",scale:"For larger, heavier build workloads"};function Pe({pkg:s,cadence:r,isCurrent:c,hasCurrentPlan:p,onTalkToSales:x,onBuy:b,pendingPriceId:f,buyDisabled:h}){const a=s.prices.find(m=>m.cadence===r);if(!a)return null;const g=s.prices.find(m=>m.cadence==="monthly"),i=s.prices.find(m=>m.cadence==="yearly"),n=r==="yearly"&&g&&i?g.amount_minor_units*12-i.amount_minor_units:null,j=f===a.paddle_price_id,l=s.package_key==="team"&&!p,d=c?"Current plan":l?"Recommended":null,u=c||l,o=a.entitlements.cache_cores===ge?"Unlimited":String(a.entitlements.cache_cores),v=e.jsx(N,{className:"w-full",onClick:()=>b(s,r),disabled:j||h,children:j?"Processingâ¦":"Buy plan"});return e.jsxs(D,{className:ie("flex-1 basis-0 gap-3 p-4",u&&"border-primary"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx(V,{className:"text-lg",children:s.display_name}),d&&e.jsx(he,{variant:"custom",className:"bg-primary/15 text-primary-strong border-transparent",children:d})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsx("span",{className:"text-2xl font-semibold",children:R(a.amount_minor_units,a.currency_code)}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["/ ",r==="monthly"?"month":"year"]})]}),n!==null&&n>0&&e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-foreground",children:[e.jsx(W,{className:"size-4"}),"Save ",R(n,a.currency_code)]}),e.jsx(G,{children:ke[s.package_key]}),c?e.jsx(N,{disabled:!0,className:"w-full",children:"Current plan"}):p?e.jsx(N,{variant:"outline",className:"w-full",onClick:x,children:"Talk to sales"}):h?e.jsxs(T,{children:[e.jsx(I,{asChild:!0,children:e.jsx("span",{className:"w-full",children:v})}),e.jsx(S,{children:Se})]}):v,e.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(T,{children:[e.jsx(I,{asChild:!0,children:e.jsx("span",{children:e.jsx(k,{type:"initiator"})})}),e.jsx(S,{children:Te})]}),a.entitlements.initiators," Initiators"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs(T,{children:[e.jsx(I,{asChild:!0,children:e.jsx("span",{children:e.jsx(k,{type:"helper"})})}),e.jsx(S,{children:Ie})]}),a.entitlements.helper_cores," Helper cores"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(k,{type:"localCache"}),o," Builds cache"]})]})]})}function Ee({onTalkToSales:s}){return e.jsxs(D,{className:"flex-1 basis-0 gap-3 p-4",children:[e.jsx(V,{className:"text-lg",children:"Enterprise"}),e.jsx("div",{className:"text-2xl font-bold",children:"Custom"}),e.jsx(G,{children:"Customized for your business needs"}),e.jsx(N,{variant:"secondary",className:"w-full",onClick:s,children:"Talk to sales"}),e.jsxs("div",{className:"flex flex-col gap-2 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"size-5"}),"Custom capacity"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(w,{className:"size-5"}),"Dedicated support"]})]})]})}function Le({onTalkToSales:s}){return e.jsxs(le,{variant:"muted",className:"border",children:[e.jsx(oe,{variant:"icon",children:e.jsx(fe,{})}),e.jsxs(ce,{children:[e.jsx(de,{children:"Need Linux licenses?"}),e.jsx(ue,{children:"Linux licenses are available through Sales"})]}),e.jsx(me,{children:e.jsx(N,{variant:"outline",onClick:s,children:"Talk to sales"})})]})}function Oe({license:s,catalogue:r}){const[c,p]=_.useState("monthly"),x=_e(),{openCheckout:b}=ae(),{userData:f}=Ne(),[h,a]=_.useState(void 0),{data:g}=U(J()),i=s.grid_public_id!==null,n=i?g?.find(t=>t.grid_id===s.grid_public_id):void 0,j=!s.is_trial&&F(s),y=i?Y(n?.version,K.license_action_activate_async):j,l=$("blocking",n,"license_action_activate_async"),d=()=>{const t=window.open(x,"_blank");t&&(t.opener=null)},u=Q({...re(),onSuccess:t=>{a(t.paddle_price_id),b({transactionId:t.transaction_id,customerEmail:f?.email,onCompleted:()=>{a(void 0),C.success("Payment received",{description:"Your license will update shortly."})},onClosed:()=>{a(void 0)},onError:()=>{a(void 0),C.error("Checkout failed",{description:"Please try again."})}})},onError:t=>{console.error("Failed to create checkout session",{detail:t?.response?.data,err:t}),C.error("Failed to start checkout",{description:"Please try again."})}}),o=(t,L)=>{if(!y)return;const O=t.prices.find(z=>z.cadence===L);O&&u.mutate({paddlePriceId:O.paddle_price_id,cadence:L,licenseId:s.public_id})},v=u.isPending?u.variables?.paddlePriceId:h,m=s.grid_name?.trim()||"grid",P=F(s)?null:je(s,r.packages),E=P!==null;return e.jsxs("div",{className:"flex flex-col gap-6 p-6",children:[e.jsxs("div",{className:"flex items-end justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"size-6"}),e.jsx("h1",{className:"text-2xl font-semibold",children:"Windows plans"})]}),e.jsx("p",{className:"text-base text-muted-foreground",children:E?"View your current plan and available options":`Select the plan that best fits this ${m}`})]}),e.jsx(pe,{value:c,onValueChange:t=>p(t),children:e.jsxs(xe,{variant:"base",children:[e.jsx(A,{value:"monthly",children:"Monthly"}),e.jsx(A,{value:"yearly",children:"Yearly (13% off)"})]})})]}),i&&!y&&l&&e.jsx(ye,{gridId:n?.grid_id??s.public_id,tier:"blocking",version:l,dismissable:!1}),e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[r.packages.map(t=>e.jsx(Pe,{pkg:t,cadence:c,isCurrent:t.package_key===P,hasCurrentPlan:E,onTalkToSales:d,onBuy:o,pendingPriceId:v,buyDisabled:!y},t.package_key)),e.jsx(Ee,{onTalkToSales:d})]}),e.jsx(Le,{onTalkToSales:d})]})}const we=1e4;function M(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-4xl font-bold",children:"404"}),e.jsx("p",{className:"text-muted-foreground",children:"page not found"})]})})}function B(){return e.jsx("div",{className:"flex h-full items-center justify-center",role:"status","aria-label":"Loading Windows plans",children:e.jsx("div",{className:"border-muted-foreground
1/40 border-t-foreground h-8 w-8 animate-spin rounded-full border-2","aria-hidden":"true"})})}function Re({onRetry:s}){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[e.jsx("p",{className:"text-muted-foreground",children:"Something went wrong loading plans."}),e.jsx(N,{onClick:s,children:"Try again"})]})})}function Ae(s){return be(s,te)}function os(){Ce("Incredibuild | Windows plans");const{licenseId:s}=X.useParams(),r=Z(ve),{isTrusted:c}=ee(),{data:p}=H({...se(),refetchInterval:Ae(c)}),{data:x,isPending:b,isFetching:f,isError:h,error:a,refetch:g}=U({...ne(),enabled:r===!0}),[i,n]=_.useState(!1),[j,y]=_.useState(0);_.useEffect(()=>{if(r!==!0||!f){n(!1);return}const o=setTimeout(()=>n(!0),we);return()=>clearTimeout(o)},[r,f,j]);const l=h||i,d=()=>{n(!1),y(o=>o+1),g()};if(_.useEffect(()=>{l&&(console.error("Billing catalogue fetch failed",{error:a,timedOut:i}),C.error("Failed to load plans",{description:"Please try again."}))},[l,a,i]),r===void 0)return e.jsx(B,{});if(!r)return e.jsx(M,{});if(l)return e.jsx(Re,{onRetry:d});if(b)return e.jsx(B,{});if(!x)return e.jsx(M,{});const u=p.find(o=>o.public_id===s);return u?e.jsx(Oe,{license:u,catalogue:x}):e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"License not found."})})}export{os as component,Ae as plansLicensesRefetchInterval};
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.