@homlista-devs/ui 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,5 +93,5 @@
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const _s=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Je=D("x",_s),je=j.forwardRef(({className:e,containerClassName:r,labelClassName:s,variant:o,selectSize:a,label:n,helperText:l,error:i,required:c,options:m,placeholder:u,id:d,...x},N)=>{const h=j.useId(),v=d||h,g=`${v}-helper`,f=`${v}-error`,P=i?"error":o,C=i||l;return t.jsxs("div",{className:p("w-full",r),children:[n&&t.jsx("label",{htmlFor:v,className:p(as({variant:P,required:c}),s),children:n}),t.jsxs("div",{className:"relative",children:[t.jsxs("select",{id:v,ref:N,className:p(os({variant:P,selectSize:a}),"pr-10",e),"aria-invalid":i?"true":"false","aria-describedby":C?i?f:g:void 0,...x,children:[u&&t.jsx("option",{value:"",disabled:!0,children:u}),m.map(M=>t.jsx("option",{value:M.value,disabled:M.disabled,children:M.label},M.value))]}),t.jsx("div",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:t.jsx(ys,{className:"h-4 w-4"})})]}),C&&t.jsx("p",{id:i?f:g,className:ns({variant:P}),role:i?"alert":void 0,children:C})]})});je.displayName="Select";const Vs=e=>{switch(e){case"sm":return"p-4";case"md":return"p-6";case"lg":return"p-8";default:return"p-0"}},ke=({children:e,header:r,sidebar:s,footer:o,padding:a="md"})=>{const n=p("min-h-screen flex flex-col"),l=p("bg-card border-b border-border z-10"),i=p("flex flex-1"),c=p("w-70 bg-card border-r border-border p-6"),m=p("flex-1 flex flex-col"),u=p("flex-1 mx-auto w-full max-w-7xl",Vs(a));return t.jsxs("div",{className:n,children:[r&&t.jsx("header",{className:l,children:r}),t.jsxs("div",{className:i,children:[s&&t.jsx("aside",{className:c,children:s}),t.jsx("div",{className:m,children:t.jsx("main",{className:u,children:e})})]}),o&&t.jsx("footer",{className:"bg-card border-t border-border mt-auto",children:o})]})},Ds=({children:e,header:r,sidebar:s})=>t.jsx(ke,{header:r,sidebar:s,padding:"lg",children:t.jsx("div",{className:"max-w-screen-2xl",children:e})}),Bs=({children:e,title:r,subtitle:s})=>t.jsx(ke,{padding:"lg",children:t.jsxs("div",{className:"max-w-md mx-auto",children:[t.jsxs("div",{className:"text-center mb-8",children:[r&&t.jsx(I,{variant:"h2",className:"mb-2",children:r}),s&&t.jsx(I,{variant:"body",color:"muted",children:s})]}),e]})}),Hs=({children:e,header:r,footer:s})=>t.jsx(ke,{header:r,footer:s,padding:"none",children:e}),gt=j.forwardRef(({message:e="No entities found",icon:r,action:s,className:o},a)=>t.jsxs("div",{ref:a,role:"status","aria-live":"polite",className:p("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[r&&t.jsx("div",{className:"mb-4 text-4xl opacity-50","aria-hidden":"true",children:r}),t.jsx(I,{variant:"body-lg",className:"text-muted-foreground mb-4",children:e}),s&&t.jsx(q,{variant:"outline",onClick:s.onClick,children:s.label})]}));gt.displayName="EntityDirectoryEmptyState";const bt=j.forwardRef(({error:e,onRetry:r,className:s},o)=>{const a=typeof e=="string"?e:e.message;return t.jsxs("div",{ref:o,role:"alert","aria-live":"assertive",className:p("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[t.jsx("div",{className:"mb-4 text-4xl","aria-hidden":"true",children:"⚠️"}),t.jsx(I,{variant:"body-lg",className:"text-destructive mb-2 font-semibold",children:"Error"}),t.jsx(I,{variant:"body",className:"text-muted-foreground mb-4",children:a}),r&&t.jsx(q,{variant:"outline",onClick:r,children:"Try Again"})]})});bt.displayName="EntityDirectoryErrorState";const yt=j.forwardRef(({title:e,description:r,className:s},o)=>t.jsxs("div",{ref:o,className:p("space-y-1.5",s),children:[t.jsx(I,{variant:"h2",className:"font-bold",children:e}),r&&t.jsx(I,{variant:"body",className:"text-muted-foreground",children:r})]}));yt.displayName="EntityDirectoryHeader";const vt=j.forwardRef(({entity:e,categories:r,showIcon:s=!0,showCategoryBadge:o=!0,showMetric:a=!0,compact:n=!1,className:l},i)=>{const c=r?.find(x=>x.id===e.categoryId),m=!!e.onClick,u=()=>{e.onClick&&!e.disabled&&e.onClick()},d=x=>{m&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u())};return t.jsxs("div",{ref:i,role:m?"button":"listitem",tabIndex:m&&!e.disabled?0:void 0,onClick:u,onKeyDown:d,"aria-disabled":e.disabled,className:p("flex items-center gap-4 border-b border-border transition-colors",n?"p-3":"p-4",m&&!e.disabled&&"cursor-pointer hover:bg-accent/50 focus-visible:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e.disabled&&"opacity-50 cursor-not-allowed",l),children:[s&&t.jsx("div",{className:p("flex-shrink-0 flex items-center justify-center bg-muted rounded-full",n?"w-8 h-8 text-lg":"w-10 h-10 text-xl"),"aria-hidden":"true",children:typeof e.icon=="string"?t.jsx("span",{children:e.icon}):e.icon?j.createElement(e.icon):t.jsx("span",{className:"text-muted-foreground",children:"•"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(I,{variant:n?"body-sm":"body",className:"font-semibold truncate",children:e.title}),e.subtitle&&t.jsx(I,{variant:n?"caption":"body-sm",className:"text-muted-foreground truncate",children:e.subtitle})]}),o&&c&&t.jsx(we,{variant:"secondary",size:n?"sm":"default",className:"flex-shrink-0 bg-foreground text-background hover:bg-foreground/90","aria-label":`Category: ${c.label}`,children:c.label}),a&&e.metricValue&&t.jsxs("div",{className:"flex-shrink-0 text-right min-w-[4rem]",children:[t.jsx(I,{variant:n?"body-sm":"body",className:"font-medium",children:e.metricValue}),e.metricLabel&&t.jsx(I,{variant:"caption",className:"text-muted-foreground",children:e.metricLabel})]})]})});vt.displayName="EntityDirectoryListItem";const wt=j.forwardRef(({columns:e,showIcon:r,sort:s,onSortChange:o,compact:a,className:n},l)=>{const i=d=>{if(!o)return;const x=s?.column===d&&s?.direction==="asc"?"desc":"asc";o({column:d,direction:x})},c=d=>{i(d)},m=(d,x)=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i(x))},u=d=>d!=="title"&&d!=="metric"?null:!s||s.column!==d?t.jsx("span",{className:"ml-1 text-muted-foreground opacity-50","aria-hidden":"true",children:"⇅"}):t.jsx("span",{className:"ml-1","aria-hidden":"true",children:s.direction==="asc"?"↑":"↓"});return t.jsxs("div",{ref:l,role:"row",className:p("flex items-center gap-4 bg-background border-b border-border font-medium text-sm text-muted-foreground",a?"px-3 py-2":"px-4 py-3",n),children:[r&&t.jsx("div",{className:a?"w-8":"w-10"}),e.map(d=>{const x=d.sortable&&(d.key==="title"||d.key==="metric"),N=s?.column===d.key;return t.jsxs("div",{role:"columnheader","aria-sort":N?s?.direction==="asc"?"ascending":"descending":void 0,className:p(d.key==="title"&&"flex-1",d.key==="category"&&"w-40",d.key==="metric"&&"w-24 text-right",d.align==="center"&&"text-center",d.align==="right"&&"text-right",x&&"cursor-pointer hover:text-foreground transition-colors select-none",N&&"text-foreground"),style:d.width?{width:d.width}:void 0,onClick:x&&(d.key==="title"||d.key==="metric")?()=>c(d.key):void 0,tabIndex:x?0:void 0,onKeyDown:x&&(d.key==="title"||d.key==="metric")?h=>m(h,d.key):void 0,children:[d.label,x&&u(d.key)]},d.key)})]})});wt.displayName="EntityDirectoryTableHeader";const jt=j.forwardRef(({entities:e,categories:r,showIcons:s=!0,showCategoryBadges:o=!0,showMetric:a=!0,metricLabel:n,sortable:l=!1,sort:i,onSortChange:c,compact:m=!1,renderItem:u,className:d},x)=>{const N=[{key:"title",label:n?"Nombre":"Name",sortable:l},...o?[{key:"category",label:"Categoría",sortable:!1}]:[],...a&&n?[{key:"metric",label:n,sortable:l,align:"right"}]:[]];return t.jsxs("div",{ref:x,role:"table","aria-label":"Entity directory",className:p("border border-border rounded-lg overflow-hidden",d),children:[t.jsx(wt,{columns:N,showIcon:s,sort:i,onSortChange:c,compact:m}),t.jsx("div",{role:"rowgroup",children:e.map(h=>u?t.jsx(j.Fragment,{children:u(h)},h.id):t.jsx(vt,{entity:h,categories:r,showIcon:s,showCategoryBadge:o,showMetric:a,compact:m},h.id))})]})});jt.displayName="EntityDirectoryList";const kt=j.forwardRef(({rows:e=5,className:r},s)=>t.jsxs("div",{ref:s,role:"status","aria-live":"polite","aria-label":"Loading entities",className:p("space-y-3",r),children:[Array.from({length:e}).map((o,a)=>t.jsxs("div",{className:"flex items-center gap-4 p-4 border border-border rounded-lg animate-pulse",children:[t.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex-shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),t.jsx("div",{className:"h-3 bg-muted rounded w-1/2"})]}),t.jsx("div",{className:"h-6 bg-muted rounded-full w-24 flex-shrink-0"}),t.jsx("div",{className:"h-4 bg-muted rounded w-16 flex-shrink-0"})]},a)),t.jsx("span",{className:"sr-only",children:"Loading..."})]}));kt.displayName="EntityDirectoryLoadingState";const Nt=j.forwardRef(({value:e,onChange:r,placeholder:s="Search entities...",className:o},a)=>t.jsxs("div",{className:p("relative",o),children:[t.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:t.jsx("svg",{className:"w-4 h-4 text-muted-foreground","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",children:t.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})})}),t.jsx("input",{ref:a,type:"search",value:e,onChange:n=>r(n.target.value),placeholder:s,className:p("block w-full pl-10 pr-3 py-2 border border-input rounded-md","bg-background text-foreground placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent","transition-colors"),"aria-label":"Search entities"}),e&&t.jsx("button",{type:"button",onClick:()=>r(""),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}));Nt.displayName="EntityDirectorySearchFilter";const Ct=j.forwardRef(({entities:e,categories:r,title:s,description:o,activeCategory:a,onCategoryChange:n,showCategoryCount:l,getCategoryCount:i,enableSearch:c=!1,searchQuery:m="",onSearchChange:u,searchPlaceholder:d,sortable:x=!1,sort:N,onSortChange:h,showIcons:v=!0,showCategoryBadges:g=!0,showMetric:f=!0,metricLabel:P,compact:C=!1,loading:M=!1,error:S,emptyMessage:R,onRetry:T,emptyState:w,errorState:L,loadingState:K,renderItem:re,className:X,style:se},Y)=>{const H=r&&r.length>0,B=!M&&!S&&e.length===0,W=!M&&!!S;return t.jsxs("div",{ref:Y,className:p("space-y-6",X),style:se,children:[t.jsx(yt,{title:s,description:o}),H&&n&&t.jsx($e,{categories:r,activeCategory:a,onCategoryChange:n,showCount:l,getCategoryCount:i}),c&&u&&t.jsx(Nt,{value:m,onChange:u,placeholder:d}),M&&(K||t.jsx(kt,{})),W&&(L||t.jsx(bt,{error:S,onRetry:T})),B&&(w||t.jsx(gt,{message:R})),!M&&!W&&!B&&t.jsx(jt,{entities:e,categories:r,showIcons:v,showCategoryBadges:g,showMetric:f,metricLabel:P,sortable:x,sort:N,onSortChange:h,compact:C,renderItem:re})]})});Ct.displayName="EntityDirectory";function Gs(e){return{variant:e.variant||"minimal",logo:e.logo,navigationItems:e.navigationItems||[],loginButtonText:e.loginButtonText||"Iniciar Sesión",showMobileMenu:e.showMobileMenu??!0}}const Mt=E.forwardRef(({variant:e,logo:r,navigationItems:s,loginButtonText:o,showMobileMenu:a,className:n,logoClassName:l,navigationClassName:i,navigationItemClassName:c,loginButtonClassName:m,mobileMenuButtonClassName:u,renderNavLink:d,id:x,"aria-label":N},h)=>{const[v,g]=E.useState(!1),f=Gs({variant:e,logo:r,navigationItems:s,loginButtonText:o,showMobileMenu:a}),P=f.variant==="modern",C=f.variant==="luxury",M=C&&f.showMobileMenu,S=v?M?"Close navigation panel":"Close menu":M?"Open navigation panel":"Open menu",R=({item:T,className:w,onClick:L})=>d?d({item:T,children:T.label,className:w,onClick:L}):t.jsx("a",{href:T.href,className:w,onClick:L,children:T.label});return t.jsxs(t.Fragment,{children:[t.jsxs("header",{ref:h,id:x,role:"banner","aria-label":N||"Site header",className:p("flex items-center justify-between relative w-full space-x-4",C?"px-16 py-2":"px-6 py-1",n),children:[f.logo&&t.jsx("div",{className:p("shrink-0 w-2/3 md:w-1/5 text-ellipsis overflow-hidden text-nowrap",P&&"[&_img]:brightness-0 [&_img]:saturate-0 [&_svg]:brightness-0 [&_svg]:saturate-0"),children:typeof f.logo=="string"?t.jsx("p",{className:p("leading-normal",C?"font-heading text-xl font-normal uppercase tracking-[0.04em]":"font-black tracking-wider text-xl",P?"text-black":"text-white",l),children:f.logo}):f.logo}),f.navigationItems.length>0&&t.jsx("nav",{className:p("hidden md:flex items-center max-w-fit",C?"ml-auto gap-4":P?"gap-4 bg-transparent border-0 shadow-none":"gap-4 px-6 py-2 bg-white border border-gray-200 rounded-full shadow-sm",i),"aria-label":"Main navigation",children:f.navigationItems.map((T,w)=>t.jsxs("div",{className:"flex items-center gap-4",children:[w>0&&t.jsx("div",{className:"flex items-center justify-center h-6 w-0","aria-hidden":"true",children:t.jsx("div",{className:"h-0 w-6 rotate-90",children:t.jsx("div",{className:p("h-px w-full",C?"bg-white":"bg-gray-200")})})}),R({item:T,className:p(C?"font-body text-sm font-normal uppercase tracking-[0.05em] leading-5 text-white hover:text-white/80 transition-colors":"text-gray-900 text-sm font-medium leading-5 hover:text-black transition-colors text-ellipsis overflow-hidden text-nowrap",c)})]},T.id))}),t.jsxs("div",{className:p("flex items-center shrink-0 w-1/5","gap-6 p-4"),children:[t.jsx("button",{type:"button",className:p("hidden md:flex items-center justify-center px-4 py-2 text-sm font-medium leading-5 transition-colors",C?"font-body h-9 bg-white text-zinc-900 border border-zinc-200 rounded-none hover:bg-zinc-100":P?"h-10 bg-zinc-900 text-white border-0 rounded-md hover:bg-zinc-800":"h-9 bg-white border border-gray-200 text-zinc-900 rounded-full hover:bg-zinc-200",m),children:f.loginButtonText}),f.showMobileMenu&&t.jsx("button",{type:"button",onClick:()=>g(!v),"aria-label":S,"aria-expanded":v,className:p("flex md:hidden items-center justify-center px-3 py-2 bg-white transition-colors",C?"border border-zinc-200 text-zinc-900 hover:bg-zinc-100":P?"rounded-xl border border-zinc-200 hover:bg-gray-50":"rounded-full hover:bg-gray-50",u),children:v?t.jsx(Je,{className:p("text-gray-900",C?"h-[15px] w-[15px]":"h-4 w-4")}):t.jsx(Ls,{className:p("text-gray-900",C?"h-[15px] w-[15px]":"h-4 w-4")})})]})]}),v&&f.showMobileMenu&&t.jsxs("div",{className:"fixed inset-0 z-40 md:hidden",role:"dialog","aria-modal":"true","aria-label":"Mobile menu",children:[t.jsx("div",{className:"fixed inset-0 bg-black/50",onClick:()=>g(!1),"aria-hidden":"true"}),t.jsx("div",{className:"fixed right-0 top-0 h-full w-full max-w-sm bg-white shadow-xl",children:t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx("div",{className:"flex items-center justify-end px-6 py-4",children:t.jsx("button",{type:"button",onClick:()=>g(!1),"aria-label":"Close menu",className:"flex h-10 w-10 items-center justify-center rounded-full bg-zinc-100 text-zinc-900 hover:bg-zinc-200",children:t.jsx(Je,{className:"h-5 w-5"})})}),t.jsx("nav",{className:"flex-1 overflow-y-auto px-6 py-4",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[f.navigationItems.map(T=>t.jsx("div",{children:R({item:T,className:"block text-base font-medium text-zinc-900 hover:text-zinc-600 transition-colors py-2",onClick:()=>g(!1)})},T.id)),t.jsx("div",{className:"mt-4 pt-4 border-t border-zinc-200",children:t.jsx("button",{type:"button",className:"w-full h-12 flex items-center justify-center rounded-full bg-zinc-100 text-zinc-900 font-semibold",children:f.loginButtonText})})]})})]})})]})]})});Mt.displayName="Header";const Ws=e=>({content:e.content,theme:e.theme||{},variant:e.variant||"modern",layout:e.layout||"centered"}),Us={center:"object-center",top:"object-top",bottom:"object-bottom",left:"object-left",right:"object-right","left-top":"object-left-top","left-bottom":"object-left-bottom","right-top":"object-right-top","right-bottom":"object-right-bottom"},St=E.forwardRef(({content:e,theme:r,variant:s="modern",layout:o="centered",searchForm:a,logo:n,navigation:l,className:i,id:c,"aria-label":m},u)=>{const d=Ws({content:e,theme:r,variant:s,layout:o}),x=d.variant==="modern",N=d.variant==="modern"||d.variant==="luxury";return t.jsx("section",{ref:u,id:c,"aria-label":m||"Hero banner",className:p("relative",x&&"px-4 lg:px-8",i),children:t.jsxs("div",{className:p("relative flex min-h-[600px] flex-col",x?"lg:min-h-[85vh] rounded-2xl overflow-hidden":"lg:min-h-screen","bg-gradient-to-br from-zinc-900 to-zinc-800","text-white"),children:[d.theme.backgroundImage&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute inset-0 z-0",children:t.jsx("img",{src:d.theme.backgroundImage,alt:"",className:p("h-full w-full object-cover",d.theme.backgroundPosition&&Us[d.theme.backgroundPosition]||"object-center"),loading:"eager",decoding:"async"})}),t.jsx("div",{className:"absolute inset-0 z-[1] bg-gradient-to-b from-black/40 via-black/40 via-[68.25%] to-transparent"})]}),l&&t.jsx("div",{className:"relative z-10",children:l}),t.jsx("div",{className:"relative z-10 flex flex-col items-center justify-center px-4 py-12 lg:flex-1 lg:py-24",children:t.jsxs("div",{className:"w-full max-w-6xl text-center",children:[d.variant==="minimal"&&n&&t.jsx("div",{className:"mb-8 flex items-center justify-center",children:n}),d.content.title&&t.jsxs("div",{className:"mb-16 space-y-8",children:[t.jsx("h1",{className:"text-4xl font-bold tracking-wide text-white sm:text-5xl lg:text-6xl",children:d.content.title}),d.content.subtitle&&t.jsx("p",{className:"mt-4 text-xl text-white/90 sm:text-2xl",children:d.content.subtitle})]}),d.variant==="minimal"&&d.content.metrics&&d.content.metrics.length>0&&t.jsx("div",{className:"mb-16",children:t.jsx("div",{className:"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3",children:d.content.metrics.map((h,v)=>t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"mb-2 text-3xl font-bold text-white md:text-4xl",children:h.value}),t.jsx("div",{className:"text-sm text-white/80 md:text-base",children:h.label})]},v))})}),a&&t.jsx("div",{className:"relative z-20 mx-auto w-full max-w-4xl",children:a})]})}),N&&d.content.metrics&&d.content.metrics.length>0&&t.jsx("div",{className:"absolute bottom-0 right-0 z-10 hidden md:block",children:t.jsx("div",{className:"flex h-20 w-full max-w-4xl items-center gap-6 rounded-tl-2xl bg-white px-8 py-4 text-zinc-900 md:h-24 md:gap-12 md:px-12 md:py-6",children:d.content.metrics.map((h,v)=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-xl font-semibold leading-tight md:text-2xl",children:h.value}),t.jsx("div",{className:"text-xs leading-tight text-zinc-600 md:text-sm",children:h.label})]},v))})}),d.variant==="minimal"&&t.jsx("div",{className:"relative z-10 pb-8",children:t.jsx("div",{className:"flex justify-center",children:t.jsx("div",{className:"h-1 w-8 rounded-full bg-white/30","aria-hidden":"true"})})})]})})});St.displayName="HeroBanner";const Tt=[{value:"15-years",label:"15 años fijos",years:15},{value:"20-years",label:"20 años fijos",years:20},{value:"30-years",label:"30 años fijos",years:30},{value:"40-years",label:"40 años fijos",years:40}],qs=Tt.map(e=>({value:e.value,label:e.label})),ye={propertyPrice:2e7,downPayment:2e5,loanProgram:"30-years",interestRate:6.5},Se={principalAndInterest:"#0a2540",propertyTax:"#4da6c7",hoaFees:"#7fc9e3"},Pt=j.forwardRef(({initialPropertyPrice:e=ye.propertyPrice,initialDownPayment:r=ye.downPayment,initialLoanProgram:s=ye.loanProgram,initialInterestRate:o=ye.interestRate,showPropertyTax:a=!1,showHoaFees:n=!1,className:l,onCalculationChange:i},c)=>{const[m,u]=j.useState(e),[d,x]=j.useState(r),[N,h]=j.useState(s),[v,g]=j.useState(o),[f,P]=j.useState(0),[C,M]=j.useState(0),S=j.useMemo(()=>{const w=Tt.find(K=>K.value===N)?.years||30;return rt({propertyPrice:m,downPayment:d,loanTerm:w,interestRate:v,propertyTax:a?f:void 0,hoaFees:n?C:void 0})},[m,d,N,v,f,C,a,n]);j.useEffect(()=>{i?.(S)},[S,i]);const R=j.useMemo(()=>{const T=[{label:"Principal e Intereses",value:S.breakdown.principalAndInterest,color:Se.principalAndInterest}];return a&&S.breakdown.propertyTax>0&&T.push({label:"Impuesto Predial",value:S.breakdown.propertyTax,color:Se.propertyTax}),n&&S.breakdown.hoaFees>0&&T.push({label:"Cuota HOA",value:S.breakdown.hoaFees,color:Se.hoaFees}),T},[S,a,n]);return t.jsx("div",{ref:c,className:p("w-full",l),children:t.jsx(Ae,{padding:"lg",className:"w-full",children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx(I,{variant:"h2",className:"mb-2",children:"Calculadora de Hipotecas"}),t.jsx(I,{variant:"body",color:"secondary",className:"max-w-2xl",children:"Calcule el pago mensual de su hipoteca, incluyendo capital e intereses, impuestos prediales y cuota de la asociación de propietarios. Ajuste los valores para obtener una tasa más precisa."})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsx(te,{label:"Precio de la propiedad",type:"number",value:m,onChange:T=>u(Number(T.target.value)),suffix:"MXN",min:0,step:1e4}),t.jsx(te,{label:"Enganche",type:"number",value:d,onChange:T=>x(Number(T.target.value)),suffix:"MXN",min:0,step:1e4}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(je,{label:"Programa de préstamos",value:N,onChange:T=>h(T.target.value),options:qs}),t.jsx(te,{label:"Tasa de interés",type:"number",value:v,onChange:T=>g(Number(T.target.value)),suffix:"%",min:0,max:100,step:.1})]}),a&&t.jsx(te,{label:"Impuesto predial mensual",type:"number",value:f,onChange:T=>P(Number(T.target.value)),suffix:"MXN",min:0,step:100}),n&&t.jsx(te,{label:"Cuota HOA mensual",type:"number",value:C,onChange:T=>M(Number(T.target.value)),suffix:"MXN",min:0,step:100})]}),t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx(Le,{segments:R,size:320,innerRadiusRatio:.65,centerContent:t.jsxs("div",{className:"text-center",children:[t.jsx(I,{variant:"h1",className:"font-bold mb-1",children:ae(S.totalMonthlyPayment)}),t.jsx(I,{variant:"body-sm",color:"secondary",children:"Tu Pago"})]}),showLegend:!0,legendPosition:"bottom"}),t.jsxs("div",{className:"mt-6 text-center space-y-1",children:[t.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-success",children:[t.jsx(Fs,{className:"h-4 w-4"}),t.jsx("span",{className:"font-medium",children:"Trending up by 5.2% this month"})]}),t.jsx(I,{variant:"caption",color:"secondary",children:"Showing total visitors for the last 6 months"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 pt-4 border-t",children:[t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Monto del préstamo"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.loanPrincipal)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Pago mensual"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.monthlyPayment)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Interés total"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.totalInterest)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Total a pagar"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.totalAmount)})]})]})]})})})});Pt.displayName="MortgageCalculator";const Ks=(e,r,s)=>{if(r)return"text-white";if(s)switch(e.type){case"Venta":return"bg-stone-950 text-white";case"Desarrollo":return"bg-cyan-600 text-white";case"Renta":return"bg-cyan-950 text-white";case"Remate":return"bg-orange-700 text-white";default:return"bg-stone-950 text-white"}switch(e.variant||Xs(e.type)){case"primary":return"bg-primary text-primary-foreground";case"secondary":return"bg-secondary text-secondary-foreground";case"success":return"bg-success text-success-foreground";case"warning":return"bg-warning text-warning-foreground";case"error":return"bg-error text-error-foreground";case"info":return"bg-info text-info-foreground";default:return"bg-secondary text-secondary-foreground"}},Xs=e=>{switch(e){case"Venta":return"primary";case"Desarrollo":return"success";case"Renta":return"info";case"Remate":return"warning";default:return"secondary"}},Zs=({property:e,className:r,onLike:s,onImageClick:o,showLikeButton:a=!0,variant:n="default",badgeColors:l})=>{const[i,c]=E.useState(0),[m,u]=E.useState(!1),[d,x]=E.useState(!1),N=V=>{V.preventDefault(),V.stopPropagation();const _=!m;u(_),s?.(e.id,_)},h=V=>{V.preventDefault(),V.stopPropagation(),o?.(i,e.id)},v=(V,_)=>!V||!_?"Price not available":`$${V.toLocaleString()} ${_}`,g=n==="compact",f=n==="minimal",P=p("relative overflow-hidden bg-card transition-all duration-300 ease-out cursor-pointer",g?"rounded-xl hover:shadow-lg border px-4 shadow-md":f?"rounded-2xl w-[454px] flex flex-col gap-4":"rounded-2xl hover:-translate-y-1 hover:shadow-xl shadow-md",r),C=p("relative overflow-hidden",g?"rounded-xl px-4 shadow-md":f?"rounded-2xl":""),M=p("w-full h-full object-cover",g?"":f?"rounded-2xl":"transition-transform duration-300 hover:scale-105"),S=p("absolute z-10 flex flex-wrap gap-2",g?"top-3 left-3":"top-4 left-4"),R=p("font-semibold",g?"rounded-full px-3 py-1 text-xs":f?"rounded-full px-3 h-7 flex items-center justify-center text-base":"px-2 py-1 rounded-lg font-medium uppercase tracking-wide text-xs"),T=p("absolute z-10 cursor-pointer transition-all duration-200",g?"top-3 right-3 p-1 shadow-md rounded-full":f?"top-4 right-4 w-7 h-7 flex items-center justify-center hover:scale-105":"top-4 right-4 bg-background/90 backdrop-blur-sm border border-border/20 text-foreground w-10 h-10 flex items-center justify-center rounded-full hover:bg-background hover:scale-105"),w=p("absolute left-1/2 -translate-x-1/2 flex z-10",f?"bottom-4 gap-2 p-4":"bottom-4 gap-1"),L=p("w-2 h-2 rounded-full border-none cursor-pointer transition-all duration-200 hover:scale-120"),K=p(g?"p-2":f?"flex flex-col gap-2":"p-6"),re=p("font-semibold text-foreground line-clamp-2 leading-tight",g?"text-base mb-2":f?"text-base":"text-lg font-bold mb-2"),X=p("font-bold",g?"text-lg text-primary mb-2":f?"text-lg text-foreground":"text-xl text-primary mb-2"),se=p("text-muted-foreground",g?"text-sm flex items-center gap-1 mb-4":f?"text-base":"text-base mb-4"),Y=p("flex items-center",g?"justify-between mt-3 mb-4":f?"gap-3":"gap-4 mb-4"),H=p("flex items-center gap-1 text-muted-foreground","text-sm"),B=p("text-sm text-muted-foreground line-clamp-2",g?"mt-2":""),k=!(e.images&&e.images.length>0)||d,ue=()=>t.jsxs("div",{className:"w-full h-full bg-gradient-to-br from-primary/10 via-primary/5 to-secondary/10 flex flex-col items-center justify-center gap-3",children:[t.jsx("div",{className:"rounded-full bg-primary/10 p-6",children:t.jsx(Ps,{size:g?32:48,className:"text-primary/40"})}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No image available"})]}),ce=t.jsxs("div",{className:P,children:[t.jsxs("div",{className:p(C,g?"h-52":f?"h-[481px]":"aspect-[4/3]"),children:[k?t.jsx(ue,{}):t.jsxs("div",{className:"relative w-full h-full","aria-hidden":"true",children:[t.jsx("img",{src:e.images[i],alt:e.title,className:M,onClick:o?h:void 0,onError:()=>x(!0)}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black/40 pointer-events-none rounded-2xl"})]}),t.jsx("div",{className:S,children:e.transactionTypes.map((V,_)=>{const A=l?.[V.type];return t.jsx("span",{className:p(R,Ks(V,A,f)),style:A?{backgroundColor:A}:void 0,children:V.type},_)})}),a&&t.jsx("button",{onClick:N,className:T,"aria-label":m?"Unlike property":"Like property",children:g?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:m?"red":"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:m?"red":"currentColor",className:"h-5 w-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733C11.285 4.876 9.623 3.75 7.688 3.75 5.099 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})}):t.jsx(Ss,{size:20,fill:m?"currentColor":"none",className:f?"text-white":m?"text-destructive":"",strokeWidth:f?1.5:2})}),!g&&!k&&e.images.length>1&&t.jsx("div",{className:w,children:e.images.map((V,_)=>t.jsx("button",{className:p(L,_===i?"bg-white":"bg-white/50"),onClick:A=>{A.preventDefault(),A.stopPropagation(),c(_)},"aria-label":`Go to image ${_+1}`,"aria-current":_===i},_))})]}),t.jsxs("div",{className:K,children:[t.jsx("h3",{className:re,children:e.title}),t.jsx("p",{className:X,children:v(e.price?.amount,e.price?.currency)}),t.jsxs("p",{className:se,children:[g&&t.jsx(Es,{size:14}),e.location.city,", ",e.location.state]}),t.jsxs("div",{className:Y,children:[t.jsxs("div",{className:H,children:[t.jsx(xs,{size:f?20:16}),t.jsx("span",{children:e.features.bedrooms})]}),t.jsxs("div",{className:H,children:[t.jsx(ps,{size:f?20:16}),t.jsx("span",{children:e.features.bathrooms})]}),t.jsxs("div",{className:H,children:[t.jsx(gs,{size:f?20:16}),t.jsx("span",{children:e.features.parking})]}),t.jsxs("div",{className:H,children:[t.jsx(Rs,{size:f?20:16}),t.jsxs("span",{children:[e.features.area," m²"]})]})]}),e.amenities.length>0&&t.jsx("p",{className:B,children:e.amenities.join(", ")})]})]});return e.href?t.jsx("a",{href:e.href,className:"no-underline text-inherit",children:ce}):ce},Js=({images:e,onViewAllClick:r,onImageClick:s})=>{const[o,a]=E.useState(!1),[n,l]=E.useState(0),i=e.length,c=E.useCallback(h=>{s?.(h),i!==0&&(l(h),a(!0))},[s,i]),m=E.useCallback(()=>{r?.(),i!==0&&(l(0),a(!0))},[r,i]),u=E.useCallback(()=>{a(!1)},[]),d=E.useCallback(()=>{i<=1||l(h=>h===0?i-1:h-1)},[i]),x=E.useCallback(()=>{i<=1||l(h=>h===i-1?0:h+1)},[i]),N=E.useCallback(h=>{l(h)},[]);return E.useEffect(()=>{if(!o)return;const h=v=>{v.key==="ArrowLeft"&&(v.preventDefault(),d()),v.key==="ArrowRight"&&(v.preventDefault(),x())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[x,d,o]),{isModalOpen:o,activeImageIndex:n,totalImageCount:i,handlePreviewImageClick:c,handleViewAllPhotosClick:m,handleCloseModal:u,handlePreviousImage:d,handleNextImage:x,handleSelectImage:N}},Qs=({images:e,isOpen:r,activeImageIndex:s,onClose:o,onPrevious:a,onNext:n,onSelectImage:l})=>{const i=e.length;return t.jsx(Oe,{isOpen:r,onClose:o,title:`Foto ${s+1} de ${i}`,size:"xl",children:e[s]?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-black",children:[t.jsx("img",{src:e[s],alt:`Property image ${s+1}`,className:"w-full max-h-[70vh] object-contain mx-auto"}),i>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:a,"aria-label":"Previous image",className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-white/90 p-2 text-foreground shadow-md transition hover:bg-white",children:t.jsx(ws,{className:"h-5 w-5"})}),t.jsx("button",{type:"button",onClick:n,"aria-label":"Next image",className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-white/90 p-2 text-foreground shadow-md transition hover:bg-white",children:t.jsx(ks,{className:"h-5 w-5"})})]})]}),i>1&&t.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((c,m)=>t.jsx("button",{type:"button",onClick:()=>l(m),className:p("w-16 h-16 sm:w-20 sm:h-20 rounded-lg overflow-hidden border-2 flex-shrink-0 transition",m===s?"border-primary":"border-transparent"),"aria-label":`Go to image ${m+1}`,"aria-current":m===s,children:t.jsx("img",{src:c,alt:`Thumbnail ${m+1}`,className:"w-full h-full object-cover"})},`${c}-${m}`))})]}):t.jsx("div",{className:"w-full bg-muted flex items-center justify-center rounded-2xl p-8",children:t.jsx("span",{className:"text-muted-foreground",children:"No image"})})})},zt=E.forwardRef(({images:e,transactionType:r,totalPhotos:s,onViewAllClick:o,onImageClick:a,className:n},l)=>{const{activeImageIndex:i,isModalOpen:c,totalImageCount:m,handlePreviewImageClick:u,handleViewAllPhotosClick:d,handleCloseModal:x,handlePreviousImage:N,handleNextImage:h,handleSelectImage:v}=Js({images:e,onImageClick:a,onViewAllClick:o}),g=s??m,f=e.slice(0,5);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:l,className:p("w-full h-[340px] sm:h-[460px] md:h-[560px] grid grid-cols-2 gap-2 auto-rows-fr",n),children:[t.jsx("div",{className:"relative col-span-2 sm:col-span-1 sm:row-span-2 rounded-2xl overflow-hidden group cursor-pointer",children:f[0]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:f[0],alt:"Property main view",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(0)}),r&&t.jsx("div",{className:"absolute top-4 left-4 bg-white rounded-full px-4 py-2 shadow-md",children:t.jsx("span",{className:"text-sm font-medium text-foreground",children:r})})]}):t.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:t.jsx("span",{className:"text-muted-foreground",children:"No image"})})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[1]?t.jsx("img",{src:f[1],alt:"Property view 2",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(1)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[2]?t.jsx("img",{src:f[2],alt:"Property view 3",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(2)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[3]?t.jsx("img",{src:f[3],alt:"Property view 4",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(3)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[4]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:f[4],alt:"Property view 5",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(4)}),g>5&&t.jsx("div",{className:"absolute bottom-3 right-3 sm:bottom-4 sm:right-4",children:t.jsxs("button",{type:"button",onClick:P=>{P.stopPropagation(),d()},className:"flex items-center gap-2 bg-white rounded-full px-3 py-2 sm:px-4 shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105",children:[t.jsx(Cs,{className:"w-4 h-4 text-foreground"}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium text-foreground",children:["Ver las ",g," fotos"]})]})})]}):t.jsx("div",{className:"w-full h-full bg-muted"})})]}),t.jsx(Qs,{images:e,isOpen:c,activeImageIndex:i,onClose:x,onPrevious:N,onNext:h,onSelectImage:v})]})});zt.displayName="PropertyGallery";function Ys({onSubmit:e,defaultValues:r,propertyTypeOptions:s,transactionTypeOptions:o,locationOptions:a}){const n=j.useMemo(()=>({propertyType:r?.propertyType||s[0]?.value||"",transactionType:r?.transactionType||o[0]?.value||"",location:r?.location||a[0]?.value||""}),[r,s,o,a]),[l,i]=j.useState(n),c=j.useCallback(u=>{i(d=>{const x=typeof u=="function"?u(d):u;return JSON.stringify(d)===JSON.stringify(x)?d:x})},[]),m=j.useCallback(u=>{u.preventDefault(),e?.({propertyType:l.propertyType,transactionType:l.transactionType,location:l.location})},[l,e]);return{formData:l,setFormData:c,handleSubmit:m,propertyTypeOptions:s,transactionTypeOptions:o,locationOptions:a}}const Fe=({variant:e="pill",isSubmitting:r,className:s})=>{const o="relative size-12 rounded-full bg-black text-white transition-all duration-200 hover:bg-black/90 hover:shadow-md flex items-center justify-center",a="w-full";return e==="mobile"?t.jsxs(q,{type:"submit",className:p(a,s),children:[t.jsx(Ie,{className:"h-4 w-4"}),r?"Searching...":"Search"]}):t.jsx(q,{type:"submit",size:"icon",variant:"ghost","aria-label":r?"Searching...":"Search properties",className:p(o,s),disabled:r,children:t.jsx(Ie,{className:"h-6 w-6"})})},F=({label:e,options:r,value:s,onChange:o,className:a,containerClassName:n})=>{const l=j.useMemo(()=>r.map(c=>({value:c.value,label:c.label})),[r]),i=j.useCallback(c=>{o(c.target.value)},[o]);return t.jsx("div",{className:p("flex min-w-0 flex-1 items-center",n),children:t.jsx("div",{className:"flex-1 px-6 py-3.5",children:t.jsx(je,{label:e,options:l,value:s,className:p("w-full border-none bg-transparent focus:outline-none focus:ring-0 text-base text-muted-foreground h-auto p-0",a),labelClassName:"text-sm font-semibold text-foreground mb-1 text-left",onChange:i})})})},eo=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,error:n,className:l})=>t.jsx("div",{className:p("rounded-xl bg-white shadow-lg p-6",l),children:t.jsxs("form",{className:"space-y-6",onSubmit:a,children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("location")})]}),t.jsxs(q,{type:"submit",className:"w-full",size:"lg",disabled:o,children:[t.jsx(Ie,{className:"h-4 w-4 mr-2"}),o?"Searching...":"Search Properties"]}),n&&t.jsx("div",{className:"bg-destructive/10 text-destructive mt-3 rounded-lg p-3 text-center text-sm",role:"alert",children:n})]})}),to=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n})=>t.jsx("form",{className:p("w-full max-w-md",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl bg-white p-4 shadow-lg",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",onChange:s("location")}),t.jsx(Fe,{variant:"mobile",isSubmitting:o})]})}),ne=({className:e})=>t.jsx("div",{className:p("w-px self-stretch bg-gray-300 mx-6",e)}),ro=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n,buttonLabel:l="Conoce Más"})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch bg-white border border-gray-300 shadow-xl relative z-10 px-3",children:[t.jsx(F,{label:"Tipo de propiedad",options:r.propertyTypeOptions,value:e.propertyType,onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transacción",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Ciudad",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center py-3",children:t.jsx("button",{type:"submit",disabled:o,className:"h-10 px-4 py-2 bg-zinc-900 text-white text-sm font-medium rounded-md hover:bg-zinc-800 transition-colors disabled:opacity-50 whitespace-nowrap","aria-label":o?"Buscando propiedades...":l,children:o?"Buscando...":l})})]})}),so=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch rounded-full bg-white border border-gray-300 shadow-xl relative z-10 p-1.5",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center",children:t.jsx(Fe,{variant:"pill",isSubmitting:o,className:"bg-black"})})]})}),oo=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a})=>t.jsx("form",{className:"mt-4 block md:hidden",onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"grid grid-cols-1 gap-3 rounded-2xl bg-white p-4 shadow-lg",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",onChange:s("location")}),t.jsx(Fe,{variant:"mobile",isSubmitting:o})]})}),ao=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n,buttonLabel:l="Conoce Más"})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch rounded-lg bg-white border border-gray-300 shadow-xl relative z-10 px-3",children:[t.jsx(F,{label:"Tipo de propiedad",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"rounded-tl-full rounded-bl-full",onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transacción",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Ciudad",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center py-3",children:t.jsx("button",{type:"submit",disabled:o,className:"h-10 px-4 py-2 bg-zinc-900 text-white text-sm font-medium rounded-md hover:bg-zinc-800 transition-colors disabled:opacity-50 whitespace-nowrap","aria-label":o?"Buscando propiedades...":l,children:o?"Buscando...":l})})]})}),Qe={minimal:so,modern:ao,luxury:ro,compact:to,card:eo},Et=({onSubmit:e,defaultValues:r,className:s,variant:o="minimal",propertyTypeOptions:a,transactionTypeOptions:n,locationOptions:l,buttonLabel:i})=>{const[c,m]=j.useState(!1),[u,d]=j.useState(null),x=Ys({onSubmit:e,defaultValues:r,propertyTypeOptions:a,transactionTypeOptions:n,locationOptions:l}),{formData:N,setFormData:h,handleSubmit:v,propertyTypeOptions:g,transactionTypeOptions:f,locationOptions:P}=x,C=j.useCallback(async T=>{T.preventDefault(),d(null),m(!0);try{await v(T)}catch(w){const L=w instanceof Error?w.message:"Search failed. Please try again.";d(L),console.error("Search error:",w)}finally{m(!1)}},[v]),M=j.useCallback(T=>w=>{d(null),h(L=>({...L,[T]:w}))},[h]),S=j.useMemo(()=>({propertyTypeOptions:g,transactionTypeOptions:f,locationOptions:P}),[g,f,P]),R=Qe[o]||Qe.minimal;return t.jsxs(t.Fragment,{children:[t.jsx(R,{formData:N,options:S,isSubmitting:c,error:u,className:s,onFieldChange:M,onSubmit:C,...(o==="modern"||o==="luxury")&&{buttonLabel:i}}),o==="minimal"&&t.jsx(oo,{formData:N,options:S,isSubmitting:c,onFieldChange:M,onSubmit:C})]})};Et.displayName="SearchFeature";const no=({href:e,children:r})=>t.jsx("a",{href:e,className:"sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-primary focus:text-white focus:rounded",children:r}),lo={spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},radius:{none:"0",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},typography:{fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}]},fontWeight:{thin:"100",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"}},shadows:{none:"none",xs:"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",DEFAULT:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",md:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",lg:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",xl:"0 25px 50px -12px rgb(0 0 0 / 0.25)"},zIndex:{dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070,toast:1080},duration:{instant:"0ms",fast:"150ms",normal:"300ms",slow:"500ms"},easing:{linear:"linear",in:"ease-in",out:"ease-out",inOut:"ease-in-out"}},It={button:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-8",icon:"h-10 w-10"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},input:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-3 py-2",lg:"h-11 px-3 py-2"}},card:{variant:{default:"bg-card text-card-foreground",elevated:"bg-card text-card-foreground shadow-lg",outlined:"bg-card text-card-foreground border-2"}}},Rt={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},At={withOpacity:(e,r)=>r!==void 0?`hsl(var(${e}) / ${r})`:`hsl(var(${e}))`,get:e=>`hsl(var(--${e}))`},Lt={generateId:(e="ds")=>`${e}-${Math.random().toString(36).substr(2,9)}`,focus:{visible:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",within:"focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2"},sr:{only:"absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0",not:"not-sr-only"}},$t={icon:{xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},avatar:{xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-16 h-16"}},Ot={fade:{in:"animate-in fade-in duration-200",out:"animate-out fade-out duration-200"},slide:{inFromLeft:"animate-in slide-in-from-left duration-200",inFromRight:"animate-in slide-in-from-right duration-200",inFromTop:"animate-in slide-in-from-top duration-200",inFromBottom:"animate-in slide-in-from-bottom duration-200"},scale:{in:"animate-in scale-in duration-200",out:"animate-out scale-out duration-200"}},Ft={container:{responsive:"container mx-auto px-4 sm:px-6 lg:px-8",fluid:"w-full max-w-none",centered:"container mx-auto px-4 flex items-center justify-center min-h-screen"},grid:{responsive:"grid gap-4 sm:gap-6 lg:gap-8",cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"}},flex:{center:"flex items-center justify-center",between:"flex items-center justify-between",start:"flex items-center justify-start",end:"flex items-center justify-end",col:"flex flex-col",colCenter:"flex flex-col items-center justify-center"}},_t={isDark:()=>typeof window>"u"?!1:document.documentElement.classList.contains("dark"),toggle:()=>{typeof window>"u"||document.documentElement.classList.toggle("dark")},set:e=>{typeof window>"u"||document.documentElement.classList.toggle("dark",e==="dark")}},Vt={debounce:(e,r)=>{let s;return(...o)=>{clearTimeout(s),s=setTimeout(()=>e(...o),r)}},throttle:(e,r)=>{let s;return(...o)=>{s||(e(...o),s=!0,setTimeout(()=>s=!1,r))}}},Dt=E.createContext(null),io=()=>{const e=E.useContext(Dt);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},co={name:"light",colors:{primary:"#007bff",secondary:"#6c757d",success:"#28a745",warning:"#ffc107",error:"#dc3545",info:"#17a2b8",background:"#ffffff",surface:"#f8f9fa",text:"#212529",textSecondary:"#6c757d",border:"#dee2e6",borderLight:"#e9ecef"},shapes:{borderRadius:{small:"4px",medium:"8px",large:"12px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",medium:"0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12)",large:"0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.10)",xl:"0 15px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.05)"}},mo={name:"dark",colors:{primary:"#0d6efd",secondary:"#6c757d",success:"#198754",warning:"#fd7e14",error:"#dc3545",info:"#0dcaf0",background:"#121212",surface:"#1e1e1e",text:"#ffffff",textSecondary:"#adb5bd",border:"#495057",borderLight:"#343a40"},shapes:{borderRadius:{small:"4px",medium:"8px",large:"12px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4)",medium:"0 3px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3)",large:"0 10px 20px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3)",xl:"0 15px 25px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.3)"}},uo={name:"corporate",colors:{primary:"#1a365d",secondary:"#2d3748",success:"#38a169",warning:"#d69e2e",error:"#e53e3e",info:"#3182ce",background:"#f7fafc",surface:"#ffffff",text:"#1a202c",textSecondary:"#4a5568",border:"#e2e8f0",borderLight:"#edf2f7"},shapes:{borderRadius:{small:"2px",medium:"4px",large:"6px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Georgia, "Times New Roman", serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06)",medium:"0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06)",large:"0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)"}},po={name:"minimal",colors:{primary:"#000000",secondary:"#666666",success:"#00aa00",warning:"#ffaa00",error:"#aa0000",info:"#00aaaa",background:"#ffffff",surface:"#fafafa",text:"#000000",textSecondary:"#666666",border:"#cccccc",borderLight:"#e0e0e0"},shapes:{borderRadius:{small:"0px",medium:"0px",large:"0px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:"Helvetica, Arial, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"none",medium:"none",large:"none",xl:"none"}},Te={light:co,dark:mo,corporate:uo,minimal:po},Bt=ve.createEvent(),Ht=ve.createEvent(),Gt=ve.createEvent(),Q=ve.createStore(Te.light).on(Bt,(e,r)=>Te[r]||e).on(Ht,(e,r)=>r).on(Gt,()=>Te.light),fo=Q.map(e=>e.name),xo=Q.map(e=>e.colors);Q.map(e=>e.shapes);Q.map(e=>e.typography);Q.map(e=>e.spacing);Q.map(e=>e.shadows);const ho=({children:e})=>{const s={theme:Ut.useUnit(Q)};return t.jsx(Dt.Provider,{value:s,children:e})};exports.$theme=Q;exports.$themeColors=xo;exports.$themeName=fo;exports.AuthLayout=Bs;exports.Button=q;exports.Card=Ae;exports.CategoryChips=$e;exports.Chip=we;exports.CompoundCard=Kr;exports.ConfirmModal=ss;exports.DashboardLayout=Ds;exports.DonutChart=Le;exports.EntityDirectory=Ct;exports.Header=Mt;exports.HeroBanner=St;exports.Input=te;exports.MarketingLayout=Hs;exports.Modal=Oe;exports.ModalWithActions=xt;exports.MortgageCalculator=Pt;exports.PageLayout=ke;exports.PropertyCard=Zs;exports.PropertyGallery=zt;exports.SearchFeature=Et;exports.Select=je;exports.SkipLink=no;exports.Text=I;exports.ThemeProvider=ho;exports.a11y=Lt;exports.accessibilityUtils=Lt;exports.animationUtils=Ot;exports.animations=Ot;exports.breakpoints=Rt;exports.calculateMortgage=rt;exports.cn=p;exports.colorUtils=At;exports.colors=At;exports.componentSizes=$t;exports.componentVariants=It;exports.countEntitiesByCategory=tt;exports.designSystem=lo;exports.filterEntitiesByCategory=Ye;exports.formatCurrency=ae;exports.formatPercentage=Kt;exports.layout=Ft;exports.layoutUtils=Ft;exports.performance=Vt;exports.performanceUtils=Vt;exports.resetTheme=Gt;exports.responsiveBreakpoints=Rt;exports.setCustomTheme=Ht;exports.setTheme=Bt;exports.sizes=$t;exports.sortEntities=et;exports.theme=_t;exports.themeUtils=_t;exports.useEntityFilter=Jr;exports.useTheme=io;exports.validateMortgageInput=Xt;exports.variants=It;
96
+ */const _s=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Je=D("x",_s),je=j.forwardRef(({className:e,containerClassName:r,labelClassName:s,variant:o,selectSize:a,label:n,helperText:l,error:i,required:c,options:m,placeholder:u,id:d,...x},N)=>{const h=j.useId(),v=d||h,g=`${v}-helper`,f=`${v}-error`,P=i?"error":o,C=i||l;return t.jsxs("div",{className:p("w-full",r),children:[n&&t.jsx("label",{htmlFor:v,className:p(as({variant:P,required:c}),s),children:n}),t.jsxs("div",{className:"relative",children:[t.jsxs("select",{id:v,ref:N,className:p(os({variant:P,selectSize:a}),"pr-10",e),"aria-invalid":i?"true":"false","aria-describedby":C?i?f:g:void 0,...x,children:[u&&t.jsx("option",{value:"",disabled:!0,children:u}),m.map(M=>t.jsx("option",{value:M.value,disabled:M.disabled,children:M.label},M.value))]}),t.jsx("div",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground",children:t.jsx(ys,{className:"h-4 w-4"})})]}),C&&t.jsx("p",{id:i?f:g,className:ns({variant:P}),role:i?"alert":void 0,children:C})]})});je.displayName="Select";const Vs=e=>{switch(e){case"sm":return"p-4";case"md":return"p-6";case"lg":return"p-8";default:return"p-0"}},ke=({children:e,header:r,sidebar:s,footer:o,padding:a="md"})=>{const n=p("min-h-screen flex flex-col"),l=p("bg-card border-b border-border z-10"),i=p("flex flex-1"),c=p("w-70 bg-card border-r border-border p-6"),m=p("flex-1 flex flex-col"),u=p("flex-1 mx-auto w-full max-w-7xl",Vs(a));return t.jsxs("div",{className:n,children:[r&&t.jsx("header",{className:l,children:r}),t.jsxs("div",{className:i,children:[s&&t.jsx("aside",{className:c,children:s}),t.jsx("div",{className:m,children:t.jsx("main",{className:u,children:e})})]}),o&&t.jsx("footer",{className:"bg-card border-t border-border mt-auto",children:o})]})},Ds=({children:e,header:r,sidebar:s})=>t.jsx(ke,{header:r,sidebar:s,padding:"lg",children:t.jsx("div",{className:"max-w-screen-2xl",children:e})}),Bs=({children:e,title:r,subtitle:s})=>t.jsx(ke,{padding:"lg",children:t.jsxs("div",{className:"max-w-md mx-auto",children:[t.jsxs("div",{className:"text-center mb-8",children:[r&&t.jsx(I,{variant:"h2",className:"mb-2",children:r}),s&&t.jsx(I,{variant:"body",color:"muted",children:s})]}),e]})}),Hs=({children:e,header:r,footer:s})=>t.jsx(ke,{header:r,footer:s,padding:"none",children:e}),gt=j.forwardRef(({message:e="No entities found",icon:r,action:s,className:o},a)=>t.jsxs("div",{ref:a,role:"status","aria-live":"polite",className:p("flex flex-col items-center justify-center py-12 px-4 text-center",o),children:[r&&t.jsx("div",{className:"mb-4 text-4xl opacity-50","aria-hidden":"true",children:r}),t.jsx(I,{variant:"body-lg",className:"text-muted-foreground mb-4",children:e}),s&&t.jsx(q,{variant:"outline",onClick:s.onClick,children:s.label})]}));gt.displayName="EntityDirectoryEmptyState";const bt=j.forwardRef(({error:e,onRetry:r,className:s},o)=>{const a=typeof e=="string"?e:e.message;return t.jsxs("div",{ref:o,role:"alert","aria-live":"assertive",className:p("flex flex-col items-center justify-center py-12 px-4 text-center",s),children:[t.jsx("div",{className:"mb-4 text-4xl","aria-hidden":"true",children:"⚠️"}),t.jsx(I,{variant:"body-lg",className:"text-destructive mb-2 font-semibold",children:"Error"}),t.jsx(I,{variant:"body",className:"text-muted-foreground mb-4",children:a}),r&&t.jsx(q,{variant:"outline",onClick:r,children:"Try Again"})]})});bt.displayName="EntityDirectoryErrorState";const yt=j.forwardRef(({title:e,description:r,className:s},o)=>t.jsxs("div",{ref:o,className:p("space-y-1.5",s),children:[t.jsx(I,{variant:"h2",className:"font-bold",children:e}),r&&t.jsx(I,{variant:"body",className:"text-muted-foreground",children:r})]}));yt.displayName="EntityDirectoryHeader";const vt=j.forwardRef(({entity:e,categories:r,showIcon:s=!0,showCategoryBadge:o=!0,showMetric:a=!0,compact:n=!1,className:l},i)=>{const c=r?.find(x=>x.id===e.categoryId),m=!!e.onClick,u=()=>{e.onClick&&!e.disabled&&e.onClick()},d=x=>{m&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),u())};return t.jsxs("div",{ref:i,role:m?"button":"listitem",tabIndex:m&&!e.disabled?0:void 0,onClick:u,onKeyDown:d,"aria-disabled":e.disabled,className:p("flex items-center gap-4 border-b border-border transition-colors",n?"p-3":"p-4",m&&!e.disabled&&"cursor-pointer hover:bg-accent/50 focus-visible:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e.disabled&&"opacity-50 cursor-not-allowed",l),children:[s&&t.jsx("div",{className:p("flex-shrink-0 flex items-center justify-center bg-muted rounded-full",n?"w-8 h-8 text-lg":"w-10 h-10 text-xl"),"aria-hidden":"true",children:typeof e.icon=="string"?t.jsx("span",{children:e.icon}):e.icon?j.createElement(e.icon):t.jsx("span",{className:"text-muted-foreground",children:"•"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx(I,{variant:n?"body-sm":"body",className:"font-semibold truncate",children:e.title}),e.subtitle&&t.jsx(I,{variant:n?"caption":"body-sm",className:"text-muted-foreground truncate",children:e.subtitle})]}),o&&c&&t.jsx(we,{variant:"secondary",size:n?"sm":"default",className:"flex-shrink-0 bg-foreground text-background hover:bg-foreground/90","aria-label":`Category: ${c.label}`,children:c.label}),a&&e.metricValue&&t.jsxs("div",{className:"flex-shrink-0 text-right min-w-[4rem]",children:[t.jsx(I,{variant:n?"body-sm":"body",className:"font-medium",children:e.metricValue}),e.metricLabel&&t.jsx(I,{variant:"caption",className:"text-muted-foreground",children:e.metricLabel})]})]})});vt.displayName="EntityDirectoryListItem";const wt=j.forwardRef(({columns:e,showIcon:r,sort:s,onSortChange:o,compact:a,className:n},l)=>{const i=d=>{if(!o)return;const x=s?.column===d&&s?.direction==="asc"?"desc":"asc";o({column:d,direction:x})},c=d=>{i(d)},m=(d,x)=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),i(x))},u=d=>d!=="title"&&d!=="metric"?null:!s||s.column!==d?t.jsx("span",{className:"ml-1 text-muted-foreground opacity-50","aria-hidden":"true",children:"⇅"}):t.jsx("span",{className:"ml-1","aria-hidden":"true",children:s.direction==="asc"?"↑":"↓"});return t.jsxs("div",{ref:l,role:"row",className:p("flex items-center gap-4 bg-background border-b border-border font-medium text-sm text-muted-foreground",a?"px-3 py-2":"px-4 py-3",n),children:[r&&t.jsx("div",{className:a?"w-8":"w-10"}),e.map(d=>{const x=d.sortable&&(d.key==="title"||d.key==="metric"),N=s?.column===d.key;return t.jsxs("div",{role:"columnheader","aria-sort":N?s?.direction==="asc"?"ascending":"descending":void 0,className:p(d.key==="title"&&"flex-1",d.key==="category"&&"w-40",d.key==="metric"&&"w-24 text-right",d.align==="center"&&"text-center",d.align==="right"&&"text-right",x&&"cursor-pointer hover:text-foreground transition-colors select-none",N&&"text-foreground"),style:d.width?{width:d.width}:void 0,onClick:x&&(d.key==="title"||d.key==="metric")?()=>c(d.key):void 0,tabIndex:x?0:void 0,onKeyDown:x&&(d.key==="title"||d.key==="metric")?h=>m(h,d.key):void 0,children:[d.label,x&&u(d.key)]},d.key)})]})});wt.displayName="EntityDirectoryTableHeader";const jt=j.forwardRef(({entities:e,categories:r,showIcons:s=!0,showCategoryBadges:o=!0,showMetric:a=!0,metricLabel:n,sortable:l=!1,sort:i,onSortChange:c,compact:m=!1,renderItem:u,className:d},x)=>{const N=[{key:"title",label:n?"Nombre":"Name",sortable:l},...o?[{key:"category",label:"Categoría",sortable:!1}]:[],...a&&n?[{key:"metric",label:n,sortable:l,align:"right"}]:[]];return t.jsxs("div",{ref:x,role:"table","aria-label":"Entity directory",className:p("border border-border rounded-lg overflow-hidden",d),children:[t.jsx(wt,{columns:N,showIcon:s,sort:i,onSortChange:c,compact:m}),t.jsx("div",{role:"rowgroup",children:e.map(h=>u?t.jsx(j.Fragment,{children:u(h)},h.id):t.jsx(vt,{entity:h,categories:r,showIcon:s,showCategoryBadge:o,showMetric:a,compact:m},h.id))})]})});jt.displayName="EntityDirectoryList";const kt=j.forwardRef(({rows:e=5,className:r},s)=>t.jsxs("div",{ref:s,role:"status","aria-live":"polite","aria-label":"Loading entities",className:p("space-y-3",r),children:[Array.from({length:e}).map((o,a)=>t.jsxs("div",{className:"flex items-center gap-4 p-4 border border-border rounded-lg animate-pulse",children:[t.jsx("div",{className:"w-10 h-10 bg-muted rounded-full flex-shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-2",children:[t.jsx("div",{className:"h-4 bg-muted rounded w-1/3"}),t.jsx("div",{className:"h-3 bg-muted rounded w-1/2"})]}),t.jsx("div",{className:"h-6 bg-muted rounded-full w-24 flex-shrink-0"}),t.jsx("div",{className:"h-4 bg-muted rounded w-16 flex-shrink-0"})]},a)),t.jsx("span",{className:"sr-only",children:"Loading..."})]}));kt.displayName="EntityDirectoryLoadingState";const Nt=j.forwardRef(({value:e,onChange:r,placeholder:s="Search entities...",className:o},a)=>t.jsxs("div",{className:p("relative",o),children:[t.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:t.jsx("svg",{className:"w-4 h-4 text-muted-foreground","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",children:t.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"})})}),t.jsx("input",{ref:a,type:"search",value:e,onChange:n=>r(n.target.value),placeholder:s,className:p("block w-full pl-10 pr-3 py-2 border border-input rounded-md","bg-background text-foreground placeholder:text-muted-foreground","focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent","transition-colors"),"aria-label":"Search entities"}),e&&t.jsx("button",{type:"button",onClick:()=>r(""),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground","aria-label":"Clear search",children:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}));Nt.displayName="EntityDirectorySearchFilter";const Ct=j.forwardRef(({entities:e,categories:r,title:s,description:o,activeCategory:a,onCategoryChange:n,showCategoryCount:l,getCategoryCount:i,enableSearch:c=!1,searchQuery:m="",onSearchChange:u,searchPlaceholder:d,sortable:x=!1,sort:N,onSortChange:h,showIcons:v=!0,showCategoryBadges:g=!0,showMetric:f=!0,metricLabel:P,compact:C=!1,loading:M=!1,error:S,emptyMessage:R,onRetry:T,emptyState:w,errorState:L,loadingState:K,renderItem:re,className:X,style:se},Y)=>{const H=r&&r.length>0,B=!M&&!S&&e.length===0,W=!M&&!!S;return t.jsxs("div",{ref:Y,className:p("space-y-6",X),style:se,children:[t.jsx(yt,{title:s,description:o}),H&&n&&t.jsx($e,{categories:r,activeCategory:a,onCategoryChange:n,showCount:l,getCategoryCount:i}),c&&u&&t.jsx(Nt,{value:m,onChange:u,placeholder:d}),M&&(K||t.jsx(kt,{})),W&&(L||t.jsx(bt,{error:S,onRetry:T})),B&&(w||t.jsx(gt,{message:R})),!M&&!W&&!B&&t.jsx(jt,{entities:e,categories:r,showIcons:v,showCategoryBadges:g,showMetric:f,metricLabel:P,sortable:x,sort:N,onSortChange:h,compact:C,renderItem:re})]})});Ct.displayName="EntityDirectory";function Gs(e){return{variant:e.variant||"minimal",logo:e.logo,navigationItems:e.navigationItems||[],loginButtonText:e.loginButtonText||"Iniciar Sesión",showMobileMenu:e.showMobileMenu??!0}}const Mt=E.forwardRef(({variant:e,logo:r,navigationItems:s,loginButtonText:o,showMobileMenu:a,className:n,logoClassName:l,navigationClassName:i,navigationItemClassName:c,loginButtonClassName:m,mobileMenuButtonClassName:u,renderNavLink:d,id:x,"aria-label":N},h)=>{const[v,g]=E.useState(!1),f=Gs({variant:e,logo:r,navigationItems:s,loginButtonText:o,showMobileMenu:a}),P=f.variant==="modern",C=f.variant==="luxury",M=C&&f.showMobileMenu,S=v?M?"Close navigation panel":"Close menu":M?"Open navigation panel":"Open menu",R=({item:T,className:w,onClick:L})=>d?d({item:T,children:T.label,className:w,onClick:L}):t.jsx("a",{href:T.href,className:w,onClick:L,children:T.label});return t.jsxs(t.Fragment,{children:[t.jsxs("header",{ref:h,id:x,role:"banner","aria-label":N||"Site header",className:p("flex items-center justify-between relative w-full space-x-4",C?"px-16 py-2":"px-6 py-1",n),children:[f.logo&&t.jsx("div",{className:p("shrink-0 w-2/3 md:w-1/5 text-ellipsis overflow-hidden text-nowrap",P&&"[&_img]:brightness-0 [&_img]:saturate-0 [&_svg]:brightness-0 [&_svg]:saturate-0"),children:typeof f.logo=="string"?t.jsx("p",{className:p("leading-normal",C?"font-heading text-xl font-normal uppercase tracking-[0.04em]":"font-black tracking-wider text-xl",P?"text-black":"text-white",l),children:f.logo}):f.logo}),f.navigationItems.length>0&&t.jsx("nav",{className:p("hidden md:flex items-center max-w-fit",C?"ml-auto gap-4":P?"gap-4 bg-transparent border-0 shadow-none":"gap-4 px-6 py-2 bg-white border border-gray-200 rounded-full shadow-sm",i),"aria-label":"Main navigation",children:f.navigationItems.map((T,w)=>t.jsxs("div",{className:"flex items-center gap-4",children:[w>0&&t.jsx("div",{className:"flex items-center justify-center h-6 w-0","aria-hidden":"true",children:t.jsx("div",{className:"h-0 w-6 rotate-90",children:t.jsx("div",{className:p("h-px w-full",C?"bg-white":"bg-gray-200")})})}),R({item:T,className:p(C?"font-body text-sm font-normal uppercase tracking-[0.05em] leading-5 text-white hover:text-white/80 transition-colors":"text-gray-900 text-sm font-medium leading-5 hover:text-black transition-colors text-ellipsis overflow-hidden text-nowrap",c)})]},T.id))}),t.jsxs("div",{className:p("flex items-center shrink-0 w-1/5","gap-6 p-4"),children:[t.jsx("button",{type:"button",className:p("hidden md:flex items-center justify-center px-4 py-2 text-sm font-medium leading-5 transition-colors",C?"font-body h-9 bg-white text-zinc-900 border border-zinc-200 rounded-none hover:bg-zinc-100":P?"h-10 bg-zinc-900 text-white border-0 rounded-md hover:bg-zinc-800":"h-9 bg-white border border-gray-200 text-zinc-900 rounded-full hover:bg-zinc-200",m),children:f.loginButtonText}),f.showMobileMenu&&t.jsx("button",{type:"button",onClick:()=>g(!v),"aria-label":S,"aria-expanded":v,className:p("flex md:hidden items-center justify-center px-3 py-2 bg-white transition-colors",C?"border border-zinc-200 text-zinc-900 hover:bg-zinc-100":P?"rounded-xl border border-zinc-200 hover:bg-gray-50":"rounded-full hover:bg-gray-50",u),children:v?t.jsx(Je,{className:p("text-gray-900",C?"h-[15px] w-[15px]":"h-4 w-4")}):t.jsx(Ls,{className:p("text-gray-900",C?"h-[15px] w-[15px]":"h-4 w-4")})})]})]}),v&&f.showMobileMenu&&t.jsxs("div",{className:"fixed inset-0 z-40 md:hidden",role:"dialog","aria-modal":"true","aria-label":"Mobile menu",children:[t.jsx("div",{className:"fixed inset-0 bg-black/50",onClick:()=>g(!1),"aria-hidden":"true"}),t.jsx("div",{className:"fixed right-0 top-0 h-full w-full max-w-sm bg-white shadow-xl",children:t.jsxs("div",{className:"flex h-full flex-col",children:[t.jsx("div",{className:"flex items-center justify-end px-6 py-4",children:t.jsx("button",{type:"button",onClick:()=>g(!1),"aria-label":"Close menu",className:"flex h-10 w-10 items-center justify-center rounded-full bg-zinc-100 text-zinc-900 hover:bg-zinc-200",children:t.jsx(Je,{className:"h-5 w-5"})})}),t.jsx("nav",{className:"flex-1 overflow-y-auto px-6 py-4",children:t.jsxs("div",{className:"flex flex-col gap-4",children:[f.navigationItems.map(T=>t.jsx("div",{children:R({item:T,className:"block text-base font-medium text-zinc-900 hover:text-zinc-600 transition-colors py-2",onClick:()=>g(!1)})},T.id)),t.jsx("div",{className:"mt-4 pt-4 border-t border-zinc-200",children:t.jsx("button",{type:"button",className:"w-full h-12 flex items-center justify-center rounded-full bg-zinc-100 text-zinc-900 font-semibold",children:f.loginButtonText})})]})})]})})]})]})});Mt.displayName="Header";const Ws=e=>({content:e.content,theme:e.theme||{},variant:e.variant||"modern",layout:e.layout||"centered"}),Us={center:"object-center",top:"object-top",bottom:"object-bottom",left:"object-left",right:"object-right","left-top":"object-left-top","left-bottom":"object-left-bottom","right-top":"object-right-top","right-bottom":"object-right-bottom"},St=E.forwardRef(({content:e,theme:r,variant:s="modern",layout:o="centered",searchForm:a,logo:n,navigation:l,className:i,id:c,"aria-label":m},u)=>{const d=Ws({content:e,theme:r,variant:s,layout:o}),x=d.variant==="modern",N=d.variant==="modern"||d.variant==="luxury";return t.jsx("section",{ref:u,id:c,"aria-label":m||"Hero banner",className:p("relative",x&&"px-4 lg:px-8",i),children:t.jsxs("div",{className:p("relative flex min-h-[600px] flex-col",x?"lg:min-h-[85vh] rounded-2xl overflow-hidden":"lg:min-h-screen","bg-gradient-to-br from-zinc-900 to-zinc-800","text-white"),children:[d.theme.backgroundImage&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute inset-0 z-0",children:t.jsx("img",{src:d.theme.backgroundImage,alt:"",className:p("h-full w-full object-cover",d.theme.backgroundPosition&&Us[d.theme.backgroundPosition]||"object-center"),loading:"eager",decoding:"async"})}),t.jsx("div",{className:"absolute inset-0 z-[1] bg-gradient-to-b from-black/40 via-black/40 via-[68.25%] to-transparent"})]}),l&&t.jsx("div",{className:"relative z-10",children:l}),t.jsx("div",{className:"relative z-10 flex flex-1 flex-col items-center justify-center px-4 py-12 lg:py-24",children:t.jsxs("div",{className:"w-full max-w-6xl text-center",children:[d.variant==="minimal"&&n&&t.jsx("div",{className:"mb-8 flex items-center justify-center",children:n}),d.content.title&&t.jsxs("div",{className:"mb-8 space-y-4 lg:mb-16 lg:space-y-8",children:[t.jsx("h1",{className:"text-4xl font-bold tracking-wide text-white sm:text-5xl lg:text-6xl",children:d.content.title}),d.content.subtitle&&t.jsx("p",{className:"mt-4 text-xl text-white/90 sm:text-2xl",children:d.content.subtitle})]}),d.variant==="minimal"&&d.content.metrics&&d.content.metrics.length>0&&t.jsx("div",{className:"mb-16",children:t.jsx("div",{className:"mx-auto grid max-w-4xl grid-cols-1 gap-8 md:grid-cols-3",children:d.content.metrics.map((h,v)=>t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"mb-2 text-3xl font-bold text-white md:text-4xl",children:h.value}),t.jsx("div",{className:"text-sm text-white/80 md:text-base",children:h.label})]},v))})}),a&&t.jsx("div",{className:"relative z-20 mx-auto w-full max-w-4xl",children:a})]})}),N&&d.content.metrics&&d.content.metrics.length>0&&t.jsx("div",{className:"absolute bottom-0 right-0 z-10 hidden md:block",children:t.jsx("div",{className:"flex h-20 w-full max-w-4xl items-center gap-6 rounded-tl-2xl bg-white px-8 py-4 text-zinc-900 md:h-24 md:gap-12 md:px-12 md:py-6",children:d.content.metrics.map((h,v)=>t.jsxs("div",{className:"flex flex-col",children:[t.jsx("div",{className:"text-xl font-semibold leading-tight md:text-2xl",children:h.value}),t.jsx("div",{className:"text-xs leading-tight text-zinc-600 md:text-sm",children:h.label})]},v))})}),d.variant==="minimal"&&t.jsx("div",{className:"relative z-10 pb-8",children:t.jsx("div",{className:"flex justify-center",children:t.jsx("div",{className:"h-1 w-8 rounded-full bg-white/30","aria-hidden":"true"})})})]})})});St.displayName="HeroBanner";const Tt=[{value:"15-years",label:"15 años fijos",years:15},{value:"20-years",label:"20 años fijos",years:20},{value:"30-years",label:"30 años fijos",years:30},{value:"40-years",label:"40 años fijos",years:40}],qs=Tt.map(e=>({value:e.value,label:e.label})),ye={propertyPrice:2e7,downPayment:2e5,loanProgram:"30-years",interestRate:6.5},Se={principalAndInterest:"#0a2540",propertyTax:"#4da6c7",hoaFees:"#7fc9e3"},Pt=j.forwardRef(({initialPropertyPrice:e=ye.propertyPrice,initialDownPayment:r=ye.downPayment,initialLoanProgram:s=ye.loanProgram,initialInterestRate:o=ye.interestRate,showPropertyTax:a=!1,showHoaFees:n=!1,className:l,onCalculationChange:i},c)=>{const[m,u]=j.useState(e),[d,x]=j.useState(r),[N,h]=j.useState(s),[v,g]=j.useState(o),[f,P]=j.useState(0),[C,M]=j.useState(0),S=j.useMemo(()=>{const w=Tt.find(K=>K.value===N)?.years||30;return rt({propertyPrice:m,downPayment:d,loanTerm:w,interestRate:v,propertyTax:a?f:void 0,hoaFees:n?C:void 0})},[m,d,N,v,f,C,a,n]);j.useEffect(()=>{i?.(S)},[S,i]);const R=j.useMemo(()=>{const T=[{label:"Principal e Intereses",value:S.breakdown.principalAndInterest,color:Se.principalAndInterest}];return a&&S.breakdown.propertyTax>0&&T.push({label:"Impuesto Predial",value:S.breakdown.propertyTax,color:Se.propertyTax}),n&&S.breakdown.hoaFees>0&&T.push({label:"Cuota HOA",value:S.breakdown.hoaFees,color:Se.hoaFees}),T},[S,a,n]);return t.jsx("div",{ref:c,className:p("w-full",l),children:t.jsx(Ae,{padding:"lg",className:"w-full",children:t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx(I,{variant:"h2",className:"mb-2",children:"Calculadora de Hipotecas"}),t.jsx(I,{variant:"body",color:"secondary",className:"max-w-2xl",children:"Calcule el pago mensual de su hipoteca, incluyendo capital e intereses, impuestos prediales y cuota de la asociación de propietarios. Ajuste los valores para obtener una tasa más precisa."})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsx(te,{label:"Precio de la propiedad",type:"number",value:m,onChange:T=>u(Number(T.target.value)),suffix:"MXN",min:0,step:1e4}),t.jsx(te,{label:"Enganche",type:"number",value:d,onChange:T=>x(Number(T.target.value)),suffix:"MXN",min:0,step:1e4}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsx(je,{label:"Programa de préstamos",value:N,onChange:T=>h(T.target.value),options:qs}),t.jsx(te,{label:"Tasa de interés",type:"number",value:v,onChange:T=>g(Number(T.target.value)),suffix:"%",min:0,max:100,step:.1})]}),a&&t.jsx(te,{label:"Impuesto predial mensual",type:"number",value:f,onChange:T=>P(Number(T.target.value)),suffix:"MXN",min:0,step:100}),n&&t.jsx(te,{label:"Cuota HOA mensual",type:"number",value:C,onChange:T=>M(Number(T.target.value)),suffix:"MXN",min:0,step:100})]}),t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx(Le,{segments:R,size:320,innerRadiusRatio:.65,centerContent:t.jsxs("div",{className:"text-center",children:[t.jsx(I,{variant:"h1",className:"font-bold mb-1",children:ae(S.totalMonthlyPayment)}),t.jsx(I,{variant:"body-sm",color:"secondary",children:"Tu Pago"})]}),showLegend:!0,legendPosition:"bottom"}),t.jsxs("div",{className:"mt-6 text-center space-y-1",children:[t.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-success",children:[t.jsx(Fs,{className:"h-4 w-4"}),t.jsx("span",{className:"font-medium",children:"Trending up by 5.2% this month"})]}),t.jsx(I,{variant:"caption",color:"secondary",children:"Showing total visitors for the last 6 months"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 pt-4 border-t",children:[t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Monto del préstamo"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.loanPrincipal)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Pago mensual"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.monthlyPayment)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Interés total"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.totalInterest)})]}),t.jsxs("div",{children:[t.jsx(I,{variant:"caption",color:"secondary",className:"mb-1",children:"Total a pagar"}),t.jsx(I,{variant:"body",weight:"semibold",children:ae(S.totalAmount)})]})]})]})})})});Pt.displayName="MortgageCalculator";const Ks=(e,r,s)=>{if(r)return"text-white";if(s)switch(e.type){case"Venta":return"bg-stone-950 text-white";case"Desarrollo":return"bg-cyan-600 text-white";case"Renta":return"bg-cyan-950 text-white";case"Remate":return"bg-orange-700 text-white";default:return"bg-stone-950 text-white"}switch(e.variant||Xs(e.type)){case"primary":return"bg-primary text-primary-foreground";case"secondary":return"bg-secondary text-secondary-foreground";case"success":return"bg-success text-success-foreground";case"warning":return"bg-warning text-warning-foreground";case"error":return"bg-error text-error-foreground";case"info":return"bg-info text-info-foreground";default:return"bg-secondary text-secondary-foreground"}},Xs=e=>{switch(e){case"Venta":return"primary";case"Desarrollo":return"success";case"Renta":return"info";case"Remate":return"warning";default:return"secondary"}},Zs=({property:e,className:r,onLike:s,onImageClick:o,showLikeButton:a=!0,variant:n="default",badgeColors:l})=>{const[i,c]=E.useState(0),[m,u]=E.useState(!1),[d,x]=E.useState(!1),N=V=>{V.preventDefault(),V.stopPropagation();const _=!m;u(_),s?.(e.id,_)},h=V=>{V.preventDefault(),V.stopPropagation(),o?.(i,e.id)},v=(V,_)=>!V||!_?"Price not available":`$${V.toLocaleString()} ${_}`,g=n==="compact",f=n==="minimal",P=p("relative overflow-hidden bg-card transition-all duration-300 ease-out cursor-pointer",g?"rounded-xl hover:shadow-lg border px-4 shadow-md":f?"rounded-2xl w-[454px] flex flex-col gap-4":"rounded-2xl hover:-translate-y-1 hover:shadow-xl shadow-md",r),C=p("relative overflow-hidden",g?"rounded-xl px-4 shadow-md":f?"rounded-2xl":""),M=p("w-full h-full object-cover",g?"":f?"rounded-2xl":"transition-transform duration-300 hover:scale-105"),S=p("absolute z-10 flex flex-wrap gap-2",g?"top-3 left-3":"top-4 left-4"),R=p("font-semibold",g?"rounded-full px-3 py-1 text-xs":f?"rounded-full px-3 h-7 flex items-center justify-center text-base":"px-2 py-1 rounded-lg font-medium uppercase tracking-wide text-xs"),T=p("absolute z-10 cursor-pointer transition-all duration-200",g?"top-3 right-3 p-1 shadow-md rounded-full":f?"top-4 right-4 w-7 h-7 flex items-center justify-center hover:scale-105":"top-4 right-4 bg-background/90 backdrop-blur-sm border border-border/20 text-foreground w-10 h-10 flex items-center justify-center rounded-full hover:bg-background hover:scale-105"),w=p("absolute left-1/2 -translate-x-1/2 flex z-10",f?"bottom-4 gap-2 p-4":"bottom-4 gap-1"),L=p("w-2 h-2 rounded-full border-none cursor-pointer transition-all duration-200 hover:scale-120"),K=p(g?"p-2":f?"flex flex-col gap-2":"p-6"),re=p("font-semibold text-foreground line-clamp-2 leading-tight",g?"text-base mb-2":f?"text-base":"text-lg font-bold mb-2"),X=p("font-bold",g?"text-lg text-primary mb-2":f?"text-lg text-foreground":"text-xl text-primary mb-2"),se=p("text-muted-foreground",g?"text-sm flex items-center gap-1 mb-4":f?"text-base":"text-base mb-4"),Y=p("flex items-center",g?"justify-between mt-3 mb-4":f?"gap-3":"gap-4 mb-4"),H=p("flex items-center gap-1 text-muted-foreground","text-sm"),B=p("text-sm text-muted-foreground line-clamp-2",g?"mt-2":""),k=!(e.images&&e.images.length>0)||d,ue=()=>t.jsxs("div",{className:"w-full h-full bg-gradient-to-br from-primary/10 via-primary/5 to-secondary/10 flex flex-col items-center justify-center gap-3",children:[t.jsx("div",{className:"rounded-full bg-primary/10 p-6",children:t.jsx(Ps,{size:g?32:48,className:"text-primary/40"})}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No image available"})]}),ce=t.jsxs("div",{className:P,children:[t.jsxs("div",{className:p(C,g?"h-52":f?"h-[481px]":"aspect-[4/3]"),children:[k?t.jsx(ue,{}):t.jsxs("div",{className:"relative w-full h-full","aria-hidden":"true",children:[t.jsx("img",{src:e.images[i],alt:e.title,className:M,onClick:o?h:void 0,onError:()=>x(!0)}),t.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black/40 pointer-events-none rounded-2xl"})]}),t.jsx("div",{className:S,children:e.transactionTypes.map((V,_)=>{const A=l?.[V.type];return t.jsx("span",{className:p(R,Ks(V,A,f)),style:A?{backgroundColor:A}:void 0,children:V.type},_)})}),a&&t.jsx("button",{onClick:N,className:T,"aria-label":m?"Unlike property":"Like property",children:g?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:m?"red":"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:m?"red":"currentColor",className:"h-5 w-5",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733C11.285 4.876 9.623 3.75 7.688 3.75 5.099 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})}):t.jsx(Ss,{size:20,fill:m?"currentColor":"none",className:f?"text-white":m?"text-destructive":"",strokeWidth:f?1.5:2})}),!g&&!k&&e.images.length>1&&t.jsx("div",{className:w,children:e.images.map((V,_)=>t.jsx("button",{className:p(L,_===i?"bg-white":"bg-white/50"),onClick:A=>{A.preventDefault(),A.stopPropagation(),c(_)},"aria-label":`Go to image ${_+1}`,"aria-current":_===i},_))})]}),t.jsxs("div",{className:K,children:[t.jsx("h3",{className:re,children:e.title}),t.jsx("p",{className:X,children:v(e.price?.amount,e.price?.currency)}),t.jsxs("p",{className:se,children:[g&&t.jsx(Es,{size:14}),e.location.city,", ",e.location.state]}),t.jsxs("div",{className:Y,children:[t.jsxs("div",{className:H,children:[t.jsx(xs,{size:f?20:16}),t.jsx("span",{children:e.features.bedrooms})]}),t.jsxs("div",{className:H,children:[t.jsx(ps,{size:f?20:16}),t.jsx("span",{children:e.features.bathrooms})]}),t.jsxs("div",{className:H,children:[t.jsx(gs,{size:f?20:16}),t.jsx("span",{children:e.features.parking})]}),t.jsxs("div",{className:H,children:[t.jsx(Rs,{size:f?20:16}),t.jsxs("span",{children:[e.features.area," m²"]})]})]}),e.amenities.length>0&&t.jsx("p",{className:B,children:e.amenities.join(", ")})]})]});return e.href?t.jsx("a",{href:e.href,className:"no-underline text-inherit",children:ce}):ce},Js=({images:e,onViewAllClick:r,onImageClick:s})=>{const[o,a]=E.useState(!1),[n,l]=E.useState(0),i=e.length,c=E.useCallback(h=>{s?.(h),i!==0&&(l(h),a(!0))},[s,i]),m=E.useCallback(()=>{r?.(),i!==0&&(l(0),a(!0))},[r,i]),u=E.useCallback(()=>{a(!1)},[]),d=E.useCallback(()=>{i<=1||l(h=>h===0?i-1:h-1)},[i]),x=E.useCallback(()=>{i<=1||l(h=>h===i-1?0:h+1)},[i]),N=E.useCallback(h=>{l(h)},[]);return E.useEffect(()=>{if(!o)return;const h=v=>{v.key==="ArrowLeft"&&(v.preventDefault(),d()),v.key==="ArrowRight"&&(v.preventDefault(),x())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[x,d,o]),{isModalOpen:o,activeImageIndex:n,totalImageCount:i,handlePreviewImageClick:c,handleViewAllPhotosClick:m,handleCloseModal:u,handlePreviousImage:d,handleNextImage:x,handleSelectImage:N}},Qs=({images:e,isOpen:r,activeImageIndex:s,onClose:o,onPrevious:a,onNext:n,onSelectImage:l})=>{const i=e.length;return t.jsx(Oe,{isOpen:r,onClose:o,title:`Foto ${s+1} de ${i}`,size:"xl",children:e[s]?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-black",children:[t.jsx("img",{src:e[s],alt:`Property image ${s+1}`,className:"w-full max-h-[70vh] object-contain mx-auto"}),i>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:a,"aria-label":"Previous image",className:"absolute left-3 top-1/2 -translate-y-1/2 rounded-full bg-white/90 p-2 text-foreground shadow-md transition hover:bg-white",children:t.jsx(ws,{className:"h-5 w-5"})}),t.jsx("button",{type:"button",onClick:n,"aria-label":"Next image",className:"absolute right-3 top-1/2 -translate-y-1/2 rounded-full bg-white/90 p-2 text-foreground shadow-md transition hover:bg-white",children:t.jsx(ks,{className:"h-5 w-5"})})]})]}),i>1&&t.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((c,m)=>t.jsx("button",{type:"button",onClick:()=>l(m),className:p("w-16 h-16 sm:w-20 sm:h-20 rounded-lg overflow-hidden border-2 flex-shrink-0 transition",m===s?"border-primary":"border-transparent"),"aria-label":`Go to image ${m+1}`,"aria-current":m===s,children:t.jsx("img",{src:c,alt:`Thumbnail ${m+1}`,className:"w-full h-full object-cover"})},`${c}-${m}`))})]}):t.jsx("div",{className:"w-full bg-muted flex items-center justify-center rounded-2xl p-8",children:t.jsx("span",{className:"text-muted-foreground",children:"No image"})})})},zt=E.forwardRef(({images:e,transactionType:r,totalPhotos:s,onViewAllClick:o,onImageClick:a,className:n},l)=>{const{activeImageIndex:i,isModalOpen:c,totalImageCount:m,handlePreviewImageClick:u,handleViewAllPhotosClick:d,handleCloseModal:x,handlePreviousImage:N,handleNextImage:h,handleSelectImage:v}=Js({images:e,onImageClick:a,onViewAllClick:o}),g=s??m,f=e.slice(0,5);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{ref:l,className:p("w-full h-[340px] sm:h-[460px] md:h-[560px] grid grid-cols-2 gap-2 auto-rows-fr",n),children:[t.jsx("div",{className:"relative col-span-2 sm:col-span-1 sm:row-span-2 rounded-2xl overflow-hidden group cursor-pointer",children:f[0]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:f[0],alt:"Property main view",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(0)}),r&&t.jsx("div",{className:"absolute top-4 left-4 bg-white rounded-full px-4 py-2 shadow-md",children:t.jsx("span",{className:"text-sm font-medium text-foreground",children:r})})]}):t.jsx("div",{className:"w-full h-full bg-muted flex items-center justify-center",children:t.jsx("span",{className:"text-muted-foreground",children:"No image"})})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[1]?t.jsx("img",{src:f[1],alt:"Property view 2",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(1)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[2]?t.jsx("img",{src:f[2],alt:"Property view 3",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(2)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[3]?t.jsx("img",{src:f[3],alt:"Property view 4",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(3)}):t.jsx("div",{className:"w-full h-full bg-muted"})}),t.jsx("div",{className:"relative col-span-1 row-span-1 rounded-2xl overflow-hidden group cursor-pointer",children:f[4]?t.jsxs(t.Fragment,{children:[t.jsx("img",{src:f[4],alt:"Property view 5",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",onClick:()=>u(4)}),g>5&&t.jsx("div",{className:"absolute bottom-3 right-3 sm:bottom-4 sm:right-4",children:t.jsxs("button",{type:"button",onClick:P=>{P.stopPropagation(),d()},className:"flex items-center gap-2 bg-white rounded-full px-3 py-2 sm:px-4 shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105",children:[t.jsx(Cs,{className:"w-4 h-4 text-foreground"}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium text-foreground",children:["Ver las ",g," fotos"]})]})})]}):t.jsx("div",{className:"w-full h-full bg-muted"})})]}),t.jsx(Qs,{images:e,isOpen:c,activeImageIndex:i,onClose:x,onPrevious:N,onNext:h,onSelectImage:v})]})});zt.displayName="PropertyGallery";function Ys({onSubmit:e,defaultValues:r,propertyTypeOptions:s,transactionTypeOptions:o,locationOptions:a}){const n=j.useMemo(()=>({propertyType:r?.propertyType||s[0]?.value||"",transactionType:r?.transactionType||o[0]?.value||"",location:r?.location||a[0]?.value||""}),[r,s,o,a]),[l,i]=j.useState(n),c=j.useCallback(u=>{i(d=>{const x=typeof u=="function"?u(d):u;return JSON.stringify(d)===JSON.stringify(x)?d:x})},[]),m=j.useCallback(u=>{u.preventDefault(),e?.({propertyType:l.propertyType,transactionType:l.transactionType,location:l.location})},[l,e]);return{formData:l,setFormData:c,handleSubmit:m,propertyTypeOptions:s,transactionTypeOptions:o,locationOptions:a}}const Fe=({variant:e="pill",isSubmitting:r,className:s})=>{const o="relative size-12 rounded-full bg-black text-white transition-all duration-200 hover:bg-black/90 hover:shadow-md flex items-center justify-center",a="w-full";return e==="mobile"?t.jsxs(q,{type:"submit",className:p(a,s),children:[t.jsx(Ie,{className:"h-4 w-4"}),r?"Searching...":"Search"]}):t.jsx(q,{type:"submit",size:"icon",variant:"ghost","aria-label":r?"Searching...":"Search properties",className:p(o,s),disabled:r,children:t.jsx(Ie,{className:"h-6 w-6"})})},F=({label:e,options:r,value:s,onChange:o,className:a,containerClassName:n})=>{const l=j.useMemo(()=>r.map(c=>({value:c.value,label:c.label})),[r]),i=j.useCallback(c=>{o(c.target.value)},[o]);return t.jsx("div",{className:p("flex min-w-0 flex-1 items-center",n),children:t.jsx("div",{className:"flex-1 px-6 py-3.5",children:t.jsx(je,{label:e,options:l,value:s,className:p("w-full border-none bg-transparent focus:outline-none focus:ring-0 text-base text-muted-foreground h-auto p-0",a),labelClassName:"text-sm font-semibold text-foreground mb-1 text-left",onChange:i})})})},eo=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,error:n,className:l})=>t.jsx("div",{className:p("rounded-xl bg-white shadow-lg p-6",l),children:t.jsxs("form",{className:"space-y-6",onSubmit:a,children:[t.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",className:"placeholder:text-muted-foreground",onChange:s("location")})]}),t.jsxs(q,{type:"submit",className:"w-full",size:"lg",disabled:o,children:[t.jsx(Ie,{className:"h-4 w-4 mr-2"}),o?"Searching...":"Search Properties"]}),n&&t.jsx("div",{className:"bg-destructive/10 text-destructive mt-3 rounded-lg p-3 text-center text-sm",role:"alert",children:n})]})}),to=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n})=>t.jsx("form",{className:p("w-full max-w-md",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex flex-col gap-3 rounded-2xl bg-white p-4 shadow-lg",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",onChange:s("location")}),t.jsx(Fe,{variant:"mobile",isSubmitting:o})]})}),ne=({className:e})=>t.jsx("div",{className:p("w-px self-stretch bg-gray-300 mx-6",e)}),ro=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n,buttonLabel:l="Conoce Más"})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch bg-white border border-gray-300 shadow-xl relative z-10 px-3",children:[t.jsx(F,{label:"Tipo de propiedad",options:r.propertyTypeOptions,value:e.propertyType,onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transacción",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Ciudad",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center py-3",children:t.jsx("button",{type:"submit",disabled:o,className:"h-10 px-4 py-2 bg-zinc-900 text-white text-sm font-medium rounded-md hover:bg-zinc-800 transition-colors disabled:opacity-50 whitespace-nowrap","aria-label":o?"Buscando propiedades...":l,children:o?"Buscando...":l})})]})}),so=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch rounded-full bg-white border border-gray-300 shadow-xl relative z-10 p-1.5",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center",children:t.jsx(Fe,{variant:"pill",isSubmitting:o,className:"bg-black"})})]})}),oo=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a})=>t.jsx("form",{className:"mt-4 block md:hidden",onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"grid grid-cols-1 gap-3 rounded-2xl bg-white p-4 shadow-lg",children:[t.jsx(F,{label:"Property Type",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"flex items-center",onChange:s("propertyType")}),t.jsx(F,{label:"Transaction",options:r.transactionTypeOptions,value:e.transactionType,containerClassName:"flex items-center",onChange:s("transactionType")}),t.jsx(F,{label:"Location",options:r.locationOptions,value:e.location,containerClassName:"flex items-center",onChange:s("location")}),t.jsx(Fe,{variant:"mobile",isSubmitting:o})]})}),ao=({formData:e,options:r,onFieldChange:s,isSubmitting:o,onSubmit:a,className:n,buttonLabel:l="Conoce Más"})=>t.jsx("form",{className:p("relative mx-auto w-full max-w-5xl",n),onSubmit:a,"aria-label":"Property search form",children:t.jsxs("div",{className:"flex items-stretch rounded-lg bg-white border border-gray-300 shadow-xl relative z-10 px-3",children:[t.jsx(F,{label:"Tipo de propiedad",options:r.propertyTypeOptions,value:e.propertyType,containerClassName:"rounded-tl-full rounded-bl-full",onChange:s("propertyType")}),t.jsx(ne,{}),t.jsx(F,{label:"Transacción",options:r.transactionTypeOptions,value:e.transactionType,onChange:s("transactionType")}),t.jsx(ne,{}),t.jsx(F,{label:"Ciudad",options:r.locationOptions,value:e.location,containerClassName:"flex min-w-0 flex-[1.2] items-center",onChange:s("location")}),t.jsx("div",{className:"flex items-center py-3",children:t.jsx("button",{type:"submit",disabled:o,className:"h-10 px-4 py-2 bg-zinc-900 text-white text-sm font-medium rounded-md hover:bg-zinc-800 transition-colors disabled:opacity-50 whitespace-nowrap","aria-label":o?"Buscando propiedades...":l,children:o?"Buscando...":l})})]})}),Qe={minimal:so,modern:ao,luxury:ro,compact:to,card:eo},Et=({onSubmit:e,defaultValues:r,className:s,variant:o="minimal",propertyTypeOptions:a,transactionTypeOptions:n,locationOptions:l,buttonLabel:i})=>{const[c,m]=j.useState(!1),[u,d]=j.useState(null),x=Ys({onSubmit:e,defaultValues:r,propertyTypeOptions:a,transactionTypeOptions:n,locationOptions:l}),{formData:N,setFormData:h,handleSubmit:v,propertyTypeOptions:g,transactionTypeOptions:f,locationOptions:P}=x,C=j.useCallback(async T=>{T.preventDefault(),d(null),m(!0);try{await v(T)}catch(w){const L=w instanceof Error?w.message:"Search failed. Please try again.";d(L),console.error("Search error:",w)}finally{m(!1)}},[v]),M=j.useCallback(T=>w=>{d(null),h(L=>({...L,[T]:w}))},[h]),S=j.useMemo(()=>({propertyTypeOptions:g,transactionTypeOptions:f,locationOptions:P}),[g,f,P]),R=Qe[o]||Qe.minimal;return t.jsxs(t.Fragment,{children:[t.jsx(R,{formData:N,options:S,isSubmitting:c,error:u,className:s,onFieldChange:M,onSubmit:C,...(o==="modern"||o==="luxury")&&{buttonLabel:i}}),o==="minimal"&&t.jsx(oo,{formData:N,options:S,isSubmitting:c,onFieldChange:M,onSubmit:C})]})};Et.displayName="SearchFeature";const no=({href:e,children:r})=>t.jsx("a",{href:e,className:"sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50 focus:px-4 focus:py-2 focus:bg-primary focus:text-white focus:rounded",children:r}),lo={spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},radius:{none:"0",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},typography:{fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}]},fontWeight:{thin:"100",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"}},shadows:{none:"none",xs:"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",DEFAULT:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",md:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",lg:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",xl:"0 25px 50px -12px rgb(0 0 0 / 0.25)"},zIndex:{dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070,toast:1080},duration:{instant:"0ms",fast:"150ms",normal:"300ms",slow:"500ms"},easing:{linear:"linear",in:"ease-in",out:"ease-out",inOut:"ease-in-out"}},It={button:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-4 py-2",lg:"h-11 px-8",icon:"h-10 w-10"},variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"}},input:{size:{sm:"h-9 px-3 text-sm",md:"h-10 px-3 py-2",lg:"h-11 px-3 py-2"}},card:{variant:{default:"bg-card text-card-foreground",elevated:"bg-card text-card-foreground shadow-lg",outlined:"bg-card text-card-foreground border-2"}}},Rt={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},At={withOpacity:(e,r)=>r!==void 0?`hsl(var(${e}) / ${r})`:`hsl(var(${e}))`,get:e=>`hsl(var(--${e}))`},Lt={generateId:(e="ds")=>`${e}-${Math.random().toString(36).substr(2,9)}`,focus:{visible:"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",within:"focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2"},sr:{only:"absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0",not:"not-sr-only"}},$t={icon:{xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6",xl:"w-8 h-8"},avatar:{xs:"w-6 h-6",sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-16 h-16"}},Ot={fade:{in:"animate-in fade-in duration-200",out:"animate-out fade-out duration-200"},slide:{inFromLeft:"animate-in slide-in-from-left duration-200",inFromRight:"animate-in slide-in-from-right duration-200",inFromTop:"animate-in slide-in-from-top duration-200",inFromBottom:"animate-in slide-in-from-bottom duration-200"},scale:{in:"animate-in scale-in duration-200",out:"animate-out scale-out duration-200"}},Ft={container:{responsive:"container mx-auto px-4 sm:px-6 lg:px-8",fluid:"w-full max-w-none",centered:"container mx-auto px-4 flex items-center justify-center min-h-screen"},grid:{responsive:"grid gap-4 sm:gap-6 lg:gap-8",cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",5:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",6:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"}},flex:{center:"flex items-center justify-center",between:"flex items-center justify-between",start:"flex items-center justify-start",end:"flex items-center justify-end",col:"flex flex-col",colCenter:"flex flex-col items-center justify-center"}},_t={isDark:()=>typeof window>"u"?!1:document.documentElement.classList.contains("dark"),toggle:()=>{typeof window>"u"||document.documentElement.classList.toggle("dark")},set:e=>{typeof window>"u"||document.documentElement.classList.toggle("dark",e==="dark")}},Vt={debounce:(e,r)=>{let s;return(...o)=>{clearTimeout(s),s=setTimeout(()=>e(...o),r)}},throttle:(e,r)=>{let s;return(...o)=>{s||(e(...o),s=!0,setTimeout(()=>s=!1,r))}}},Dt=E.createContext(null),io=()=>{const e=E.useContext(Dt);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},co={name:"light",colors:{primary:"#007bff",secondary:"#6c757d",success:"#28a745",warning:"#ffc107",error:"#dc3545",info:"#17a2b8",background:"#ffffff",surface:"#f8f9fa",text:"#212529",textSecondary:"#6c757d",border:"#dee2e6",borderLight:"#e9ecef"},shapes:{borderRadius:{small:"4px",medium:"8px",large:"12px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)",medium:"0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12)",large:"0 10px 20px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.10)",xl:"0 15px 25px rgba(0, 0, 0, 0.15), 0 5px 10px rgba(0, 0, 0, 0.05)"}},mo={name:"dark",colors:{primary:"#0d6efd",secondary:"#6c757d",success:"#198754",warning:"#fd7e14",error:"#dc3545",info:"#0dcaf0",background:"#121212",surface:"#1e1e1e",text:"#ffffff",textSecondary:"#adb5bd",border:"#495057",borderLight:"#343a40"},shapes:{borderRadius:{small:"4px",medium:"8px",large:"12px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4)",medium:"0 3px 6px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3)",large:"0 10px 20px rgba(0, 0, 0, 0.4), 0 3px 6px rgba(0, 0, 0, 0.3)",xl:"0 15px 25px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.3)"}},uo={name:"corporate",colors:{primary:"#1a365d",secondary:"#2d3748",success:"#38a169",warning:"#d69e2e",error:"#e53e3e",info:"#3182ce",background:"#f7fafc",surface:"#ffffff",text:"#1a202c",textSecondary:"#4a5568",border:"#e2e8f0",borderLight:"#edf2f7"},shapes:{borderRadius:{small:"2px",medium:"4px",large:"6px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:'Georgia, "Times New Roman", serif',fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06)",medium:"0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06)",large:"0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04)"}},po={name:"minimal",colors:{primary:"#000000",secondary:"#666666",success:"#00aa00",warning:"#ffaa00",error:"#aa0000",info:"#00aaaa",background:"#ffffff",surface:"#fafafa",text:"#000000",textSecondary:"#666666",border:"#cccccc",borderLight:"#e0e0e0"},shapes:{borderRadius:{small:"0px",medium:"0px",large:"0px",round:"50%"},borderWidth:{thin:"1px",medium:"2px",thick:"3px"}},typography:{fontFamily:"Helvetica, Arial, sans-serif",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xxl:"1.5rem"},fontWeight:{light:300,regular:400,medium:500,bold:700},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem",xxl:"3rem"},shadows:{none:"none",small:"none",medium:"none",large:"none",xl:"none"}},Te={light:co,dark:mo,corporate:uo,minimal:po},Bt=ve.createEvent(),Ht=ve.createEvent(),Gt=ve.createEvent(),Q=ve.createStore(Te.light).on(Bt,(e,r)=>Te[r]||e).on(Ht,(e,r)=>r).on(Gt,()=>Te.light),fo=Q.map(e=>e.name),xo=Q.map(e=>e.colors);Q.map(e=>e.shapes);Q.map(e=>e.typography);Q.map(e=>e.spacing);Q.map(e=>e.shadows);const ho=({children:e})=>{const s={theme:Ut.useUnit(Q)};return t.jsx(Dt.Provider,{value:s,children:e})};exports.$theme=Q;exports.$themeColors=xo;exports.$themeName=fo;exports.AuthLayout=Bs;exports.Button=q;exports.Card=Ae;exports.CategoryChips=$e;exports.Chip=we;exports.CompoundCard=Kr;exports.ConfirmModal=ss;exports.DashboardLayout=Ds;exports.DonutChart=Le;exports.EntityDirectory=Ct;exports.Header=Mt;exports.HeroBanner=St;exports.Input=te;exports.MarketingLayout=Hs;exports.Modal=Oe;exports.ModalWithActions=xt;exports.MortgageCalculator=Pt;exports.PageLayout=ke;exports.PropertyCard=Zs;exports.PropertyGallery=zt;exports.SearchFeature=Et;exports.Select=je;exports.SkipLink=no;exports.Text=I;exports.ThemeProvider=ho;exports.a11y=Lt;exports.accessibilityUtils=Lt;exports.animationUtils=Ot;exports.animations=Ot;exports.breakpoints=Rt;exports.calculateMortgage=rt;exports.cn=p;exports.colorUtils=At;exports.colors=At;exports.componentSizes=$t;exports.componentVariants=It;exports.countEntitiesByCategory=tt;exports.designSystem=lo;exports.filterEntitiesByCategory=Ye;exports.formatCurrency=ae;exports.formatPercentage=Kt;exports.layout=Ft;exports.layoutUtils=Ft;exports.performance=Vt;exports.performanceUtils=Vt;exports.resetTheme=Gt;exports.responsiveBreakpoints=Rt;exports.setCustomTheme=Ht;exports.setTheme=Bt;exports.sizes=$t;exports.sortEntities=et;exports.theme=_t;exports.themeUtils=_t;exports.useEntityFilter=Jr;exports.useTheme=io;exports.validateMortgageInput=Xt;exports.variants=It;
97
97
  //# sourceMappingURL=design-system.cjs.js.map