'use client';
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("@heroui/react"),A=require("framer-motion"),J=require("./sign-in-form.cjs"),K=require("../../../hooks/use-config.cjs"),Q=require("../../../hooks/use-theme.cjs");function X({variant:F="shadow",className:y="",padding:a="lg",radius:v="lg",shadow:p="md",isBlurred:N=!1,methods:S=["password","oauth","magic-link"],email:C,organizationId:$,redirectUrl:q,onSuccess:w,onError:h,title:e,subtitle:l,size:I="md",showBranding:b=!0,disabled:T=!1,footer:u,header:D,backgroundImage:f,backgroundGradient:x,animated:M=!0,maxWidth:n=400,centered:o=!1,fullHeight:O=!1,showOrganizationBranding:P=!0,cardHeader:r,cardFooter:g,hideCardHeader:t=!1,hideCardFooter:j=!1}){const{components:L,organizationSettings:R}=K.useConfig(),{getColorValue:Y}=Q.useTheme(),V=L.SignInCard;if(V)return s.jsx(V,{variant:F,className:y,padding:a,radius:v,shadow:p,isBlurred:N,methods:S,email:C,organizationId:$,redirectUrl:q,onSuccess:w,onError:h,title:e,subtitle:l,size:I,showBranding:b,disabled:T,footer:u,header:D,backgroundImage:f,backgroundGradient:x,animated:M,maxWidth:n,centered:o,fullHeight:O,showOrganizationBranding:P,cardHeader:r,cardFooter:g,hideCardHeader:t,hideCardFooter:j});const U={hidden:{opacity:0,y:20,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{duration:.3,ease:"easeOut"}}},c={};f&&(c.backgroundImage=`url(${f})`,c.backgroundSize="cover",c.backgroundPosition="center"),x&&(c.background=x),n&&(c.maxWidth=typeof n=="number"?`${n}px`:n);const m=P&&R?.branding,z=[o?"flex items-center justify-center min-h-screen p-4":"",O?"h-full":""].filter(Boolean).join(" "),k=s.jsxs(i.Card,{className:`${y} ${o?"w-full":""}`,style:c,shadow:p,radius:v,isBlurred:N,children:[!t&&(r||e||l||m)&&s.jsx(i.CardHeader,{className:`flex flex-col items-center text-center gap-2 p-${a}`,children:r||s.jsxs(s.Fragment,{children:[m?.logoUrl&&s.jsx("img",{src:m.logoUrl,alt:"Organization Logo",className:"h-12 w-auto mb-2"}),e&&s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:e}),l&&s.jsx("p",{className:"text-default-500 text-sm max-w-sm",children:l}),D]})}),!t&&(r||e||l||m)&&!j&&s.jsx(i.Divider,{}),s.jsx(i.CardBody,{className:`p-${a}`,children:s.jsx(J.SignInForm,{methods:S,email:C,organizationId:$,redirectUrl:q,onSuccess:w,onError:h,title:t?e:void 0,subtitle:t?l:void 0,size:I,showBranding:t?b:!1,disabled:T,variant:"minimal",className:"space-y-4"})}),!j&&(g||u)&&s.jsxs(s.Fragment,{children:[s.jsx(i.Divider,{}),s.jsx(i.CardFooter,{className:`p-${a} text-center`,children:g||u})]})]}),B=M?s.jsx(A.motion.div,{initial:"hidden",animate:"visible",variants:U,style:{maxWidth:n},className:o?"w-full":"",children:k}):s.jsx("div",{style:{maxWidth:n},className:o?"w-full":"",children:k});return o?s.jsx("div",{className:z,children:B}):B}exports.SignInCard=X;
//# sourceMappingURL=sign-in-card.cjs.map
