bonsaif-ui 0.1.11 → 0.1.13
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.
package/dist/bonsaif-ui.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react-icons/hi2"),require("react"),require("react-dom"),require("overlayscrollbars"),require("react-icons/md"),require("overlayscrollbars-react"),require("react-day-picker"),require("react-day-picker/dist/style.css"),require("react-icons/fi"),require("sonner")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-icons/hi2","react","react-dom","overlayscrollbars","react-icons/md","overlayscrollbars-react","react-day-picker","react-day-picker/dist/style.css","react-icons/fi","sonner"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.BonsaifUI={},L.jsxRuntime,L.ReactIconsHi2,L.React,L.ReactDOM,L.OverlayScrollbarsGlobal,L.ReactIconsMd,L.OverlayScrollbarsReact,L.ReactDayPicker,L.ReactDayPickerStyles,L.ReactIconsFi,L.Sonner))})(this,(function(L,e,w,o,Ee,pr,st,hr,br,mn,lt,it){"use strict";"use client";function mr(...r){return r.filter(Boolean).join(" ")}function ct({variant:r="primary",className:t,type:a="button",children:n,...s}){return e.jsx("button",{className:mr("bonsaif-ui-button",`bonsaif-ui-button--${r}`,t),type:a,...s,children:n})}function xr({value:r,onChange:t,placeholder:a,className:n="",autoFocus:s=!1,forceExpanded:i=!1,onEscape:d,size:l="default",inputTabIndex:p}){const h=o.useRef(null),[S,k]=o.useState(!1),g=i||S||r.trim().length>0,v=l==="sm"?"h-9 rounded-md":"h-10 rounded-lg",f=n||"w-48 sm:w-64 lg:w-72";o.useEffect(()=>{var m;s&&((m=h.current)==null||m.focus())},[s]);const b=()=>{var m;k(!0),(m=h.current)==null||m.focus()};return e.jsxs("div",{className:`relative flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${g?f:"w-24 sm:w-28"}`,onMouseDown:m=>{g||(m.preventDefault(),b())},children:[e.jsx(w.HiMagnifyingGlass,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:h,type:"text",tabIndex:p,"aria-label":a,value:r,onChange:m=>t(m.target.value),onKeyDown:m=>{m.key==="Escape"&&(d==null||d())},placeholder:g?a:"Buscar",className:`${v} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${g?"pl-9 pr-8":"cursor-pointer pl-9 pr-3"}`,style:{background:"color-mix(in srgb, var(--bg-card) 86%, transparent)",border:"1px solid var(--border)",color:"var(--text-main)"},onFocus:m=>{k(!0),m.currentTarget.style.borderColor="var(--primary)",m.currentTarget.style.boxShadow="0 0 0 3px rgba(59,130,246,0.12)"},onBlur:m=>{k(!1),m.currentTarget.style.borderColor="var(--border)",m.currentTarget.style.boxShadow="none"}}),r&&e.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",style:{color:"var(--text-muted)"},"aria-label":"Limpiar búsqueda",children:e.jsx(w.HiXMark,{className:"h-3.5 w-3.5 flex-shrink-0"})})]})}const vr=o.createContext({});function dt(r){var n;const t=Array.from(r.querySelectorAll("*")).filter(s=>{var i;return s.scrollWidth>s.clientWidth&&!!((i=s.textContent)!=null&&i.trim())&&s.tagName.toLowerCase()!=="svg"&&!s.closest("svg")});return(r.scrollWidth>r.clientWidth||t.length>0)&&(((n=t[0])==null?void 0:n.textContent)??r.textContent??"").trim()||null}function We({children:r,content:t,onlyWhenOverflow:a=!1,className:n="",style:s,as:i="div"}){const d=o.useRef(null),l=o.useRef(null),[p,h]=o.useState(null),[S,k]=o.useState("");o.useEffect(()=>{const f=d.current;f&&(f.querySelectorAll("[title]").forEach(b=>{const m=b.getAttribute("title");m&&(b.getAttribute("aria-label")||b.setAttribute("aria-label",m),b.removeAttribute("title"))}),f.querySelectorAll("svg title").forEach(b=>b.remove()))}),o.useLayoutEffect(()=>{if(!p)return;const f=l.current;if(!f)return;const b=12,m=14,$=f.getBoundingClientRect(),j=window.innerWidth-$.width-b,z=window.innerHeight-$.height-b;let H=p.mouseX+m,N=p.mouseY+m;H>j&&(H=p.mouseX-$.width-m),N>z&&(N=p.mouseY-$.height-m),H=Math.min(Math.max(b,H),Math.max(b,j)),N=Math.min(Math.max(b,N),Math.max(b,z)),(Math.abs(H-p.x)>.5||Math.abs(N-p.y)>.5)&&h(E=>E&&{...E,x:H,y:N})},[p]);const g=(f,b)=>{const m=d.current;if(m){if(a){const $=dt(m);if(!$)return;k($)}!a&&!t||h({mouseX:f,mouseY:b,x:f+14,y:b+14})}},v=a?S:t;return e.jsxs(e.Fragment,{children:[e.jsx(i,{ref:f=>{d.current=f},className:n,style:s,onMouseEnter:f=>g(f.clientX,f.clientY),onMouseMove:f=>{p&&g(f.clientX,f.clientY)},onMouseLeave:()=>h(null),children:r}),p&&v?Ee.createPortal(e.jsx("div",{ref:l,role:"tooltip",style:{position:"fixed",top:p.y,left:p.x,zIndex:9999,background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:6,padding:"5px 10px",fontSize:12,color:"var(--text-main)",boxShadow:"0 4px 16px rgba(0,0,0,0.35)",pointerEvents:"none",maxWidth:"min(420px, calc(100vw - 24px))",whiteSpace:"normal",lineHeight:1.6,overflowWrap:"anywhere"},children:v}),document.body):null]})}function gr(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}const ut="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg",ft={primary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",secondary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",danger:"border border-[var(--border)] text-[var(--danger)] hover:border-[var(--danger)] hover:bg-[var(--danger-bg)] active:scale-[0.98] transition-colors",ghost:"text-[var(--text-secondary)] hover:opacity-70",icon:"text-[var(--text-muted)] hover:text-[var(--primary)] hover:bg-primary/5"},pt="border border-[var(--border)] text-[var(--text-muted)] shadow-sm shadow-black/5 hover:border-[var(--border)] hover:bg-[var(--bg-input)] hover:text-[var(--primary)] active:scale-[0.98] transition-colors",ht={xs:"h-8 px-2.5 text-xs",sm:"h-9 px-3.5 text-xs",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-sm font-semibold"},bt={xs:"h-8 w-8",sm:"h-9 w-9",md:"h-10 w-10",lg:"h-10 w-10"},mt={primary:{background:"var(--bg-card)"},secondary:{background:"var(--bg-card)"},danger:{background:"var(--bg-card)"},ghost:{},icon:{}};function er(r){return typeof r=="string"||typeof r=="number"?String(r):Array.isArray(r)?r.map(er).join(" ").trim():o.isValidElement(r)?er(r.props.children):""}function xt(r){return o.Children.toArray(r).find(o.isValidElement)??null}function he({variant:r="primary",size:t="md",loading:a=!1,icon:n,tooltip:s,iconOnly:i,height:d,padding:l,children:p,className:h="",disabled:S,style:k,...g}){const v=o.useContext(vr),f=i??v.iconOnly??r==="icon",b=v.compact??!1,m=v.headerAction??!1,$=b&&!m&&t==="md"?"xs":t,j=r==="icon"||f,z=m&&j,H=er(p),N=s??g.title??g["aria-label"]??(f?H:void 0),E=N?void 0:g.title,B=g["aria-label"]??(typeof N=="string"?N:H||void 0),P=a?null:n??(f?xt(p):null),O=e.jsxs("button",{...g,title:E,"aria-label":B,"data-variant":r,"data-size":$,"data-icon":j?"true":void 0,disabled:S||a,className:`${ut} ${z?pt:ft[r]} ${j?bt[$]:ht[$]} ${b&&!j?"px-2.5":""} ${h}`,style:{...mt[r],height:gr(d),padding:gr(l),...k,...z?{width:"40px",height:"40px",padding:0,background:"var(--bg-card)",borderRadius:"8px"}:null},children:[a?e.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):P,!f&&p]});return N?e.jsx(We,{as:"span",content:N,className:"inline-flex shrink-0",children:O}):O}function yr({variant:r="page",title:t="Cargando...",rows:a=6,children:n}){return r==="table"?e.jsx(wr,{rows:a}):r==="sections"?e.jsx(vt,{rows:a}):r==="cards"?e.jsx(gt,{rows:a}):e.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[e.jsx("div",{className:"h-9 w-9 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:t}),n&&e.jsx("div",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n})]})]})})}function vt({rows:r}){return e.jsx("div",{className:"space-y-4",children:Array.from({length:Math.max(2,Math.min(r,4))}).map((t,a)=>e.jsxs("section",{className:"overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-5 w-20 animate-pulse rounded-full bg-[var(--bg-input)]"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]"})]})]}),e.jsx(wr,{rows:a===0?r:Math.max(3,r-2),compact:!0})]},a))})}function gt({rows:r}){return e.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:r}).map((t,a)=>e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"mt-3 h-3 w-full animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"mt-2 h-3 w-4/5 animate-pulse rounded bg-[var(--bg-input)]"})]},a))})}function wr({rows:r,compact:t=!1}){const a=t?5:6;return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"grid border-b border-[var(--border)]",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},children:Array.from({length:a}).map((n,s)=>e.jsx("div",{className:"px-3 py-3",children:e.jsx("div",{className:"h-3 w-2/3 animate-pulse rounded bg-[var(--bg-input)]"})},s))}),Array.from({length:r}).map((n,s)=>e.jsx("div",{className:"grid border-b border-[var(--border)] last:border-b-0",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},children:Array.from({length:a}).map((i,d)=>e.jsx("div",{className:"px-3 py-3",children:e.jsx("div",{className:"h-3.5 animate-pulse rounded-full bg-[var(--bg-input)]",style:{width:`${52+(s*13+d*11)%36}%`}})},d))},s))]})}function Nr(r){const t=r.split("/").filter(Boolean);return(t[t.length-1]??r).replace(/^lv_/,"").split(/[-_]/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function kr(r){return r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function yt(r){return[r.label,Nr(r.service),r.description,r.service].filter(Boolean).join(" ")}function wt(r){return typeof r=="function"?r:r.default}function Nt(r,t){return e.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:"No se pudo cargar este modulo"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r.message}),e.jsx(he,{className:"mt-4",height:36,padding:"0 14px",onClick:t,children:"Reintentar"})]})})}function kt({parentPanel:r,parentPanelComponent:t,renderParentPanel:a,parent:n,context:s,links:i,moduleRegistry:d,loadModule:l,activeService:p,initialService:h,onActiveServiceChange:S,canAccess:k,keepAlive:g=!0,title:v,subtitle:f,emptyState:b,loadingState:m,errorState:$=Nt,renderTabLabel:j,searchableTabs:z="auto",tabsSearchThreshold:H=6,tabsSearchPlaceholder:N="Buscar modulo...",tabsSearchValue:E,onTabsSearchChange:B,emptySearchState:P,showTabCount:O=!0,className:T="",parentClassName:I="",contentClassName:F="",tabsClassName:G=""}){var je;const W=o.useMemo(()=>i.filter(M=>!M.hidden&&((k==null?void 0:k(M,s))??!0)),[k,s,i]),Z=(je=W.find(M=>!M.disabled))==null?void 0:je.service,[ee,u]=o.useState(h??Z??""),[D,U]=o.useState({}),[J,K]=o.useState({}),[te,le]=o.useState(""),[x,Q]=o.useState(!1),oe=o.useRef(J),V=o.useRef(0),ae=E??te,A=kr(ae),X=z===!0||z==="auto"&&W.length>=H,R=X&&ae.trim().length>0,de=o.useMemo(()=>A?W.filter(M=>kr(yt(M)).includes(A)):W,[A,W]),be=p??ee,Y=W.find(M=>M.service===be)??W.find(M=>!M.disabled);o.useEffect(()=>{!Y&&Z&&u(Z)},[Z,Y]),o.useEffect(()=>{oe.current=J},[J]);const xe=M=>{M.disabled||(p||u(M.service),S==null||S(M.service,M))},Ke=M=>{E===void 0&&le(M),B==null||B(M)},Te=(M,ue)=>{const pe=de.filter(ie=>!ie.disabled),De=pe.findIndex(ie=>ie.service===ue.service);De<0||((M.key==="ArrowRight"||M.key==="ArrowDown")&&(M.preventDefault(),xe(pe[(De+1)%pe.length])),(M.key==="ArrowLeft"||M.key==="ArrowUp")&&(M.preventDefault(),xe(pe[(De-1+pe.length)%pe.length])),M.key==="Home"&&(M.preventDefault(),xe(pe[0])),M.key==="End"&&(M.preventDefault(),xe(pe[pe.length-1])))},Oe=o.useCallback(()=>{if(!Y)return;const M=Y.service,ue=oe.current[M];if(ue!=null&&ue.loading||ue!=null&&ue.component&&g)return;const pe=(d==null?void 0:d[M])??l;if(!pe){K(ie=>({...ie,[M]:{loading:!1,error:new Error(`No module loader found for service "${M}".`)}}));return}const De=++V.current;K(ie=>({...ie,[M]:{...ie[M],loading:!0,error:void 0}})),pe(Y,s).then(ie=>{if(De!==V.current&&!g)return;const _e=wt(ie);K(ke=>({...ke,[M]:{component:_e,loading:!1}}))}).catch(ie=>{const _e=ie instanceof Error?ie:new Error(String(ie));K(ke=>({...ke,[M]:{...ke[M],loading:!1,error:_e}}))})},[s,g,l,d,Y]);o.useEffect(Oe,[Oe]);const Ve=Y?D[Y.service]??null:null,se=Y?J[Y.service]:void 0,Ze=se==null?void 0:se.component,we=M=>{Y&&U(ue=>({...ue,[Y.service]:M}))},Ce=()=>{Y&&U(M=>({...M,[Y.service]:null}))},Ne={context:s,parent:n,links:i,visibleLinks:W,filteredLinks:de,selectedLink:Y,selectedService:Y==null?void 0:Y.service,activeItemId:Ve,tabsSearch:ae,onSelectService:xe,onOpenDetail:we,onBackToList:Ce},Ae=a?a(Ne):t?e.jsx(t,{...Ne}):r;return e.jsxs("section",{className:`grid min-h-[520px] gap-4 lg:grid-cols-[minmax(260px,360px)_minmax(0,1fr)] ${T}`,children:[e.jsx("aside",{className:`min-w-0 rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4 ${I}`,children:Ae}),e.jsxs("div",{className:`relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${F}`,children:[(v||f||X||O)&&e.jsx("div",{className:"relative border-b border-[var(--border)] px-4 py-3",children:e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[v&&e.jsx("h2",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:v}),f&&e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-[var(--text-muted)]",children:f})]}),(X||O)&&e.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-end gap-2",children:[O&&e.jsxs("span",{className:"hidden text-xs font-semibold text-[var(--text-muted)] transition-opacity duration-200 sm:inline",children:[de.length," / ",W.length]}),X&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${x?"w-[min(20rem,44vw)] translate-x-0 opacity-100":"w-0 translate-x-2 opacity-0"}`,"aria-hidden":!x,children:e.jsx(xr,{value:ae,onChange:Ke,placeholder:N,className:"w-full",autoFocus:x,forceExpanded:!0,onEscape:()=>Q(!1),size:"sm",inputTabIndex:x?0:-1})}),e.jsx("button",{type:"button","aria-label":x?"Cerrar busqueda":"Buscar tabs","aria-expanded":x,onClick:()=>{x&&ae&&Ke(""),Q(M=>!M)},className:`inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${x||R?"border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm":"border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,children:e.jsx("span",{className:"grid h-4 w-4 place-items-center transition-transform duration-200",children:x||R?e.jsx(w.HiXMark,{className:"h-4 w-4"}):e.jsx(w.HiMagnifyingGlass,{className:"h-4 w-4"})})})]})]})]})}),e.jsx("div",{role:"tablist","aria-label":v??"Modulos relacionados",className:`flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${G}`,children:de.length>0?de.map(M=>{const ue=M.service===(Y==null?void 0:Y.service);return e.jsx("button",{type:"button",role:"tab","aria-selected":ue,disabled:M.disabled,onClick:()=>xe(M),onKeyDown:pe=>Te(pe,M),className:`inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${ue?"border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm":"border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,children:j?j(M,ue):e.jsxs(e.Fragment,{children:[M.icon,e.jsx("span",{children:M.label??Nr(M.service)}),M.badge&&e.jsx("span",{className:"rounded-full bg-[var(--bg-input)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:M.badge})]})},M.service)}):e.jsx("div",{className:"flex min-h-9 flex-1 items-center rounded-md border border-dashed border-[var(--border)] px-3 text-xs text-[var(--text-muted)]",children:P??"No hay modulos que coincidan con la busqueda."})}),(Y==null?void 0:Y.description)&&e.jsx("div",{className:"border-b border-[var(--border)] px-4 py-2 text-xs text-[var(--text-muted)]",children:Y.description}),e.jsxs("div",{className:"min-h-[420px] p-4",children:[!Y&&(b??e.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]",children:"No hay modulos disponibles."})),Y&&(se==null?void 0:se.loading)&&(m??e.jsx(yr,{title:"Cargando modulo..."})),Y&&(se==null?void 0:se.error)&&$(se.error,Oe),Y&&Ze&&!(se!=null&&se.loading)&&!(se!=null&&se.error)&&e.jsx(Ze,{context:s,parent:n,link:Y,activeItemId:Ve,onOpenDetail:we,onBackToList:Ce})]})]})]})}const St={info:{color:"#2563eb",background:"rgba(59, 130, 246, 0.1)",border:"rgba(59, 130, 246, 0.24)",icon:e.jsx(w.HiInformationCircle,{className:"h-5 w-5"})},success:{color:"#047857",background:"rgba(16, 185, 129, 0.1)",border:"rgba(16, 185, 129, 0.24)",icon:e.jsx(w.HiCheckCircle,{className:"h-5 w-5"})},warning:{color:"#b45309",background:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)",icon:e.jsx(w.HiExclamationTriangle,{className:"h-5 w-5"})},danger:{color:"var(--danger)",background:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))",icon:e.jsx(w.HiExclamationCircle,{className:"h-5 w-5"})},neutral:{color:"var(--text-secondary)",background:"var(--bg-input)",border:"var(--border)",icon:e.jsx(w.HiInformationCircle,{className:"h-5 w-5"})}};function Ct({variant:r="info",title:t,children:a,icon:n,action:s,onDismiss:i,className:d=""}){const l=St[r];return e.jsxs("div",{role:r==="danger"||r==="warning"?"alert":"status",className:`flex items-start gap-3 rounded-lg border px-3 py-3 ${d}`,style:{background:l.background,borderColor:l.border},children:[e.jsx("div",{className:"mt-0.5 shrink-0",style:{color:l.color},children:n??l.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[t&&e.jsx("div",{className:"text-sm font-semibold text-[var(--text-main)]",children:t}),a&&e.jsx("div",{className:"mt-0.5 text-sm leading-5 text-[var(--text-secondary)]",children:a}),s&&e.jsx("div",{className:"mt-3",children:s})]}),i&&e.jsx(he,{variant:"icon",size:"xs","aria-label":"Cerrar alerta",onClick:i,className:"-mr-1 -mt-1",children:e.jsx(w.HiXMark,{className:"h-4 w-4"})})]})}const Sr=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Et=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],$t=["Do","Lu","Ma","Mi","Ju","Vi","Sá"],rr=6;function tr(r,t,a){return`${r}-${String(t).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function Mt(){const r=new Date;return tr(r.getFullYear(),r.getMonth()+1,r.getDate())}function Cr(r){const[t,a,n]=r.split("-").map(Number);return{year:t,month:a,day:n}}function Dt(r){if(!r)return"Seleccionar fecha";const{year:t,month:a,day:n}=Cr(r);return!t||!a||!n?"Seleccionar fecha":`${String(n).padStart(2,"0")} ${Sr[a-1]} ${t}`}function Lt({value:r,onChange:t,minDate:a,displayMode:n="inline"}){const s=Mt(),d=Cr(r||s),l=n==="popover",[p,h]=o.useState(!1),S=o.useRef(null),[k,g]=o.useState({horizontal:"left",vertical:"bottom"}),[v,f]=o.useState(d.year),[b,m]=o.useState(d.month),[$,j]=o.useState("days"),z=16,[H,N]=o.useState(0),E=v-7+H,B=Array.from({length:z},(u,D)=>E+D);o.useEffect(()=>{if(!l||!p||!S.current)return;const u=S.current.getBoundingClientRect(),D=8,U=280,J=340,K=u.left+U>window.innerWidth-D,te=u.right-U>=D,le=u.bottom+8+J>window.innerHeight-D,x=u.top-8-J>=D;g({horizontal:K&&te?"right":"left",vertical:le&&x?"top":"bottom"})},[l,p]),o.useEffect(()=>{if(!l||!p)return;function u(U){S.current&&(S.current.contains(U.target)||h(!1))}function D(U){U.key==="Escape"&&h(!1)}return document.addEventListener("mousedown",u),document.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",D)}},[l,p]);function P(){b===1?(f(u=>u-1),m(12)):m(u=>u-1)}function O(){b===12?(f(u=>u+1),m(1)):m(u=>u+1)}const T=new Date(v,b-1,1).getDay(),I=new Date(v,b,0).getDate(),F=[...Array(T).fill(null),...Array.from({length:I},(u,D)=>D+1)];for(;F.length<rr*7;)F.push(null);const G=F.slice(0,rr*7);function W(u){const D=tr(v,b,u);a&&D<a||(t(D),l&&h(!1))}const Z={background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:4,borderRadius:6,display:"flex",alignItems:"center"},ee=e.jsxs("div",{style:{background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",userSelect:"none",width:280},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",borderBottom:"1px solid var(--border)"},children:$==="days"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:P,style:Z,title:"Mes anterior",children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>{j("years"),N(0)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:13,fontWeight:700,color:"var(--text-main)",borderRadius:6,padding:"2px 6px"},children:[Sr[b-1]," ",v,e.jsx(w.HiChevronDown,{size:13,style:{color:"var(--text-muted)"}})]}),e.jsx("button",{type:"button",onClick:O,style:Z,title:"Mes siguiente",children:e.jsx(w.HiChevronRight,{size:16})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>N(u=>u-z),style:Z,children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>j("days"),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:700,color:"var(--text-main)",borderRadius:6,padding:"2px 6px"},children:[B[0]," – ",B[B.length-1]]}),e.jsx("button",{type:"button",onClick:()=>N(u=>u+z),style:Z,children:e.jsx(w.HiChevronRight,{size:16})})]})}),$==="years"&&e.jsxs("div",{style:{padding:"8px 10px 10px"},children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:3,marginBottom:8},children:Et.map((u,D)=>{const U=D+1===b;return e.jsx("button",{type:"button",onClick:()=>m(D+1),style:{border:"none",cursor:"pointer",borderRadius:6,fontSize:11,fontWeight:U?700:400,padding:"4px 0",background:U?"var(--primary)":"transparent",color:U?"var(--primary-fg, #ffffff)":"var(--text-secondary)"},children:u},u)})}),e.jsx("div",{style:{height:1,background:"var(--border)",marginBottom:8}}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:3},children:B.map(u=>{const D=u===v;return e.jsx("button",{type:"button",onClick:()=>{f(u),j("days")},style:{border:"none",cursor:"pointer",borderRadius:6,fontSize:12,fontWeight:D?700:400,padding:"6px 0",background:D?"var(--primary)":"transparent",color:D?"var(--primary-fg, #ffffff)":"var(--text-main)",outline:u===new Date().getFullYear()&&!D?"2px solid var(--primary)":"none",outlineOffset:"-2px"},children:u},u)})})]}),$==="days"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",padding:"6px 8px 0"},children:$t.map(u=>e.jsx("div",{style:{textAlign:"center",fontSize:10,fontWeight:700,color:"var(--text-muted)",padding:"2px 0",textTransform:"uppercase"},children:u},u))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gridTemplateRows:`repeat(${rr},1fr)`,padding:"4px 8px 10px",gap:2},children:G.map((u,D)=>{if(u===null)return e.jsx("div",{style:{aspectRatio:"1"}},D);const U=tr(v,b,u),J=U===r,K=U===s,te=!!(a&&U<a);return e.jsx("button",{type:"button",onClick:()=>!te&&W(u),style:{width:"100%",aspectRatio:"1",borderRadius:6,border:"none",cursor:te?"not-allowed":"pointer",fontSize:12,fontWeight:J||K?700:400,background:J?"var(--primary)":"transparent",color:J?"var(--primary-fg, #ffffff)":te?"var(--text-muted)":"var(--text-main)",opacity:te?.4:1,outline:K&&!J?"2px solid var(--primary)":"none",outlineOffset:"-2px"},children:u},D)})})]})]});return l?e.jsxs("div",{ref:S,className:"relative w-full",children:[e.jsxs("button",{type:"button",onClick:()=>h(u=>!u),className:"flex h-10 w-full items-center justify-between gap-2 rounded-lg px-2.5 py-0 text-sm transition-all duration-150 focus:outline-none",style:{background:"var(--bg-input)",border:`1px solid ${p?"var(--primary)":"var(--border)"}`,color:"var(--text-main)",boxShadow:p?"0 0 0 3px rgba(59,130,246,0.12)":"none"},children:[e.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[e.jsx(w.HiCalendarDays,{className:"w-4 h-4 text-[var(--text-muted)]"}),e.jsx("span",{className:"truncate",children:Dt(r)})]}),e.jsx(w.HiChevronDown,{className:`w-4 h-4 text-[var(--text-muted)] transition-transform ${p?"rotate-180":""}`})]}),p&&e.jsx("div",{className:"absolute z-50",style:{...k.horizontal==="left"?{left:0}:{right:0},...k.vertical==="bottom"?{top:"calc(100% + 8px)"}:{bottom:"calc(100% + 8px)"}},children:ee})]}):ee}const Ht={sm:"h-4 w-4",md:"h-5 w-5"};function Bt({label:r,description:t,error:a,size:n="md",className:s="",containerClassName:i="",disabled:d,...l}){return e.jsxs("label",{className:`group inline-flex items-start gap-2.5 ${d?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`,children:[e.jsxs("span",{className:"relative mt-0.5 inline-flex shrink-0",children:[e.jsx("input",{...l,type:"checkbox",disabled:d,"aria-invalid":!!a||l["aria-invalid"],className:`peer ${Ht[n]} appearance-none rounded border border-[var(--border)] bg-[var(--bg-input)] transition-colors checked:border-[var(--primary)] checked:bg-[var(--primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40 ${s}`}),e.jsx(w.HiCheck,{className:"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 scale-75 text-[var(--primary-fg)] opacity-0 transition peer-checked:scale-100 peer-checked:opacity-100"})]}),(r||t||a)&&e.jsxs("span",{className:"min-w-0",children:[r&&e.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:r}),t&&!a&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:t}),a&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--danger)]",children:a})]})]})}function Er(r){const t=document.createElement("textarea");t.value=r,t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}async function Tt(r){var t;if((t=navigator.clipboard)!=null&&t.writeText){await navigator.clipboard.writeText(r);return}Er(r)}function Ot(r){return typeof r=="function"?r():r}function ar({value:r,resetDelay:t=2e3,title:a,copiedTitle:n="Copiado",copiedLabel:s,icon:i=e.jsx(w.HiClipboardDocument,{size:14}),copiedIcon:d=e.jsx(w.HiCheck,{size:14}),stopPropagation:l=!0,onCopied:p,onCopyError:h,className:S="",style:k,children:g,onClick:v,type:f="button",...b}){const[m,$]=o.useState(!1),j=o.useRef(null);o.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);function z(N){$(!0),p==null||p(N),j.current&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{$(!1),j.current=null},t)}async function H(N){var B;if(l&&N.stopPropagation(),v==null||v(N),N.defaultPrevented)return;const E=Ot(r);if(E)try{await Tt(E),z(E)}catch(P){try{Er(E),z(E)}catch(O){h==null||h(O,E);return}(B=navigator.clipboard)!=null&&B.writeText||h==null||h(P,E)}}return e.jsxs("button",{...b,type:f,onClick:H,title:m?n:a,"aria-label":b["aria-label"]??(m?n:a),"data-copied":m?"true":void 0,className:`relative inline-flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-md transition-all duration-200 ${g?"min-w-7 px-2":"w-7"} ${S}`,style:{cursor:"pointer",background:m?"rgba(22,163,74,0.15)":"var(--bg-card)",border:m?"1px solid rgba(22,163,74,0.4)":"1px solid var(--border)",color:m?"#16a34a":"var(--text-secondary)",boxShadow:m?"0 0 0 3px rgba(22,163,74,0.12)":"none",...k},children:[e.jsx("span",{className:"inline-flex items-center justify-center transition-all duration-150",style:{transform:m?"scale(1.15)":"scale(1)"},children:m?d:i}),g&&e.jsx("span",{className:"text-xs font-semibold leading-none",children:m?s??g:g})]})}function At({code:r,children:t,title:a="Codigo",language:n,copyLabel:s="Copiar",copiedLabel:i="Copiado",className:d="",style:l,onCopied:p}){const h=(r??t??"").trim();return e.jsxs("div",{className:`overflow-hidden rounded-lg border ${d}`,style:{borderColor:"rgba(148, 163, 184, 0.22)",background:"#0f172a",color:"#e2e8f0",...l},children:[e.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b px-3 py-1.5",style:{borderColor:"rgba(148, 163, 184, 0.18)",background:"#111827",color:"#94a3b8"},children:[e.jsx("span",{className:"min-w-0 truncate text-[11px] font-black uppercase tracking-[0.08em]",children:a}),e.jsx(ar,{value:h,title:"Copiar codigo",copiedTitle:"Codigo copiado",copiedLabel:i,onCopied:p,className:"h-7 min-w-[72px] px-2",style:{background:"#182235",border:"1px solid rgba(148, 163, 184, 0.28)",color:"#f8fafc"},children:s})]}),e.jsx("pre",{className:"m-0 overflow-x-auto p-3 text-xs leading-6",style:{background:"#0f172a",color:"#e2e8f0",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'},children:e.jsx("code",{className:n?`language-${n}`:void 0,children:h})})]})}function $r(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function nr({value:r,onChange:t,options:a,placeholder:n="Seleccionar…",emptyLabel:s,disabled:i=!1,className:d="",style:l,height:p=40,padding:h="0 10px",searchable:S=!0,minOptionsForSearch:k=6}){const[g,v]=o.useState(!1),[f,b]=o.useState(""),[m,$]=o.useState(-1),[j,z]=o.useState(!1),[H,N]=o.useState({}),E=o.useRef(null),B=o.useRef(null),P=o.useRef(null),O=o.useRef(null),T=S&&a.length>=k,I=a.find(u=>u.value===r)??null,F=T&&f.trim()?a.filter(u=>{var D;return u.label.toLowerCase().includes(f.toLowerCase())||((D=u.sublabel)==null?void 0:D.toLowerCase().includes(f.toLowerCase()))}):a,G=o.useCallback(()=>{const u=E.current;if(!u)return;const D=u.getBoundingClientRect(),U=T?272:212,J=window.innerHeight-D.bottom,K=J<U&&D.top>J;N({position:"fixed",left:D.left,top:K?void 0:D.bottom+4,bottom:K?window.innerHeight-D.top+4:void 0,width:D.width,zIndex:9999})},[T]);o.useEffect(()=>z(!0),[]),o.useEffect(()=>{if(!g)return;function u(D){var J,K;const U=D.target;!((J=E.current)!=null&&J.contains(U))&&!((K=B.current)!=null&&K.contains(U))&&(v(!1),b(""))}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[g]),o.useEffect(()=>{g&&($(-1),G(),T&&setTimeout(()=>{var u;return(u=P.current)==null?void 0:u.focus()},0))},[g,T,G]),o.useEffect(()=>{if(g)return window.addEventListener("resize",G),window.addEventListener("scroll",G,!0),()=>{window.removeEventListener("resize",G),window.removeEventListener("scroll",G,!0)}},[g,G]),o.useEffect(()=>{if(m<0||!O.current)return;const u=O.current.children[m];u==null||u.scrollIntoView({block:"nearest"})},[m]);const W=o.useCallback(u=>{t(u),v(!1),b("")},[t]);function Z(u){if(!g){(u.key==="Enter"||u.key===" "||u.key==="ArrowDown")&&(u.preventDefault(),v(!0));return}u.key==="Escape"?(u.preventDefault(),v(!1),b("")):u.key==="ArrowDown"?(u.preventDefault(),$(D=>Math.min(D+1,F.length-1))):u.key==="ArrowUp"?(u.preventDefault(),$(D=>Math.max(D-1,s?-1:0))):u.key==="Enter"&&(u.preventDefault(),m===-1&&s?W(""):F[m]&&W(F[m].value))}const ee=e.jsxs("div",{ref:B,className:"rounded-xl shadow-xl overflow-hidden",style:{...H,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[T&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[e.jsx(w.HiMagnifyingGlass,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:P,value:f,onChange:u=>{b(u.target.value),$(-1)},placeholder:"Buscar…",className:"min-w-0 flex-1 text-sm bg-transparent outline-none",style:{color:"var(--text-main)"}}),f&&e.jsx("button",{type:"button",onMouseDown:u=>{u.preventDefault(),b("")},children:e.jsx(w.HiXMark,{className:"w-3.5 h-3.5",style:{color:"var(--text-muted)"}})})]}),e.jsxs("ul",{ref:O,role:"listbox",className:"overflow-y-auto",style:{maxHeight:T?220:180,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[s&&e.jsx("li",{role:"option","aria-selected":r==="",onMouseDown:u=>{u.preventDefault(),W("")},onMouseEnter:()=>$(-1),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:m===-1?"var(--bg-hover)":"transparent",color:"var(--text-muted)",fontStyle:"italic"},children:s}),F.map((u,D)=>{const J=D===m,K=u.value===r;return e.jsxs("li",{role:"option","aria-selected":K,onMouseDown:te=>{te.preventDefault(),u.disabled||W(u.value)},onMouseEnter:()=>!u.disabled&&$(D),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:J?"var(--bg-hover)":K?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:u.disabled?"var(--text-muted)":"var(--text-main)",cursor:u.disabled?"not-allowed":"pointer",boxShadow:K?"inset 2px 0 0 var(--primary)":void 0},children:[u.color&&e.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:u.color}}),e.jsxs("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:[e.jsx("span",{className:"truncate",children:u.label}),u.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:u.sublabel})]}),u.badge&&e.jsx("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:u.badge})]},u.value)}),F.length===0&&e.jsx("li",{className:"px-3 py-4 text-sm text-center",style:{color:"var(--text-muted)"},children:"Sin resultados"})]})]});return e.jsxs("div",{ref:E,className:`relative ${d||"w-full"}`,style:l,onKeyDown:Z,children:[e.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&v(u=>!u),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{height:$r(p),padding:$r(h),background:"var(--bg-input)",color:I?"var(--text-main)":"var(--text-muted)",border:g?"1px solid var(--primary)":"1px solid var(--border)",opacity:i?.5:1,cursor:i?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":g,children:[(I==null?void 0:I.color)&&e.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:I.color}}),e.jsx("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:I?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"truncate",children:I.label}),I.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:I.sublabel})]}):e.jsx("span",{className:"truncate",children:n})}),I&&s?e.jsx("span",{role:"button",tabIndex:-1,onMouseDown:u=>{u.preventDefault(),u.stopPropagation(),W("")},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:e.jsx(w.HiXMark,{className:"w-3 h-3"})}):e.jsx(w.HiChevronDown,{className:"flex-shrink-0 w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:g?"rotate(180deg)":"rotate(0deg)"}})]}),g&&j&&Ee.createPortal(ee,document.body)]})}function Ue(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function It({value:r,onChange:t,placeholder:a="Buscar...",className:n="",height:s=40,padding:i="0 10px 0 30px",iconLeft:d=10}){return e.jsxs("div",{className:`relative ${n}`,children:[e.jsx(w.HiMagnifyingGlass,{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)] pointer-events-none",style:{left:Ue(d)}}),e.jsx("input",{type:"text",value:r,onChange:l=>t(l.target.value),placeholder:a,className:"w-full rounded-lg border border-[var(--border)] [background:var(--bg-card)] text-sm text-[var(--text-main)] placeholder:text-[var(--text-muted)] outline-none transition-[border-color,box-shadow] focus:border-primary focus:ring-2 focus:ring-primary/20",style:{height:Ue(s),padding:Ue(i)}})]})}function Pt({value:r,onChange:t,options:a,placeholder:n,icon:s,className:i="",height:d=40,padding:l,iconLeft:p=10,searchable:h=!0}){const S=s?a.map((k,g)=>g===0&&!k.color?{...k,sublabel:k.sublabel??void 0}:k):a;return e.jsxs("div",{className:`relative ${i}`,children:[s&&e.jsx("span",{className:"pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-[var(--text-muted)]",style:{left:Ue(p)},children:s}),e.jsx(nr,{value:r,onChange:t,options:S,placeholder:n,searchable:h,minOptionsForSearch:5,height:d,padding:l??(s?"0 10px 0 30px":"0 10px"),className:"[&>button]:text-sm [&>button]:[background:var(--bg-card)]"})]})}const zt={sm:"24rem",md:"28rem",lg:"32rem",xl:"40rem","2xl":"48rem","4xl":"56rem","5xl":"64rem"},qe=180;function Mr({open:r,onClose:t,title:a,subtitle:n,leadingIcon:s,headerActions:i,footer:d,children:l,size:p="md",maxWidth:h,zIndex:S=1e3,closeOnBackdrop:k=!0,closeOnEscape:g=!0,showCloseButton:v=!0,placement:f="center",bodyClassName:b="px-6 py-5",panelClassName:m="",backdropClassName:$="bg-black/50 backdrop-blur-sm",contentClassName:j="p-4",ariaLabel:z,frameless:H=!1}){const[N,E]=o.useState(!1),[B,P]=o.useState(!1),O=o.useRef(null);if(o.useEffect(()=>(r?(O.current&&clearTimeout(O.current),E(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>P(!0)))):(P(!1),O.current=setTimeout(()=>E(!1),qe+40)),()=>{O.current&&clearTimeout(O.current)}),[r]),o.useEffect(()=>{if(r)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[r]),o.useEffect(()=>{if(!r||!g)return;const Z=ee=>{ee.key==="Escape"&&t()};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[g,t,r]),!N)return null;const T=a||n||s||i||v,I=h??zt[p],F=f==="bottom-mobile"?"items-end sm:items-center justify-center p-0 sm:p-4":"items-center justify-center",G=f==="bottom-mobile"?"rounded-t-2xl sm:rounded-2xl":"rounded-2xl",W=B?"translateY(0) scale(1)":f==="bottom-mobile"?"translateY(16px) scale(0.98)":"translateY(10px) scale(0.96)";return Ee.createPortal(e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":z??a,className:`fixed inset-0 flex ${F} ${j}`,style:{zIndex:S},children:[e.jsx("div",{className:`absolute inset-0 ${$}`,onClick:k?t:void 0,style:{opacity:B?1:0,transition:`opacity ${qe}ms ease`}}),e.jsxs("div",{className:`relative z-10 flex max-h-[92dvh] w-full flex-col overflow-hidden ${H?"shadow-none":"shadow-2xl"} ${G} ${m}`,style:{maxWidth:I,background:H?"transparent":"var(--bg-card)",border:H?"none":"1px solid var(--border)",opacity:B?1:0,transform:W,transition:`opacity ${qe}ms ease, transform ${qe}ms ease`},onClick:Z=>Z.stopPropagation(),children:[T&&e.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 px-6 py-4",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s&&e.jsx("div",{className:"flex-shrink-0",children:s}),(a||n)&&e.jsxs("div",{className:"min-w-0",children:[a&&e.jsx("h2",{className:"truncate text-base font-semibold",style:{color:"var(--text-main)"},children:a}),n&&e.jsx("p",{className:"truncate text-xs",style:{color:"var(--text-muted)"},children:n})]})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[i,v&&e.jsx(he,{variant:"icon",onClick:t,title:"Cerrar",children:e.jsx(w.HiXMark,{className:"h-5 w-5"})})]})]}),e.jsx("div",{className:`min-h-0 flex-1 overflow-y-auto ${b}`,children:l}),d&&e.jsx("div",{className:"flex flex-shrink-0 justify-end gap-2 px-6 py-4",style:{borderTop:"1px solid var(--border)"},children:d})]})]}),document.body)}const jt={danger:{iconBg:"rgba(239,68,68,0.12)",iconColor:"var(--danger)",btnBg:"var(--danger)",btnColor:"#fff"},warning:{iconBg:"rgba(245,158,11,0.12)",iconColor:"var(--warning)",btnBg:"var(--warning)",btnColor:"#fff"},primary:{iconBg:"rgba(59,130,246,0.12)",iconColor:"var(--primary)",btnBg:"var(--primary)",btnColor:"#fff"}};function _t({open:r,title:t,description:a,confirmLabel:n="Confirmar",cancelLabel:s="Cancelar",variant:i="danger",onConfirm:d,onCancel:l}){const p=jt[i];return e.jsxs(Mr,{open:r,onClose:l,size:"sm",zIndex:9998,showCloseButton:!1,bodyClassName:"p-6",panelClassName:"px-1",ariaLabel:t,children:[e.jsx(he,{variant:"icon",onClick:l,className:"absolute right-3 top-3 h-7 w-7 hover:opacity-70",style:{color:"var(--text-muted)"},"aria-label":"Cancelar",children:e.jsx(w.HiXMark,{className:"h-4 w-4"})}),e.jsx("div",{className:"mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{background:p.iconBg},children:e.jsx(w.HiExclamationTriangle,{className:"h-5 w-5",style:{color:p.iconColor}})}),e.jsx("h2",{className:"mb-1 text-base font-semibold",style:{color:"var(--text-main)"},children:t}),a&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:a}),e.jsxs("div",{className:"mt-6 flex gap-2",children:[e.jsx(he,{variant:"secondary",onClick:l,className:"flex-1",style:{background:"var(--bg-input)"},children:s}),e.jsx(he,{variant:"danger",onClick:d,className:"flex-1",style:{background:p.btnBg,color:p.btnColor,borderColor:"transparent"},children:n})]})]})}function Ft(r,t){const a=typeof r=="function"?r():r;return t?t(a):a}function Wt({url:r,resolveUrl:t,title:a="Copiar link",copiedTitle:n="Link copiado",icon:s=e.jsx(w.HiLink,{className:"h-3.5 w-3.5"}),...i}){return e.jsx(ar,{...i,value:()=>Ft(r,t),title:a,copiedTitle:n,icon:s})}const Ut="[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0",qt=[];function Pe(r){if(!r)return 150;const t=parseInt(r,10);return isNaN(t)||t<=0?150:t}function $e(r,t){const a=r.minWidth??80,n=r.maxWidth??1/0;return Math.min(n,Math.max(a,t))}function Gt(r,t){if(t<=7)return Array.from({length:t},(n,s)=>s+1);const a=[1];r>3&&a.push("...");for(let n=Math.max(2,r-1);n<=Math.min(t-1,r+1);n++)a.push(n);return r<t-2&&a.push("..."),a.push(t),a}function Me(r,t){var d;const a=new Set(t.filter(l=>l.hideable!==!1).map(l=>l.key)),n=Array.from(new Set(r??[])).filter(l=>a.has(l));if(t.filter(l=>!n.includes(l.key)).length>0)return n;const i=(d=t.find(l=>l.hideable!==!1))==null?void 0:d.key;return i?n.filter(l=>l!==i):[]}function Dr({children:r,className:t="",style:a}){return e.jsx(We,{onlyWhenOverflow:!0,className:t,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",...a},children:r})}function Yt({columns:r,data:t,getRowId:a,loading:n=!1,skeletonRows:s=8,emptyIcon:i,emptyText:d="Sin resultados",onRowClick:l,selected:p,onToggleOne:h,onToggleAll:S,highlightSelected:k=!0,rowClassName:g,getRowCategory:v,stickyHeader:f=!0,pageSize:b=25,pageSizeOptions:m=[25,50,100],pageSizeSelectWidth:$=62,pageSizeSelectHeight:j=30,pageSizeSelectPadding:z="0 7px",totalRows:H,page:N,onPageChange:E,onPageSizeChange:B,storageKey:P,stickyFirstColumn:O=!1,bottomOffset:T=0,compact:I=!0,restrictHeight:F=!0,minTableWidth:G,enableColumnVisibility:W=!1,hiddenColumnKeys:Z,defaultHiddenColumnKeys:ee=qt,onHiddenColumnKeysChange:u,columnVisibilityLabel:D="Columnas"}){const U=r.map(c=>c.key).join(","),[J,K]=o.useState(!P),te=o.useRef(null),le=o.useRef(!P),x=Z!==void 0,[Q,oe]=o.useState(()=>Me(ee,r)),V=Me(x?Z:Q,r),[ae,A]=o.useState(!1),[X,R]=o.useState(null),[de,be]=o.useState({}),Y=o.useRef(null),xe=o.useRef(null),Ke=(c,y)=>50+(c*17+y*13+7)%40,Te=o.useRef(null),[Oe,Ve]=o.useState(void 0),[se,Ze]=o.useState(!1);o.useEffect(()=>{const y=b!==!1?32:0,C=12;function _(){if(Ze(window.innerWidth<640),!Te.current)return;const q=Te.current.getBoundingClientRect().top;Ve(Math.max(120,window.innerHeight-q-y-C-T))}return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[n,b,T]);const[we,Ce]=o.useState(()=>r.map(c=>c.key)),[Ne,Ae]=o.useState(()=>Object.fromEntries(r.map(c=>[c.key,$e(c,Pe(c.width))])));o.useEffect(()=>{const c=r.map(C=>C.key);if(!P){Ce(c),x||oe(Me(ee,r)),le.current=!1,K(!0);return}let y=!1;return le.current=!1,K(!1),fetch(`/api/user/preferences/datatables?key=${encodeURIComponent(P)}`,{cache:"no-store"}).then(C=>C.ok?C.json():null).then(C=>{var Re,nt,ot;if(y)return;const _=(Re=C==null?void 0:C.settings)==null?void 0:Re.columnOrder,q=Array.isArray(_)?_.filter(me=>c.includes(me)):[],ne=c.filter(me=>!q.includes(me)),ce=q.length>0?[...q,...ne]:c,Be=Object.fromEntries(r.map(me=>[me.key,$e(me,Pe(me.width))])),re=((nt=C==null?void 0:C.settings)==null?void 0:nt.columnWidths)??{},fe=Object.fromEntries(r.map(me=>[me.key,$e(me,re[me.key]??Be[me.key])])),Qe=Me(((ot=C==null?void 0:C.settings)==null?void 0:ot.hiddenColumnKeys)??ee,r);Ce(ce),Ae(fe),x||oe(Qe),te.current=JSON.stringify({columnOrder:ce,columnWidths:fe,hiddenColumnKeys:Qe}),le.current=!0}).catch(()=>{if(!y){Ce(c);const C=Object.fromEntries(r.map(q=>[q.key,$e(q,Pe(q.width))]));Ae(C);const _=Me(ee,r);x||oe(_),te.current=JSON.stringify({columnOrder:c,columnWidths:C,hiddenColumnKeys:_}),le.current=!0}}).finally(()=>{y||K(!0)}),()=>{y=!0}},[P,U,r,ee,x]),o.useEffect(()=>{if(!P||!J||!le.current)return;const c={columnOrder:we,columnWidths:Ne,hiddenColumnKeys:V},y=JSON.stringify(c);if(y===te.current)return;const C=window.setTimeout(()=>{fetch("/api/user/preferences/datatables",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:P,settings:c})}).then(_=>{_.ok&&(te.current=y)}).catch(()=>{})},300);return()=>window.clearTimeout(C)},[we,Ne,V,P,J]),o.useEffect(()=>{Ce(c=>{const y=r.map(q=>q.key),C=c.filter(q=>y.includes(q)),_=y.filter(q=>!C.includes(q));return[...C,..._]})},[U,r]);const je=we.map(c=>r.find(y=>y.key===c)).filter(c=>!!c),M=je.filter(c=>!V.includes(c.key));function ue(c){const y=Me(c,r);x||oe(y),u==null||u(y)}function pe(c){ue(V.includes(c)?V.filter(y=>y!==c):[...V,c])}function De(){ue([])}const ie=o.useCallback((c=xe.current)=>{if(!c)return;const y=c.getBoundingClientRect(),C=256,_=Math.min(Math.max(8,y.right-C),window.innerWidth-C-8),q=window.innerHeight-y.bottom,ne=q<288&&y.top>q?void 0:y.bottom+6,ce=ne===void 0?window.innerHeight-y.top+6:void 0;be({position:"fixed",zIndex:9999,left:_,top:ne,bottom:ce,width:C})},[]);function _e(c,y){c.preventDefault(),c.stopPropagation();const C=xe.current===c.currentTarget&&X===y;if(ae&&C){A(!1),R(null);return}xe.current=c.currentTarget,R(y),ie(c.currentTarget),A(!0)}o.useEffect(()=>{Ae(c=>{const y=Object.fromEntries(r.map(C=>[C.key,$e(C,Pe(C.width))]));return Object.fromEntries(r.map(C=>[C.key,$e(C,c[C.key]??y[C.key])]))})},[U,r]),o.useEffect(()=>{x||oe(c=>Me(c,r))},[U,r,x]),o.useEffect(()=>{function c(_){var ne,ce;const q=_.target;!((ne=Y.current)!=null&&ne.contains(q))&&!((ce=xe.current)!=null&&ce.contains(q))&&(A(!1),R(null))}function y(_){_.key==="Escape"&&(A(!1),R(null))}function C(){ie()}return ae&&(document.addEventListener("mousedown",c),window.addEventListener("keydown",y),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0)),()=>{document.removeEventListener("mousedown",c),window.removeEventListener("keydown",y),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[ae,ie]);const ke=o.useRef(null);o.useEffect(()=>{function c(C){const _=ke.current;if(!_)return;const q=C.clientX-_.startX,ne=r.find(ce=>ce.key===_.colKey);ne&&Ae(ce=>({...ce,[_.colKey]:$e(ne,_.startWidth+q)}))}function y(){ke.current&&(ke.current=null,document.body.style.cursor="",document.body.style.userSelect="")}return document.addEventListener("pointermove",c),document.addEventListener("pointerup",y),()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",y)}},[r]);const Je=o.useRef(null),[Vr,lr]=o.useState(null);function rn(c,y){Je.current=we.indexOf(c),y.dataTransfer.effectAllowed="move"}function tn(c,y){y.preventDefault(),y.dataTransfer.dropEffect="move";const C=we.indexOf(c);Vr!==C&&lr(C)}function an(c,y){y.preventDefault();const C=Je.current,_=we.indexOf(c);C!==null&&C!==_&&Ce(q=>{const ne=[...q],[ce]=ne.splice(C,1);return ne.splice(_,0,ce),ne}),Je.current=null,lr(null)}function nn(){Je.current=null,lr(null)}const[ve,Zr]=o.useState(null);function on(c){c.sortKey&&Zr(y=>(y==null?void 0:y.key)===c.key?{key:c.key,dir:y.dir==="asc"?"desc":"asc"}:{key:c.key,dir:"asc"})}const[sn,ir]=o.useState(1),[Jr,ln]=o.useState(b===!1?0:b);o.useEffect(()=>{ir(1)},[t]);const Ie=!!(E&&B),Le=b!==!1,ge=Ie?N??1:sn,He=Ie||Le?Jr:t.length,ye=!!p&&!!h&&!!S,cr=ye?40:0,cn=ye&&t.length>0&&p.size===t.length,dn=ye&&p.size>0&&p.size<t.length,dr=o.useMemo(()=>{if(!ve)return t;const c=r.find(y=>y.key===ve.key&&y.sortKey);return c!=null&&c.sortKey?[...t].sort((y,C)=>{const _=y[c.sortKey],q=C[c.sortKey],ne=_===q?0:_==null?1:q==null||_<q?-1:1;return ve.dir==="asc"?ne:-ne}):t},[t,ve,r]),Qr=o.useMemo(()=>{if(Ie||!Le)return dr;const c=(ge-1)*He;return dr.slice(c,c+He)},[dr,Ie,Le,ge,He]),Fe=H??t.length,ur=Le?Math.max(1,Math.ceil(Fe/He)):1,un=Le?(ge-1)*He+1:1,fn=Le?Math.min(ge*He,Fe):Fe;function fr(c){const y=Math.max(1,Math.min(c,ur));Ie?E(y):ir(y)}function pn(c){ln(c),Ie?(B(c),E(1)):ir(1),B&&B(c)}const Rr=c=>c==="center"?"text-center":c==="right"?"text-right":"text-left",hn="color-mix(in srgb, var(--primary) 6%, var(--bg-card))",bn=M.length+(ye?1:0);o.useEffect(()=>{ve&&V.includes(ve.key)&&Zr(null)},[V,ve]);function et(c){return c?typeof c=="string"?{key:c,label:c}:c:null}const rt=()=>e.jsxs("tr",{style:{background:"color-mix(in srgb, var(--bg-input) 72%, transparent)"},children:[ye&&e.jsx("th",{className:`${I?"px-2 py-1.5":"px-3 py-2.5"} w-10`,style:O?{position:"sticky",left:0,zIndex:12,background:"color-mix(in srgb, var(--bg-input) 72%, transparent)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:"inset 0 -2px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"2px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("input",{type:"checkbox",checked:cn,ref:c=>{c&&(c.indeterminate=dn)},onChange:S,className:"rounded cursor-pointer accent-[var(--primary)]"})}),M.map((c,y)=>{const C=(ve==null?void 0:ve.key)===c.key,_=!!c.sortKey,q=O&&!se&&y===0,ne=Vr===y,Be=(Ne[c.key]??Pe(c.width))<120;return e.jsxs("th",{className:`group select-none ${Be?"text-left":Rr(c.align)}`,style:{...q?{position:"sticky",left:cr,zIndex:12,background:"color-mix(in srgb, var(--bg-input) 72%, transparent)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -2px 0 var(--border)",borderRight:"1px solid var(--border)"}:{position:"relative",borderBottom:"2px solid var(--border)",borderRight:"1px solid var(--border)"},color:C?"var(--primary)":"var(--text-muted)",whiteSpace:"nowrap",transition:"color 0.15s",borderLeft:ne?"2px solid var(--primary)":"2px solid transparent",cursor:_?"pointer":"default",padding:W?I?"5px 48px 5px 6px":"7px 52px 7px 6px":I?"5px 24px 5px 6px":"7px 28px 7px 6px"},onDragOver:re=>tn(c.key,re),onDrop:re=>an(c.key,re),onClick:_?()=>on(c):void 0,children:[e.jsx("span",{draggable:!0,onDragStart:re=>{re.stopPropagation(),rn(c.key,re)},onDragEnd:re=>{re.stopPropagation(),nn()},onClick:re=>re.stopPropagation(),title:"Arrastrar para reordenar",className:"inline-flex items-center mr-1 opacity-0 group-hover:opacity-40 transition-opacity",style:{cursor:"grab",color:"var(--text-muted)",verticalAlign:"middle"},children:e.jsx(st.MdDragIndicator,{size:15})}),e.jsx(Dr,{className:"inline-block max-w-full align-middle",style:{width:W?"calc(100% - 42px)":"calc(100% - 22px)",textAlign:Be?"left":c.align==="center"?"center":c.align==="right"?"right":"left"},children:e.jsxs("span",{className:`inline-flex max-w-full items-center gap-1 font-semibold uppercase tracking-wider ${I?"text-[11px]":"text-xs"}`,children:[e.jsx("span",{className:"min-w-0 truncate",children:c.header}),_&&e.jsx("span",{className:"flex-shrink-0 opacity-60",children:C?ve.dir==="asc"?e.jsx(w.HiChevronUp,{className:"w-3 h-3"}):e.jsx(w.HiChevronDown,{className:"w-3 h-3"}):e.jsx(w.HiChevronUpDown,{className:"w-3 h-3 opacity-40"})})]})}),W&&e.jsx("button",{type:"button","aria-haspopup":"menu","aria-expanded":ae&&X===c.key,"aria-label":D,title:D,onClick:re=>_e(re,c.key),className:`absolute top-1/2 right-3 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md opacity-0 transition-colors transition-opacity hover:bg-[var(--bg-card)] group-hover:opacity-100 focus:opacity-100 ${ae&&X===c.key?"opacity-100":""}`,style:{color:"var(--text-muted)",zIndex:4},children:e.jsx(w.HiEllipsisVertical,{className:"h-4 w-4"})}),e.jsx("span",{role:"separator","aria-orientation":"vertical",title:"Arrastrar para redimensionar",onPointerDown:re=>{re.preventDefault(),re.stopPropagation(),ke.current={colKey:c.key,startX:re.clientX,startWidth:Ne[c.key]??150},document.body.style.cursor="col-resize",document.body.style.userSelect="none"},onClick:re=>re.stopPropagation(),className:"absolute right-0 top-0 h-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",style:{width:12,cursor:"col-resize",zIndex:3},children:e.jsx("span",{style:{width:3,height:"40%",borderRadius:2,background:"var(--primary)",display:"block"}})})]},c.key)})]}),tt=()=>{if(!W||!ae||typeof document>"u")return null;const c=V.length;return Ee.createPortal(e.jsxs("div",{ref:Y,role:"menu",className:"overflow-hidden rounded-lg border p-1 shadow-xl",style:{...de,borderColor:"var(--border)",background:"var(--bg-card)"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-2 py-1.5",children:[e.jsx("span",{className:"min-w-0 truncate text-xs font-semibold uppercase text-[var(--text-muted)]",children:c>0?`${M.length} de ${r.length} visibles`:`${r.length} visibles`}),e.jsx("button",{type:"button",onClick:De,disabled:c===0,className:"rounded px-1.5 py-0.5 text-xs font-medium text-[var(--primary)] transition-colors hover:bg-[var(--bg-input)] disabled:opacity-40",children:"Mostrar todas"})]}),e.jsx("div",{className:"max-h-72 overflow-auto py-1",children:je.map(y=>{const C=!V.includes(y.key),q=!(y.hideable!==!1)||C&&M.length<=1;return e.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":C,disabled:q,onClick:()=>pe(y.key),className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",style:{color:"var(--text-main)"},children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded border",style:{borderColor:C?"var(--primary)":"var(--border)",background:C?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:C&&e.jsx(w.HiCheck,{className:"h-3 w-3"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:y.header})]},y.key)})})]}),document.body)},at=()=>{if(!Le||n)return null;const c=Gt(ge,ur);return e.jsxs("div",{className:`grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 rounded-b-xl border-t text-xs select-none ${I?"px-2 py-0.5":"px-3 py-1"}`,style:{borderColor:"var(--border)",background:"var(--bg-input)"},children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{style:{color:"var(--text-muted)"},children:Fe===0?"0 filas":`${un}–${fn} de ${Fe}`}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{style:{color:"var(--text-muted)"},children:"Filas:"}),e.jsx(nr,{value:String(He),onChange:y=>pn(Number(y)),options:m.map(y=>({value:String(y),label:String(y)})),placeholder:"Filas",searchable:!1,height:j,padding:z,className:"shrink-0 [&>button]:rounded-md [&>button]:text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",style:{width:$}})]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[e.jsx("button",{disabled:ge<=1,onClick:()=>fr(ge-1),className:"rounded p-0.5 transition-colors disabled:opacity-30",style:{color:"var(--text-muted)",background:"transparent"},children:e.jsx(w.HiChevronLeft,{className:"h-3.5 w-3.5"})}),c.map((y,C)=>y==="..."?e.jsx("span",{className:"px-1",style:{color:"var(--text-muted)"},children:"…"},`e${C}`):e.jsx("button",{onClick:()=>fr(y),className:"h-5 w-5 rounded text-[11px] font-medium transition-colors",style:{background:y===ge?"var(--primary)":"transparent",color:y===ge?"var(--primary-fg)":"var(--text-muted)"},children:y},y)),e.jsx("button",{disabled:ge>=ur,onClick:()=>fr(ge+1),className:"rounded p-0.5 transition-colors disabled:opacity-30",style:{color:"var(--text-muted)",background:"transparent"},children:e.jsx(w.HiChevronRight,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{"aria-hidden":"true"})]})};return n&&t.length===0?e.jsxs("div",{className:"w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",style:{border:"1px solid var(--border)"},children:[tt(),e.jsx("div",{ref:Te,className:"min-w-0 max-w-full overflow-hidden rounded-t-xl",children:e.jsx(hr.OverlayScrollbarsComponent,{options:{scrollbars:{autoHide:"leave",autoHideDelay:200}},className:"w-full",style:{maxHeight:F?Oe:void 0,maxWidth:"100%"},defer:!0,children:e.jsxs("table",{className:"text-sm",style:{tableLayout:"fixed",width:"100%",minWidth:G??"max-content",borderCollapse:"separate",borderSpacing:0},children:[e.jsxs("colgroup",{children:[ye&&e.jsx("col",{style:{width:40}}),M.map(c=>e.jsx("col",{style:{width:Ne[c.key]??150}},c.key))]}),e.jsx("thead",{style:f?{position:"sticky",top:0,zIndex:10,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"}:void 0,children:rt()}),e.jsx("tbody",{children:Array.from({length:s}).map((c,y)=>e.jsxs("tr",{children:[ye&&e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} w-10`,style:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"}}),M.map((C,_)=>{const q=O&&!se&&_===0;return e.jsx("td",{className:I?"px-2 py-1.5":"px-3 py-2",style:q?{position:"sticky",left:cr,zIndex:1,background:"color-mix(in srgb, var(--bg-card) 72%, transparent)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("div",{className:"h-3.5 rounded-full animate-pulse",style:{background:"var(--border)",width:`${Ke(y,_)}%`,minWidth:32}})},C.key)})]},y))})]})})}),at()]}):!n&&t.length===0?e.jsxs("div",{className:"py-20 flex flex-col items-center gap-3",children:[i&&e.jsx("div",{style:{color:"var(--text-muted)",opacity:.5},children:i}),e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:d})]}):e.jsxs("div",{className:"w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",style:{border:"1px solid var(--border)"},children:[tt(),e.jsx("div",{ref:Te,className:"min-w-0 max-w-full overflow-hidden rounded-t-xl",children:e.jsx(hr.OverlayScrollbarsComponent,{options:{scrollbars:{autoHide:"leave",autoHideDelay:200}},className:"w-full",style:{maxHeight:F?Oe:void 0,maxWidth:"100%"},defer:!0,children:e.jsxs("table",{className:"text-sm",style:{tableLayout:"fixed",width:"100%",minWidth:G??"max-content",borderCollapse:"separate",borderSpacing:0},children:[e.jsxs("colgroup",{children:[ye&&e.jsx("col",{style:{width:40}}),M.map(c=>e.jsx("col",{style:{width:Ne[c.key]??150}},c.key))]}),e.jsx("thead",{style:f?{position:"sticky",top:0,zIndex:10,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"}:void 0,children:rt()}),e.jsx("tbody",{children:Qr.map((c,y)=>{const C=a(c),_=et(v==null?void 0:v(c)),q=y>0?et(v==null?void 0:v(Qr[y-1])):null,ne=_&&_.key!==(q==null?void 0:q.key),ce=ye&&p.has(C),Be=!!l,re=ce&&k?"color-mix(in srgb, var(--primary) 8%, var(--bg-card))":y%2===1?"color-mix(in srgb, var(--bg-input) 50%, var(--bg-card))":"var(--bg-card)";return e.jsxs(o.Fragment,{children:[ne&&e.jsx("tr",{className:_.className??"",children:e.jsx("td",{colSpan:bn,className:I?"px-2 py-2":"px-3 py-3",style:{background:"color-mix(in srgb, var(--primary) 8%, var(--bg-input))",borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("div",{className:"flex min-w-0 items-center justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-xs font-semibold uppercase tracking-wider text-[var(--text-main)]",children:_.label}),_.description&&e.jsx("div",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:_.description})]})})})}),e.jsxs("tr",{onClick:Be?()=>l(c):void 0,className:`transition-colors ${Be?"cursor-pointer":""} ${g?g(c):""}`,style:{"--dt-row-bg":re,"--dt-sticky-bg":re,background:"var(--dt-row-bg)"},onMouseEnter:fe=>{ce||(fe.currentTarget.style.setProperty("--dt-row-bg","var(--bg-hover)"),fe.currentTarget.style.setProperty("--dt-sticky-bg",hn))},onMouseLeave:fe=>{fe.currentTarget.style.setProperty("--dt-row-bg",re),fe.currentTarget.style.setProperty("--dt-sticky-bg",re)},children:[ye&&e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} w-10`,style:O?{position:"sticky",left:0,zIndex:3,background:"var(--dt-sticky-bg)",boxShadow:"inset 0 -1px 0 var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},onClick:fe=>{fe.stopPropagation(),h(C)},children:e.jsx("input",{type:"checkbox",checked:ce,onClick:fe=>fe.stopPropagation(),onChange:()=>h(C),className:"rounded cursor-pointer accent-[var(--primary)]"})}),M.map((fe,Qe)=>{const Re=O&&!se&&Qe===0;return e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} ${Ut} ${Rr(fe.align)} ${fe.className??""}`,style:{overflow:"hidden",whiteSpace:"nowrap",...Re?{position:"sticky",left:cr,zIndex:3,background:"var(--dt-sticky-bg)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"}},children:e.jsx(Dr,{children:fe.cell(c)})},fe.key)})]})]},C)})})]})})}),at()]})}function ze(r){return r?new Date(`${r}T12:00:00`):void 0}function Lr(r){return r.toISOString().slice(0,10)}function Xt({calendarMonth:r,displayIndex:t}){const{previousMonth:a,nextMonth:n,goToMonth:s,months:i,labels:d,formatters:l}=br.useDayPicker(),p=!!a&&t===0,h=!!n&&t===i.length-1;return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",color:"var(--text-main)",marginBottom:6},children:[e.jsx("span",{style:{fontWeight:700},children:l.formatCaption(r.date)}),e.jsx("button",{type:"button","aria-label":d.labelPrevious(a),onClick:()=>a&&s(a),disabled:!p,style:{height:28,width:28,borderRadius:8,border:"1px solid var(--border)",background:"var(--bg-card)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--text-main)",opacity:p?1:.45,cursor:p?"pointer":"not-allowed"},children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsx("button",{type:"button","aria-label":d.labelNext(n),onClick:()=>n&&s(n),disabled:!h,style:{height:28,width:28,borderRadius:8,border:"1px solid var(--border)",background:"var(--bg-card)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--text-main)",opacity:h?1:.45,cursor:h?"pointer":"not-allowed"},children:e.jsx(w.HiChevronRight,{size:16})})]})}function Kt(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Vt({startDate:r,endDate:t,onChange:a,minDate:n,viewMonth:s,numberOfMonths:i=1,showSummary:d=!0,startLabel:l="Inicio",endLabel:p="Regreso"}){const h={from:ze(r),to:ze(t)},S=ze(n),[k,g]=o.useState(ze(s||r));return o.useEffect(()=>{g(ze(s||r))},[s,r]),e.jsxs("div",{children:[e.jsx("div",{style:{borderRadius:10,overflow:"hidden",border:"1px solid var(--border)",background:"var(--bg-input)",display:"flex",justifyContent:"center",padding:"10px 8px"},children:e.jsx(br.DayPicker,{mode:"range",selected:h,month:k,onMonthChange:g,onSelect:v=>{const f=v!=null&&v.from?Lr(v.from):r,b=v!=null&&v.to?Lr(v.to):"";a({startDate:f,endDate:b})},numberOfMonths:i,hideNavigation:!0,disabled:S?{before:S}:void 0,showOutsideDays:!1,components:{MonthCaption:Xt},className:"text-sm",classNames:{root:"w-full",months:"flex gap-3 justify-center",month:"space-y-2",month_caption:"flex items-center justify-between px-1",caption_label:"capitalize",nav:"flex items-center gap-1",button_previous:"h-8 w-8 inline-flex items-center justify-center rounded-md transition-colors",button_next:"h-8 w-8 inline-flex items-center justify-center rounded-md transition-colors",month_grid:"w-full border-collapse",weekdays:"grid grid-cols-7 gap-1 mb-1",weekday:"text-[11px] font-semibold text-center",week:"grid grid-cols-7 gap-1",day:"h-9 w-9 p-0 flex items-center justify-center",day_button:"h-9 w-9 rounded-md text-sm font-medium transition-colors outline-none",selected:"font-semibold",range_start:"font-semibold",range_middle:"font-medium",range_end:"font-semibold",today:"font-bold",disabled:"opacity-40 cursor-not-allowed",hidden:"invisible"},styles:{month_caption:{color:"var(--text-main)",marginBottom:6,display:"flex",alignItems:"center",justifyContent:"space-between"},caption_label:{color:"var(--text-main)",fontWeight:700},nav:{position:"static",display:"flex",alignItems:"center",gap:6},weekday:{color:"var(--text-muted)",textTransform:"lowercase"},button_previous:{height:32,width:32,background:"var(--bg-card)",color:"var(--text-main)",border:"1px solid var(--border)"},button_next:{height:32,width:32,background:"var(--bg-card)",color:"var(--text-main)",border:"1px solid var(--border)"},day_button:{color:"var(--text-main)",borderRadius:8},chevron:{fill:"var(--text-main)"},today:{border:"1px solid color-mix(in srgb, var(--primary) 35%, transparent)"},disabled:{color:"var(--text-muted)"}},modifiersStyles:{selected:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_start:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_end:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_middle:{background:"color-mix(in srgb, var(--primary) 20%, transparent)",color:"var(--text-main)"}},formatters:{formatCaption:v=>Kt(new Intl.DateTimeFormat("es-MX",{month:"long",year:"numeric"}).format(v)),formatWeekdayName:v=>new Intl.DateTimeFormat("es-MX",{weekday:"short"}).format(v)},labels:{labelMonthDropdown:()=>"Mes",labelYearDropdown:()=>"Año"}})}),d&&r&&e.jsxs("div",{style:{marginTop:8,fontSize:12,color:"var(--text-muted)",display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsxs("span",{children:[l,":"," ",e.jsx("strong",{style:{color:"var(--text-main)"},children:r})]}),t&&e.jsxs("span",{children:[p,":"," ",e.jsx("strong",{style:{color:"var(--text-main)"},children:t})]})]})]})}function Zt(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function Jt({trigger:r,items:t,align:a="end",width:n=220,disabled:s=!1,className:i="",menuClassName:d="",onOpenChange:l}){const[p,h]=o.useState(!1),[S,k]=o.useState(!1),[g,v]=o.useState({}),f=o.useRef(null),b=o.useRef(null),m=o.useCallback(N=>{h(N),l==null||l(N)},[l]),$=o.useCallback(()=>{const N=f.current;if(!N)return;const E=N.getBoundingClientRect(),B=typeof n=="number"?n:E.width,P=typeof n=="number"?n:Math.max(E.width,180),O=a==="end"?Math.max(8,E.right-P):Math.min(E.left,window.innerWidth-P-8),T=window.innerHeight-E.bottom,I=T<240&&E.top>T?void 0:E.bottom+6,F=I===void 0?window.innerHeight-E.top+6:void 0;v({position:"fixed",zIndex:9999,left:O,top:I,bottom:F,width:Zt(typeof n=="number"?B:n)})},[a,n]);o.useEffect(()=>k(!0),[]),o.useEffect(()=>{if(!p)return;$();const N=B=>{var O,T;const P=B.target;!((O=f.current)!=null&&O.contains(P))&&!((T=b.current)!=null&&T.contains(P))&&m(!1)},E=B=>{B.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",N),window.addEventListener("keydown",E),window.addEventListener("resize",$),window.addEventListener("scroll",$,!0),()=>{document.removeEventListener("mousedown",N),window.removeEventListener("keydown",E),window.removeEventListener("resize",$),window.removeEventListener("scroll",$,!0)}},[p,m,$]);const j=N=>{s||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),m(!p))},z=o.isValidElement(r)?o.cloneElement(r,{onClick:()=>!s&&m(!p)}):r,H=p?e.jsx("div",{ref:b,role:"menu",className:`overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-1 shadow-xl ${d}`,style:g,children:t.map(N=>e.jsxs("div",{children:[N.separatorBefore&&e.jsx("div",{className:"my-1 border-t border-[var(--border)]"}),e.jsxs("button",{type:"button",role:"menuitem",disabled:N.disabled,onClick:()=>{var E;N.disabled||((E=N.onSelect)==null||E.call(N),m(!1))},className:"flex w-full min-w-0 items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",style:{color:N.danger?"var(--danger)":"var(--text-main)"},children:[N.icon&&e.jsx("span",{className:"mt-0.5 shrink-0",children:N.icon}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:N.label}),N.description&&e.jsx("span",{className:"block truncate text-xs text-[var(--text-muted)]",children:N.description})]})]})]},N.id))}):null;return e.jsxs("span",{ref:f,role:"button",tabIndex:s?-1:0,"aria-haspopup":"menu","aria-expanded":p,onKeyDown:j,className:`inline-flex ${s?"pointer-events-none opacity-60":""} ${i}`,children:[z,S&&H?Ee.createPortal(H,document.body):null]})}function Qt({open:r,onClose:t,title:a,subtitle:n,leadingIcon:s,confirmLabel:i="Guardar",onConfirm:d,loading:l=!1,confirmDisabled:p=!1,headerActions:h,bodyClassName:S="flex-1 overflow-y-auto px-6 py-5",width:k=440,children:g}){const[v,f]=o.useState(!1);return o.useEffect(()=>{f(!0)},[]),o.useEffect(()=>(document.body.style.overflow=r?"hidden":"",()=>{document.body.style.overflow=""}),[r]),o.useEffect(()=>{if(!r)return;const b=m=>{m.key==="Escape"&&t()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[r,t]),v?Ee.createPortal(e.jsxs("div",{"aria-hidden":!r,className:`fixed inset-0 z-[1000] flex transition-opacity duration-300 ${r?"opacity-100":"opacity-0 pointer-events-none"}`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),e.jsxs("div",{className:`absolute inset-y-0 right-0 flex flex-col shadow-2xl transition-transform duration-300 ${r?"translate-x-0":"translate-x-full"}`,style:{width:`min(100vw, ${k}px)`,background:"var(--bg-card)",borderLeft:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(he,{variant:"icon",onClick:t,title:"Cerrar",children:e.jsx(w.HiXMark,{className:"w-5 h-5"})}),s&&e.jsx("div",{className:"flex-shrink-0",children:s}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold truncate",style:{color:"var(--text-main)"},children:a}),n&&e.jsx("p",{className:"text-xs truncate",style:{color:"var(--text-muted)"},children:n})]})]}),(h||d)&&e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[h,d&&e.jsxs(e.Fragment,{children:[e.jsx(he,{variant:"secondary",size:"sm",onClick:t,style:{background:"var(--bg-input)"},children:"Cancelar"}),e.jsx(he,{variant:"primary",size:"sm",icon:e.jsx(lt.FiSave,{className:"w-4 h-4"}),onClick:d,loading:l,disabled:p,title:i})]})]})]}),e.jsx("div",{"data-drawer-scroll":"true",className:S,children:g})]})]}),document.body):null}const Rt={sm:"min-h-[160px] p-4",md:"min-h-[220px] p-6",lg:"min-h-[300px] p-8"};function ea({title:r="Sin resultados",description:t,icon:a=e.jsx(w.HiInbox,{className:"h-5 w-5"}),action:n,secondaryAction:s,size:i="md",className:d=""}){return e.jsx("div",{className:`flex items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] text-center ${Rt[i]} ${d}`,children:e.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3",children:[a&&e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]",children:a}),e.jsxs("div",{className:"space-y-1",children:[r&&e.jsx("h3",{className:"text-sm font-semibold text-[var(--text-main)]",children:r}),t&&e.jsx("div",{className:"text-sm leading-5 text-[var(--text-muted)]",children:t})]}),(n||s)&&e.jsxs("div",{className:"mt-1 flex flex-wrap items-center justify-center gap-2",children:[s,n]})]})})}function Hr({label:r,children:t,helperText:a,error:n,labelAction:s,required:i=!1,className:d="",contentClassName:l=""}){return e.jsxs("label",{className:`flex flex-col gap-2 ${d}`,children:[(r||s)&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]",children:[r&&e.jsx("span",{children:r}),i&&e.jsx("span",{className:"text-[var(--danger)]",children:"*"}),s&&e.jsx("span",{className:"ml-auto normal-case",children:s})]}),e.jsx("span",{className:`block ${l}`,children:t}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]})}var Br={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Tr=o.createContext&&o.createContext(Br),ra=["attr","size","title"];function ta(r,t){if(r==null)return{};var a,n,s=aa(r,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(n=0;n<i.length;n++)a=i[n],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(r,a)&&(s[a]=r[a])}return s}function aa(r,t){if(r==null)return{};var a={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(t.indexOf(n)!==-1)continue;a[n]=r[n]}return a}function Ge(){return Ge=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(r[n]=a[n])}return r},Ge.apply(null,arguments)}function Or(r,t){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),a.push.apply(a,n)}return a}function Ye(r){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Or(Object(a),!0).forEach(function(n){na(r,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):Or(Object(a)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(a,n))})}return r}function na(r,t,a){return(t=oa(t))in r?Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[t]=a,r}function oa(r){var t=sa(r,"string");return typeof t=="symbol"?t:t+""}function sa(r,t){if(typeof r!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var n=a.call(r,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Ar(r){return r&&r.map((t,a)=>o.createElement(t.tag,Ye({key:a},t.attr),Ar(t.child)))}function Ir(r){return t=>o.createElement(la,Ge({attr:Ye({},r.attr)},t),Ar(r.child))}function la(r){var t=a=>{var{attr:n,size:s,title:i}=r,d=ta(r,ra),l=s||a.size||"1em",p;return a.className&&(p=a.className),r.className&&(p=(p?p+" ":"")+r.className),o.createElement("svg",Ge({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,n,d,{className:p,style:Ye(Ye({color:r.color||a.color},a.style),r.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&o.createElement("title",null,i),r.children)};return Tr!==void 0?o.createElement(Tr.Consumer,null,a=>t(a)):t(Br)}function ia(r){return Ir({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"},child:[]}]})(r)}function ca(r){return Ir({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,175a8,8,0,0,1-10.92-3l-19-33.2A123.23,123.23,0,0,1,162,155.46l5.87,35.22a8,8,0,0,1-6.58,9.21A8.4,8.4,0,0,1,160,200a8,8,0,0,1-7.88-6.69l-5.77-34.58a133.06,133.06,0,0,1-36.68,0l-5.77,34.58A8,8,0,0,1,96,200a8.4,8.4,0,0,1-1.32-.11,8,8,0,0,1-6.58-9.21L94,155.46a123.23,123.23,0,0,1-36.06-16.69L39,172A8,8,0,1,1,25.06,164l20-35a153.47,153.47,0,0,1-19.3-20A8,8,0,1,1,38.22,99c16.6,20.54,45.64,45,89.78,45s73.18-24.49,89.78-45A8,8,0,1,1,230.22,109a153.47,153.47,0,0,1-19.3,20l20,35A8,8,0,0,1,228,175Z"},child:[]}]})(r)}function Xe({className:r="",...t}){return e.jsx("input",{...t,className:`h-10 rounded-lg border border-[var(--border)] bg-[var(--bg-input)] px-2.5 py-1.5 text-sm text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] ${r}`})}function da({label:r,containerClassName:t="",helperText:a,error:n,labelAction:s,floatingLabel:i=!1,showPasswordToggle:d=!0,className:l="",required:p,...h}){const[S,k]=o.useState(()=>!!h.autoFocus),[g,v]=o.useState(!1),f=h.type==="password"&&d,b=f&&g?"text":h.type,m=h.value!==void 0?String(h.value).length>0:h.defaultValue!==void 0&&String(h.defaultValue).length>0,$=S||m,j={top:$?7:12,color:S?"var(--primary)":"var(--text-muted)",fontSize:$?10:13,fontWeight:$?600:400,textTransform:$?"uppercase":"none"},z=E=>{var B;k(!0),(B=h.onFocus)==null||B.call(h,E)},H=E=>{var B;k(!1),(B=h.onBlur)==null||B.call(h,E)},N=f?e.jsxs("button",{type:"button","aria-label":g?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":g,className:"absolute right-2.5 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-[var(--text-muted)] transition-colors duration-200 hover:text-[var(--primary)] focus:outline-none",tabIndex:-1,onClick:()=>v(E=>!E),children:[e.jsx("span",{"aria-hidden":"true",className:`absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-200 ease-out ${g?"scale-y-0 rotate-[-8deg] opacity-0":"scale-y-100 rotate-0 opacity-100"}`,children:e.jsx(ia,{className:"h-[18px] w-[18px]"})}),e.jsx("span",{"aria-hidden":"true",className:`absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-200 ease-out ${g?"scale-y-100 rotate-0 opacity-100":"scale-y-0 rotate-[8deg] opacity-0"}`,children:e.jsx(ca,{className:"h-[18px] w-[18px]"})})]}):null;return i?e.jsxs("label",{className:`flex flex-col gap-2 ${t}`,children:[e.jsxs("span",{className:"relative block",children:[e.jsx(Xe,{...h,type:b,required:p,placeholder:" ","aria-invalid":!!n||h["aria-invalid"],"data-has-value":m?"true":void 0,className:`h-11 w-full pt-5 ${f?"pr-10":""} ${l}`,onFocus:z,onBlur:H}),e.jsxs("span",{className:"pointer-events-none absolute left-3 transition-all duration-150",style:j,children:[r,p&&e.jsx("span",{className:"ml-1 text-[var(--danger)]",children:"*"})]}),s&&e.jsx("span",{className:"absolute right-2 transition-all duration-150",style:{top:$?7:12},children:s}),N]}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]}):e.jsxs("label",{className:`flex flex-col gap-2 ${t}`,children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]",children:[e.jsx("span",{children:r}),p&&e.jsx("span",{className:"text-[var(--danger)]",children:"*"}),s&&e.jsx("span",{className:"ml-auto normal-case",children:s})]}),f?e.jsxs("span",{className:"relative block",children:[e.jsx(Xe,{...h,type:b,required:p,"aria-invalid":!!n||h["aria-invalid"],className:`w-full pr-10 ${l}`,onFocus:z,onBlur:H}),N]}):e.jsx(Xe,{...h,required:p,"aria-invalid":!!n||h["aria-invalid"],className:l}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]})}function Pr(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function ua(r,t){return r.length!==t.length?!1:r.every((a,n)=>a===t[n])}function fa({value:r,onChange:t,options:a,placeholder:n="Seleccionar…",disabled:s=!1,className:i="",style:d,height:l=40,padding:p="0 10px",searchable:h=!0,minOptionsForSearch:S=6,maxVisibleValues:k=2,emptyText:g="Sin resultados",clearLabel:v="Limpiar seleccion"}){const[f,b]=o.useState(!1),[m,$]=o.useState(""),[j,z]=o.useState(0),[H,N]=o.useState(!1),[E,B]=o.useState({}),P=o.useRef(null),O=o.useRef(null),T=o.useRef(null),I=o.useRef(null),F=h&&a.length>=S,G=o.useMemo(()=>new Set(r),[r]),W=o.useMemo(()=>a.filter(x=>G.has(x.value)),[a,G]),Z=W.slice(0,k),ee=Math.max(0,W.length-Z.length),u=F&&m.trim()?a.filter(x=>{var Q;return x.label.toLowerCase().includes(m.toLowerCase())||((Q=x.sublabel)==null?void 0:Q.toLowerCase().includes(m.toLowerCase()))}):a,D=o.useCallback(()=>{const x=P.current;if(!x)return;const Q=x.getBoundingClientRect(),oe=F?304:244,V=window.innerHeight-Q.bottom,ae=V<oe&&Q.top>V;B({position:"fixed",left:Q.left,top:ae?void 0:Q.bottom+4,bottom:ae?window.innerHeight-Q.top+4:void 0,width:Q.width,zIndex:9999})},[F]),U=o.useCallback(x=>{ua(r,x)||t(x)},[t,r]),J=o.useCallback(x=>{const Q=a.find(V=>V.value===x);if(Q!=null&&Q.disabled)return;const oe=G.has(x)?r.filter(V=>V!==x):[...r,x];U(oe)},[U,a,r,G]),K=o.useCallback(()=>U([]),[U]);o.useEffect(()=>N(!0),[]),o.useEffect(()=>{if(!f)return;function x(Q){var V,ae;const oe=Q.target;!((V=P.current)!=null&&V.contains(oe))&&!((ae=O.current)!=null&&ae.contains(oe))&&(b(!1),$(""))}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[f]),o.useEffect(()=>{f&&(z(0),D(),F&&setTimeout(()=>{var x;return(x=T.current)==null?void 0:x.focus()},0))},[f,F,D]),o.useEffect(()=>{if(f)return window.addEventListener("resize",D),window.addEventListener("scroll",D,!0),()=>{window.removeEventListener("resize",D),window.removeEventListener("scroll",D,!0)}},[f,D]),o.useEffect(()=>{if(j<0||!I.current)return;const x=I.current.children[j];x==null||x.scrollIntoView({block:"nearest"})},[j]);function te(x){if(!f){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),b(!0));return}x.key==="Escape"&&(x.preventDefault(),b(!1),$("")),x.key==="ArrowDown"&&(x.preventDefault(),z(Q=>Math.min(Q+1,u.length-1))),x.key==="ArrowUp"&&(x.preventDefault(),z(Q=>Math.max(Q-1,0))),x.key==="Enter"&&u[j]&&(x.preventDefault(),J(u[j].value)),x.key==="Backspace"&&!m&&r.length&&(x.preventDefault(),U(r.slice(0,-1)))}const le=e.jsxs("div",{ref:O,className:"overflow-hidden rounded-xl shadow-xl",style:{...E,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[F&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[e.jsx(w.HiMagnifyingGlass,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:T,value:m,onChange:x=>{$(x.target.value),z(0)},placeholder:"Buscar…",className:"min-w-0 flex-1 bg-transparent text-sm outline-none",style:{color:"var(--text-main)"}}),m&&e.jsx("button",{type:"button",onMouseDown:x=>{x.preventDefault(),$("")},children:e.jsx(w.HiXMark,{className:"h-3.5 w-3.5",style:{color:"var(--text-muted)"}})})]}),W.length>0&&e.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",style:{borderBottom:"1px solid var(--border)",color:"var(--text-muted)"},children:[e.jsxs("span",{children:[W.length," seleccionados"]}),e.jsx("button",{type:"button",onMouseDown:x=>{x.preventDefault(),K()},className:"font-semibold transition-colors hover:text-[var(--primary)]",children:v})]}),e.jsxs("ul",{ref:I,role:"listbox","aria-multiselectable":"true",className:"overflow-y-auto",style:{maxHeight:F?220:200,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[u.map((x,Q)=>{const oe=Q===j,V=G.has(x.value);return e.jsxs("li",{role:"option","aria-selected":V,onMouseDown:ae=>{ae.preventDefault(),J(x.value)},onMouseEnter:()=>!x.disabled&&z(Q),className:"flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors",style:{background:oe?"var(--bg-hover)":V?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:x.disabled?"var(--text-muted)":"var(--text-main)",cursor:x.disabled?"not-allowed":"pointer",opacity:x.disabled?.58:1},children:[e.jsx("span",{className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border",style:{borderColor:V?"var(--primary)":"var(--border)",background:V?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:V&&e.jsx(w.HiCheck,{className:"h-3 w-3"})}),x.color&&e.jsx("span",{className:"h-2.5 w-2.5 flex-shrink-0 rounded-full",style:{background:x.color}}),e.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1 overflow-hidden",children:[e.jsx("span",{className:"truncate",children:x.label}),x.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:x.sublabel})]}),x.badge&&e.jsx("span",{className:"flex-shrink-0 text-xs",style:{color:"var(--text-muted)"},children:x.badge})]},x.value)}),u.length===0&&e.jsx("li",{className:"px-3 py-4 text-center text-sm",style:{color:"var(--text-muted)"},children:g})]})]});return e.jsxs("div",{ref:P,className:`relative ${i||"w-full"}`,style:d,onKeyDown:te,children:[e.jsxs("button",{type:"button",disabled:s,onClick:()=>!s&&b(x=>!x),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{minHeight:Pr(l),padding:Pr(p),background:"var(--bg-input)",color:W.length?"var(--text-main)":"var(--text-muted)",border:f?"1px solid var(--primary)":"1px solid var(--border)",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":f,children:[e.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5 overflow-hidden",children:Z.length?e.jsxs(e.Fragment,{children:[Z.map(x=>e.jsxs("span",{className:"inline-flex max-w-[160px] items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-semibold",style:{background:"var(--bg-card)",borderColor:"var(--border)",color:"var(--text-main)"},children:[x.color&&e.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full",style:{background:x.color}}),e.jsx("span",{className:"truncate",children:x.label})]},x.value)),ee>0&&e.jsxs("span",{className:"inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-semibold",style:{background:"color-mix(in srgb, var(--primary) 10%, transparent)",color:"var(--primary)"},children:["+",ee]})]}):e.jsx("span",{className:"truncate",children:n})}),W.length?e.jsx("span",{role:"button",tabIndex:-1,"aria-label":v,onMouseDown:x=>{x.preventDefault(),x.stopPropagation(),K()},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:e.jsx(w.HiXMark,{className:"h-3 w-3"})}):e.jsx(w.HiChevronDown,{className:"h-4 w-4 flex-shrink-0 transition-transform",style:{color:"var(--text-muted)",transform:f?"rotate(180deg)":"rotate(0deg)"}})]}),f&&H&&Ee.createPortal(le,document.body)]})}function pa(r,t,a){const n=[],s=Math.max(2,r-a),i=Math.min(t-1,r+a);n.push(1),s>2&&n.push("...");for(let d=s;d<=i;d+=1)n.push(d);return i<t-1&&n.push("..."),t>1&&n.push(t),n}function ha({page:r,totalPages:t,onPageChange:a,disabled:n=!1,siblingCount:s=1,className:i=""}){const d=Math.max(1,t),l=Math.min(Math.max(1,r),d),p=pa(l,d,s);return e.jsxs("nav",{"aria-label":"Paginacion",className:`inline-flex items-center gap-1 ${i}`,children:[e.jsx(he,{variant:"icon",size:"xs","aria-label":"Pagina anterior",disabled:n||l<=1,onClick:()=>a(l-1),children:e.jsx(w.HiChevronLeft,{className:"h-4 w-4"})}),p.map((h,S)=>h==="..."?e.jsx("span",{className:"flex h-8 min-w-8 items-center justify-center text-xs font-semibold text-[var(--text-muted)]",children:"..."},`ellipsis-${S}`):e.jsx("button",{type:"button","aria-current":h===l?"page":void 0,disabled:n,onClick:()=>a(h),className:"flex h-8 min-w-8 items-center justify-center rounded-md border px-2 text-xs font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{borderColor:h===l?"var(--primary)":"var(--border)",background:h===l?"var(--primary)":"var(--bg-card)",color:h===l?"var(--primary-fg)":"var(--text-secondary)"},children:h},h)),e.jsx(he,{variant:"icon",size:"xs","aria-label":"Pagina siguiente",disabled:n||l>=d,onClick:()=>a(l+1),children:e.jsx(w.HiChevronRight,{className:"h-4 w-4"})})]})}function ba({value:r,onChange:t,options:a,name:n,label:s,orientation:i="vertical",disabled:d=!1,className:l="",optionClassName:p=""}){return e.jsxs("fieldset",{className:`min-w-0 ${l}`,disabled:d,children:[s&&e.jsx("legend",{className:"mb-2 text-xs font-semibold uppercase text-[var(--text-muted)]",children:s}),e.jsx("div",{className:i==="horizontal"?"flex flex-wrap gap-2":"flex flex-col gap-2",children:a.map(h=>{const S=h.value===r,k=d||h.disabled;return e.jsxs("label",{className:`inline-flex min-w-0 items-start gap-2 rounded-lg border px-2.5 py-1.5 transition-colors ${k?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-[var(--bg-input)]"} ${p}`,style:{borderColor:S?"color-mix(in srgb, var(--primary) 48%, var(--border))":"var(--border)",background:S?"color-mix(in srgb, var(--primary) 8%, transparent)":"var(--bg-card)"},children:[e.jsxs("span",{className:"relative mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--bg-input)]",children:[e.jsx("input",{type:"radio",name:n,value:h.value,checked:S,disabled:k,onChange:()=>t(h.value),className:"absolute inset-0 opacity-0"}),e.jsx("span",{className:`h-2 w-2 rounded-full transition ${S?"scale-100 opacity-100":"scale-50 opacity-0"}`,style:{background:"var(--primary)"}})]}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:h.label}),h.description&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:h.description})]})]},h.value)})})]})}function ma({title:r,subtitle:t,icon:a,actions:n,children:s,footer:i,className:d="",bodyClassName:l="p-4"}){const p=r||t||a||n;return e.jsxs("section",{className:`overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${d}`,children:[p&&e.jsxs("header",{className:"flex items-center justify-between gap-3 border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[a&&e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--primary)]",children:a}),e.jsxs("div",{className:"min-w-0",children:[r&&e.jsx("h3",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:r}),t&&e.jsx("div",{className:"truncate text-xs text-[var(--text-muted)]",children:t})]})]}),n&&e.jsx("div",{className:"shrink-0",children:n})]}),e.jsx("div",{className:l,children:s}),i&&e.jsx("footer",{className:"border-t border-[var(--border)] px-4 py-3",children:i})]})}const xa={neutral:{text:"var(--text-secondary)",bg:"var(--bg-input)",border:"var(--border)"},primary:{text:"var(--primary)",bg:"color-mix(in srgb, var(--primary) 10%, transparent)",border:"color-mix(in srgb, var(--primary) 24%, var(--border))"},success:{text:"#047857",bg:"rgba(16, 185, 129, 0.11)",border:"rgba(16, 185, 129, 0.24)"},warning:{text:"#b45309",bg:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)"},danger:{text:"var(--danger)",bg:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))"},info:{text:"#2563eb",bg:"rgba(59, 130, 246, 0.11)",border:"rgba(59, 130, 246, 0.24)"}},va={xs:"min-h-5 px-1.5 text-[10px]",sm:"min-h-6 px-2 text-xs",md:"min-h-7 px-2.5 text-sm"};function ga({children:r,tone:t="neutral",size:a="sm",icon:n,dot:s=!1,className:i=""}){const d=xa[t];return e.jsxs("span",{className:`inline-flex max-w-full shrink-0 items-center gap-1.5 rounded-full border font-semibold leading-none ${va[a]} ${i}`,style:{color:d.text,background:d.bg,borderColor:d.border},children:[s&&e.jsx("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:d.text}}),n&&e.jsx("span",{className:"shrink-0",children:n}),e.jsx("span",{className:"min-w-0 truncate",children:r})]})}function ya({tabs:r,activeTabId:t,defaultActiveTabId:a,onTabChange:n,ariaLabel:s="Pestanas",variant:i="underline",className:d="",listClassName:l="",panelClassName:p=""}){const h=r.find(f=>!f.disabled)??r[0],S=t??a??(h==null?void 0:h.id),k=r.find(f=>f.id===S)??h,g=f=>{f.disabled||n==null||n(f.id)},v=f=>{const b=r.filter($=>!$.disabled);if(!b.length||!k)return;const m=b.findIndex($=>$.id===k.id);(f.key==="ArrowRight"||f.key==="ArrowDown")&&(f.preventDefault(),g(b[(m+1)%b.length])),(f.key==="ArrowLeft"||f.key==="ArrowUp")&&(f.preventDefault(),g(b[(m-1+b.length)%b.length])),f.key==="Home"&&(f.preventDefault(),g(b[0])),f.key==="End"&&(f.preventDefault(),g(b[b.length-1]))};return e.jsxs("div",{className:d,children:[e.jsx("div",{role:"tablist","aria-label":s,onKeyDown:v,className:`flex min-w-0 gap-1 overflow-x-auto ${i==="underline"?"border-b border-[var(--border)]":"rounded-lg border border-[var(--border)] bg-[var(--bg-input)] p-1"} ${l}`,children:r.map(f=>{const b=f.id===(k==null?void 0:k.id);return e.jsxs("button",{type:"button",role:"tab","aria-selected":b,"aria-controls":`${f.id}-panel`,id:`${f.id}-tab`,disabled:f.disabled,tabIndex:b?0:-1,onClick:()=>g(f),className:`inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2.5 text-sm font-semibold transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${i==="underline"?"border-b-2":"rounded-md border"}`,style:{color:b?"var(--primary)":"var(--text-muted)",borderColor:b?"var(--primary)":"transparent",background:i==="pills"&&b?"var(--bg-card)":"transparent"},children:[f.icon&&e.jsx("span",{className:"shrink-0",children:f.icon}),e.jsx("span",{children:f.label}),f.badge&&e.jsx("span",{className:"shrink-0",children:f.badge})]},f.id)})}),(k==null?void 0:k.content)!==void 0&&e.jsx("div",{role:"tabpanel",id:`${k.id}-panel`,"aria-labelledby":`${k.id}-tab`,className:`pt-4 ${p}`,children:k.content})]})}function Se(...r){return r.filter(Boolean).join(" ")}function wa({steps:r,activeStepId:t,initialStepId:a,completedStepIds:n,defaultCompletedStepIds:s=[],onActiveStepChange:i,onCompletedStepIdsChange:d,onBlockedStep:l,allowBackNavigation:p=!0,showFooter:h=!0,previousLabel:S="Anterior",nextLabel:k="Siguiente",blockedNextLabel:g="Completa este paso",className:v="",headerClassName:f="",contentClassName:b="",footerClassName:m=""}){var ae;const $=((ae=r[0])==null?void 0:ae.id)??"",[j,z]=o.useState(a??$),[H,N]=o.useState(s),E=t??j,B=n??H,P=o.useMemo(()=>new Set(B),[B]),O=Math.max(0,r.findIndex(A=>A.id===E)),T=r[O]??r[0],I=r.length<=1?100:O/(r.length-1)*100,F=A=>{n||N(A),d==null||d(A)},G=A=>{const X=r.find(R=>R.id===A);X&&(t||z(A),i==null||i(A,X))},W=A=>P.has(A),Z=A=>r.slice(0,A).find(X=>!X.optional&&!P.has(X.id)),ee=A=>{const X=r[A];return!X||X.disabled?!1:A===O||p&&A<O?!0:!Z(A)},u=A=>{const X=r.findIndex(R=>R.id===A);return X>=0&&ee(X)},D=A=>{const X=r.findIndex(R=>R.id===A);if(X<0)return!1;if(!ee(X)){const R=Z(X);return R&&(l==null||l(r[X],R)),!1}return G(A),!0},U=(A=T==null?void 0:T.id)=>{!A||P.has(A)||F([...B,A])},J=(A=T==null?void 0:T.id)=>{if(!A)return;const X=r.findIndex(de=>de.id===A),R=B.filter(de=>{const be=r.findIndex(Y=>Y.id===de);return be>=0&&be<X});F(R),X>=0&&O>X&&G(A)},K=()=>O<=0?!1:D(r[O-1].id),te=()=>{const A=r[O+1];return A?D(A.id):!1},le={activeStep:T,activeIndex:O,completedStepIds:B,isCompleted:W,isUnlocked:u,completeStep:U,uncompleteStep:J,goToStep:D,goNext:te,goPrevious:K};if(!T)return null;const x=r[O+1],Q=O>0,oe=x?u(x.id):!1,V=typeof T.content=="function"?T.content(le):T.content;return e.jsxs("section",{className:Se("overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",v),children:[e.jsxs("div",{className:Se("border-b border-[var(--border)] bg-[var(--bg-input)]",f),children:[e.jsx("div",{className:"relative h-1 overflow-hidden bg-[var(--border)]/55",children:e.jsx("div",{className:"h-full rounded-r-full bg-[var(--primary)] transition-[width] duration-500 ease-out",style:{width:`${I}%`}})}),e.jsx("div",{className:"grid gap-2 p-2",style:{gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`},children:r.map((A,X)=>{const R=A.id===T.id,de=W(A.id),be=ee(X),Y=Z(X);return e.jsxs("button",{type:"button",disabled:!be,"aria-current":R?"step":void 0,"aria-disabled":!be,title:!be&&Y?`Completa ${Y.title}`:A.title,onClick:()=>D(A.id),className:Se("group relative min-h-16 min-w-0 overflow-hidden rounded-md border p-3 text-left transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/35 disabled:cursor-not-allowed",R&&"border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",de&&!R&&"border-[var(--primary)]/35 bg-[var(--bg-card)]",!R&&!de&&be&&"border-transparent bg-[var(--bg-card)]/45 hover:border-[var(--border)] hover:bg-[var(--bg-card)]",!be&&"border-transparent bg-[var(--bg-card)]/35 opacity-60"),children:[e.jsx("span",{className:Se("absolute inset-x-0 top-0 h-0.5 origin-left scale-x-0 bg-[var(--primary)] transition-transform duration-300",R&&"scale-x-100")}),e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:Se("grid h-7 w-7 shrink-0 place-items-center rounded-full border text-xs font-bold transition-all duration-200",R&&"border-[var(--primary)] bg-[var(--primary)] text-[var(--primary-fg)]",de&&!R&&"border-[var(--primary)] bg-[var(--primary)]/12 text-[var(--primary)]",!de&&!R&&be&&"border-[var(--border)] text-[var(--text-muted)]",!be&&"border-[var(--border)] text-[var(--text-muted)]"),children:de?e.jsx(w.HiCheck,{className:"h-4 w-4"}):be?X+1:e.jsx(w.HiLockClosed,{className:"h-3.5 w-3.5"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:Se("block truncate text-xs font-semibold transition-colors duration-200",R?"text-[var(--text-main)]":"text-[var(--text-secondary)]"),children:[X+1,". ",A.title]}),A.description&&e.jsx("span",{className:"mt-1 block truncate text-[11px] text-[var(--text-muted)]",children:A.description})]}),A.badge&&e.jsx("span",{className:"shrink-0",children:A.badge})]})]},A.id)})})]}),e.jsx("div",{className:Se("min-h-72 animate-[stepWizardIn_220ms_ease-out] p-5",b),children:V},T.id),h&&e.jsxs("div",{className:Se("flex flex-wrap items-center justify-between gap-3 border-t border-[var(--border)] bg-[var(--bg-input)] px-4 py-3",m),children:[e.jsx(he,{variant:"secondary",height:38,padding:"0 14px",icon:e.jsx(w.HiChevronLeft,{}),disabled:!Q,onClick:K,children:S}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Paso ",O+1," de ",r.length]}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-[var(--border)]"}),e.jsxs("span",{children:[B.length," completados"]})]}),e.jsx(he,{height:38,padding:"0 14px",icon:e.jsx(w.HiChevronRight,{}),disabled:!x||!oe,onClick:te,children:x&&!oe?g:k})]})]})}const Na={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-2.5 py-2 text-sm leading-5",lg:"min-h-32 px-3 py-2.5 text-sm leading-6"},ka={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"};function Sa(r,t){if(r){if(typeof r=="function"){r(t);return}r.current=t}}function Ca(r,t){return r!==void 0?String(r).length:t!==void 0?String(t).length:0}const zr=o.forwardRef(function({className:t="",wrapperClassName:a="",size:n="md",resize:s="vertical",autoResize:i=!1,minRows:d,maxRows:l,showCount:p=!1,maxCount:h,status:S="default",icon:k,action:g,style:v,value:f,defaultValue:b,maxLength:m,onInput:$,...j},z){const H=o.useRef(null),N=Ca(f,b),E=h??m,B=!!(k||g||p),P=S==="error"?"var(--danger)":S==="success"?"#16a34a":"var(--border)",O={...v??{},...d?{minHeight:`${d*24+18}px`}:null,...l?{maxHeight:`${l*24+18}px`}:null},T=()=>{const F=H.current;!F||!i||(F.style.height="auto",F.style.height=`${F.scrollHeight}px`)};o.useEffect(T,[i,f]);const I=e.jsx("textarea",{...j,ref:F=>{H.current=F,Sa(z,F)},value:f,defaultValue:b,maxLength:m,"aria-invalid":S==="error"||j["aria-invalid"],onInput:F=>{T(),$==null||$(F)},style:{...O,borderColor:P},className:`w-full rounded-lg border bg-[var(--bg-input)] text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-60 ${Na[n]} ${ka[i?"none":s]} ${k?"pl-8":""} ${g?"pr-10":""} ${t}`});return B?e.jsxs("span",{className:`relative block ${a}`,children:[k&&e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-2.5 flex h-4 w-4 items-center justify-center text-[var(--text-muted)]",children:k}),I,g&&e.jsx("span",{className:"absolute right-2 top-2 flex items-center justify-center",children:g}),p&&e.jsxs("span",{className:"absolute bottom-1.5 right-2 rounded bg-[var(--bg-input)] px-1.5 text-[10px] font-semibold text-[var(--text-muted)]",children:[N,E?`/${E}`:""]})]}):I});function Ea({label:r,containerClassName:t="",helperText:a,error:n,labelAction:s,required:i,className:d="",status:l,...p}){return e.jsx(Hr,{label:r,required:i,helperText:a,error:n,labelAction:s,className:t,children:e.jsx(zr,{...p,required:i,status:n?"error":l,className:`w-full ${d}`})})}const $a={xs:{width:28,height:16,thumb:12,padding:2},sm:{width:36,height:20,thumb:16,padding:2}};function Ma({checked:r,disabled:t,onCheckedChange:a,size:n="sm",className:s="",...i}){const d=$a[n],l=r?d.width-d.thumb-d.padding*2:0;return e.jsx("button",{...i,type:"button",role:"switch","aria-checked":r,disabled:t,onClick:()=>!t&&a(!r),className:`relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/50 disabled:cursor-not-allowed disabled:opacity-50 ${s}`,style:{width:d.width,height:d.height,background:r?"color-mix(in srgb, var(--primary) 85%, transparent)":"var(--bg-input)",border:r?"1px solid color-mix(in srgb, var(--primary) 55%, transparent)":"1px solid var(--border)"},children:e.jsx("span",{className:"absolute inline-block rounded-full transition-transform",style:{width:d.thumb,height:d.thumb,left:d.padding,top:"50%",transform:`translate(${l}px, -50%)`,background:r?"var(--primary-fg)":"var(--text-muted)"}})})}const jr=[".sidebar-scroll","[data-overlay-scroll='true']"].join(",");function Da(r){if(!(r instanceof HTMLElement)||r.dataset.overlayScroll==="false"||r.closest("[data-overlayscrollbars]")||r.matches("textarea,input,select,[contenteditable='true']"))return!1;const t=window.getComputedStyle(r);return!(![t.overflow,t.overflowX,t.overflowY].join(" ").match(/auto|scroll/)||r.clientWidth===0&&r.clientHeight===0)}function _r(r){return r.classList.contains("sidebar-scroll")}function Fr(r){_r(r)&&r.querySelectorAll(".os-scrollbar-horizontal").forEach(t=>{t.style.display="none",t.style.height="0",t.style.pointerEvents="none"})}function Wr(){return o.useEffect(()=>{const r=new WeakMap;let t=0;const a=()=>{t=0,document.querySelectorAll(jr).forEach(i=>{if(!Da(i))return;if(pr.OverlayScrollbars(i)){Fr(i);return}const l=pr.OverlayScrollbars(i,{overflow:_r(i)?{x:"hidden",y:"scroll"}:void 0,scrollbars:{autoHide:"leave",autoHideDelay:180}});Fr(i),r.set(i,l)})},n=()=>{t||(t=window.requestAnimationFrame(a))};a();const s=new MutationObserver(n);return s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","data-overlay-scroll"]}),window.addEventListener("resize",n),()=>{t&&window.cancelAnimationFrame(t),s.disconnect(),window.removeEventListener("resize",n),document.querySelectorAll(jr).forEach(i=>{var d;i instanceof HTMLElement&&((d=r.get(i))==null||d.destroy())})}},[]),null}const La={xs:{wh:"w-5 h-5",text:"text-[8px]"},sm:{wh:"w-7 h-7",text:"text-[11px]"},md:{wh:"w-9 h-9",text:"text-sm"},lg:{wh:"w-12 h-12",text:"text-base"},xl:{wh:"w-16 h-16",text:"text-xl"}},Ur=["bg-indigo-500","bg-blue-500","bg-emerald-500","bg-violet-500","bg-amber-500","bg-teal-500","bg-rose-500","bg-cyan-500"],Ha={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Ba="bonsaif.bot",Ta="Bonsaif Bot",Oa={xs:"p-0.5",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"};function qr(r){return typeof r=="string"?r.trim():""}function Aa(r){let t=0;for(const a of r)t=t*31+a.charCodeAt(0)&65535;return Ur[t%Ur.length]}function Ia(r,t){return r===Ba||t===Ta}function Pa(r,t){return`${r.replace(/\/$/,"")}${t}`}function Gr({userId:r,username:t,name:a,size:n="md",showName:s=!1,showTooltip:i,tooltipContent:d,fallbackLabel:l="Usuario",wrapperClassName:p="",labelClassName:h="",labelSize:S="xs",avatarVersion:k=0,className:g="",style:v}){var W;const[f,b]=o.useState(!1),m=typeof r=="string"&&r.trim()&&r!=="undefined"&&r!=="null"?r.trim():"";o.useEffect(()=>{b(!1)},[m,k]);const{wh:$,text:j}=La[n],z=qr(a)||qr(t)||l,H=z.trim()[0]||"?",N=typeof process<"u"&&((W=process.env)==null?void 0:W.NEXT_PUBLIC_BASE_PATH)||"",E=Ia(t,a),B=Pa(N,"/favicon.svg"),P=m?`${N}/api/user/avatar/${m}${k?`?v=${k}`:""}`:"",T={xs:20,sm:28,md:36,lg:48,xl:64}[n],I=E?e.jsx("span",{className:`${$} ${Oa[n]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${g}`,style:v,children:e.jsx("img",{src:B,alt:z,width:T,height:T,className:"h-full w-full object-contain"})}):P&&!f?e.jsx("img",{src:P,alt:z,width:T,height:T,className:`${$} rounded-full object-cover flex-shrink-0 ${g}`,style:v,onError:()=>b(!0)},`${m}-${k}`):e.jsx("span",{className:`${$} ${Aa(z)} ${j} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${g}`,style:v,title:z,children:H});if(s)return e.jsxs("span",{className:`inline-flex min-w-0 items-center gap-2 ${p}`,children:[I,e.jsx("span",{className:`min-w-0 truncate ${Ha[S]} font-medium text-[var(--text-main)] ${h}`,title:z,children:z})]});const F=i??!0,G=d??z;return F&&G?e.jsx(We,{as:"span",content:G,className:`inline-flex flex-shrink-0 ${p}`,children:I}):I}function za({href:r,className:t,children:a}){return e.jsx("a",{href:r,className:t,children:a})}function ja(r){return r.reduce((t,a)=>{const n=a.section??"Principal";return t[n]=[...t[n]??[],a],t},{})}function Yr({children:r,navItems:t=[],currentPath:a=typeof window>"u"?"/":window.location.pathname,user:n,appName:s="Bonsaif",appLogo:i,header:d,footer:l,onLogout:p,LinkComponent:h=za}){const[S,k]=o.useState(!1),g=ja(t);return e.jsxs("div",{className:"min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]",children:[e.jsx(Wr,{}),e.jsx("button",{type:"button","aria-label":"Abrir navegación",className:"fixed left-3 top-3 z-50 inline-flex h-9 w-9 items-center justify-center rounded-md border border-white/10 bg-black/70 text-white lg:hidden",onClick:()=>k(!0),children:e.jsx(w.HiBars3,{className:"h-5 w-5"})}),S&&e.jsx("button",{type:"button","aria-label":"Cerrar navegación",className:"fixed inset-0 z-40 bg-black/45 lg:hidden",onClick:()=>k(!1)}),e.jsxs("aside",{className:`fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${S?"translate-x-0":"-translate-x-full"}`,children:[e.jsxs("div",{className:"flex h-16 items-center gap-3 border-b border-white/10 px-4",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-white/10 text-white",children:i??e.jsx(w.HiHome,{className:"h-5 w-5"})}),e.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),e.jsx("button",{type:"button","aria-label":"Cerrar navegación",className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/70 hover:bg-white/10 lg:hidden",onClick:()=>k(!1),children:e.jsx(w.HiXMark,{className:"h-5 w-5"})})]}),e.jsx("nav",{className:"sidebar-scroll min-h-0 flex-1 overflow-y-auto px-3 py-4","data-overlay-scroll":"true",children:Object.entries(g).map(([v,f])=>e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35",children:[e.jsx(w.HiChevronDown,{className:"h-3.5 w-3.5"}),v]}),e.jsx("div",{className:"space-y-1",children:f.map(b=>{const m=a===b.href||a.startsWith(`${b.href}/`);return e.jsxs(h,{href:b.href,className:`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors ${m?"bg-white/10 text-white":"text-white/55 hover:bg-white/[0.06] hover:text-white/85"}`,children:[e.jsx("span",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:b.icon??e.jsx(w.HiHome,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate",children:b.label})]},b.href)})})]},v))}),e.jsxs("div",{className:"border-t border-white/10 p-3",children:[n&&e.jsxs("div",{className:"mb-3 flex min-w-0 items-center gap-3 rounded-lg bg-white/[0.04] p-2",children:[e.jsx(Gr,{name:n.initials??n.name??n.email??"Usuario",size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium text-white",children:n.name??"Usuario"}),n.email&&e.jsx("div",{className:"truncate text-xs text-white/45",children:n.email})]})]}),p&&e.jsxs(he,{variant:"ghost",className:"w-full justify-start text-white hover:bg-white/10",onClick:p,children:[e.jsx(w.HiArrowRightOnRectangle,{className:"h-4 w-4"})," Salir"]}),l]})]}),e.jsxs("div",{className:"min-h-screen lg:pl-72",children:[d,e.jsx("main",{className:"min-h-screen",children:r})]})]})}const _a={dashboard:"Dashboard",tickets:"Tickets",teams:"Equipos",projects:"Proyectos",clients:"Clientes",surveys:"Encuestas",profile:"Perfil",settings:"Configuración",notifications:"Notificaciones",changelog:"Historial",admin:"Inicio",users:"Usuarios",roles:"Roles",menus:"Menús",guards:"Guardias",vacations:"Vacaciones",audit:"Auditoría",positions:"Puestos",ranks:"Rangos","email-inbox":"Buzones","security-incidents":"Incidentes","guard-schedule":"Guardias"},or={dashboard:e.jsx(w.HiChartBar,{className:"h-5 w-5"}),tickets:e.jsx(w.HiTicket,{className:"h-5 w-5"}),teams:e.jsx(w.HiUsers,{className:"h-5 w-5"}),projects:e.jsx(w.HiRectangleGroup,{className:"h-5 w-5"}),clients:e.jsx(w.HiBuildingOffice2,{className:"h-5 w-5"}),surveys:e.jsx(w.HiClipboardDocumentList,{className:"h-5 w-5"}),profile:e.jsx(w.HiUser,{className:"h-5 w-5"}),settings:e.jsx(w.HiCog6Tooth,{className:"h-5 w-5"}),notifications:e.jsx(w.HiBell,{className:"h-5 w-5"}),changelog:e.jsx(w.HiDocumentText,{className:"h-5 w-5"}),admin:e.jsx(w.HiShieldCheck,{className:"h-5 w-5"}),users:e.jsx(w.HiUsers,{className:"h-5 w-5"}),roles:e.jsx(w.HiShieldCheck,{className:"h-5 w-5"}),menus:e.jsx(w.HiCog6Tooth,{className:"h-5 w-5"}),guards:e.jsx(w.HiCalendarDays,{className:"h-5 w-5"}),vacations:e.jsx(w.HiCalendarDays,{className:"h-5 w-5"}),audit:e.jsx(w.HiListBullet,{className:"h-5 w-5"}),positions:e.jsx(w.HiBriefcase,{className:"h-5 w-5"}),ranks:e.jsx(w.HiListBullet,{className:"h-5 w-5"}),"email-inbox":e.jsx(w.HiInbox,{className:"h-5 w-5"}),"security-incidents":e.jsx(w.HiShieldCheck,{className:"h-5 w-5"})};function Fa({href:r,className:t,style:a,children:n}){return e.jsx("a",{href:r,className:t,style:a,children:n})}function Wa(r){return r.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ua(r){return/^\d+$/.test(r)||/^[a-f0-9]{8,}$/i.test(r)}function qa(r){const t=r.split("/").filter(Boolean);if(t.length===0||t.length===1&&t[0]==="dashboard")return[];const a=decodeURIComponent(t[t.length-1]),n=t.length>1?decodeURIComponent(t[t.length-2]):void 0,s=Ua(a)&&n?n:a,i=_a[s]??Wa(s);return[{label:"Inicio",href:"/"},{label:i}]}function sr(r){return(r==null?void 0:r.querySelector(":scope > .os-viewport"))??(r==null?void 0:r.querySelector(":scope > [data-overlayscrollbars-viewport]"))}function Ga(r){const t=r.split("/").filter(Boolean),a=t[t.length-1];if(!a)return e.jsx(w.HiHome,{className:"h-5 w-5"});if(or[a])return or[a];const n=t.length>1?t[t.length-2]:"";return or[n]??e.jsx(w.HiHome,{className:"h-5 w-5"})}function Ya({title:r,subtitle:t,action:a,meta:n,icon:s,className:i="",contentClassName:d="",breadcrumbs:l,currentPath:p=typeof window>"u"?"/":window.location.pathname,showBreadcrumbs:h=!0,contained:S=!1,LinkComponent:k=Fa}){const g=o.useRef(null),[v,f]=o.useState(!1),[b,m]=o.useState(null),$=l??qa(p),j=s??Ga(p),z=h&&$.length>1;return o.useEffect(()=>{if(S){f(!1);return}let H=null,N=0,E=0;const B=()=>{const T=g.current,I=document.querySelector("[data-app-scroll='true']");return(T==null?void 0:T.closest(".os-viewport"))??(T==null?void 0:T.closest("[data-overlayscrollbars-viewport]"))??sr(I)??I??window},P=()=>{const T=H&&H!==window?H.scrollTop:window.scrollY;f(I=>I?T>24:T>72)},O=()=>{H==null||H.removeEventListener("scroll",P),H=B(),H.addEventListener("scroll",P,{passive:!0}),P()};return O(),N=window.requestAnimationFrame(O),E=window.setTimeout(O,120),()=>{window.cancelAnimationFrame(N),window.clearTimeout(E),H==null||H.removeEventListener("scroll",P)}},[S]),o.useEffect(()=>{if(S){m(null);return}let H=0;const N=[],E=()=>{const G=g.current,W=G==null?void 0:G.parentElement,Z=document.querySelector("[data-app-scroll='true']"),ee=sr(Z)??Z;if(!G||!W||!ee){m(null);return}const u=W.getBoundingClientRect(),D=window.getComputedStyle(W),U=ee.getBoundingClientRect(),J=ee instanceof HTMLElement&&ee.clientWidth>0?ee.clientWidth:U.width,K=u.left+parseFloat(D.paddingLeft||"0"),te={marginLeft:Math.round(U.left-K),width:Math.round(J)};m(le=>le&&le.marginLeft===te.marginLeft&&le.width===te.width?le:te)},B=()=>{window.cancelAnimationFrame(H),H=window.requestAnimationFrame(E)};B(),window.addEventListener("resize",B);const P=new ResizeObserver(B),O=g.current,T=O==null?void 0:O.parentElement,I=document.querySelector("[data-app-scroll='true']"),F=sr(I)??I;return[T,I,F].forEach(G=>{G&&P.observe(G)}),N.push(window.setTimeout(B,120)),N.push(window.setTimeout(B,280)),()=>{window.cancelAnimationFrame(H),window.removeEventListener("resize",B),P.disconnect(),N.forEach(G=>window.clearTimeout(G))}},[S]),e.jsx("div",{ref:g,"data-page-header":"true","data-compact":v?"true":"false",className:`sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${S?"mb-0 flex-shrink-0":"mb-4 sm:mb-0"} ${i}`,style:{...b?{marginLeft:b.marginLeft,width:b.width}:null,background:S?"var(--bg-card)":v?"var(--bg-main)":"color-mix(in srgb, var(--bg-main) 44%, transparent)",backdropFilter:"saturate(1.2) blur(14px)",WebkitBackdropFilter:"saturate(1.2) blur(14px)",borderBottom:S||v?"1px solid var(--border)":"1px solid transparent",boxShadow:v?"0 10px 28px rgba(12, 54, 53, 0.12)":"none"},children:e.jsxs("div",{className:`flex flex-wrap items-center justify-between px-4 pt-0.5 transition-[gap,min-height,padding] duration-300 ease-out ${v?"min-h-9 gap-2 sm:min-h-10 sm:gap-2.5":"min-h-10 gap-2.5 sm:min-h-11 sm:gap-3"} ${d}`,children:[e.jsxs("div",{className:`min-w-0 flex flex-1 flex-col justify-center transition-[gap,transform] duration-300 ease-out ${v?"gap-1":"gap-1.5 sm:gap-2"}`,children:[z&&e.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0 flex-shrink-0 transition-[opacity,transform] duration-300 ease-out",children:e.jsx("ol",{className:`flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${v?"text-[10px]":"text-[10px] sm:text-[11px]"}`,children:$.map((H,N)=>{const E=N===$.length-1;return e.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[N>0&&e.jsx(w.HiChevronRight,{className:"h-3.5 w-3.5 transition-[color,transform] duration-300 ease-out",style:{color:"var(--text-muted)"}}),H.href&&!E?e.jsx(k,{href:H.href,className:"truncate transition-colors duration-300 hover:underline",style:{color:"var(--text-muted)"},children:H.label}):e.jsx("span",{"aria-current":E?"page":void 0,className:E?"truncate font-semibold":"truncate",style:{color:E?"var(--text-main)":"var(--text-muted)"},children:H.label})]},`${H.label}-${N}`)})})}),e.jsxs("div",{className:`flex min-w-0 items-center transition-[gap,transform] duration-300 ease-out ${v?"gap-2":"gap-2.5 sm:gap-3"}`,children:[e.jsx("span",{className:`flex-shrink-0 transition-[color,transform,opacity] duration-300 ease-out ${v?"scale-75 opacity-80":"scale-90 opacity-100"}`,style:{color:z?"var(--text-secondary)":"var(--text-muted)"},children:j}),e.jsxs("div",{className:`flex min-w-0 flex-1 flex-wrap items-center transition-[gap] duration-300 ease-out ${v?"gap-x-2 gap-y-1":"gap-x-3 gap-y-2"}`,children:[e.jsxs("div",{className:"min-w-0 flex-shrink transition-[transform] duration-300 ease-out",children:[e.jsx("h1",{className:`truncate font-bold tracking-tight transition-[font-size,line-height,color] duration-300 ease-out ${v?"text-base sm:text-lg":"text-lg sm:text-xl"}`,style:{color:"var(--text-main)"},children:r}),t&&e.jsx("p",{"aria-hidden":v,className:`overflow-hidden text-xs transition-[max-height,opacity,transform,margin] duration-300 ease-out ${v?"mt-0 max-h-0 -translate-y-1 opacity-0":"mt-0.5 max-h-5 translate-y-0 opacity-100"}`,style:{color:"var(--text-muted)"},children:t})]}),n&&e.jsx("div",{className:`page-header-meta flex min-w-0 flex-1 basis-full items-center overflow-visible transition-[gap,opacity,transform] duration-300 ease-out sm:basis-auto ${v?"translate-y-0 gap-1.5 opacity-95":"gap-2 opacity-100"}`,children:n})]})]})]}),a&&e.jsx("div",{className:`page-header-actions ml-auto flex max-w-full flex-shrink-0 flex-wrap items-center justify-end self-center overflow-visible transition-[gap,min-height,opacity,transform] duration-300 ease-out ${v?"min-h-10 gap-1 opacity-95":"min-h-10 gap-1.5 opacity-100"}`,children:e.jsx(vr.Provider,{value:{compact:!0,headerAction:!0},children:a})})]})})}function Xa({children:r,currentPath:t=typeof window>"u"?"/":window.location.pathname,publicRoutes:a=["/","/login","/reset-password"],...n}){return a.includes(t)?e.jsx(e.Fragment,{children:r}):e.jsx(Yr,{currentPath:t,...n,children:r})}function Xr(){if(typeof window>"u")return"system";const r=localStorage.getItem("theme");return r==="light"||r==="dark"?r:r==="system"?"system":document.documentElement.classList.contains("dark")?"dark":"light"}function Ka(r,t,a){try{const n=new URL(r),s=n.searchParams.get("callbackUrl");if(s){const i=new URL(s,n.origin);return i.searchParams.set("theme",t),a&&(i.searchParams.set("primeAuthOrigin",window.location.origin),i.searchParams.set("primeAuthProjectKey",a)),n.searchParams.set("callbackUrl",`${i.pathname}${i.search}${i.hash}`),n.toString()}return n.searchParams.set("theme",t),a&&(n.searchParams.set("primeAuthOrigin",window.location.origin),n.searchParams.set("primeAuthProjectKey",a)),n.toString()}catch{return r}}function Va({name:r,src:t,projectKey:a}){const[n,s]=o.useState(()=>Xr()),i=o.useRef(null);o.useEffect(()=>{const p=new MutationObserver(()=>s(Xr()));return p.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>p.disconnect()},[]);const d=o.useMemo(()=>Ka(t,n,a),[a,t,n]),l=o.useMemo(()=>{try{return new URL(d).origin}catch{return""}},[d]);return o.useEffect(()=>{if(!a)return;const p=a;function h(S){var v,f,b;if(S.source!==((v=i.current)==null?void 0:v.contentWindow)||l&&S.origin!==l)return;if(((f=S.data)==null?void 0:f.type)==="prime-microservice:overlay"){window.dispatchEvent(new CustomEvent("prime-auth:microservice-overlay",{detail:{active:!!S.data.active}}));return}if(((b=S.data)==null?void 0:b.type)!=="prime-microservice:navigation")return;const k=S.data.path;if(!k||!k.startsWith("/")||k.startsWith("//"))return;const g=`/apps/${encodeURIComponent(p)}${k}`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==g&&(window.history.replaceState(window.history.state,"",g),window.dispatchEvent(new CustomEvent("prime-auth:microservice-navigation")))}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),window.dispatchEvent(new CustomEvent("prime-auth:microservice-overlay",{detail:{active:!1}}))}},[l,a]),e.jsx("div",{className:"flex h-full min-h-screen flex-col bg-[var(--bg-main)]",children:e.jsx("iframe",{ref:i,src:d,title:r,className:"min-h-0 flex-1 border-0 bg-[var(--bg-main)]",allow:"clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-same-origin allow-scripts",referrerPolicy:"strict-origin-when-cross-origin"})})}function Za(){const[r,t]=o.useState(""),[a,n]=o.useState(!1),[s,i]=o.useState({width:96,height:96});return o.useEffect(()=>{let d=!1;return fetch("/api/microservices/prime-suite/chat-url",{cache:"no-store"}).then(l=>l.ok?l.json():null).then(l=>{!d&&(l!=null&&l.src)&&t(l.src)}).catch(()=>{}),()=>{d=!0}},[]),o.useEffect(()=>{const d=l=>{var h;if(((h=l.data)==null?void 0:h.type)!=="prime-suite-chat:state")return;const p=!!l.data.active;n(p),i({width:Kr(l.data.width,96,720),height:Kr(l.data.height,96,560)})};return window.addEventListener("message",d),()=>window.removeEventListener("message",d)},[]),r?e.jsx("iframe",{title:"Chat Bonsaif",src:r,allow:"clipboard-write",className:"fixed bottom-0 right-0 z-[70] border-0 bg-transparent transition-[width,height] duration-200",style:{width:a?`min(${s.width}px, 100vw)`:96,height:a?`min(${s.height}px, 100vh)`:96,background:"transparent",backgroundColor:"transparent",colorScheme:"normal"}}):null}function Kr(r,t,a){const n=typeof r=="number"&&Number.isFinite(r)?r:t;return Math.max(t,Math.min(a,Math.ceil(n)))}function Ja(r){const t=document.documentElement,a=new MutationObserver(r);a.observe(t,{attributes:!0,attributeFilter:["class"]});const n=window.matchMedia("(prefers-color-scheme: dark)");return n.addEventListener("change",r),()=>{a.disconnect(),n.removeEventListener("change",r)}}function Qa(){const r=localStorage.getItem("theme")||"system",t=window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||r==="dark"||r==="system"&&t?"dark":"light"}function Ra(){return"light"}function en(){const r=o.useSyncExternalStore(Ja,Qa,Ra);return e.jsx(it.Toaster,{position:"bottom-center",theme:r,richColors:!0,closeButton:!0})}L.Alert=Ct,L.AuthShell=Yr,L.BonsaifButton=ct,L.Button=he,L.CalendarPicker=Lt,L.Checkbox=Bt,L.CodeBlock=At,L.CompactFilterSelect=Pt,L.CompactSearchInput=It,L.ConfirmDialog=_t,L.CopyButton=ar,L.CopyLinkButton=Wt,L.DataTable=Yt,L.DateRangePicker=Vt,L.Drawer=Qt,L.DropdownMenu=Jt,L.DynamicDetailTabs=kt,L.EmptyState=ea,L.FormField=Hr,L.GlobalScrollbars=Wr,L.InputField=da,L.LoadingState=yr,L.MicroserviceFrame=Va,L.Modal=Mr,L.MouseTooltip=We,L.MultiSelect=fa,L.PageHeader=Ya,L.PageSearchInput=xr,L.Pagination=ha,L.PrimeAuthRouteShell=Xa,L.PrimeAuthToaster=en,L.PrimeSuiteChatFrame=Za,L.RadioGroup=ba,L.SearchableSelect=nr,L.SectionPanel=ma,L.StatusBadge=ga,L.StepWizard=wa,L.Tabs=ya,L.TextInput=Xe,L.Textarea=zr,L.TextareaField=Ea,L.Toggle=Ma,L.UserAvatar=Gr,L.cn=mr,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(T,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react-icons/hi2"),require("react"),require("react-dom"),require("overlayscrollbars"),require("react-icons/md"),require("overlayscrollbars-react"),require("react-day-picker"),require("react-day-picker/dist/style.css"),require("react-icons/fi"),require("sonner")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-icons/hi2","react","react-dom","overlayscrollbars","react-icons/md","overlayscrollbars-react","react-day-picker","react-day-picker/dist/style.css","react-icons/fi","sonner"],e):(T=typeof globalThis<"u"?globalThis:T||self,e(T.BonsaifUI={},T.jsxRuntime,T.ReactIconsHi2,T.React,T.ReactDOM,T.OverlayScrollbarsGlobal,T.ReactIconsMd,T.OverlayScrollbarsReact,T.ReactDayPicker,T.ReactDayPickerStyles,T.ReactIconsFi,T.Sonner))})(this,(function(T,e,w,o,Ce,br,ct,mr,xr,yn,dt,ut){"use strict";"use client";function vr(...r){return r.filter(Boolean).join(" ")}function ft({variant:r="primary",className:t,type:a="button",children:n,...s}){return e.jsx("button",{className:vr("bonsaif-ui-button",`bonsaif-ui-button--${r}`,t),type:a,...s,children:n})}function gr({value:r,onChange:t,placeholder:a,className:n="",autoFocus:s=!1,forceExpanded:c=!1,onEscape:d,size:l="default",inputTabIndex:p}){const h=o.useRef(null),[S,k]=o.useState(!1),y=c||S||r.trim().length>0,v=l==="sm"?"h-9 rounded-md":"h-10 rounded-lg",u=n||"w-48 sm:w-64 lg:w-72";o.useEffect(()=>{var b;s&&((b=h.current)==null||b.focus())},[s]);const m=()=>{var b;k(!0),(b=h.current)==null||b.focus()};return e.jsxs("div",{className:`relative flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${y?u:"w-24 sm:w-28"}`,onMouseDown:b=>{y||(b.preventDefault(),m())},children:[e.jsx(w.HiMagnifyingGlass,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none transition-colors duration-200",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:h,type:"text",tabIndex:p,"aria-label":a,value:r,onChange:b=>t(b.target.value),onKeyDown:b=>{b.key==="Escape"&&(d==null||d())},placeholder:y?a:"Buscar",className:`${v} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${y?"pl-9 pr-8":"cursor-pointer pl-9 pr-3"}`,style:{background:"color-mix(in srgb, var(--bg-card) 86%, transparent)",border:"1px solid var(--border)",color:"var(--text-main)"},onFocus:b=>{k(!0),b.currentTarget.style.borderColor="var(--primary)",b.currentTarget.style.boxShadow="0 0 0 3px rgba(59,130,246,0.12)"},onBlur:b=>{k(!1),b.currentTarget.style.borderColor="var(--border)",b.currentTarget.style.boxShadow="none"}}),r&&e.jsx("button",{type:"button",onClick:()=>t(""),className:"absolute right-2 top-1/2 flex !h-6 !w-6 -translate-y-1/2 items-center justify-center rounded-full !p-0 leading-none transition-colors hover:bg-black/5",style:{color:"var(--text-muted)"},"aria-label":"Limpiar búsqueda",children:e.jsx(w.HiXMark,{className:"h-3.5 w-3.5 flex-shrink-0"})})]})}const yr=o.createContext({});function pt(r){var n;const t=Array.from(r.querySelectorAll("*")).filter(s=>{var c;return s.scrollWidth>s.clientWidth&&!!((c=s.textContent)!=null&&c.trim())&&s.tagName.toLowerCase()!=="svg"&&!s.closest("svg")});return(r.scrollWidth>r.clientWidth||t.length>0)&&(((n=t[0])==null?void 0:n.textContent)??r.textContent??"").trim()||null}function Ue({children:r,content:t,onlyWhenOverflow:a=!1,className:n="",style:s,as:c="div"}){const d=o.useRef(null),l=o.useRef(null),[p,h]=o.useState(null),[S,k]=o.useState("");o.useEffect(()=>{const u=d.current;u&&(u.querySelectorAll("[title]").forEach(m=>{const b=m.getAttribute("title");b&&(m.getAttribute("aria-label")||m.setAttribute("aria-label",b),m.removeAttribute("title"))}),u.querySelectorAll("svg title").forEach(m=>m.remove()))}),o.useLayoutEffect(()=>{if(!p)return;const u=l.current;if(!u)return;const m=12,b=14,E=u.getBoundingClientRect(),j=window.innerWidth-E.width-m,z=window.innerHeight-E.height-m;let B=p.mouseX+b,N=p.mouseY+b;B>j&&(B=p.mouseX-E.width-b),N>z&&(N=p.mouseY-E.height-b),B=Math.min(Math.max(m,B),Math.max(m,j)),N=Math.min(Math.max(m,N),Math.max(m,z)),(Math.abs(B-p.x)>.5||Math.abs(N-p.y)>.5)&&h($=>$&&{...$,x:B,y:N})},[p]);const y=(u,m)=>{const b=d.current;if(b){if(a){const E=pt(b);if(!E)return;k(E)}!a&&!t||h({mouseX:u,mouseY:m,x:u+14,y:m+14})}},v=a?S:t;return e.jsxs(e.Fragment,{children:[e.jsx(c,{ref:u=>{d.current=u},className:n,style:s,onMouseEnter:u=>y(u.clientX,u.clientY),onMouseMove:u=>{p&&y(u.clientX,u.clientY)},onMouseLeave:()=>h(null),children:r}),p&&v?Ce.createPortal(e.jsx("div",{ref:l,role:"tooltip",style:{position:"fixed",top:p.y,left:p.x,zIndex:9999,background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:6,padding:"5px 10px",fontSize:12,color:"var(--text-main)",boxShadow:"0 4px 16px rgba(0,0,0,0.35)",pointerEvents:"none",maxWidth:"min(420px, calc(100vw - 24px))",whiteSpace:"normal",lineHeight:1.6,overflowWrap:"anywhere"},children:v}),document.body):null]})}function wr(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}const ht="inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap leading-none font-medium transition-all duration-150 focus:outline-none disabled:opacity-50 rounded-lg",bt={primary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",secondary:"border border-[var(--border)] text-[var(--text-main)] hover:border-[var(--border)] hover:bg-[var(--bg-input)] active:scale-[0.98] transition-colors",danger:"border border-[var(--border)] text-[var(--danger)] hover:border-[var(--danger)] hover:bg-[var(--danger-bg)] active:scale-[0.98] transition-colors",ghost:"text-[var(--text-secondary)] hover:opacity-70",icon:"text-[var(--text-muted)] hover:text-[var(--primary)] hover:bg-primary/5"},mt="border border-[var(--border)] text-[var(--text-muted)] shadow-sm shadow-black/5 hover:border-[var(--border)] hover:bg-[var(--bg-input)] hover:text-[var(--primary)] active:scale-[0.98] transition-colors",xt={xs:"h-8 px-2.5 text-xs",sm:"h-9 px-3.5 text-xs",md:"h-10 px-3.5 text-sm",lg:"h-11 px-4 text-sm font-semibold"},vt={xs:"h-8 w-8",sm:"h-9 w-9",md:"h-10 w-10",lg:"h-10 w-10"},gt={primary:{background:"var(--bg-card)"},secondary:{background:"var(--bg-card)"},danger:{background:"var(--bg-card)"},ghost:{},icon:{}};function rr(r){return typeof r=="string"||typeof r=="number"?String(r):Array.isArray(r)?r.map(rr).join(" ").trim():o.isValidElement(r)?rr(r.props.children):""}function yt(r){return o.Children.toArray(r).find(o.isValidElement)??null}function he({variant:r="primary",size:t="md",loading:a=!1,icon:n,tooltip:s,iconOnly:c,height:d,padding:l,children:p,className:h="",disabled:S,style:k,...y}){const v=o.useContext(yr),u=c??v.iconOnly??r==="icon",m=v.compact??!1,b=v.headerAction??!1,E=m&&!b&&t==="md"?"xs":t,j=r==="icon"||u,z=b&&j,B=rr(p),N=s??y.title??y["aria-label"]??(u?B:void 0),$=N?void 0:y.title,A=y["aria-label"]??(typeof N=="string"?N:B||void 0),_=a?null:n??(u?yt(p):null),L=e.jsxs("button",{...y,title:$,"aria-label":A,"data-variant":r,"data-size":E,"data-icon":j?"true":void 0,disabled:S||a,className:`${ht} ${z?mt:bt[r]} ${j?vt[E]:xt[E]} ${m&&!j?"px-2.5":""} ${h}`,style:{...gt[r],height:wr(d),padding:wr(l),...k,...z?{width:"40px",height:"40px",padding:0,background:"var(--bg-card)",borderRadius:"8px"}:null},children:[a?e.jsx("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):_,!u&&p]});return N?e.jsx(Ue,{as:"span",content:N,className:"inline-flex shrink-0",children:L}):L}function Nr({variant:r="page",title:t="Cargando...",rows:a=6,children:n}){return r==="table"?e.jsx(kr,{rows:a}):r==="sections"?e.jsx(wt,{rows:a}):r==="cards"?e.jsx(Nt,{rows:a}):e.jsx("div",{className:"flex min-h-[240px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[e.jsx("div",{className:"h-9 w-9 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--primary)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:t}),n&&e.jsx("div",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n})]})]})})}function wt({rows:r}){return e.jsx("div",{className:"space-y-4",children:Array.from({length:Math.max(2,Math.min(r,4))}).map((t,a)=>e.jsxs("section",{className:"overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-4 w-4 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-5 w-20 animate-pulse rounded-full bg-[var(--bg-input)]"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]"}),e.jsx("div",{className:"h-8 w-8 animate-pulse rounded-md bg-[var(--bg-input)]"})]})]}),e.jsx(kr,{rows:a===0?r:Math.max(3,r-2),compact:!0})]},a))})}function Nt({rows:r}){return e.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:Array.from({length:r}).map((t,a)=>e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"h-4 w-2/3 animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"mt-3 h-3 w-full animate-pulse rounded bg-[var(--bg-input)]"}),e.jsx("div",{className:"mt-2 h-3 w-4/5 animate-pulse rounded bg-[var(--bg-input)]"})]},a))})}function kr({rows:r,compact:t=!1}){const a=t?5:6;return e.jsxs("div",{className:"overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"grid border-b border-[var(--border)]",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},children:Array.from({length:a}).map((n,s)=>e.jsx("div",{className:"px-3 py-3",children:e.jsx("div",{className:"h-3 w-2/3 animate-pulse rounded bg-[var(--bg-input)]"})},s))}),Array.from({length:r}).map((n,s)=>e.jsx("div",{className:"grid border-b border-[var(--border)] last:border-b-0",style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},children:Array.from({length:a}).map((c,d)=>e.jsx("div",{className:"px-3 py-3",children:e.jsx("div",{className:"h-3.5 animate-pulse rounded-full bg-[var(--bg-input)]",style:{width:`${52+(s*13+d*11)%36}%`}})},d))},s))]})}function Sr(r){const t=r.split("/").filter(Boolean);return(t[t.length-1]??r).replace(/^lv_/,"").split(/[-_]/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function Cr(r){return r.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function kt(r){return[r.label,Sr(r.service),r.description,r.service].filter(Boolean).join(" ")}function St(r){return typeof r=="function"?r:r.default}function Ct(r,t){return e.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-6 text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("p",{className:"text-sm font-semibold text-[var(--text-main)]",children:"No se pudo cargar este modulo"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r.message}),e.jsx(he,{className:"mt-4",height:36,padding:"0 14px",onClick:t,children:"Reintentar"})]})})}function Et({parentPanel:r,parentPanelComponent:t,renderParentPanel:a,parent:n,context:s,links:c,moduleRegistry:d,loadModule:l,activeService:p,initialService:h,onActiveServiceChange:S,canAccess:k,keepAlive:y=!0,title:v,subtitle:u,emptyState:m,loadingState:b,errorState:E=Ct,renderTabLabel:j,searchableTabs:z="auto",tabsSearchThreshold:B=6,tabsSearchPlaceholder:N="Buscar modulo...",tabsSearchValue:$,onTabsSearchChange:A,emptySearchState:_,showTabCount:L=!0,className:H="",parentClassName:F="",contentClassName:I="",tabsClassName:W=""}){var Se;const U=o.useMemo(()=>c.filter(D=>!D.hidden&&((k==null?void 0:k(D,s))??!0)),[k,s,c]),V=(Se=U.find(D=>!D.disabled))==null?void 0:Se.service,[te,f]=o.useState(h??V??""),[M,G]=o.useState({}),[Z,J]=o.useState({}),[ae,ce]=o.useState(""),[x,X]=o.useState(!1),pe=o.useRef(Z),ee=o.useRef(0),Q=$??ae,O=Cr(Q),K=z===!0||z==="auto"&&U.length>=B,R=K&&Q.trim().length>0,se=o.useMemo(()=>O?U.filter(D=>Cr(kt(D)).includes(O)):U,[O,U]),be=p??te,Y=U.find(D=>D.service===be)??U.find(D=>!D.disabled);o.useEffect(()=>{!Y&&V&&f(V)},[V,Y]),o.useEffect(()=>{pe.current=Z},[Z]);const we=D=>{D.disabled||(p||f(D.service),S==null||S(D.service,D))},Me=D=>{$===void 0&&ce(D),A==null||A(D)},je=(D,le)=>{const de=se.filter(ue=>!ue.disabled),me=de.findIndex(ue=>ue.service===le.service);me<0||((D.key==="ArrowRight"||D.key==="ArrowDown")&&(D.preventDefault(),we(de[(me+1)%de.length])),(D.key==="ArrowLeft"||D.key==="ArrowUp")&&(D.preventDefault(),we(de[(me-1+de.length)%de.length])),D.key==="Home"&&(D.preventDefault(),we(de[0])),D.key==="End"&&(D.preventDefault(),we(de[de.length-1])))},Te=o.useCallback(()=>{if(!Y)return;const D=Y.service,le=pe.current[D];if(le!=null&&le.loading||le!=null&&le.component&&y)return;const de=(d==null?void 0:d[D])??l;if(!de){J(ue=>({...ue,[D]:{loading:!1,error:new Error(`No module loader found for service "${D}".`)}}));return}const me=++ee.current;J(ue=>({...ue,[D]:{...ue[D],loading:!0,error:void 0}})),de(Y,s).then(ue=>{if(me!==ee.current&&!y)return;const Fe=St(ue);J(Oe=>({...Oe,[D]:{component:Fe,loading:!1}}))}).catch(ue=>{const Fe=ue instanceof Error?ue:new Error(String(ue));J(Oe=>({...Oe,[D]:{...Oe[D],loading:!1,error:Fe}}))})},[s,y,l,d,Y]);o.useEffect(Te,[Te]);const _e=Y?M[Y.service]??null:null,ne=Y?Z[Y.service]:void 0,Be=ne==null?void 0:ne.component,Ve=D=>{Y&&G(le=>({...le,[Y.service]:D}))},Ae=()=>{Y&&G(D=>({...D,[Y.service]:null}))},Ze={context:s,parent:n,links:c,visibleLinks:U,filteredLinks:se,selectedLink:Y,selectedService:Y==null?void 0:Y.service,activeItemId:_e,tabsSearch:Q,onSelectService:we,onOpenDetail:Ve,onBackToList:Ae},ke=a?a(Ze):t?e.jsx(t,{...Ze}):r;return e.jsxs("section",{className:`grid min-h-[520px] gap-4 lg:grid-cols-[minmax(260px,360px)_minmax(0,1fr)] ${H}`,children:[e.jsx("aside",{className:`min-w-0 rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-4 ${F}`,children:ke}),e.jsxs("div",{className:`relative min-w-0 overflow-visible rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${I}`,children:[(v||u||K||L)&&e.jsx("div",{className:"relative border-b border-[var(--border)] px-4 py-3",children:e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[v&&e.jsx("h2",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:v}),u&&e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-[var(--text-muted)]",children:u})]}),(K||L)&&e.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center justify-end gap-2",children:[L&&e.jsxs("span",{className:"hidden text-xs font-semibold text-[var(--text-muted)] transition-opacity duration-200 sm:inline",children:[se.length," / ",U.length]}),K&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${x?"w-[min(20rem,44vw)] translate-x-0 opacity-100":"w-0 translate-x-2 opacity-0"}`,"aria-hidden":!x,children:e.jsx(gr,{value:Q,onChange:Me,placeholder:N,className:"w-full",autoFocus:x,forceExpanded:!0,onEscape:()=>X(!1),size:"sm",inputTabIndex:x?0:-1})}),e.jsx("button",{type:"button","aria-label":x?"Cerrar busqueda":"Buscar tabs","aria-expanded":x,onClick:()=>{x&&Q&&Me(""),X(D=>!D)},className:`inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${x||R?"border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm":"border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,children:e.jsx("span",{className:"grid h-4 w-4 place-items-center transition-transform duration-200",children:x||R?e.jsx(w.HiXMark,{className:"h-4 w-4"}):e.jsx(w.HiMagnifyingGlass,{className:"h-4 w-4"})})})]})]})]})}),e.jsx("div",{role:"tablist","aria-label":v??"Modulos relacionados",className:`flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${W}`,children:se.length>0?se.map(D=>{const le=D.service===(Y==null?void 0:Y.service);return e.jsx("button",{type:"button",role:"tab","aria-selected":le,disabled:D.disabled,onClick:()=>we(D),onKeyDown:de=>je(de,D),className:`inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${le?"border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm":"border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,children:j?j(D,le):e.jsxs(e.Fragment,{children:[D.icon,e.jsx("span",{children:D.label??Sr(D.service)}),D.badge&&e.jsx("span",{className:"rounded-full bg-[var(--bg-input)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:D.badge})]})},D.service)}):e.jsx("div",{className:"flex min-h-9 flex-1 items-center rounded-md border border-dashed border-[var(--border)] px-3 text-xs text-[var(--text-muted)]",children:_??"No hay modulos que coincidan con la busqueda."})}),(Y==null?void 0:Y.description)&&e.jsx("div",{className:"border-b border-[var(--border)] px-4 py-2 text-xs text-[var(--text-muted)]",children:Y.description}),e.jsxs("div",{className:"min-h-[420px] p-4",children:[!Y&&(m??e.jsx("div",{className:"flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]",children:"No hay modulos disponibles."})),Y&&(ne==null?void 0:ne.loading)&&(b??e.jsx(Nr,{title:"Cargando modulo..."})),Y&&(ne==null?void 0:ne.error)&&E(ne.error,Te),Y&&Be&&!(ne!=null&&ne.loading)&&!(ne!=null&&ne.error)&&e.jsx(Be,{context:s,parent:n,link:Y,activeItemId:_e,onOpenDetail:Ve,onBackToList:Ae})]})]})]})}const $t={info:{color:"#2563eb",background:"rgba(59, 130, 246, 0.1)",border:"rgba(59, 130, 246, 0.24)",icon:e.jsx(w.HiInformationCircle,{className:"h-5 w-5"})},success:{color:"#047857",background:"rgba(16, 185, 129, 0.1)",border:"rgba(16, 185, 129, 0.24)",icon:e.jsx(w.HiCheckCircle,{className:"h-5 w-5"})},warning:{color:"#b45309",background:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)",icon:e.jsx(w.HiExclamationTriangle,{className:"h-5 w-5"})},danger:{color:"var(--danger)",background:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))",icon:e.jsx(w.HiExclamationCircle,{className:"h-5 w-5"})},neutral:{color:"var(--text-secondary)",background:"var(--bg-input)",border:"var(--border)",icon:e.jsx(w.HiInformationCircle,{className:"h-5 w-5"})}};function Mt({variant:r="info",title:t,children:a,icon:n,action:s,onDismiss:c,className:d=""}){const l=$t[r];return e.jsxs("div",{role:r==="danger"||r==="warning"?"alert":"status",className:`flex items-start gap-3 rounded-lg border px-3 py-3 ${d}`,style:{background:l.background,borderColor:l.border},children:[e.jsx("div",{className:"mt-0.5 shrink-0",style:{color:l.color},children:n??l.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[t&&e.jsx("div",{className:"text-sm font-semibold text-[var(--text-main)]",children:t}),a&&e.jsx("div",{className:"mt-0.5 text-sm leading-5 text-[var(--text-secondary)]",children:a}),s&&e.jsx("div",{className:"mt-3",children:s})]}),c&&e.jsx(he,{variant:"icon",size:"xs","aria-label":"Cerrar alerta",onClick:c,className:"-mr-1 -mt-1",children:e.jsx(w.HiXMark,{className:"h-4 w-4"})})]})}const Er=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Dt=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Lt=["Do","Lu","Ma","Mi","Ju","Vi","Sá"],tr=6;function ar(r,t,a){return`${r}-${String(t).padStart(2,"0")}-${String(a).padStart(2,"0")}`}function Ht(){const r=new Date;return ar(r.getFullYear(),r.getMonth()+1,r.getDate())}function $r(r){const[t,a,n]=r.split("-").map(Number);return{year:t,month:a,day:n}}function Tt(r){if(!r)return"Seleccionar fecha";const{year:t,month:a,day:n}=$r(r);return!t||!a||!n?"Seleccionar fecha":`${String(n).padStart(2,"0")} ${Er[a-1]} ${t}`}function Bt({value:r,onChange:t,minDate:a,displayMode:n="inline"}){const s=Ht(),d=$r(r||s),l=n==="popover",[p,h]=o.useState(!1),S=o.useRef(null),[k,y]=o.useState({horizontal:"left",vertical:"bottom"}),[v,u]=o.useState(d.year),[m,b]=o.useState(d.month),[E,j]=o.useState("days"),z=16,[B,N]=o.useState(0),$=v-7+B,A=Array.from({length:z},(f,M)=>$+M);o.useEffect(()=>{if(!l||!p||!S.current)return;const f=S.current.getBoundingClientRect(),M=8,G=280,Z=340,J=f.left+G>window.innerWidth-M,ae=f.right-G>=M,ce=f.bottom+8+Z>window.innerHeight-M,x=f.top-8-Z>=M;y({horizontal:J&&ae?"right":"left",vertical:ce&&x?"top":"bottom"})},[l,p]),o.useEffect(()=>{if(!l||!p)return;function f(G){S.current&&(S.current.contains(G.target)||h(!1))}function M(G){G.key==="Escape"&&h(!1)}return document.addEventListener("mousedown",f),document.addEventListener("keydown",M),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",M)}},[l,p]);function _(){m===1?(u(f=>f-1),b(12)):b(f=>f-1)}function L(){m===12?(u(f=>f+1),b(1)):b(f=>f+1)}const H=new Date(v,m-1,1).getDay(),F=new Date(v,m,0).getDate(),I=[...Array(H).fill(null),...Array.from({length:F},(f,M)=>M+1)];for(;I.length<tr*7;)I.push(null);const W=I.slice(0,tr*7);function U(f){const M=ar(v,m,f);a&&M<a||(t(M),l&&h(!1))}const V={background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:4,borderRadius:6,display:"flex",alignItems:"center"},te=e.jsxs("div",{style:{background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",userSelect:"none",width:280},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",borderBottom:"1px solid var(--border)"},children:E==="days"?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:_,style:V,title:"Mes anterior",children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>{j("years"),N(0)},style:{background:"none",border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:4,fontSize:13,fontWeight:700,color:"var(--text-main)",borderRadius:6,padding:"2px 6px"},children:[Er[m-1]," ",v,e.jsx(w.HiChevronDown,{size:13,style:{color:"var(--text-muted)"}})]}),e.jsx("button",{type:"button",onClick:L,style:V,title:"Mes siguiente",children:e.jsx(w.HiChevronRight,{size:16})})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>N(f=>f-z),style:V,children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsxs("button",{type:"button",onClick:()=>j("days"),style:{background:"none",border:"none",cursor:"pointer",fontSize:13,fontWeight:700,color:"var(--text-main)",borderRadius:6,padding:"2px 6px"},children:[A[0]," – ",A[A.length-1]]}),e.jsx("button",{type:"button",onClick:()=>N(f=>f+z),style:V,children:e.jsx(w.HiChevronRight,{size:16})})]})}),E==="years"&&e.jsxs("div",{style:{padding:"8px 10px 10px"},children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:3,marginBottom:8},children:Dt.map((f,M)=>{const G=M+1===m;return e.jsx("button",{type:"button",onClick:()=>b(M+1),style:{border:"none",cursor:"pointer",borderRadius:6,fontSize:11,fontWeight:G?700:400,padding:"4px 0",background:G?"var(--primary)":"transparent",color:G?"var(--primary-fg, #ffffff)":"var(--text-secondary)"},children:f},f)})}),e.jsx("div",{style:{height:1,background:"var(--border)",marginBottom:8}}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:3},children:A.map(f=>{const M=f===v;return e.jsx("button",{type:"button",onClick:()=>{u(f),j("days")},style:{border:"none",cursor:"pointer",borderRadius:6,fontSize:12,fontWeight:M?700:400,padding:"6px 0",background:M?"var(--primary)":"transparent",color:M?"var(--primary-fg, #ffffff)":"var(--text-main)",outline:f===new Date().getFullYear()&&!M?"2px solid var(--primary)":"none",outlineOffset:"-2px"},children:f},f)})})]}),E==="days"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",padding:"6px 8px 0"},children:Lt.map(f=>e.jsx("div",{style:{textAlign:"center",fontSize:10,fontWeight:700,color:"var(--text-muted)",padding:"2px 0",textTransform:"uppercase"},children:f},f))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gridTemplateRows:`repeat(${tr},1fr)`,padding:"4px 8px 10px",gap:2},children:W.map((f,M)=>{if(f===null)return e.jsx("div",{style:{aspectRatio:"1"}},M);const G=ar(v,m,f),Z=G===r,J=G===s,ae=!!(a&&G<a);return e.jsx("button",{type:"button",onClick:()=>!ae&&U(f),style:{width:"100%",aspectRatio:"1",borderRadius:6,border:"none",cursor:ae?"not-allowed":"pointer",fontSize:12,fontWeight:Z||J?700:400,background:Z?"var(--primary)":"transparent",color:Z?"var(--primary-fg, #ffffff)":ae?"var(--text-muted)":"var(--text-main)",opacity:ae?.4:1,outline:J&&!Z?"2px solid var(--primary)":"none",outlineOffset:"-2px"},children:f},M)})})]})]});return l?e.jsxs("div",{ref:S,className:"relative w-full",children:[e.jsxs("button",{type:"button",onClick:()=>h(f=>!f),className:"flex h-10 w-full items-center justify-between gap-2 rounded-lg px-2.5 py-0 text-sm transition-all duration-150 focus:outline-none",style:{background:"var(--bg-input)",border:`1px solid ${p?"var(--primary)":"var(--border)"}`,color:"var(--text-main)",boxShadow:p?"0 0 0 3px rgba(59,130,246,0.12)":"none"},children:[e.jsxs("span",{className:"inline-flex items-center gap-2 min-w-0",children:[e.jsx(w.HiCalendarDays,{className:"w-4 h-4 text-[var(--text-muted)]"}),e.jsx("span",{className:"truncate",children:Tt(r)})]}),e.jsx(w.HiChevronDown,{className:`w-4 h-4 text-[var(--text-muted)] transition-transform ${p?"rotate-180":""}`})]}),p&&e.jsx("div",{className:"absolute z-50",style:{...k.horizontal==="left"?{left:0}:{right:0},...k.vertical==="bottom"?{top:"calc(100% + 8px)"}:{bottom:"calc(100% + 8px)"}},children:te})]}):te}const At={sm:"h-4 w-4",md:"h-5 w-5"};function Ot({label:r,description:t,error:a,size:n="md",className:s="",containerClassName:c="",disabled:d,...l}){return e.jsxs("label",{className:`group inline-flex items-start gap-2.5 ${d?"cursor-not-allowed opacity-60":"cursor-pointer"} ${c}`,children:[e.jsxs("span",{className:"relative mt-0.5 inline-flex shrink-0",children:[e.jsx("input",{...l,type:"checkbox",disabled:d,"aria-invalid":!!a||l["aria-invalid"],className:`peer ${At[n]} appearance-none rounded border border-[var(--border)] bg-[var(--bg-input)] transition-colors checked:border-[var(--primary)] checked:bg-[var(--primary)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/40 ${s}`}),e.jsx(w.HiCheck,{className:"pointer-events-none absolute left-1/2 top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 scale-75 text-[var(--primary-fg)] opacity-0 transition peer-checked:scale-100 peer-checked:opacity-100"})]}),(r||t||a)&&e.jsxs("span",{className:"min-w-0",children:[r&&e.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:r}),t&&!a&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:t}),a&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--danger)]",children:a})]})]})}function Mr(r){const t=document.createElement("textarea");t.value=r,t.style.position="fixed",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}async function It(r){var t;if((t=navigator.clipboard)!=null&&t.writeText){await navigator.clipboard.writeText(r);return}Mr(r)}function Pt(r){return typeof r=="function"?r():r}function nr({value:r,resetDelay:t=2e3,title:a,copiedTitle:n="Copiado",copiedLabel:s,icon:c=e.jsx(w.HiClipboardDocument,{size:14}),copiedIcon:d=e.jsx(w.HiCheck,{size:14}),stopPropagation:l=!0,onCopied:p,onCopyError:h,className:S="",style:k,children:y,onClick:v,type:u="button",...m}){const[b,E]=o.useState(!1),j=o.useRef(null);o.useEffect(()=>()=>{j.current&&window.clearTimeout(j.current)},[]);function z(N){E(!0),p==null||p(N),j.current&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>{E(!1),j.current=null},t)}async function B(N){var A;if(l&&N.stopPropagation(),v==null||v(N),N.defaultPrevented)return;const $=Pt(r);if($)try{await It($),z($)}catch(_){try{Mr($),z($)}catch(L){h==null||h(L,$);return}(A=navigator.clipboard)!=null&&A.writeText||h==null||h(_,$)}}return e.jsxs("button",{...m,type:u,onClick:B,title:b?n:a,"aria-label":m["aria-label"]??(b?n:a),"data-copied":b?"true":void 0,className:`relative inline-flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-md transition-all duration-200 ${y?"min-w-7 px-2":"w-7"} ${S}`,style:{cursor:"pointer",background:b?"rgba(22,163,74,0.15)":"var(--bg-card)",border:b?"1px solid rgba(22,163,74,0.4)":"1px solid var(--border)",color:b?"#16a34a":"var(--text-secondary)",boxShadow:b?"0 0 0 3px rgba(22,163,74,0.12)":"none",...k},children:[e.jsx("span",{className:"inline-flex items-center justify-center transition-all duration-150",style:{transform:b?"scale(1.15)":"scale(1)"},children:b?d:c}),y&&e.jsx("span",{className:"text-xs font-semibold leading-none",children:b?s??y:y})]})}function zt({code:r,children:t,title:a="Codigo",language:n,copyLabel:s="Copiar",copiedLabel:c="Copiado",className:d="",style:l,onCopied:p}){const h=(r??t??"").trim();return e.jsxs("div",{className:`overflow-hidden rounded-lg border ${d}`,style:{borderColor:"rgba(148, 163, 184, 0.22)",background:"#0f172a",color:"#e2e8f0",...l},children:[e.jsxs("div",{className:"flex min-h-9 items-center justify-between gap-3 border-b px-3 py-1.5",style:{borderColor:"rgba(148, 163, 184, 0.18)",background:"#111827",color:"#94a3b8"},children:[e.jsx("span",{className:"min-w-0 truncate text-[11px] font-black uppercase tracking-[0.08em]",children:a}),e.jsx(nr,{value:h,title:"Copiar codigo",copiedTitle:"Codigo copiado",copiedLabel:c,onCopied:p,className:"h-7 min-w-[72px] px-2",style:{background:"#182235",border:"1px solid rgba(148, 163, 184, 0.28)",color:"#f8fafc"},children:s})]}),e.jsx("pre",{className:"m-0 overflow-x-auto p-3 text-xs leading-6",style:{background:"#0f172a",color:"#e2e8f0",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace'},children:e.jsx("code",{className:n?`language-${n}`:void 0,children:h})})]})}function Dr(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function or({value:r,onChange:t,options:a,placeholder:n="Seleccionar…",emptyLabel:s,disabled:c=!1,className:d="",style:l,height:p=40,padding:h="0 10px",searchable:S=!0,minOptionsForSearch:k=6}){const[y,v]=o.useState(!1),[u,m]=o.useState(""),[b,E]=o.useState(-1),[j,z]=o.useState(!1),[B,N]=o.useState({}),$=o.useRef(null),A=o.useRef(null),_=o.useRef(null),L=o.useRef(null),H=S&&a.length>=k,F=a.find(f=>f.value===r)??null,I=H&&u.trim()?a.filter(f=>{var M;return f.label.toLowerCase().includes(u.toLowerCase())||((M=f.sublabel)==null?void 0:M.toLowerCase().includes(u.toLowerCase()))}):a,W=o.useCallback(()=>{const f=$.current;if(!f)return;const M=f.getBoundingClientRect(),G=H?272:212,Z=window.innerHeight-M.bottom,J=Z<G&&M.top>Z;N({position:"fixed",left:M.left,top:J?void 0:M.bottom+4,bottom:J?window.innerHeight-M.top+4:void 0,width:M.width,zIndex:9999})},[H]);o.useEffect(()=>z(!0),[]),o.useEffect(()=>{if(!y)return;function f(M){var Z,J;const G=M.target;!((Z=$.current)!=null&&Z.contains(G))&&!((J=A.current)!=null&&J.contains(G))&&(v(!1),m(""))}return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[y]),o.useEffect(()=>{y&&(E(-1),W(),H&&setTimeout(()=>{var f;return(f=_.current)==null?void 0:f.focus()},0))},[y,H,W]),o.useEffect(()=>{if(y)return window.addEventListener("resize",W),window.addEventListener("scroll",W,!0),()=>{window.removeEventListener("resize",W),window.removeEventListener("scroll",W,!0)}},[y,W]),o.useEffect(()=>{if(b<0||!L.current)return;const f=L.current.children[b];f==null||f.scrollIntoView({block:"nearest"})},[b]);const U=o.useCallback(f=>{t(f),v(!1),m("")},[t]);function V(f){if(!y){(f.key==="Enter"||f.key===" "||f.key==="ArrowDown")&&(f.preventDefault(),v(!0));return}f.key==="Escape"?(f.preventDefault(),v(!1),m("")):f.key==="ArrowDown"?(f.preventDefault(),E(M=>Math.min(M+1,I.length-1))):f.key==="ArrowUp"?(f.preventDefault(),E(M=>Math.max(M-1,s?-1:0))):f.key==="Enter"&&(f.preventDefault(),b===-1&&s?U(""):I[b]&&U(I[b].value))}const te=e.jsxs("div",{ref:A,className:"rounded-xl shadow-xl overflow-hidden",style:{...B,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[H&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[e.jsx(w.HiMagnifyingGlass,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:_,value:u,onChange:f=>{m(f.target.value),E(-1)},placeholder:"Buscar…",className:"min-w-0 flex-1 text-sm bg-transparent outline-none",style:{color:"var(--text-main)"}}),u&&e.jsx("button",{type:"button",onMouseDown:f=>{f.preventDefault(),m("")},children:e.jsx(w.HiXMark,{className:"w-3.5 h-3.5",style:{color:"var(--text-muted)"}})})]}),e.jsxs("ul",{ref:L,role:"listbox",className:"overflow-y-auto",style:{maxHeight:H?220:180,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[s&&e.jsx("li",{role:"option","aria-selected":r==="",onMouseDown:f=>{f.preventDefault(),U("")},onMouseEnter:()=>E(-1),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:b===-1?"var(--bg-hover)":"transparent",color:"var(--text-muted)",fontStyle:"italic"},children:s}),I.map((f,M)=>{const Z=M===b,J=f.value===r;return e.jsxs("li",{role:"option","aria-selected":J,onMouseDown:ae=>{ae.preventDefault(),f.disabled||U(f.value)},onMouseEnter:()=>!f.disabled&&E(M),className:"flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",style:{background:Z?"var(--bg-hover)":J?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:f.disabled?"var(--text-muted)":"var(--text-main)",cursor:f.disabled?"not-allowed":"pointer",boxShadow:J?"inset 2px 0 0 var(--primary)":void 0},children:[f.color&&e.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:f.color}}),e.jsxs("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:[e.jsx("span",{className:"truncate",children:f.label}),f.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:f.sublabel})]}),f.badge&&e.jsx("span",{className:"text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:f.badge})]},f.value)}),I.length===0&&e.jsx("li",{className:"px-3 py-4 text-sm text-center",style:{color:"var(--text-muted)"},children:"Sin resultados"})]})]});return e.jsxs("div",{ref:$,className:`relative ${d||"w-full"}`,style:l,onKeyDown:V,children:[e.jsxs("button",{type:"button",disabled:c,onClick:()=>!c&&v(f=>!f),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{height:Dr(p),padding:Dr(h),background:"var(--bg-input)",color:F?"var(--text-main)":"var(--text-muted)",border:y?"1px solid var(--primary)":"1px solid var(--border)",opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":y,children:[(F==null?void 0:F.color)&&e.jsx("span",{className:"flex-shrink-0 w-2.5 h-2.5 rounded-full",style:{background:F.color}}),e.jsx("span",{className:"min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden",children:F?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"truncate",children:F.label}),F.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:F.sublabel})]}):e.jsx("span",{className:"truncate",children:n})}),F&&s?e.jsx("span",{role:"button",tabIndex:-1,onMouseDown:f=>{f.preventDefault(),f.stopPropagation(),U("")},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:e.jsx(w.HiXMark,{className:"w-3 h-3"})}):e.jsx(w.HiChevronDown,{className:"flex-shrink-0 w-4 h-4 transition-transform",style:{color:"var(--text-muted)",transform:y?"rotate(180deg)":"rotate(0deg)"}})]}),y&&j&&Ce.createPortal(te,document.body)]})}function qe(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function jt({value:r,onChange:t,placeholder:a="Buscar...",className:n="",height:s=40,padding:c="0 10px 0 30px",iconLeft:d=10}){return e.jsxs("div",{className:`relative ${n}`,children:[e.jsx(w.HiMagnifyingGlass,{className:"absolute top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)] pointer-events-none",style:{left:qe(d)}}),e.jsx("input",{type:"text",value:r,onChange:l=>t(l.target.value),placeholder:a,className:"w-full rounded-lg border border-[var(--border)] [background:var(--bg-card)] text-sm text-[var(--text-main)] placeholder:text-[var(--text-muted)] outline-none transition-[border-color,box-shadow] focus:border-primary focus:ring-2 focus:ring-primary/20",style:{height:qe(s),padding:qe(c)}})]})}function _t({value:r,onChange:t,options:a,placeholder:n,icon:s,className:c="",height:d=40,padding:l,iconLeft:p=10,searchable:h=!0}){const S=s?a.map((k,y)=>y===0&&!k.color?{...k,sublabel:k.sublabel??void 0}:k):a;return e.jsxs("div",{className:`relative ${c}`,children:[s&&e.jsx("span",{className:"pointer-events-none absolute top-1/2 z-10 -translate-y-1/2 text-[var(--text-muted)]",style:{left:qe(p)},children:s}),e.jsx(or,{value:r,onChange:t,options:S,placeholder:n,searchable:h,minOptionsForSearch:5,height:d,padding:l??(s?"0 10px 0 30px":"0 10px"),className:"[&>button]:text-sm [&>button]:[background:var(--bg-card)]"})]})}const Ft={sm:"24rem",md:"28rem",lg:"32rem",xl:"40rem","2xl":"48rem","4xl":"56rem","5xl":"64rem"},Ge=180;function Lr({open:r,onClose:t,title:a,subtitle:n,leadingIcon:s,headerActions:c,footer:d,children:l,size:p="md",maxWidth:h,zIndex:S=1e3,closeOnBackdrop:k=!0,closeOnEscape:y=!0,showCloseButton:v=!0,placement:u="center",bodyClassName:m="px-6 py-5",panelClassName:b="",backdropClassName:E="bg-black/50 backdrop-blur-sm",contentClassName:j="p-4",ariaLabel:z,frameless:B=!1}){const[N,$]=o.useState(!1),[A,_]=o.useState(!1),L=o.useRef(null);if(o.useEffect(()=>(r?(L.current&&clearTimeout(L.current),$(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>_(!0)))):(_(!1),L.current=setTimeout(()=>$(!1),Ge+40)),()=>{L.current&&clearTimeout(L.current)}),[r]),o.useEffect(()=>{if(r)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[r]),o.useEffect(()=>{if(!r||!y)return;const V=te=>{te.key==="Escape"&&t()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[y,t,r]),!N)return null;const H=a||n||s||c||v,F=h??Ft[p],I=u==="bottom-mobile"?"items-end sm:items-center justify-center p-0 sm:p-4":"items-center justify-center",W=u==="bottom-mobile"?"rounded-t-2xl sm:rounded-2xl":"rounded-2xl",U=A?"translateY(0) scale(1)":u==="bottom-mobile"?"translateY(16px) scale(0.98)":"translateY(10px) scale(0.96)";return Ce.createPortal(e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":z??a,className:`fixed inset-0 flex ${I} ${j}`,style:{zIndex:S},children:[e.jsx("div",{className:`absolute inset-0 ${E}`,onClick:k?t:void 0,style:{opacity:A?1:0,transition:`opacity ${Ge}ms ease`}}),e.jsxs("div",{className:`relative z-10 flex max-h-[92dvh] w-full flex-col overflow-hidden ${B?"shadow-none":"shadow-2xl"} ${W} ${b}`,style:{maxWidth:F,background:B?"transparent":"var(--bg-card)",border:B?"none":"1px solid var(--border)",opacity:A?1:0,transform:U,transition:`opacity ${Ge}ms ease, transform ${Ge}ms ease`},onClick:V=>V.stopPropagation(),children:[H&&e.jsxs("div",{className:"flex flex-shrink-0 items-center justify-between gap-3 px-6 py-4",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s&&e.jsx("div",{className:"flex-shrink-0",children:s}),(a||n)&&e.jsxs("div",{className:"min-w-0",children:[a&&e.jsx("h2",{className:"truncate text-base font-semibold",style:{color:"var(--text-main)"},children:a}),n&&e.jsx("p",{className:"truncate text-xs",style:{color:"var(--text-muted)"},children:n})]})]}),e.jsxs("div",{className:"flex flex-shrink-0 items-center gap-2",children:[c,v&&e.jsx(he,{variant:"icon",onClick:t,title:"Cerrar",children:e.jsx(w.HiXMark,{className:"h-5 w-5"})})]})]}),e.jsx("div",{className:`min-h-0 flex-1 overflow-y-auto ${m}`,children:l}),d&&e.jsx("div",{className:"flex flex-shrink-0 justify-end gap-2 px-6 py-4",style:{borderTop:"1px solid var(--border)"},children:d})]})]}),document.body)}const Wt={danger:{iconBg:"rgba(239,68,68,0.12)",iconColor:"var(--danger)",btnBg:"var(--danger)",btnColor:"#fff"},warning:{iconBg:"rgba(245,158,11,0.12)",iconColor:"var(--warning)",btnBg:"var(--warning)",btnColor:"#fff"},primary:{iconBg:"rgba(59,130,246,0.12)",iconColor:"var(--primary)",btnBg:"var(--primary)",btnColor:"#fff"}};function Ut({open:r,title:t,description:a,confirmLabel:n="Confirmar",cancelLabel:s="Cancelar",variant:c="danger",onConfirm:d,onCancel:l}){const p=Wt[c];return e.jsxs(Lr,{open:r,onClose:l,size:"sm",zIndex:9998,showCloseButton:!1,bodyClassName:"p-6",panelClassName:"px-1",ariaLabel:t,children:[e.jsx(he,{variant:"icon",onClick:l,className:"absolute right-3 top-3 h-7 w-7 hover:opacity-70",style:{color:"var(--text-muted)"},"aria-label":"Cancelar",children:e.jsx(w.HiXMark,{className:"h-4 w-4"})}),e.jsx("div",{className:"mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{background:p.iconBg},children:e.jsx(w.HiExclamationTriangle,{className:"h-5 w-5",style:{color:p.iconColor}})}),e.jsx("h2",{className:"mb-1 text-base font-semibold",style:{color:"var(--text-main)"},children:t}),a&&e.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:a}),e.jsxs("div",{className:"mt-6 flex gap-2",children:[e.jsx(he,{variant:"secondary",onClick:l,className:"flex-1",style:{background:"var(--bg-input)"},children:s}),e.jsx(he,{variant:"danger",onClick:d,className:"flex-1",style:{background:p.btnBg,color:p.btnColor,borderColor:"transparent"},children:n})]})]})}function qt(r,t){const a=typeof r=="function"?r():r;return t?t(a):a}function Gt({url:r,resolveUrl:t,title:a="Copiar link",copiedTitle:n="Link copiado",icon:s=e.jsx(w.HiLink,{className:"h-3.5 w-3.5"}),...c}){return e.jsx(nr,{...c,value:()=>qt(r,t),title:a,copiedTitle:n,icon:s})}const Yt="[&_button]:h-7 [&_button]:min-h-0 [&_button]:gap-1 [&_button]:px-2 [&_button]:text-xs [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button[data-icon=true]]:w-7 [&_button[data-icon=true]]:px-0",Xt=[];function Pe(r){if(!r)return 150;const t=parseInt(r,10);return isNaN(t)||t<=0?150:t}function Ee(r,t){const a=r.minWidth??80,n=r.maxWidth??1/0;return Math.min(n,Math.max(a,t))}function Kt(r,t){if(t<=7)return Array.from({length:t},(n,s)=>s+1);const a=[1];r>3&&a.push("...");for(let n=Math.max(2,r-1);n<=Math.min(t-1,r+1);n++)a.push(n);return r<t-2&&a.push("..."),a.push(t),a}function $e(r,t){var d;const a=new Set(t.filter(l=>l.hideable!==!1).map(l=>l.key)),n=Array.from(new Set(r??[])).filter(l=>a.has(l));if(t.filter(l=>!n.includes(l.key)).length>0)return n;const c=(d=t.find(l=>l.hideable!==!1))==null?void 0:d.key;return c?n.filter(l=>l!==c):[]}function Hr({children:r,className:t="",style:a}){return e.jsx(Ue,{onlyWhenOverflow:!0,className:t,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",...a},children:r})}function Vt({columns:r,data:t,getRowId:a,loading:n=!1,skeletonRows:s=8,emptyIcon:c,emptyText:d="Sin resultados",initialEmptyDelay:l=450,onRowClick:p,selected:h,onToggleOne:S,onToggleAll:k,highlightSelected:y=!0,rowClassName:v,getRowCategory:u,stickyHeader:m=!0,pageSize:b=25,pageSizeOptions:E=[25,50,100],pageSizeSelectWidth:j=62,pageSizeSelectHeight:z=30,pageSizeSelectPadding:B="0 7px",totalRows:N,page:$,onPageChange:A,onPageSizeChange:_,storageKey:L,stickyFirstColumn:H=!1,bottomOffset:F=0,compact:I=!0,restrictHeight:W=!0,minTableWidth:U,enableColumnVisibility:V=!0,hiddenColumnKeys:te,defaultHiddenColumnKeys:f=Xt,onHiddenColumnKeysChange:M,columnVisibilityLabel:G="Columnas"}){const Z=r.map(i=>i.key).join(","),[J,ae]=o.useState(!L),ce=o.useRef(null),x=o.useRef(!L),X=te!==void 0,[pe,ee]=o.useState(()=>$e(f,r)),Q=$e(X?te:pe,r),[O,K]=o.useState(!1),[R,se]=o.useState(null),[be,Y]=o.useState({}),we=o.useRef(null),Me=o.useRef(null),[je,Te]=o.useState(t.length>0||n||l===!1),_e=(i,g)=>50+(i*17+g*13+7)%40,ne=o.useRef(null),[Be,Ve]=o.useState(void 0),[Ae,Ze]=o.useState(!1);o.useEffect(()=>{const g=b!==!1?32:0,C=12;function P(){if(Ze(window.innerWidth<640),!ne.current)return;const q=ne.current.getBoundingClientRect().top;Ve(Math.max(120,window.innerHeight-q-g-C-F))}return P(),window.addEventListener("resize",P),()=>window.removeEventListener("resize",P)},[n,b,F]),o.useEffect(()=>{if(l===!1||n||t.length>0){Te(!0);return}if(je)return;const i=window.setTimeout(()=>{Te(!0)},l);return()=>window.clearTimeout(i)},[t.length,l,je,n]);const[ke,Se]=o.useState(()=>r.map(i=>i.key)),[D,le]=o.useState(()=>Object.fromEntries(r.map(i=>[i.key,Ee(i,Pe(i.width))])));o.useEffect(()=>{const i=r.map(C=>C.key);if(!L){Se(i),X||ee($e(f,r)),x.current=!1,ae(!0);return}let g=!1;return x.current=!1,ae(!1),fetch(`/api/user/preferences/datatables?key=${encodeURIComponent(L)}`,{cache:"no-store"}).then(C=>C.ok?C.json():null).then(C=>{var er,lt,it;if(g)return;const P=(er=C==null?void 0:C.settings)==null?void 0:er.columnOrder,q=Array.isArray(P)?P.filter(xe=>i.includes(xe)):[],oe=i.filter(xe=>!q.includes(xe)),ie=q.length>0?[...q,...oe]:i,He=Object.fromEntries(r.map(xe=>[xe.key,Ee(xe,Pe(xe.width))])),re=((lt=C==null?void 0:C.settings)==null?void 0:lt.columnWidths)??{},fe=Object.fromEntries(r.map(xe=>[xe.key,Ee(xe,re[xe.key]??He[xe.key])])),Re=$e(((it=C==null?void 0:C.settings)==null?void 0:it.hiddenColumnKeys)??f,r);Se(ie),le(fe),X||ee(Re),ce.current=JSON.stringify({columnOrder:ie,columnWidths:fe,hiddenColumnKeys:Re}),x.current=!0}).catch(()=>{if(!g){Se(i);const C=Object.fromEntries(r.map(q=>[q.key,Ee(q,Pe(q.width))]));le(C);const P=$e(f,r);X||ee(P),ce.current=JSON.stringify({columnOrder:i,columnWidths:C,hiddenColumnKeys:P}),x.current=!0}}).finally(()=>{g||ae(!0)}),()=>{g=!0}},[L,Z,r,f,X]),o.useEffect(()=>{if(!L||!J||!x.current)return;const i={columnOrder:ke,columnWidths:D,hiddenColumnKeys:Q},g=JSON.stringify(i);if(g===ce.current)return;const C=window.setTimeout(()=>{fetch("/api/user/preferences/datatables",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:L,settings:i})}).then(P=>{P.ok&&(ce.current=g)}).catch(()=>{})},300);return()=>window.clearTimeout(C)},[ke,D,Q,L,J]),o.useEffect(()=>{Se(i=>{const g=r.map(q=>q.key),C=i.filter(q=>g.includes(q)),P=g.filter(q=>!C.includes(q));return[...C,...P]})},[Z,r]);const de=ke.map(i=>r.find(g=>g.key===i)).filter(i=>!!i),me=de.filter(i=>!Q.includes(i.key));function ue(i){const g=$e(i,r);X||ee(g),M==null||M(g)}function Fe(i){ue(Q.includes(i)?Q.filter(g=>g!==i):[...Q,i])}function Oe(){ue([])}const ir=o.useCallback((i=Me.current)=>{if(!i)return;const g=i.getBoundingClientRect(),C=256,P=Math.min(Math.max(8,g.right-C),window.innerWidth-C-8),q=window.innerHeight-g.bottom,oe=q<288&&g.top>q?void 0:g.bottom+6,ie=oe===void 0?window.innerHeight-g.top+6:void 0;Y({position:"fixed",zIndex:9999,left:P,top:oe,bottom:ie,width:C})},[]);function nn(i,g){i.preventDefault(),i.stopPropagation();const C=Me.current===i.currentTarget&&R===g;if(O&&C){K(!1),se(null);return}Me.current=i.currentTarget,se(g),ir(i.currentTarget),K(!0)}o.useEffect(()=>{le(i=>{const g=Object.fromEntries(r.map(C=>[C.key,Ee(C,Pe(C.width))]));return Object.fromEntries(r.map(C=>[C.key,Ee(C,i[C.key]??g[C.key])]))})},[Z,r]),o.useEffect(()=>{X||ee(i=>$e(i,r))},[Z,r,X]),o.useEffect(()=>{function i(P){var oe,ie;const q=P.target;!((oe=we.current)!=null&&oe.contains(q))&&!((ie=Me.current)!=null&&ie.contains(q))&&(K(!1),se(null))}function g(P){P.key==="Escape"&&(K(!1),se(null))}function C(){ir()}return O&&(document.addEventListener("mousedown",i),window.addEventListener("keydown",g),window.addEventListener("resize",C),window.addEventListener("scroll",C,!0)),()=>{document.removeEventListener("mousedown",i),window.removeEventListener("keydown",g),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0)}},[O,ir]);const Je=o.useRef(null);o.useEffect(()=>{function i(C){const P=Je.current;if(!P)return;const q=C.clientX-P.startX,oe=r.find(ie=>ie.key===P.colKey);oe&&le(ie=>({...ie,[P.colKey]:Ee(oe,P.startWidth+q)}))}function g(){Je.current&&(Je.current=null,document.body.style.cursor="",document.body.style.userSelect="")}return document.addEventListener("pointermove",i),document.addEventListener("pointerup",g),()=>{document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",g)}},[r]);const Qe=o.useRef(null),[Jr,cr]=o.useState(null);function on(i,g){Qe.current=ke.indexOf(i),g.dataTransfer.effectAllowed="move"}function sn(i,g){g.preventDefault(),g.dataTransfer.dropEffect="move";const C=ke.indexOf(i);Jr!==C&&cr(C)}function ln(i,g){g.preventDefault();const C=Qe.current,P=ke.indexOf(i);C!==null&&C!==P&&Se(q=>{const oe=[...q],[ie]=oe.splice(C,1);return oe.splice(P,0,ie),oe}),Qe.current=null,cr(null)}function cn(){Qe.current=null,cr(null)}const[ve,Qr]=o.useState(null);function dn(i){i.sortKey&&Qr(g=>(g==null?void 0:g.key)===i.key?{key:i.key,dir:g.dir==="asc"?"desc":"asc"}:{key:i.key,dir:"asc"})}const[un,dr]=o.useState(1),[Rr,fn]=o.useState(b===!1?0:b);o.useEffect(()=>{dr(1)},[t]);const Ie=!!(A&&_),De=b!==!1,ge=Ie?$??1:un,Le=Ie||De?Rr:t.length,ye=!!h&&!!S&&!!k,ur=ye?40:0,pn=ye&&t.length>0&&h.size===t.length,hn=ye&&h.size>0&&h.size<t.length,fr=o.useMemo(()=>{if(!ve)return t;const i=r.find(g=>g.key===ve.key&&g.sortKey);return i!=null&&i.sortKey?[...t].sort((g,C)=>{const P=g[i.sortKey],q=C[i.sortKey],oe=P===q?0:P==null?1:q==null||P<q?-1:1;return ve.dir==="asc"?oe:-oe}):t},[t,ve,r]),et=o.useMemo(()=>{if(Ie||!De)return fr;const i=(ge-1)*Le;return fr.slice(i,i+Le)},[fr,Ie,De,ge,Le]),We=N??t.length,pr=De?Math.max(1,Math.ceil(We/Le)):1,bn=De?(ge-1)*Le+1:1,mn=De?Math.min(ge*Le,We):We;function hr(i){const g=Math.max(1,Math.min(i,pr));Ie?A(g):dr(g)}function xn(i){fn(i),Ie?(_(i),A(1)):dr(1),_&&_(i)}const rt=i=>i==="center"?"text-center":i==="right"?"text-right":"text-left",vn="color-mix(in srgb, var(--primary) 6%, var(--bg-card))",gn=me.length+(ye?1:0);o.useEffect(()=>{ve&&Q.includes(ve.key)&&Qr(null)},[Q,ve]);function tt(i){return i?typeof i=="string"?{key:i,label:i}:i:null}const at=()=>e.jsxs("tr",{style:{background:"color-mix(in srgb, var(--bg-input) 72%, transparent)"},children:[ye&&e.jsx("th",{className:`${I?"px-2 py-1.5":"px-3 py-2.5"} w-10`,style:H?{position:"sticky",left:0,zIndex:12,background:"color-mix(in srgb, var(--bg-input) 72%, transparent)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:"inset 0 -2px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"2px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("input",{type:"checkbox",checked:pn,ref:i=>{i&&(i.indeterminate=hn)},onChange:k,className:"rounded cursor-pointer accent-[var(--primary)]"})}),me.map((i,g)=>{const C=(ve==null?void 0:ve.key)===i.key,P=!!i.sortKey,q=H&&!Ae&&g===0,oe=Jr===g,He=(D[i.key]??Pe(i.width))<120;return e.jsxs("th",{className:`group select-none ${He?"text-left":rt(i.align)}`,style:{...q?{position:"sticky",left:ur,zIndex:12,background:"color-mix(in srgb, var(--bg-input) 72%, transparent)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -2px 0 var(--border)",borderRight:"1px solid var(--border)"}:{position:"relative",borderBottom:"2px solid var(--border)",borderRight:"1px solid var(--border)"},color:C?"var(--primary)":"var(--text-muted)",whiteSpace:"nowrap",transition:"color 0.15s",borderLeft:oe?"2px solid var(--primary)":"2px solid transparent",cursor:P?"pointer":"default",padding:V?I?"5px 48px 5px 6px":"7px 52px 7px 6px":I?"5px 24px 5px 6px":"7px 28px 7px 6px"},onDragOver:re=>sn(i.key,re),onDrop:re=>ln(i.key,re),onClick:P?()=>dn(i):void 0,children:[e.jsx("span",{draggable:!0,onDragStart:re=>{re.stopPropagation(),on(i.key,re)},onDragEnd:re=>{re.stopPropagation(),cn()},onClick:re=>re.stopPropagation(),title:"Arrastrar para reordenar",className:"inline-flex items-center mr-1 opacity-0 group-hover:opacity-40 transition-opacity",style:{cursor:"grab",color:"var(--text-muted)",verticalAlign:"middle"},children:e.jsx(ct.MdDragIndicator,{size:15})}),e.jsx(Hr,{className:"inline-block max-w-full align-middle",style:{width:V?"calc(100% - 42px)":"calc(100% - 22px)",textAlign:He?"left":i.align==="center"?"center":i.align==="right"?"right":"left"},children:e.jsxs("span",{className:`inline-flex max-w-full items-center gap-1 font-semibold uppercase tracking-wider ${I?"text-[11px]":"text-xs"}`,children:[e.jsx("span",{className:"min-w-0 truncate",children:i.header}),P&&e.jsx("span",{className:"flex-shrink-0 opacity-60",children:C?ve.dir==="asc"?e.jsx(w.HiChevronUp,{className:"w-3 h-3"}):e.jsx(w.HiChevronDown,{className:"w-3 h-3"}):e.jsx(w.HiChevronUpDown,{className:"w-3 h-3 opacity-40"})})]})}),V&&e.jsx("button",{type:"button","aria-haspopup":"menu","aria-expanded":O&&R===i.key,"aria-label":G,title:G,onClick:re=>nn(re,i.key),className:`absolute top-1/2 right-3 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md opacity-0 transition-colors transition-opacity hover:bg-[var(--bg-card)] group-hover:opacity-100 focus:opacity-100 ${O&&R===i.key?"opacity-100":""}`,style:{color:"var(--text-muted)",zIndex:4},children:e.jsx(w.HiEllipsisVertical,{className:"h-4 w-4"})}),e.jsx("span",{role:"separator","aria-orientation":"vertical",title:"Arrastrar para redimensionar",onPointerDown:re=>{re.preventDefault(),re.stopPropagation(),Je.current={colKey:i.key,startX:re.clientX,startWidth:D[i.key]??150},document.body.style.cursor="col-resize",document.body.style.userSelect="none"},onClick:re=>re.stopPropagation(),className:"absolute right-0 top-0 h-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",style:{width:12,cursor:"col-resize",zIndex:3},children:e.jsx("span",{style:{width:3,height:"40%",borderRadius:2,background:"var(--primary)",display:"block"}})})]},i.key)})]}),nt=()=>{if(!V||!O||typeof document>"u")return null;const i=Q.length;return Ce.createPortal(e.jsxs("div",{ref:we,role:"menu",className:"overflow-hidden rounded-lg border p-1 shadow-xl",style:{...be,borderColor:"var(--border)",background:"var(--bg-card)"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[var(--border)] px-2 py-1.5",children:[e.jsx("span",{className:"min-w-0 truncate text-xs font-semibold uppercase text-[var(--text-muted)]",children:i>0?`${me.length} de ${r.length} visibles`:`${r.length} visibles`}),e.jsx("button",{type:"button",onClick:Oe,disabled:i===0,className:"rounded px-1.5 py-0.5 text-xs font-medium text-[var(--primary)] transition-colors hover:bg-[var(--bg-input)] disabled:opacity-40",children:"Mostrar todas"})]}),e.jsx("div",{className:"max-h-72 overflow-auto py-1",children:de.map(g=>{const C=!Q.includes(g.key),q=!(g.hideable!==!1)||C&&me.length<=1;return e.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":C,disabled:q,onClick:()=>Fe(g.key),className:"flex w-full min-w-0 items-center gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",style:{color:"var(--text-main)"},children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded border",style:{borderColor:C?"var(--primary)":"var(--border)",background:C?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:C&&e.jsx(w.HiCheck,{className:"h-3 w-3"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:g.header})]},g.key)})})]}),document.body)},ot=()=>{if(!De||n)return null;const i=Kt(ge,pr);return e.jsxs("div",{className:`grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 rounded-b-xl border-t text-xs select-none ${I?"px-2 py-0.5":"px-3 py-1"}`,style:{borderColor:"var(--border)",background:"var(--bg-input)"},children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{style:{color:"var(--text-muted)"},children:We===0?"0 filas":`${bn}–${mn} de ${We}`}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{style:{color:"var(--text-muted)"},children:"Filas:"}),e.jsx(or,{value:String(Le),onChange:g=>xn(Number(g)),options:E.map(g=>({value:String(g),label:String(g)})),placeholder:"Filas",searchable:!1,height:z,padding:B,className:"shrink-0 [&>button]:rounded-md [&>button]:text-xs [&_svg]:h-3.5 [&_svg]:w-3.5",style:{width:j}})]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-0.5",children:[e.jsx("button",{disabled:ge<=1,onClick:()=>hr(ge-1),className:"rounded p-0.5 transition-colors disabled:opacity-30",style:{color:"var(--text-muted)",background:"transparent"},children:e.jsx(w.HiChevronLeft,{className:"h-3.5 w-3.5"})}),i.map((g,C)=>g==="..."?e.jsx("span",{className:"px-1",style:{color:"var(--text-muted)"},children:"…"},`e${C}`):e.jsx("button",{onClick:()=>hr(g),className:"h-5 w-5 rounded text-[11px] font-medium transition-colors",style:{background:g===ge?"var(--primary)":"transparent",color:g===ge?"var(--primary-fg)":"var(--text-muted)"},children:g},g)),e.jsx("button",{disabled:ge>=pr,onClick:()=>hr(ge+1),className:"rounded p-0.5 transition-colors disabled:opacity-30",style:{color:"var(--text-muted)",background:"transparent"},children:e.jsx(w.HiChevronRight,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{"aria-hidden":"true"})]})},st=()=>e.jsx("div",{className:"w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-hidden",style:{border:"1px solid var(--border)"},children:e.jsxs("div",{ref:ne,className:"min-w-0 max-w-full",style:{maxHeight:W?Be:void 0,background:"var(--bg-card)"},children:[e.jsx("div",{className:"border-b px-3 py-2",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-input) 72%, transparent)"},children:e.jsx("div",{className:"h-3.5 w-40 animate-pulse rounded-full",style:{background:"var(--border)"}})}),e.jsx("div",{className:"space-y-2 p-3",children:Array.from({length:Math.min(6,s)}).map((i,g)=>e.jsx("div",{className:"grid grid-cols-[1.2fr_1fr_0.8fr_0.7fr] gap-3",children:Array.from({length:4}).map((C,P)=>e.jsx("div",{className:"h-3.5 animate-pulse rounded-full",style:{background:"var(--border)",width:`${_e(g,P)}%`,minWidth:32}},P))},g))})]})});return L&&!J||!n&&t.length===0&&!je?st():n&&t.length===0?e.jsxs("div",{className:"w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",style:{border:"1px solid var(--border)"},children:[nt(),e.jsx("div",{ref:ne,className:"min-w-0 max-w-full overflow-hidden rounded-t-xl",children:e.jsx(mr.OverlayScrollbarsComponent,{options:{scrollbars:{autoHide:"leave",autoHideDelay:200}},className:"w-full",style:{maxHeight:W?Be:void 0,maxWidth:"100%"},defer:!0,children:e.jsxs("table",{className:"text-sm",style:{tableLayout:"fixed",width:"100%",minWidth:U??"max-content",borderCollapse:"separate",borderSpacing:0},children:[e.jsxs("colgroup",{children:[ye&&e.jsx("col",{style:{width:40}}),me.map(i=>e.jsx("col",{style:{width:D[i.key]??150}},i.key))]}),e.jsx("thead",{style:m?{position:"sticky",top:0,zIndex:10,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"}:void 0,children:at()}),e.jsx("tbody",{children:Array.from({length:s}).map((i,g)=>e.jsxs("tr",{children:[ye&&e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} w-10`,style:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"}}),me.map((C,P)=>{const q=H&&!Ae&&P===0;return e.jsx("td",{className:I?"px-2 py-1.5":"px-3 py-2",style:q?{position:"sticky",left:ur,zIndex:1,background:"color-mix(in srgb, var(--bg-card) 72%, transparent)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("div",{className:"h-3.5 rounded-full animate-pulse",style:{background:"var(--border)",width:`${_e(g,P)}%`,minWidth:32}})},C.key)})]},g))})]})})}),ot()]}):!n&&t.length===0?e.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center gap-3 rounded-xl border px-6 py-14 text-center",style:{borderColor:"var(--border)",background:"linear-gradient(180deg, color-mix(in srgb, var(--bg-input) 58%, transparent), var(--bg-card))"},children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full border",style:{borderColor:"color-mix(in srgb, var(--primary) 24%, var(--border))",background:"color-mix(in srgb, var(--primary) 8%, var(--bg-card))",color:"var(--primary)"},children:c??e.jsx(w.HiMagnifyingGlass,{className:"h-5 w-5"})}),e.jsx("p",{className:"max-w-sm text-sm font-medium",style:{color:"var(--text-main)"},children:d}),e.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Ajusta la busqueda o cambia los filtros para ver mas informacion."})]}):e.jsxs("div",{className:"w-full min-w-0 max-w-full flex flex-col rounded-xl overflow-visible",style:{border:"1px solid var(--border)"},children:[nt(),e.jsx("div",{ref:ne,className:"min-w-0 max-w-full overflow-hidden rounded-t-xl",children:e.jsx(mr.OverlayScrollbarsComponent,{options:{scrollbars:{autoHide:"leave",autoHideDelay:200}},className:"w-full",style:{maxHeight:W?Be:void 0,maxWidth:"100%"},defer:!0,children:e.jsxs("table",{className:"text-sm",style:{tableLayout:"fixed",width:"100%",minWidth:U??"max-content",borderCollapse:"separate",borderSpacing:0},children:[e.jsxs("colgroup",{children:[ye&&e.jsx("col",{style:{width:40}}),me.map(i=>e.jsx("col",{style:{width:D[i.key]??150}},i.key))]}),e.jsx("thead",{style:m?{position:"sticky",top:0,zIndex:10,backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)"}:void 0,children:at()}),e.jsx("tbody",{children:et.map((i,g)=>{const C=a(i),P=tt(u==null?void 0:u(i)),q=g>0?tt(u==null?void 0:u(et[g-1])):null,oe=P&&P.key!==(q==null?void 0:q.key),ie=ye&&h.has(C),He=!!p,re=ie&&y?"color-mix(in srgb, var(--primary) 8%, var(--bg-card))":g%2===1?"color-mix(in srgb, var(--bg-input) 50%, var(--bg-card))":"var(--bg-card)";return e.jsxs(o.Fragment,{children:[oe&&e.jsx("tr",{className:P.className??"",children:e.jsx("td",{colSpan:gn,className:I?"px-2 py-2":"px-3 py-3",style:{background:"color-mix(in srgb, var(--primary) 8%, var(--bg-input))",borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},children:e.jsx("div",{className:"flex min-w-0 items-center justify-between gap-3",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-xs font-semibold uppercase tracking-wider text-[var(--text-main)]",children:P.label}),P.description&&e.jsx("div",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:P.description})]})})})}),e.jsxs("tr",{onClick:He?()=>p(i):void 0,className:`transition-colors ${He?"cursor-pointer":""} ${v?v(i):""}`,style:{"--dt-row-bg":re,"--dt-sticky-bg":re,background:"var(--dt-row-bg)"},onMouseEnter:fe=>{ie||(fe.currentTarget.style.setProperty("--dt-row-bg","var(--bg-hover)"),fe.currentTarget.style.setProperty("--dt-sticky-bg",vn))},onMouseLeave:fe=>{fe.currentTarget.style.setProperty("--dt-row-bg",re),fe.currentTarget.style.setProperty("--dt-sticky-bg",re)},children:[ye&&e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} w-10`,style:H?{position:"sticky",left:0,zIndex:3,background:"var(--dt-sticky-bg)",boxShadow:"inset 0 -1px 0 var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"},onClick:fe=>{fe.stopPropagation(),S(C)},children:e.jsx("input",{type:"checkbox",checked:ie,onClick:fe=>fe.stopPropagation(),onChange:()=>S(C),className:"rounded cursor-pointer accent-[var(--primary)]"})}),me.map((fe,Re)=>{const er=H&&!Ae&&Re===0;return e.jsx("td",{className:`${I?"px-2 py-1.5":"px-3 py-2"} ${Yt} ${rt(fe.align)} ${fe.className??""}`,style:{overflow:"hidden",whiteSpace:"nowrap",...er?{position:"sticky",left:ur,zIndex:3,background:"var(--dt-sticky-bg)",boxShadow:"3px 0 6px -2px rgba(0,0,0,0.12), inset 0 -1px 0 var(--border)",borderRight:"1px solid var(--border)"}:{borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)"}},children:e.jsx(Hr,{children:fe.cell(i)})},fe.key)})]})]},C)})})]})})}),ot()]})}function ze(r){return r?new Date(`${r}T12:00:00`):void 0}function Tr(r){return r.toISOString().slice(0,10)}function Zt({calendarMonth:r,displayIndex:t}){const{previousMonth:a,nextMonth:n,goToMonth:s,months:c,labels:d,formatters:l}=xr.useDayPicker(),p=!!a&&t===0,h=!!n&&t===c.length-1;return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",color:"var(--text-main)",marginBottom:6},children:[e.jsx("span",{style:{fontWeight:700},children:l.formatCaption(r.date)}),e.jsx("button",{type:"button","aria-label":d.labelPrevious(a),onClick:()=>a&&s(a),disabled:!p,style:{height:28,width:28,borderRadius:8,border:"1px solid var(--border)",background:"var(--bg-card)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--text-main)",opacity:p?1:.45,cursor:p?"pointer":"not-allowed"},children:e.jsx(w.HiChevronLeft,{size:16})}),e.jsx("button",{type:"button","aria-label":d.labelNext(n),onClick:()=>n&&s(n),disabled:!h,style:{height:28,width:28,borderRadius:8,border:"1px solid var(--border)",background:"var(--bg-card)",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--text-main)",opacity:h?1:.45,cursor:h?"pointer":"not-allowed"},children:e.jsx(w.HiChevronRight,{size:16})})]})}function Jt(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Qt({startDate:r,endDate:t,onChange:a,minDate:n,viewMonth:s,numberOfMonths:c=1,showSummary:d=!0,startLabel:l="Inicio",endLabel:p="Regreso"}){const h={from:ze(r),to:ze(t)},S=ze(n),[k,y]=o.useState(ze(s||r));return o.useEffect(()=>{y(ze(s||r))},[s,r]),e.jsxs("div",{children:[e.jsx("div",{style:{borderRadius:10,overflow:"hidden",border:"1px solid var(--border)",background:"var(--bg-input)",display:"flex",justifyContent:"center",padding:"10px 8px"},children:e.jsx(xr.DayPicker,{mode:"range",selected:h,month:k,onMonthChange:y,onSelect:v=>{const u=v!=null&&v.from?Tr(v.from):r,m=v!=null&&v.to?Tr(v.to):"";a({startDate:u,endDate:m})},numberOfMonths:c,hideNavigation:!0,disabled:S?{before:S}:void 0,showOutsideDays:!1,components:{MonthCaption:Zt},className:"text-sm",classNames:{root:"w-full",months:"flex gap-3 justify-center",month:"space-y-2",month_caption:"flex items-center justify-between px-1",caption_label:"capitalize",nav:"flex items-center gap-1",button_previous:"h-8 w-8 inline-flex items-center justify-center rounded-md transition-colors",button_next:"h-8 w-8 inline-flex items-center justify-center rounded-md transition-colors",month_grid:"w-full border-collapse",weekdays:"grid grid-cols-7 gap-1 mb-1",weekday:"text-[11px] font-semibold text-center",week:"grid grid-cols-7 gap-1",day:"h-9 w-9 p-0 flex items-center justify-center",day_button:"h-9 w-9 rounded-md text-sm font-medium transition-colors outline-none",selected:"font-semibold",range_start:"font-semibold",range_middle:"font-medium",range_end:"font-semibold",today:"font-bold",disabled:"opacity-40 cursor-not-allowed",hidden:"invisible"},styles:{month_caption:{color:"var(--text-main)",marginBottom:6,display:"flex",alignItems:"center",justifyContent:"space-between"},caption_label:{color:"var(--text-main)",fontWeight:700},nav:{position:"static",display:"flex",alignItems:"center",gap:6},weekday:{color:"var(--text-muted)",textTransform:"lowercase"},button_previous:{height:32,width:32,background:"var(--bg-card)",color:"var(--text-main)",border:"1px solid var(--border)"},button_next:{height:32,width:32,background:"var(--bg-card)",color:"var(--text-main)",border:"1px solid var(--border)"},day_button:{color:"var(--text-main)",borderRadius:8},chevron:{fill:"var(--text-main)"},today:{border:"1px solid color-mix(in srgb, var(--primary) 35%, transparent)"},disabled:{color:"var(--text-muted)"}},modifiersStyles:{selected:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_start:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_end:{background:"var(--primary)",color:"var(--primary-fg, #ffffff)"},range_middle:{background:"color-mix(in srgb, var(--primary) 20%, transparent)",color:"var(--text-main)"}},formatters:{formatCaption:v=>Jt(new Intl.DateTimeFormat("es-MX",{month:"long",year:"numeric"}).format(v)),formatWeekdayName:v=>new Intl.DateTimeFormat("es-MX",{weekday:"short"}).format(v)},labels:{labelMonthDropdown:()=>"Mes",labelYearDropdown:()=>"Año"}})}),d&&r&&e.jsxs("div",{style:{marginTop:8,fontSize:12,color:"var(--text-muted)",display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsxs("span",{children:[l,":"," ",e.jsx("strong",{style:{color:"var(--text-main)"},children:r})]}),t&&e.jsxs("span",{children:[p,":"," ",e.jsx("strong",{style:{color:"var(--text-main)"},children:t})]})]})]})}function Rt(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function ea({trigger:r,items:t,align:a="end",width:n=220,disabled:s=!1,className:c="",menuClassName:d="",onOpenChange:l}){const[p,h]=o.useState(!1),[S,k]=o.useState(!1),[y,v]=o.useState({}),u=o.useRef(null),m=o.useRef(null),b=o.useCallback(N=>{h(N),l==null||l(N)},[l]),E=o.useCallback(()=>{const N=u.current;if(!N)return;const $=N.getBoundingClientRect(),A=typeof n=="number"?n:$.width,_=typeof n=="number"?n:Math.max($.width,180),L=a==="end"?Math.max(8,$.right-_):Math.min($.left,window.innerWidth-_-8),H=window.innerHeight-$.bottom,F=H<240&&$.top>H?void 0:$.bottom+6,I=F===void 0?window.innerHeight-$.top+6:void 0;v({position:"fixed",zIndex:9999,left:L,top:F,bottom:I,width:Rt(typeof n=="number"?A:n)})},[a,n]);o.useEffect(()=>k(!0),[]),o.useEffect(()=>{if(!p)return;E();const N=A=>{var L,H;const _=A.target;!((L=u.current)!=null&&L.contains(_))&&!((H=m.current)!=null&&H.contains(_))&&b(!1)},$=A=>{A.key==="Escape"&&b(!1)};return document.addEventListener("mousedown",N),window.addEventListener("keydown",$),window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{document.removeEventListener("mousedown",N),window.removeEventListener("keydown",$),window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[p,b,E]);const j=N=>{s||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),b(!p))},z=o.isValidElement(r)?o.cloneElement(r,{onClick:()=>!s&&b(!p)}):r,B=p?e.jsx("div",{ref:m,role:"menu",className:`overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-1 shadow-xl ${d}`,style:y,children:t.map(N=>e.jsxs("div",{children:[N.separatorBefore&&e.jsx("div",{className:"my-1 border-t border-[var(--border)]"}),e.jsxs("button",{type:"button",role:"menuitem",disabled:N.disabled,onClick:()=>{var $;N.disabled||(($=N.onSelect)==null||$.call(N),b(!1))},className:"flex w-full min-w-0 items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",style:{color:N.danger?"var(--danger)":"var(--text-main)"},children:[N.icon&&e.jsx("span",{className:"mt-0.5 shrink-0",children:N.icon}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-sm font-medium",children:N.label}),N.description&&e.jsx("span",{className:"block truncate text-xs text-[var(--text-muted)]",children:N.description})]})]})]},N.id))}):null;return e.jsxs("span",{ref:u,role:"button",tabIndex:s?-1:0,"aria-haspopup":"menu","aria-expanded":p,onKeyDown:j,className:`inline-flex ${s?"pointer-events-none opacity-60":""} ${c}`,children:[z,S&&B?Ce.createPortal(B,document.body):null]})}function ra({open:r,onClose:t,title:a,subtitle:n,leadingIcon:s,confirmLabel:c="Guardar",onConfirm:d,loading:l=!1,confirmDisabled:p=!1,headerActions:h,bodyClassName:S="flex-1 overflow-y-auto px-6 py-5",width:k=440,children:y}){const[v,u]=o.useState(!1);return o.useEffect(()=>{u(!0)},[]),o.useEffect(()=>(document.body.style.overflow=r?"hidden":"",()=>{document.body.style.overflow=""}),[r]),o.useEffect(()=>{if(!r)return;const m=b=>{b.key==="Escape"&&t()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[r,t]),v?Ce.createPortal(e.jsxs("div",{"aria-hidden":!r,className:`fixed inset-0 z-[1000] flex transition-opacity duration-300 ${r?"opacity-100":"opacity-0 pointer-events-none"}`,children:[e.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:t}),e.jsxs("div",{className:`absolute inset-y-0 right-0 flex flex-col shadow-2xl transition-transform duration-300 ${r?"translate-x-0":"translate-x-full"}`,style:{width:`min(100vw, ${k}px)`,background:"var(--bg-card)",borderLeft:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 flex-shrink-0",style:{borderBottom:"1px solid var(--border)"},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(he,{variant:"icon",onClick:t,title:"Cerrar",children:e.jsx(w.HiXMark,{className:"w-5 h-5"})}),s&&e.jsx("div",{className:"flex-shrink-0",children:s}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-base font-semibold truncate",style:{color:"var(--text-main)"},children:a}),n&&e.jsx("p",{className:"text-xs truncate",style:{color:"var(--text-muted)"},children:n})]})]}),(h||d)&&e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[h,d&&e.jsxs(e.Fragment,{children:[e.jsx(he,{variant:"secondary",size:"sm",onClick:t,style:{background:"var(--bg-input)"},children:"Cancelar"}),e.jsx(he,{variant:"primary",size:"sm",icon:e.jsx(dt.FiSave,{className:"w-4 h-4"}),onClick:d,loading:l,disabled:p,title:c})]})]})]}),e.jsx("div",{"data-drawer-scroll":"true",className:S,children:y})]})]}),document.body):null}const ta={sm:"min-h-[160px] p-4",md:"min-h-[220px] p-6",lg:"min-h-[300px] p-8"};function aa({title:r="Sin resultados",description:t,icon:a=e.jsx(w.HiInbox,{className:"h-5 w-5"}),action:n,secondaryAction:s,size:c="md",className:d=""}){return e.jsx("div",{className:`flex items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-card)] text-center ${ta[c]} ${d}`,children:e.jsxs("div",{className:"flex max-w-sm flex-col items-center gap-3",children:[a&&e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]",children:a}),e.jsxs("div",{className:"space-y-1",children:[r&&e.jsx("h3",{className:"text-sm font-semibold text-[var(--text-main)]",children:r}),t&&e.jsx("div",{className:"text-sm leading-5 text-[var(--text-muted)]",children:t})]}),(n||s)&&e.jsxs("div",{className:"mt-1 flex flex-wrap items-center justify-center gap-2",children:[s,n]})]})})}function Br({label:r,children:t,helperText:a,error:n,labelAction:s,required:c=!1,className:d="",contentClassName:l=""}){return e.jsxs("label",{className:`flex flex-col gap-2 ${d}`,children:[(r||s)&&e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]",children:[r&&e.jsx("span",{children:r}),c&&e.jsx("span",{className:"text-[var(--danger)]",children:"*"}),s&&e.jsx("span",{className:"ml-auto normal-case",children:s})]}),e.jsx("span",{className:`block ${l}`,children:t}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]})}var Ar={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Or=o.createContext&&o.createContext(Ar),na=["attr","size","title"];function oa(r,t){if(r==null)return{};var a,n,s=sa(r,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(n=0;n<c.length;n++)a=c[n],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(r,a)&&(s[a]=r[a])}return s}function sa(r,t){if(r==null)return{};var a={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(t.indexOf(n)!==-1)continue;a[n]=r[n]}return a}function Ye(){return Ye=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)({}).hasOwnProperty.call(a,n)&&(r[n]=a[n])}return r},Ye.apply(null,arguments)}function Ir(r,t){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),a.push.apply(a,n)}return a}function Xe(r){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Ir(Object(a),!0).forEach(function(n){la(r,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):Ir(Object(a)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(a,n))})}return r}function la(r,t,a){return(t=ia(t))in r?Object.defineProperty(r,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[t]=a,r}function ia(r){var t=ca(r,"string");return typeof t=="symbol"?t:t+""}function ca(r,t){if(typeof r!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var n=a.call(r,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function Pr(r){return r&&r.map((t,a)=>o.createElement(t.tag,Xe({key:a},t.attr),Pr(t.child)))}function zr(r){return t=>o.createElement(da,Ye({attr:Xe({},r.attr)},t),Pr(r.child))}function da(r){var t=a=>{var{attr:n,size:s,title:c}=r,d=oa(r,na),l=s||a.size||"1em",p;return a.className&&(p=a.className),r.className&&(p=(p?p+" ":"")+r.className),o.createElement("svg",Ye({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,n,d,{className:p,style:Xe(Xe({color:r.color||a.color},a.style),r.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),c&&o.createElement("title",null,c),r.children)};return Or!==void 0?o.createElement(Or.Consumer,null,a=>t(a)):t(Ar)}function ua(r){return zr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M247.31,124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57,61.26,162.88,48,128,48S61.43,61.26,36.34,86.35C17.51,105.18,9,124,8.69,124.76a8,8,0,0,0,0,6.5c.35.79,8.82,19.57,27.65,38.4C61.43,194.74,93.12,208,128,208s66.57-13.26,91.66-38.34c18.83-18.83,27.3-37.61,27.65-38.4A8,8,0,0,0,247.31,124.76ZM128,192c-30.78,0-57.67-11.19-79.93-33.25A133.47,133.47,0,0,1,25,128,133.33,133.33,0,0,1,48.07,97.25C70.33,75.19,97.22,64,128,64s57.67,11.19,79.93,33.25A133.46,133.46,0,0,1,231.05,128C223.84,141.46,192.43,192,128,192Zm0-112a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"},child:[]}]})(r)}function fa(r){return zr({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M228,175a8,8,0,0,1-10.92-3l-19-33.2A123.23,123.23,0,0,1,162,155.46l5.87,35.22a8,8,0,0,1-6.58,9.21A8.4,8.4,0,0,1,160,200a8,8,0,0,1-7.88-6.69l-5.77-34.58a133.06,133.06,0,0,1-36.68,0l-5.77,34.58A8,8,0,0,1,96,200a8.4,8.4,0,0,1-1.32-.11,8,8,0,0,1-6.58-9.21L94,155.46a123.23,123.23,0,0,1-36.06-16.69L39,172A8,8,0,1,1,25.06,164l20-35a153.47,153.47,0,0,1-19.3-20A8,8,0,1,1,38.22,99c16.6,20.54,45.64,45,89.78,45s73.18-24.49,89.78-45A8,8,0,1,1,230.22,109a153.47,153.47,0,0,1-19.3,20l20,35A8,8,0,0,1,228,175Z"},child:[]}]})(r)}function Ke({className:r="",...t}){return e.jsx("input",{...t,className:`h-10 rounded-lg border border-[var(--border)] bg-[var(--bg-input)] px-2.5 py-1.5 text-sm text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] ${r}`})}function pa({label:r,containerClassName:t="",helperText:a,error:n,labelAction:s,floatingLabel:c=!1,showPasswordToggle:d=!0,className:l="",required:p,...h}){const[S,k]=o.useState(()=>!!h.autoFocus),[y,v]=o.useState(!1),u=h.type==="password"&&d,m=u&&y?"text":h.type,b=h.value!==void 0?String(h.value).length>0:h.defaultValue!==void 0&&String(h.defaultValue).length>0,E=S||b,j={top:E?7:12,color:S?"var(--primary)":"var(--text-muted)",fontSize:E?10:13,fontWeight:E?600:400,textTransform:E?"uppercase":"none"},z=$=>{var A;k(!0),(A=h.onFocus)==null||A.call(h,$)},B=$=>{var A;k(!1),(A=h.onBlur)==null||A.call(h,$)},N=u?e.jsxs("button",{type:"button","aria-label":y?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":y,className:"absolute right-2.5 top-1/2 flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-md text-[var(--text-muted)] transition-colors duration-200 hover:text-[var(--primary)] focus:outline-none",tabIndex:-1,onClick:()=>v($=>!$),children:[e.jsx("span",{"aria-hidden":"true",className:`absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-200 ease-out ${y?"scale-y-0 rotate-[-8deg] opacity-0":"scale-y-100 rotate-0 opacity-100"}`,children:e.jsx(ua,{className:"h-[18px] w-[18px]"})}),e.jsx("span",{"aria-hidden":"true",className:`absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-200 ease-out ${y?"scale-y-100 rotate-0 opacity-100":"scale-y-0 rotate-[8deg] opacity-0"}`,children:e.jsx(fa,{className:"h-[18px] w-[18px]"})})]}):null;return c?e.jsxs("label",{className:`flex flex-col gap-2 ${t}`,children:[e.jsxs("span",{className:"relative block",children:[e.jsx(Ke,{...h,type:m,required:p,placeholder:" ","aria-invalid":!!n||h["aria-invalid"],"data-has-value":b?"true":void 0,className:`h-11 w-full pt-5 ${u?"pr-10":""} ${l}`,onFocus:z,onBlur:B}),e.jsxs("span",{className:"pointer-events-none absolute left-3 transition-all duration-150",style:j,children:[r,p&&e.jsx("span",{className:"ml-1 text-[var(--danger)]",children:"*"})]}),s&&e.jsx("span",{className:"absolute right-2 transition-all duration-150",style:{top:E?7:12},children:s}),N]}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]}):e.jsxs("label",{className:`flex flex-col gap-2 ${t}`,children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]",children:[e.jsx("span",{children:r}),p&&e.jsx("span",{className:"text-[var(--danger)]",children:"*"}),s&&e.jsx("span",{className:"ml-auto normal-case",children:s})]}),u?e.jsxs("span",{className:"relative block",children:[e.jsx(Ke,{...h,type:m,required:p,"aria-invalid":!!n||h["aria-invalid"],className:`w-full pr-10 ${l}`,onFocus:z,onBlur:B}),N]}):e.jsx(Ke,{...h,required:p,"aria-invalid":!!n||h["aria-invalid"],className:l}),n?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--danger)]",children:n}):a?e.jsx("span",{className:"text-xs font-medium normal-case text-[var(--text-muted)]",children:a}):null]})}function jr(r){if(r!==void 0)return typeof r=="number"?`${r}px`:r}function ha(r,t){return r.length!==t.length?!1:r.every((a,n)=>a===t[n])}function ba({value:r,onChange:t,options:a,placeholder:n="Seleccionar…",disabled:s=!1,className:c="",style:d,height:l=40,padding:p="0 10px",searchable:h=!0,minOptionsForSearch:S=6,maxVisibleValues:k=2,emptyText:y="Sin resultados",clearLabel:v="Limpiar seleccion"}){const[u,m]=o.useState(!1),[b,E]=o.useState(""),[j,z]=o.useState(0),[B,N]=o.useState(!1),[$,A]=o.useState({}),_=o.useRef(null),L=o.useRef(null),H=o.useRef(null),F=o.useRef(null),I=h&&a.length>=S,W=o.useMemo(()=>new Set(r),[r]),U=o.useMemo(()=>a.filter(x=>W.has(x.value)),[a,W]),V=U.slice(0,k),te=Math.max(0,U.length-V.length),f=I&&b.trim()?a.filter(x=>{var X;return x.label.toLowerCase().includes(b.toLowerCase())||((X=x.sublabel)==null?void 0:X.toLowerCase().includes(b.toLowerCase()))}):a,M=o.useCallback(()=>{const x=_.current;if(!x)return;const X=x.getBoundingClientRect(),pe=I?304:244,ee=window.innerHeight-X.bottom,Q=ee<pe&&X.top>ee;A({position:"fixed",left:X.left,top:Q?void 0:X.bottom+4,bottom:Q?window.innerHeight-X.top+4:void 0,width:X.width,zIndex:9999})},[I]),G=o.useCallback(x=>{ha(r,x)||t(x)},[t,r]),Z=o.useCallback(x=>{const X=a.find(ee=>ee.value===x);if(X!=null&&X.disabled)return;const pe=W.has(x)?r.filter(ee=>ee!==x):[...r,x];G(pe)},[G,a,r,W]),J=o.useCallback(()=>G([]),[G]);o.useEffect(()=>N(!0),[]),o.useEffect(()=>{if(!u)return;function x(X){var ee,Q;const pe=X.target;!((ee=_.current)!=null&&ee.contains(pe))&&!((Q=L.current)!=null&&Q.contains(pe))&&(m(!1),E(""))}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[u]),o.useEffect(()=>{u&&(z(0),M(),I&&setTimeout(()=>{var x;return(x=H.current)==null?void 0:x.focus()},0))},[u,I,M]),o.useEffect(()=>{if(u)return window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[u,M]),o.useEffect(()=>{if(j<0||!F.current)return;const x=F.current.children[j];x==null||x.scrollIntoView({block:"nearest"})},[j]);function ae(x){if(!u){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),m(!0));return}x.key==="Escape"&&(x.preventDefault(),m(!1),E("")),x.key==="ArrowDown"&&(x.preventDefault(),z(X=>Math.min(X+1,f.length-1))),x.key==="ArrowUp"&&(x.preventDefault(),z(X=>Math.max(X-1,0))),x.key==="Enter"&&f[j]&&(x.preventDefault(),Z(f[j].value)),x.key==="Backspace"&&!b&&r.length&&(x.preventDefault(),G(r.slice(0,-1)))}const ce=e.jsxs("div",{ref:L,className:"overflow-hidden rounded-xl shadow-xl",style:{...$,background:"var(--bg-card)",border:"1px solid var(--border)"},children:[I&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:[e.jsx(w.HiMagnifyingGlass,{className:"h-3.5 w-3.5 flex-shrink-0",style:{color:"var(--text-muted)"}}),e.jsx("input",{ref:H,value:b,onChange:x=>{E(x.target.value),z(0)},placeholder:"Buscar…",className:"min-w-0 flex-1 bg-transparent text-sm outline-none",style:{color:"var(--text-main)"}}),b&&e.jsx("button",{type:"button",onMouseDown:x=>{x.preventDefault(),E("")},children:e.jsx(w.HiXMark,{className:"h-3.5 w-3.5",style:{color:"var(--text-muted)"}})})]}),U.length>0&&e.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2 text-xs",style:{borderBottom:"1px solid var(--border)",color:"var(--text-muted)"},children:[e.jsxs("span",{children:[U.length," seleccionados"]}),e.jsx("button",{type:"button",onMouseDown:x=>{x.preventDefault(),J()},className:"font-semibold transition-colors hover:text-[var(--primary)]",children:v})]}),e.jsxs("ul",{ref:F,role:"listbox","aria-multiselectable":"true",className:"overflow-y-auto",style:{maxHeight:I?220:200,scrollbarWidth:"thin",scrollbarColor:"var(--border) transparent",overscrollBehavior:"contain"},children:[f.map((x,X)=>{const pe=X===j,ee=W.has(x.value);return e.jsxs("li",{role:"option","aria-selected":ee,onMouseDown:Q=>{Q.preventDefault(),Z(x.value)},onMouseEnter:()=>!x.disabled&&z(X),className:"flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors",style:{background:pe?"var(--bg-hover)":ee?"color-mix(in srgb, var(--primary) 6%, transparent)":"transparent",color:x.disabled?"var(--text-muted)":"var(--text-main)",cursor:x.disabled?"not-allowed":"pointer",opacity:x.disabled?.58:1},children:[e.jsx("span",{className:"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border",style:{borderColor:ee?"var(--primary)":"var(--border)",background:ee?"var(--primary)":"var(--bg-input)",color:"var(--primary-fg)"},children:ee&&e.jsx(w.HiCheck,{className:"h-3 w-3"})}),x.color&&e.jsx("span",{className:"h-2.5 w-2.5 flex-shrink-0 rounded-full",style:{background:x.color}}),e.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1 overflow-hidden",children:[e.jsx("span",{className:"truncate",children:x.label}),x.sublabel&&e.jsx("span",{className:"min-w-0 flex-shrink truncate",style:{color:"var(--text-muted)",fontSize:12},children:x.sublabel})]}),x.badge&&e.jsx("span",{className:"flex-shrink-0 text-xs",style:{color:"var(--text-muted)"},children:x.badge})]},x.value)}),f.length===0&&e.jsx("li",{className:"px-3 py-4 text-center text-sm",style:{color:"var(--text-muted)"},children:y})]})]});return e.jsxs("div",{ref:_,className:`relative ${c||"w-full"}`,style:d,onKeyDown:ae,children:[e.jsxs("button",{type:"button",disabled:s,onClick:()=>!s&&m(x=>!x),className:"flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",style:{minHeight:jr(l),padding:jr(p),background:"var(--bg-input)",color:U.length?"var(--text-main)":"var(--text-muted)",border:u?"1px solid var(--primary)":"1px solid var(--border)",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"},"aria-haspopup":"listbox","aria-expanded":u,children:[e.jsx("span",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5 overflow-hidden",children:V.length?e.jsxs(e.Fragment,{children:[V.map(x=>e.jsxs("span",{className:"inline-flex max-w-[160px] items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-semibold",style:{background:"var(--bg-card)",borderColor:"var(--border)",color:"var(--text-main)"},children:[x.color&&e.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full",style:{background:x.color}}),e.jsx("span",{className:"truncate",children:x.label})]},x.value)),te>0&&e.jsxs("span",{className:"inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-semibold",style:{background:"color-mix(in srgb, var(--primary) 10%, transparent)",color:"var(--primary)"},children:["+",te]})]}):e.jsx("span",{className:"truncate",children:n})}),U.length?e.jsx("span",{role:"button",tabIndex:-1,"aria-label":v,onMouseDown:x=>{x.preventDefault(),x.stopPropagation(),J()},className:"flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",style:{color:"var(--text-muted)"},children:e.jsx(w.HiXMark,{className:"h-3 w-3"})}):e.jsx(w.HiChevronDown,{className:"h-4 w-4 flex-shrink-0 transition-transform",style:{color:"var(--text-muted)",transform:u?"rotate(180deg)":"rotate(0deg)"}})]}),u&&B&&Ce.createPortal(ce,document.body)]})}function ma(r,t,a){const n=[],s=Math.max(2,r-a),c=Math.min(t-1,r+a);n.push(1),s>2&&n.push("...");for(let d=s;d<=c;d+=1)n.push(d);return c<t-1&&n.push("..."),t>1&&n.push(t),n}function xa({page:r,totalPages:t,onPageChange:a,disabled:n=!1,siblingCount:s=1,className:c=""}){const d=Math.max(1,t),l=Math.min(Math.max(1,r),d),p=ma(l,d,s);return e.jsxs("nav",{"aria-label":"Paginacion",className:`inline-flex items-center gap-1 ${c}`,children:[e.jsx(he,{variant:"icon",size:"xs","aria-label":"Pagina anterior",disabled:n||l<=1,onClick:()=>a(l-1),children:e.jsx(w.HiChevronLeft,{className:"h-4 w-4"})}),p.map((h,S)=>h==="..."?e.jsx("span",{className:"flex h-8 min-w-8 items-center justify-center text-xs font-semibold text-[var(--text-muted)]",children:"..."},`ellipsis-${S}`):e.jsx("button",{type:"button","aria-current":h===l?"page":void 0,disabled:n,onClick:()=>a(h),className:"flex h-8 min-w-8 items-center justify-center rounded-md border px-2 text-xs font-semibold transition-colors disabled:cursor-not-allowed disabled:opacity-50",style:{borderColor:h===l?"var(--primary)":"var(--border)",background:h===l?"var(--primary)":"var(--bg-card)",color:h===l?"var(--primary-fg)":"var(--text-secondary)"},children:h},h)),e.jsx(he,{variant:"icon",size:"xs","aria-label":"Pagina siguiente",disabled:n||l>=d,onClick:()=>a(l+1),children:e.jsx(w.HiChevronRight,{className:"h-4 w-4"})})]})}function va({value:r,onChange:t,options:a,name:n,label:s,orientation:c="vertical",disabled:d=!1,className:l="",optionClassName:p=""}){return e.jsxs("fieldset",{className:`min-w-0 ${l}`,disabled:d,children:[s&&e.jsx("legend",{className:"mb-2 text-xs font-semibold uppercase text-[var(--text-muted)]",children:s}),e.jsx("div",{className:c==="horizontal"?"flex flex-wrap gap-2":"flex flex-col gap-2",children:a.map(h=>{const S=h.value===r,k=d||h.disabled;return e.jsxs("label",{className:`inline-flex min-w-0 items-start gap-2 rounded-lg border px-2.5 py-1.5 transition-colors ${k?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-[var(--bg-input)]"} ${p}`,style:{borderColor:S?"color-mix(in srgb, var(--primary) 48%, var(--border))":"var(--border)",background:S?"color-mix(in srgb, var(--primary) 8%, transparent)":"var(--bg-card)"},children:[e.jsxs("span",{className:"relative mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--bg-input)]",children:[e.jsx("input",{type:"radio",name:n,value:h.value,checked:S,disabled:k,onChange:()=>t(h.value),className:"absolute inset-0 opacity-0"}),e.jsx("span",{className:`h-2 w-2 rounded-full transition ${S?"scale-100 opacity-100":"scale-50 opacity-0"}`,style:{background:"var(--primary)"}})]}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-medium leading-5 text-[var(--text-main)]",children:h.label}),h.description&&e.jsx("span",{className:"block text-xs leading-5 text-[var(--text-muted)]",children:h.description})]})]},h.value)})})]})}function ga({title:r,subtitle:t,icon:a,actions:n,children:s,footer:c,className:d="",bodyClassName:l="p-4"}){const p=r||t||a||n;return e.jsxs("section",{className:`overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${d}`,children:[p&&e.jsxs("header",{className:"flex items-center justify-between gap-3 border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[a&&e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--primary)]",children:a}),e.jsxs("div",{className:"min-w-0",children:[r&&e.jsx("h3",{className:"truncate text-sm font-semibold text-[var(--text-main)]",children:r}),t&&e.jsx("div",{className:"truncate text-xs text-[var(--text-muted)]",children:t})]})]}),n&&e.jsx("div",{className:"shrink-0",children:n})]}),e.jsx("div",{className:l,children:s}),c&&e.jsx("footer",{className:"border-t border-[var(--border)] px-4 py-3",children:c})]})}const ya={neutral:{text:"var(--text-secondary)",bg:"var(--bg-input)",border:"var(--border)"},primary:{text:"var(--primary)",bg:"color-mix(in srgb, var(--primary) 10%, transparent)",border:"color-mix(in srgb, var(--primary) 24%, var(--border))"},success:{text:"#047857",bg:"rgba(16, 185, 129, 0.11)",border:"rgba(16, 185, 129, 0.24)"},warning:{text:"#b45309",bg:"rgba(245, 158, 11, 0.12)",border:"rgba(245, 158, 11, 0.26)"},danger:{text:"var(--danger)",bg:"var(--danger-bg)",border:"color-mix(in srgb, var(--danger) 20%, var(--border))"},info:{text:"#2563eb",bg:"rgba(59, 130, 246, 0.11)",border:"rgba(59, 130, 246, 0.24)"}},wa={xs:"min-h-5 px-1.5 text-[10px]",sm:"min-h-6 px-2 text-xs",md:"min-h-7 px-2.5 text-sm"};function Na({children:r,tone:t="neutral",size:a="sm",icon:n,dot:s=!1,className:c=""}){const d=ya[t];return e.jsxs("span",{className:`inline-flex max-w-full shrink-0 items-center gap-1.5 rounded-full border font-semibold leading-none ${wa[a]} ${c}`,style:{color:d.text,background:d.bg,borderColor:d.border},children:[s&&e.jsx("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:d.text}}),n&&e.jsx("span",{className:"shrink-0",children:n}),e.jsx("span",{className:"min-w-0 truncate",children:r})]})}function ka({tabs:r,activeTabId:t,defaultActiveTabId:a,onTabChange:n,ariaLabel:s="Pestanas",variant:c="underline",className:d="",listClassName:l="",panelClassName:p=""}){const h=r.find(u=>!u.disabled)??r[0],S=t??a??(h==null?void 0:h.id),k=r.find(u=>u.id===S)??h,y=u=>{u.disabled||n==null||n(u.id)},v=u=>{const m=r.filter(E=>!E.disabled);if(!m.length||!k)return;const b=m.findIndex(E=>E.id===k.id);(u.key==="ArrowRight"||u.key==="ArrowDown")&&(u.preventDefault(),y(m[(b+1)%m.length])),(u.key==="ArrowLeft"||u.key==="ArrowUp")&&(u.preventDefault(),y(m[(b-1+m.length)%m.length])),u.key==="Home"&&(u.preventDefault(),y(m[0])),u.key==="End"&&(u.preventDefault(),y(m[m.length-1]))};return e.jsxs("div",{className:d,children:[e.jsx("div",{role:"tablist","aria-label":s,onKeyDown:v,className:`flex min-w-0 gap-1 overflow-x-auto ${c==="underline"?"border-b border-[var(--border)]":"rounded-lg border border-[var(--border)] bg-[var(--bg-input)] p-1"} ${l}`,children:r.map(u=>{const m=u.id===(k==null?void 0:k.id);return e.jsxs("button",{type:"button",role:"tab","aria-selected":m,"aria-controls":`${u.id}-panel`,id:`${u.id}-tab`,disabled:u.disabled,tabIndex:m?0:-1,onClick:()=>y(u),className:`inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2.5 text-sm font-semibold transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${c==="underline"?"border-b-2":"rounded-md border"}`,style:{color:m?"var(--primary)":"var(--text-muted)",borderColor:m?"var(--primary)":"transparent",background:c==="pills"&&m?"var(--bg-card)":"transparent"},children:[u.icon&&e.jsx("span",{className:"shrink-0",children:u.icon}),e.jsx("span",{children:u.label}),u.badge&&e.jsx("span",{className:"shrink-0",children:u.badge})]},u.id)})}),(k==null?void 0:k.content)!==void 0&&e.jsx("div",{role:"tabpanel",id:`${k.id}-panel`,"aria-labelledby":`${k.id}-tab`,className:`pt-4 ${p}`,children:k.content})]})}function Ne(...r){return r.filter(Boolean).join(" ")}function Sa({steps:r,activeStepId:t,initialStepId:a,completedStepIds:n,defaultCompletedStepIds:s=[],onActiveStepChange:c,onCompletedStepIdsChange:d,onBlockedStep:l,allowBackNavigation:p=!0,showFooter:h=!0,previousLabel:S="Anterior",nextLabel:k="Siguiente",blockedNextLabel:y="Completa este paso",className:v="",headerClassName:u="",contentClassName:m="",footerClassName:b=""}){var Q;const E=((Q=r[0])==null?void 0:Q.id)??"",[j,z]=o.useState(a??E),[B,N]=o.useState(s),$=t??j,A=n??B,_=o.useMemo(()=>new Set(A),[A]),L=Math.max(0,r.findIndex(O=>O.id===$)),H=r[L]??r[0],F=r.length<=1?100:L/(r.length-1)*100,I=O=>{n||N(O),d==null||d(O)},W=O=>{const K=r.find(R=>R.id===O);K&&(t||z(O),c==null||c(O,K))},U=O=>_.has(O),V=O=>r.slice(0,O).find(K=>!K.optional&&!_.has(K.id)),te=O=>{const K=r[O];return!K||K.disabled?!1:O===L||p&&O<L?!0:!V(O)},f=O=>{const K=r.findIndex(R=>R.id===O);return K>=0&&te(K)},M=O=>{const K=r.findIndex(R=>R.id===O);if(K<0)return!1;if(!te(K)){const R=V(K);return R&&(l==null||l(r[K],R)),!1}return W(O),!0},G=(O=H==null?void 0:H.id)=>{!O||_.has(O)||I([...A,O])},Z=(O=H==null?void 0:H.id)=>{if(!O)return;const K=r.findIndex(se=>se.id===O),R=A.filter(se=>{const be=r.findIndex(Y=>Y.id===se);return be>=0&&be<K});I(R),K>=0&&L>K&&W(O)},J=()=>L<=0?!1:M(r[L-1].id),ae=()=>{const O=r[L+1];return O?M(O.id):!1},ce={activeStep:H,activeIndex:L,completedStepIds:A,isCompleted:U,isUnlocked:f,completeStep:G,uncompleteStep:Z,goToStep:M,goNext:ae,goPrevious:J};if(!H)return null;const x=r[L+1],X=L>0,pe=x?f(x.id):!1,ee=typeof H.content=="function"?H.content(ce):H.content;return e.jsxs("section",{className:Ne("overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)]",v),children:[e.jsxs("div",{className:Ne("border-b border-[var(--border)] bg-[var(--bg-input)]",u),children:[e.jsx("div",{className:"relative h-1 overflow-hidden bg-[var(--border)]/55",children:e.jsx("div",{className:"h-full rounded-r-full bg-[var(--primary)] transition-[width] duration-500 ease-out",style:{width:`${F}%`}})}),e.jsx("div",{className:"grid gap-2 p-2",style:{gridTemplateColumns:`repeat(${r.length}, minmax(0, 1fr))`},children:r.map((O,K)=>{const R=O.id===H.id,se=U(O.id),be=te(K),Y=V(K);return e.jsxs("button",{type:"button",disabled:!be,"aria-current":R?"step":void 0,"aria-disabled":!be,title:!be&&Y?`Completa ${Y.title}`:O.title,onClick:()=>M(O.id),className:Ne("group relative min-h-16 min-w-0 overflow-hidden rounded-md border p-3 text-left transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/35 disabled:cursor-not-allowed",R&&"border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",se&&!R&&"border-[var(--primary)]/35 bg-[var(--bg-card)]",!R&&!se&&be&&"border-transparent bg-[var(--bg-card)]/45 hover:border-[var(--border)] hover:bg-[var(--bg-card)]",!be&&"border-transparent bg-[var(--bg-card)]/35 opacity-60"),children:[e.jsx("span",{className:Ne("absolute inset-x-0 top-0 h-0.5 origin-left scale-x-0 bg-[var(--primary)] transition-transform duration-300",R&&"scale-x-100")}),e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:Ne("grid h-7 w-7 shrink-0 place-items-center rounded-full border text-xs font-bold transition-all duration-200",R&&"border-[var(--primary)] bg-[var(--primary)] text-[var(--primary-fg)]",se&&!R&&"border-[var(--primary)] bg-[var(--primary)]/12 text-[var(--primary)]",!se&&!R&&be&&"border-[var(--border)] text-[var(--text-muted)]",!be&&"border-[var(--border)] text-[var(--text-muted)]"),children:se?e.jsx(w.HiCheck,{className:"h-4 w-4"}):be?K+1:e.jsx(w.HiLockClosed,{className:"h-3.5 w-3.5"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:Ne("block truncate text-xs font-semibold transition-colors duration-200",R?"text-[var(--text-main)]":"text-[var(--text-secondary)]"),children:[K+1,". ",O.title]}),O.description&&e.jsx("span",{className:"mt-1 block truncate text-[11px] text-[var(--text-muted)]",children:O.description})]}),O.badge&&e.jsx("span",{className:"shrink-0",children:O.badge})]})]},O.id)})})]}),e.jsx("div",{className:Ne("min-h-72 animate-[stepWizardIn_220ms_ease-out] p-5",m),children:ee},H.id),h&&e.jsxs("div",{className:Ne("flex flex-wrap items-center justify-between gap-3 border-t border-[var(--border)] bg-[var(--bg-input)] px-4 py-3",b),children:[e.jsx(he,{variant:"secondary",height:38,padding:"0 14px",icon:e.jsx(w.HiChevronLeft,{}),disabled:!X,onClick:J,children:S}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Paso ",L+1," de ",r.length]}),e.jsx("span",{className:"h-1 w-1 rounded-full bg-[var(--border)]"}),e.jsxs("span",{children:[A.length," completados"]})]}),e.jsx(he,{height:38,padding:"0 14px",icon:e.jsx(w.HiChevronRight,{}),disabled:!x||!pe,onClick:ae,children:x&&!pe?y:k})]})]})}const Ca={sm:"min-h-20 px-2.5 py-1.5 text-xs leading-5",md:"min-h-24 px-2.5 py-2 text-sm leading-5",lg:"min-h-32 px-3 py-2.5 text-sm leading-6"},Ea={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"};function $a(r,t){if(r){if(typeof r=="function"){r(t);return}r.current=t}}function Ma(r,t){return r!==void 0?String(r).length:t!==void 0?String(t).length:0}const _r=o.forwardRef(function({className:t="",wrapperClassName:a="",size:n="md",resize:s="vertical",autoResize:c=!1,minRows:d,maxRows:l,showCount:p=!1,maxCount:h,status:S="default",icon:k,action:y,style:v,value:u,defaultValue:m,maxLength:b,onInput:E,...j},z){const B=o.useRef(null),N=Ma(u,m),$=h??b,A=!!(k||y||p),_=S==="error"?"var(--danger)":S==="success"?"#16a34a":"var(--border)",L={...v??{},...d?{minHeight:`${d*24+18}px`}:null,...l?{maxHeight:`${l*24+18}px`}:null},H=()=>{const I=B.current;!I||!c||(I.style.height="auto",I.style.height=`${I.scrollHeight}px`)};o.useEffect(H,[c,u]);const F=e.jsx("textarea",{...j,ref:I=>{B.current=I,$a(z,I)},value:u,defaultValue:m,maxLength:b,"aria-invalid":S==="error"||j["aria-invalid"],onInput:I=>{H(),E==null||E(I)},style:{...L,borderColor:_},className:`w-full rounded-lg border bg-[var(--bg-input)] text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-60 ${Ca[n]} ${Ea[c?"none":s]} ${k?"pl-8":""} ${y?"pr-10":""} ${t}`});return A?e.jsxs("span",{className:`relative block ${a}`,children:[k&&e.jsx("span",{className:"pointer-events-none absolute left-2.5 top-2.5 flex h-4 w-4 items-center justify-center text-[var(--text-muted)]",children:k}),F,y&&e.jsx("span",{className:"absolute right-2 top-2 flex items-center justify-center",children:y}),p&&e.jsxs("span",{className:"absolute bottom-1.5 right-2 rounded bg-[var(--bg-input)] px-1.5 text-[10px] font-semibold text-[var(--text-muted)]",children:[N,$?`/${$}`:""]})]}):F});function Da({label:r,containerClassName:t="",helperText:a,error:n,labelAction:s,required:c,className:d="",status:l,...p}){return e.jsx(Br,{label:r,required:c,helperText:a,error:n,labelAction:s,className:t,children:e.jsx(_r,{...p,required:c,status:n?"error":l,className:`w-full ${d}`})})}const La={xs:{width:28,height:16,thumb:12,padding:2},sm:{width:36,height:20,thumb:16,padding:2}};function Ha({checked:r,disabled:t,onCheckedChange:a,size:n="sm",className:s="",...c}){const d=La[n],l=r?d.width-d.thumb-d.padding*2:0;return e.jsx("button",{...c,type:"button",role:"switch","aria-checked":r,disabled:t,onClick:()=>!t&&a(!r),className:`relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/50 disabled:cursor-not-allowed disabled:opacity-50 ${s}`,style:{width:d.width,height:d.height,background:r?"color-mix(in srgb, var(--primary) 85%, transparent)":"var(--bg-input)",border:r?"1px solid color-mix(in srgb, var(--primary) 55%, transparent)":"1px solid var(--border)"},children:e.jsx("span",{className:"absolute inline-block rounded-full transition-transform",style:{width:d.thumb,height:d.thumb,left:d.padding,top:"50%",transform:`translate(${l}px, -50%)`,background:r?"var(--primary-fg)":"var(--text-muted)"}})})}const Fr=[".sidebar-scroll","[data-overlay-scroll='true']"].join(",");function Ta(r){if(!(r instanceof HTMLElement)||r.dataset.overlayScroll==="false"||r.closest("[data-overlayscrollbars]")||r.matches("textarea,input,select,[contenteditable='true']"))return!1;const t=window.getComputedStyle(r);return!(![t.overflow,t.overflowX,t.overflowY].join(" ").match(/auto|scroll/)||r.clientWidth===0&&r.clientHeight===0)}function Wr(r){return r.classList.contains("sidebar-scroll")}function Ur(r){Wr(r)&&r.querySelectorAll(".os-scrollbar-horizontal").forEach(t=>{t.style.display="none",t.style.height="0",t.style.pointerEvents="none"})}function qr(){return o.useEffect(()=>{const r=new WeakMap;let t=0;const a=()=>{t=0,document.querySelectorAll(Fr).forEach(c=>{if(!Ta(c))return;if(br.OverlayScrollbars(c)){Ur(c);return}const l=br.OverlayScrollbars(c,{overflow:Wr(c)?{x:"hidden",y:"scroll"}:void 0,scrollbars:{autoHide:"leave",autoHideDelay:180}});Ur(c),r.set(c,l)})},n=()=>{t||(t=window.requestAnimationFrame(a))};a();const s=new MutationObserver(n);return s.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","data-overlay-scroll"]}),window.addEventListener("resize",n),()=>{t&&window.cancelAnimationFrame(t),s.disconnect(),window.removeEventListener("resize",n),document.querySelectorAll(Fr).forEach(c=>{var d;c instanceof HTMLElement&&((d=r.get(c))==null||d.destroy())})}},[]),null}const Ba={xs:{wh:"w-5 h-5",text:"text-[8px]"},sm:{wh:"w-7 h-7",text:"text-[11px]"},md:{wh:"w-9 h-9",text:"text-sm"},lg:{wh:"w-12 h-12",text:"text-base"},xl:{wh:"w-16 h-16",text:"text-xl"}},Gr=["bg-indigo-500","bg-blue-500","bg-emerald-500","bg-violet-500","bg-amber-500","bg-teal-500","bg-rose-500","bg-cyan-500"],Aa={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Oa="bonsaif.bot",Ia="Bonsaif Bot",Pa={xs:"p-0.5",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"};function Yr(r){return typeof r=="string"?r.trim():""}function za(r){let t=0;for(const a of r)t=t*31+a.charCodeAt(0)&65535;return Gr[t%Gr.length]}function ja(r,t){return r===Oa||t===Ia}function _a(r,t){return`${r.replace(/\/$/,"")}${t}`}function Xr({userId:r,username:t,name:a,size:n="md",showName:s=!1,showTooltip:c,tooltipContent:d,fallbackLabel:l="Usuario",wrapperClassName:p="",labelClassName:h="",labelSize:S="xs",avatarVersion:k=0,className:y="",style:v}){var U;const[u,m]=o.useState(!1),b=typeof r=="string"&&r.trim()&&r!=="undefined"&&r!=="null"?r.trim():"";o.useEffect(()=>{m(!1)},[b,k]);const{wh:E,text:j}=Ba[n],z=Yr(a)||Yr(t)||l,B=z.trim()[0]||"?",N=typeof process<"u"&&((U=process.env)==null?void 0:U.NEXT_PUBLIC_BASE_PATH)||"",$=ja(t,a),A=_a(N,"/favicon.svg"),_=b?`${N}/api/user/avatar/${b}${k?`?v=${k}`:""}`:"",H={xs:20,sm:28,md:36,lg:48,xl:64}[n],F=$?e.jsx("span",{className:`${E} ${Pa[n]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${y}`,style:v,children:e.jsx("img",{src:A,alt:z,width:H,height:H,className:"h-full w-full object-contain"})}):_&&!u?e.jsx("img",{src:_,alt:z,width:H,height:H,className:`${E} rounded-full object-cover flex-shrink-0 ${y}`,style:v,onError:()=>m(!0)},`${b}-${k}`):e.jsx("span",{className:`${E} ${za(z)} ${j} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${y}`,style:v,title:z,children:B});if(s)return e.jsxs("span",{className:`inline-flex min-w-0 items-center gap-2 ${p}`,children:[F,e.jsx("span",{className:`min-w-0 truncate ${Aa[S]} font-medium text-[var(--text-main)] ${h}`,title:z,children:z})]});const I=c??!0,W=d??z;return I&&W?e.jsx(Ue,{as:"span",content:W,className:`inline-flex flex-shrink-0 ${p}`,children:F}):F}function Fa({href:r,className:t,children:a}){return e.jsx("a",{href:r,className:t,children:a})}function Wa(r){return r.reduce((t,a)=>{const n=a.section??"Principal";return t[n]=[...t[n]??[],a],t},{})}function Kr({children:r,navItems:t=[],currentPath:a=typeof window>"u"?"/":window.location.pathname,user:n,appName:s="Bonsaif",appLogo:c,header:d,footer:l,onLogout:p,LinkComponent:h=Fa}){const[S,k]=o.useState(!1),y=Wa(t);return e.jsxs("div",{className:"min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]",children:[e.jsx(qr,{}),e.jsx("button",{type:"button","aria-label":"Abrir navegación",className:"fixed left-3 top-3 z-50 inline-flex h-9 w-9 items-center justify-center rounded-md border border-white/10 bg-black/70 text-white lg:hidden",onClick:()=>k(!0),children:e.jsx(w.HiBars3,{className:"h-5 w-5"})}),S&&e.jsx("button",{type:"button","aria-label":"Cerrar navegación",className:"fixed inset-0 z-40 bg-black/45 lg:hidden",onClick:()=>k(!1)}),e.jsxs("aside",{className:`fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${S?"translate-x-0":"-translate-x-full"}`,children:[e.jsxs("div",{className:"flex h-16 items-center gap-3 border-b border-white/10 px-4",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-white/10 text-white",children:c??e.jsx(w.HiHome,{className:"h-5 w-5"})}),e.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),e.jsx("button",{type:"button","aria-label":"Cerrar navegación",className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/70 hover:bg-white/10 lg:hidden",onClick:()=>k(!1),children:e.jsx(w.HiXMark,{className:"h-5 w-5"})})]}),e.jsx("nav",{className:"sidebar-scroll min-h-0 flex-1 overflow-y-auto px-3 py-4","data-overlay-scroll":"true",children:Object.entries(y).map(([v,u])=>e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35",children:[e.jsx(w.HiChevronDown,{className:"h-3.5 w-3.5"}),v]}),e.jsx("div",{className:"space-y-1",children:u.map(m=>{const b=a===m.href||a.startsWith(`${m.href}/`);return e.jsxs(h,{href:m.href,className:`flex min-w-0 items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors ${b?"bg-white/10 text-white":"text-white/55 hover:bg-white/[0.06] hover:text-white/85"}`,children:[e.jsx("span",{className:"flex h-5 w-5 flex-shrink-0 items-center justify-center",children:m.icon??e.jsx(w.HiHome,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate",children:m.label})]},m.href)})})]},v))}),e.jsxs("div",{className:"border-t border-white/10 p-3",children:[n&&e.jsxs("div",{className:"mb-3 flex min-w-0 items-center gap-3 rounded-lg bg-white/[0.04] p-2",children:[e.jsx(Xr,{name:n.initials??n.name??n.email??"Usuario",size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate text-sm font-medium text-white",children:n.name??"Usuario"}),n.email&&e.jsx("div",{className:"truncate text-xs text-white/45",children:n.email})]})]}),p&&e.jsxs(he,{variant:"ghost",className:"w-full justify-start text-white hover:bg-white/10",onClick:p,children:[e.jsx(w.HiArrowRightOnRectangle,{className:"h-4 w-4"})," Salir"]}),l]})]}),e.jsxs("div",{className:"min-h-screen lg:pl-72",children:[d,e.jsx("main",{className:"min-h-screen",children:r})]})]})}const Ua={dashboard:"Dashboard",tickets:"Tickets",teams:"Equipos",projects:"Proyectos",clients:"Clientes",surveys:"Encuestas",profile:"Perfil",settings:"Configuración",notifications:"Notificaciones",changelog:"Historial",admin:"Inicio",users:"Usuarios",roles:"Roles",menus:"Menús",guards:"Guardias",vacations:"Vacaciones",audit:"Auditoría",positions:"Puestos",ranks:"Rangos","email-inbox":"Buzones","security-incidents":"Incidentes","guard-schedule":"Guardias"},sr={dashboard:e.jsx(w.HiChartBar,{className:"h-5 w-5"}),tickets:e.jsx(w.HiTicket,{className:"h-5 w-5"}),teams:e.jsx(w.HiUsers,{className:"h-5 w-5"}),projects:e.jsx(w.HiRectangleGroup,{className:"h-5 w-5"}),clients:e.jsx(w.HiBuildingOffice2,{className:"h-5 w-5"}),surveys:e.jsx(w.HiClipboardDocumentList,{className:"h-5 w-5"}),profile:e.jsx(w.HiUser,{className:"h-5 w-5"}),settings:e.jsx(w.HiCog6Tooth,{className:"h-5 w-5"}),notifications:e.jsx(w.HiBell,{className:"h-5 w-5"}),changelog:e.jsx(w.HiDocumentText,{className:"h-5 w-5"}),admin:e.jsx(w.HiShieldCheck,{className:"h-5 w-5"}),users:e.jsx(w.HiUsers,{className:"h-5 w-5"}),roles:e.jsx(w.HiShieldCheck,{className:"h-5 w-5"}),menus:e.jsx(w.HiCog6Tooth,{className:"h-5 w-5"}),guards:e.jsx(w.HiCalendarDays,{className:"h-5 w-5"}),vacations:e.jsx(w.HiCalendarDays,{className:"h-5 w-5"}),audit:e.jsx(w.HiListBullet,{className:"h-5 w-5"}),positions:e.jsx(w.HiBriefcase,{className:"h-5 w-5"}),ranks:e.jsx(w.HiListBullet,{className:"h-5 w-5"}),"email-inbox":e.jsx(w.HiInbox,{className:"h-5 w-5"}),"security-incidents":e.jsx(w.HiShieldCheck,{className:"h-5 w-5"})};function qa({href:r,className:t,style:a,children:n}){return e.jsx("a",{href:r,className:t,style:a,children:n})}function Ga(r){return r.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function Ya(r){return/^\d+$/.test(r)||/^[a-f0-9]{8,}$/i.test(r)}function Xa(r){const t=r.split("/").filter(Boolean);if(t.length===0||t.length===1&&t[0]==="dashboard")return[];const a=decodeURIComponent(t[t.length-1]),n=t.length>1?decodeURIComponent(t[t.length-2]):void 0,s=Ya(a)&&n?n:a,c=Ua[s]??Ga(s);return[{label:"Inicio",href:"/"},{label:c}]}function lr(r){return(r==null?void 0:r.querySelector(":scope > .os-viewport"))??(r==null?void 0:r.querySelector(":scope > [data-overlayscrollbars-viewport]"))}function Ka(r){const t=r.split("/").filter(Boolean),a=t[t.length-1];if(!a)return e.jsx(w.HiHome,{className:"h-5 w-5"});if(sr[a])return sr[a];const n=t.length>1?t[t.length-2]:"";return sr[n]??e.jsx(w.HiHome,{className:"h-5 w-5"})}function Va({title:r,subtitle:t,action:a,meta:n,icon:s,className:c="",contentClassName:d="",breadcrumbs:l,currentPath:p=typeof window>"u"?"/":window.location.pathname,showBreadcrumbs:h=!0,contained:S=!1,LinkComponent:k=qa}){const y=o.useRef(null),[v,u]=o.useState(!1),[m,b]=o.useState(null),E=l??Xa(p),j=s??Ka(p),z=h&&E.length>1;return o.useEffect(()=>{if(S){u(!1);return}let B=null,N=0,$=0;const A=()=>{const H=y.current,F=document.querySelector("[data-app-scroll='true']");return(H==null?void 0:H.closest(".os-viewport"))??(H==null?void 0:H.closest("[data-overlayscrollbars-viewport]"))??lr(F)??F??window},_=()=>{const H=B&&B!==window?B.scrollTop:window.scrollY;u(F=>F?H>24:H>72)},L=()=>{B==null||B.removeEventListener("scroll",_),B=A(),B.addEventListener("scroll",_,{passive:!0}),_()};return L(),N=window.requestAnimationFrame(L),$=window.setTimeout(L,120),()=>{window.cancelAnimationFrame(N),window.clearTimeout($),B==null||B.removeEventListener("scroll",_)}},[S]),o.useEffect(()=>{if(S){b(null);return}let B=0;const N=[],$=()=>{const W=y.current,U=W==null?void 0:W.parentElement,V=document.querySelector("[data-app-scroll='true']"),te=lr(V)??V;if(!W||!U||!te){b(null);return}const f=U.getBoundingClientRect(),M=window.getComputedStyle(U),G=te.getBoundingClientRect(),Z=te instanceof HTMLElement&&te.clientWidth>0?te.clientWidth:G.width,J=f.left+parseFloat(M.paddingLeft||"0"),ae={marginLeft:Math.round(G.left-J),width:Math.round(Z)};b(ce=>ce&&ce.marginLeft===ae.marginLeft&&ce.width===ae.width?ce:ae)},A=()=>{window.cancelAnimationFrame(B),B=window.requestAnimationFrame($)};A(),window.addEventListener("resize",A);const _=new ResizeObserver(A),L=y.current,H=L==null?void 0:L.parentElement,F=document.querySelector("[data-app-scroll='true']"),I=lr(F)??F;return[H,F,I].forEach(W=>{W&&_.observe(W)}),N.push(window.setTimeout(A,120)),N.push(window.setTimeout(A,280)),()=>{window.cancelAnimationFrame(B),window.removeEventListener("resize",A),_.disconnect(),N.forEach(W=>window.clearTimeout(W))}},[S]),e.jsx("div",{ref:y,"data-page-header":"true","data-compact":v?"true":"false",className:`sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${S?"mb-0 flex-shrink-0":"mb-4 sm:mb-0"} ${c}`,style:{...m?{marginLeft:m.marginLeft,width:m.width}:null,background:S?"var(--bg-card)":v?"var(--bg-main)":"color-mix(in srgb, var(--bg-main) 44%, transparent)",backdropFilter:"saturate(1.2) blur(14px)",WebkitBackdropFilter:"saturate(1.2) blur(14px)",borderBottom:S||v?"1px solid var(--border)":"1px solid transparent",boxShadow:v?"0 10px 28px rgba(12, 54, 53, 0.12)":"none"},children:e.jsxs("div",{className:`flex flex-wrap items-center justify-between px-4 pt-0.5 transition-[gap,min-height,padding] duration-300 ease-out ${v?"min-h-9 gap-2 sm:min-h-10 sm:gap-2.5":"min-h-10 gap-2.5 sm:min-h-11 sm:gap-3"} ${d}`,children:[e.jsxs("div",{className:`min-w-0 flex flex-1 flex-col justify-center transition-[gap,transform] duration-300 ease-out ${v?"gap-1":"gap-1.5 sm:gap-2"}`,children:[z&&e.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0 flex-shrink-0 transition-[opacity,transform] duration-300 ease-out",children:e.jsx("ol",{className:`flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${v?"text-[10px]":"text-[10px] sm:text-[11px]"}`,children:E.map((B,N)=>{const $=N===E.length-1;return e.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[N>0&&e.jsx(w.HiChevronRight,{className:"h-3.5 w-3.5 transition-[color,transform] duration-300 ease-out",style:{color:"var(--text-muted)"}}),B.href&&!$?e.jsx(k,{href:B.href,className:"truncate transition-colors duration-300 hover:underline",style:{color:"var(--text-muted)"},children:B.label}):e.jsx("span",{"aria-current":$?"page":void 0,className:$?"truncate font-semibold":"truncate",style:{color:$?"var(--text-main)":"var(--text-muted)"},children:B.label})]},`${B.label}-${N}`)})})}),e.jsxs("div",{className:`flex min-w-0 items-center transition-[gap,transform] duration-300 ease-out ${v?"gap-2":"gap-2.5 sm:gap-3"}`,children:[e.jsx("span",{className:`flex-shrink-0 transition-[color,transform,opacity] duration-300 ease-out ${v?"scale-75 opacity-80":"scale-90 opacity-100"}`,style:{color:z?"var(--text-secondary)":"var(--text-muted)"},children:j}),e.jsxs("div",{className:`flex min-w-0 flex-1 flex-wrap items-center transition-[gap] duration-300 ease-out ${v?"gap-x-2 gap-y-1":"gap-x-3 gap-y-2"}`,children:[e.jsxs("div",{className:"min-w-0 flex-shrink transition-[transform] duration-300 ease-out",children:[e.jsx("h1",{className:`truncate font-bold tracking-tight transition-[font-size,line-height,color] duration-300 ease-out ${v?"text-base sm:text-lg":"text-lg sm:text-xl"}`,style:{color:"var(--text-main)"},children:r}),t&&e.jsx("p",{"aria-hidden":v,className:`overflow-hidden text-xs transition-[max-height,opacity,transform,margin] duration-300 ease-out ${v?"mt-0 max-h-0 -translate-y-1 opacity-0":"mt-0.5 max-h-5 translate-y-0 opacity-100"}`,style:{color:"var(--text-muted)"},children:t})]}),n&&e.jsx("div",{className:`page-header-meta flex min-w-0 flex-1 basis-full items-center overflow-visible transition-[gap,opacity,transform] duration-300 ease-out sm:basis-auto ${v?"translate-y-0 gap-1.5 opacity-95":"gap-2 opacity-100"}`,children:n})]})]})]}),a&&e.jsx("div",{className:`page-header-actions ml-auto flex max-w-full flex-shrink-0 flex-wrap items-center justify-end self-center overflow-visible transition-[gap,min-height,opacity,transform] duration-300 ease-out ${v?"min-h-10 gap-1 opacity-95":"min-h-10 gap-1.5 opacity-100"}`,children:e.jsx(yr.Provider,{value:{compact:!0,headerAction:!0},children:a})})]})})}function Za({children:r,currentPath:t=typeof window>"u"?"/":window.location.pathname,publicRoutes:a=["/","/login","/reset-password"],...n}){return a.includes(t)?e.jsx(e.Fragment,{children:r}):e.jsx(Kr,{currentPath:t,...n,children:r})}function Vr(){if(typeof window>"u")return"system";const r=localStorage.getItem("theme");return r==="light"||r==="dark"?r:r==="system"?"system":document.documentElement.classList.contains("dark")?"dark":"light"}function Ja(r,t,a){try{const n=new URL(r),s=n.searchParams.get("callbackUrl");if(s){const c=new URL(s,n.origin);return c.searchParams.set("theme",t),a&&(c.searchParams.set("primeAuthOrigin",window.location.origin),c.searchParams.set("primeAuthProjectKey",a)),n.searchParams.set("callbackUrl",`${c.pathname}${c.search}${c.hash}`),n.toString()}return n.searchParams.set("theme",t),a&&(n.searchParams.set("primeAuthOrigin",window.location.origin),n.searchParams.set("primeAuthProjectKey",a)),n.toString()}catch{return r}}function Qa({name:r,src:t,projectKey:a}){const[n,s]=o.useState(()=>Vr()),c=o.useRef(null);o.useEffect(()=>{const p=new MutationObserver(()=>s(Vr()));return p.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>p.disconnect()},[]);const d=o.useMemo(()=>Ja(t,n,a),[a,t,n]),l=o.useMemo(()=>{try{return new URL(d).origin}catch{return""}},[d]);return o.useEffect(()=>{if(!a)return;const p=a;function h(S){var v,u,m;if(S.source!==((v=c.current)==null?void 0:v.contentWindow)||l&&S.origin!==l)return;if(((u=S.data)==null?void 0:u.type)==="prime-microservice:overlay"){window.dispatchEvent(new CustomEvent("prime-auth:microservice-overlay",{detail:{active:!!S.data.active}}));return}if(((m=S.data)==null?void 0:m.type)!=="prime-microservice:navigation")return;const k=S.data.path;if(!k||!k.startsWith("/")||k.startsWith("//"))return;const y=`/apps/${encodeURIComponent(p)}${k}`;`${window.location.pathname}${window.location.search}${window.location.hash}`!==y&&(window.history.replaceState(window.history.state,"",y),window.dispatchEvent(new CustomEvent("prime-auth:microservice-navigation")))}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),window.dispatchEvent(new CustomEvent("prime-auth:microservice-overlay",{detail:{active:!1}}))}},[l,a]),e.jsx("div",{className:"flex h-full min-h-screen flex-col bg-[var(--bg-main)]",children:e.jsx("iframe",{ref:c,src:d,title:r,className:"min-h-0 flex-1 border-0 bg-[var(--bg-main)]",allow:"clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-same-origin allow-scripts",referrerPolicy:"strict-origin-when-cross-origin"})})}function Ra(){const[r,t]=o.useState(""),[a,n]=o.useState(!1),[s,c]=o.useState({width:96,height:96});return o.useEffect(()=>{let d=!1;return fetch("/api/microservices/prime-suite/chat-url",{cache:"no-store"}).then(l=>l.ok?l.json():null).then(l=>{!d&&(l!=null&&l.src)&&t(l.src)}).catch(()=>{}),()=>{d=!0}},[]),o.useEffect(()=>{const d=l=>{var h;if(((h=l.data)==null?void 0:h.type)!=="prime-suite-chat:state")return;const p=!!l.data.active;n(p),c({width:Zr(l.data.width,96,720),height:Zr(l.data.height,96,560)})};return window.addEventListener("message",d),()=>window.removeEventListener("message",d)},[]),r?e.jsx("iframe",{title:"Chat Bonsaif",src:r,allow:"clipboard-write",className:"fixed bottom-0 right-0 z-[70] border-0 bg-transparent transition-[width,height] duration-200",style:{width:a?`min(${s.width}px, 100vw)`:96,height:a?`min(${s.height}px, 100vh)`:96,background:"transparent",backgroundColor:"transparent",colorScheme:"normal"}}):null}function Zr(r,t,a){const n=typeof r=="number"&&Number.isFinite(r)?r:t;return Math.max(t,Math.min(a,Math.ceil(n)))}function en(r){const t=document.documentElement,a=new MutationObserver(r);a.observe(t,{attributes:!0,attributeFilter:["class"]});const n=window.matchMedia("(prefers-color-scheme: dark)");return n.addEventListener("change",r),()=>{a.disconnect(),n.removeEventListener("change",r)}}function rn(){const r=localStorage.getItem("theme")||"system",t=window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||r==="dark"||r==="system"&&t?"dark":"light"}function tn(){return"light"}function an(){const r=o.useSyncExternalStore(en,rn,tn);return e.jsx(ut.Toaster,{position:"bottom-center",theme:r,richColors:!0,closeButton:!0})}T.Alert=Mt,T.AuthShell=Kr,T.BonsaifButton=ft,T.Button=he,T.CalendarPicker=Bt,T.Checkbox=Ot,T.CodeBlock=zt,T.CompactFilterSelect=_t,T.CompactSearchInput=jt,T.ConfirmDialog=Ut,T.CopyButton=nr,T.CopyLinkButton=Gt,T.DataTable=Vt,T.DateRangePicker=Qt,T.Drawer=ra,T.DropdownMenu=ea,T.DynamicDetailTabs=Et,T.EmptyState=aa,T.FormField=Br,T.GlobalScrollbars=qr,T.InputField=pa,T.LoadingState=Nr,T.MicroserviceFrame=Qa,T.Modal=Lr,T.MouseTooltip=Ue,T.MultiSelect=ba,T.PageHeader=Va,T.PageSearchInput=gr,T.Pagination=xa,T.PrimeAuthRouteShell=Za,T.PrimeAuthToaster=an,T.PrimeSuiteChatFrame=Ra,T.RadioGroup=va,T.SearchableSelect=or,T.SectionPanel=ga,T.StatusBadge=Na,T.StepWizard=Sa,T.Tabs=ka,T.TextInput=Ke,T.Textarea=_r,T.TextareaField=Da,T.Toggle=Ha,T.UserAvatar=Xr,T.cn=vr,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|