"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("../../../../utils/cn/cn.cjs.js"),n=require("../../../../utils/formatUnits/formatUnits.cjs.js"),t=require("../../../../src/modules/IndividualProductCard/components/PlanCard/planCard.module.css"),d=require("../../../../components/Label/Label.cjs.js"),m=require("../../../../components/RadioButton/RadioButton.cjs.js"),a=require("../../../../components/Typography/Typography.cjs.js"),o=require("../../../../components/Icon/Icon.cjs.js"),c=require("../../../../components/Icon/constants.cjs.js"),u=({plan:e,isActive:i,onSelect:l})=>s.jsxs("button",{className:r.cn(t.root,i&&t.active),onClick:()=>l(e.id),children:[e.featured&&s.jsx(d.Label,{color:e.featuredLabelColor||"black",className:t.label,size:"sm",children:"Most popular"}),s.jsxs("div",{className:t.planContainer,children:[s.jsxs("div",{className:t.planInfo,children:[s.jsx(m.RadioButton,{checked:i}),s.jsxs("div",{className:t.planDetails,children:[s.jsx(a.Typography,{as:"h4",defaultVariant:"bodySm",emphasis:!0,align:"left",children:e.label}),!!e.savingsPercentage&&s.jsxs(a.Typography,{as:"p",defaultVariant:"labelXs",weight:"regular",className:t.savings,children:["Save ",e.savingsPercentage,"%"]})]})]}),s.jsxs("div",{className:t.priceDetails,children:[!!e.monthlyPrice&&s.jsxs(a.Typography,{as:"p",defaultVariant:"bodySm",weight:"regular",className:t.description,children:[n.formatUnits(e.monthlyPrice,"usd",0),"/mo"]}),s.jsxs("div",{className:r.cn(t.priceContainer),children:[e.price!==e.totalPrice&&s.jsx(a.Typography,{as:"p",defaultVariant:"labelXs",weight:"regular",className:t.totalPrice,children:n.formatUnits(e.price,"usd",0)}),s.jsx(a.Typography,{as:"p",defaultVariant:!e.monthlyPrice&&e.price===e.totalPrice?"bodySm":"labelXs",className:r.cn(t.price,{[t.description]:!e.monthlyPrice&&e.price===e.totalPrice}),children:n.formatUnits(e.totalPrice,"usd",0)})]})]})]}),!!e.duration&&e.duration!=="one-time"&&s.jsx("div",{className:r.cn(t.benefitsContainer,i&&t.benefitsActive),children:s.jsxs("div",{className:t.benefitsContent,children:[s.jsxs("div",{className:t.benefit,children:[s.jsx(o.Icon,{name:c.EIconName.ARROW_RETURN,className:t.benefitIcon}),s.jsxs(a.Typography,{as:"p",defaultVariant:"bodyXs",children:["Delivered every"," ",e.durationAmount&&e.durationAmount>1?`${e.durationAmount} months`:"month"]})]}),s.jsxs("div",{className:t.benefit,children:[s.jsx(o.Icon,{name:c.EIconName.CALENDAR,className:t.benefitIcon}),s.jsx(a.Typography,{as:"p",defaultVariant:"bodyXs",children:"Modify or cancel anytime"})]})]})})]});exports.PlanCard=u;
