siesa-ui-kit 1.0.138 → 1.0.139

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.
@@ -1818,7 +1818,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1818
1818
  bg-background-secondary dark:bg-dark-bg-secondary
1819
1819
  overflow-hidden rounded-xl
1820
1820
  ${c}
1821
- `.trim().replace(/\s+/g," "),children:[n.jsxs("div",{className:"shrink-0 flex items-center gap-3 px-4 py-3 border-b border-border-primary dark:border-dark-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s&&n.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-1 -ml-1 rounded-md text-content-primary dark:text-dark-content-primary hover:bg-[rgba(0,0,0,0.03)] dark:hover:bg-white/5 transition-colors cursor-pointer","aria-label":"Volver",children:H9}),n.jsxs("div",{className:"flex flex-col min-w-0",children:[n.jsx("h1",{className:"text-xl font-bold leading-7 tracking-tight text-[#1355b7] dark:text-primary-custom-600 truncate",children:a}),T>0&&n.jsx("div",{className:"mt-1",children:n.jsx(dr,{color:"blue",label:`Modificaciones: ${T}`})})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx(A9,{value:N,onChange:U,placeholder:f}),!d&&n.jsx(ae,{onClick:se,disabled:T===0||R.size>0,leftIcon:V9,children:u})]})]}),L.length>0&&n.jsx("div",{className:"shrink-0",children:n.jsx(D9,{tabs:L,activeId:j,onChange:F})}),n.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 mx-4 my-3 bg-bg-primary dark:bg-dark-bg-primary rounded-xl",children:_.length===0?n.jsx("div",{className:"flex items-center justify-center py-12 text-content-secondary dark:text-dark-content-secondary text-sm",children:"No se encontraron parametros que coincidan con la busqueda."}):n.jsx($9,{parameters:P,sections:z,editedValues:b,originalValues:x.current,validationErrors:R,onChange:I,onValidationError:Z,onEntityDisplayLabel:W,fetcher:r,readOnly:d,onResetToDefault:g})}),D&&n.jsx(B9,{changes:H,onConfirm:te,onCancel:()=>k(!1),onUndoChange:K,saving:M,confirmButtonText:p,cancelButtonText:m})]})},U9=(...e)=>Wa(re(e)),Ah=({checked:e,indeterminate:t,disabled:r,readOnly:a})=>{const i=U9("w-4 h-4 rounded-[4px] flex items-center justify-center",e||t?"bg-primary-custom-600 border-primary-custom-600 shadow-button-inset dark:bg-primary-custom-300":"border border-border-primary bg-bg-primary dark:border-dark-border-primary dark:bg-dark-bg-secondary",r&&"opacity-50",a&&!r&&"opacity-70");return n.jsxs("span",{"data-testid":"tree-checkbox",className:i,children:[e&&!t&&n.jsx(G9,{}),t&&n.jsx(W9,{})]})};Ah.displayName="TreeCheckbox";const G9=()=>n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),W9=()=>n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2.5 6H9.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})}),ps=(...e)=>Wa(re(e));function K9(e){const{node:t,level:r,expanded:a,hasChildren:s,readOnly:i,showBadge:o,childCount:l,onToggle:c,onExpand:d,tabIndex:u,onKeyDown:f}=e,p=t.disabled,m=!p&&!i,g=`${16+r*24}px`,x=h.useCallback(S=>{S.stopPropagation(),s&&d(t.id)},[s,t.id,d]),y=h.useCallback(S=>{S.stopPropagation(),m&&c(t.id)},[m,t.id,c]),b=h.useCallback(S=>{f(S,t.id)},[t.id,f]),C=ps("flex items-center gap-3 py-1 rounded-md outline-none","transition-colors duration-150",m&&"hover:bg-primary-custom-100 dark:hover:bg-[rgba(14,121,253,0.08)]",m&&"hover:text-primary-custom-600 dark:hover:text-primary-custom-300",p&&"cursor-not-allowed",!p&&i&&"cursor-default"),j=ps("w-4 h-4 transition-transform duration-150",a&&"rotate-90");return n.jsxs("div",{role:"treeitem","aria-expanded":s?a:void 0,"aria-checked":t.indeterminate?"mixed":t.checked?"true":"false","aria-disabled":p?"true":void 0,"aria-level":r+1,tabIndex:u,className:C,style:{paddingLeft:g},onKeyDown:b,children:[n.jsx("button",{type:"button","data-testid":"tree-node-chevron",className:ps("flex-shrink-0 flex items-center justify-center p-0 border-0 bg-transparent",!s&&"invisible",p&&"pointer-events-none"),onClick:x,tabIndex:-1,"aria-hidden":"true",children:n.jsx(le.ChevronRight,{size:16,className:j})}),n.jsx("button",{type:"button","data-testid":"tree-node-checkbox-area",className:"flex-shrink-0 flex items-center justify-center p-0 border-0 bg-transparent",onClick:y,tabIndex:-1,"aria-hidden":"true",children:n.jsx(Ah,{checked:t.checked,indeterminate:t.indeterminate,disabled:p,readOnly:i})}),t.icon!=null&&n.jsx("span",{"data-testid":"tree-node-icon",className:"flex-shrink-0 w-4 h-4 flex items-center justify-center text-content-secondary",children:t.icon}),n.jsx("span",{"data-testid":"tree-node-label",className:ps("flex-1 truncate text-sm select-none","text-content-primary dark:text-dark-content-primary",s?"font-bold":"font-normal"),children:t.label}),o&&s&&n.jsx("span",{"data-testid":"tree-node-badge",className:ps("flex-shrink-0 inline-flex items-center justify-center","min-w-[20px] h-5 px-1.5 rounded-full text-xs font-medium","bg-bg-secondary text-content-secondary","dark:bg-dark-bg-secondary dark:text-dark-content-secondary"),children:l})]})}const Dh=h.memo(K9,(e,t)=>e.node.checked===t.node.checked&&e.node.disabled===t.node.disabled&&e.node.indeterminate===t.node.indeterminate&&e.expanded===t.expanded&&e.tabIndex===t.tabIndex);Dh.displayName="TreeNode";function Z9(e){return{...e,childIds:[...e.childIds]}}function Fh(e){const t=new Map;for(const[r,a]of e)t.set(r,Z9(a));return t}function Cl(e){const t=new Map;function r(a,s,i){for(const o of a){const l=(o.children??[]).map(d=>d.id),c={id:o.id,label:o.label,checked:o.checked,disabled:o.disabled??!1,indeterminate:!1,parentId:s,childIds:l,depth:i,icon:o.icon,data:o.data};t.set(o.id,c),o.children&&o.children.length>0&&r(o.children,o.id,i+1)}}return r(e,null,0),t}function Q9(e,t,r){const a=Fh(r);function s(i){const o=a.get(i);if(o){o.disabled||(o.checked=t);for(const l of o.childIds)s(l)}}return s(e),a}function Y9(e,t){const r=Fh(t),a=r.get(e);if(!a)return r;let s=a.parentId;for(;s!==null;){const i=r.get(s);if(!i)break;const o=i.childIds.map(d=>r.get(d)),l=o.every(d=>d.checked&&!d.indeterminate),c=o.every(d=>!d.checked&&!d.indeterminate);l?(i.checked=!0,i.indeterminate=!1):c?(i.checked=!1,i.indeterminate=!1):(i.checked=!1,i.indeterminate=!0),s=i.parentId}return r}function Ri(e,t){const r=[];function a(s){const i=e.get(s);if(i){r.push(i);for(const o of i.childIds)a(o)}}for(const s of t)a(s);return r}function Tf(e,t,r){const a=[];function s(i){const o=e.get(i);if(o&&(a.push(o),r.has(i)))for(const l of o.childIds)s(l)}for(const i of t)s(i);return a}function Of(e,t){const r=[];for(const[a,s]of e){const i=t.get(a);i!==void 0&&s.checked!==i&&r.push(s)}return r}function Lh(e){const t=new Set;for(const[r,a]of e)a.childIds.length>0&&t.add(r);return t}function X9(e,t){return t?.expandedIds?new Set(t.expandedIds):t?.defaultExpanded?Lh(e):new Set}function cn(e){const t={id:e.id,label:e.label,checked:e.checked};return e.disabled&&(t.disabled=e.disabled),e.icon!==void 0&&(t.icon=e.icon),e.data!==void 0&&(t.data=e.data),t}function J9(e,t){const[r,a]=h.useState(()=>Cl(e)),s=h.useRef(r);s.current=r;const i=h.useRef((()=>{const v=new Map,M=Cl(e);for(const[A,_]of M)v.set(A,_.checked);return v})()),[o]=h.useState(()=>e.map(v=>v.id)),[l,c]=h.useState(()=>X9(Cl(e),t)),d=h.useRef(t?.readOnly??!1);d.current=t?.readOnly??!1;const u=h.useRef(t?.beforeCheck);u.current=t?.beforeCheck;const f=h.useRef(t?.onChange);f.current=t?.onChange;const p=h.useCallback(v=>{const M=s.current,A=M.get(v);if(!A||A.disabled||d.current)return;const _=!A.checked;if(u.current){const T=cn(A),H=u.current(T,_);if(process.env.NODE_ENV!=="production"&&typeof H!="boolean"&&console.warn("Tree: beforeCheck must return a boolean synchronously. Async functions are not supported and will be ignored."),!H)return}const L=Q9(v,_,M),O=Y9(v,L),P=Of(O,i.current);a(O);const z=O.get(v);if(f.current&&z){const T={source:cn(z),affected:P.map(H=>cn(H)),checked:_};f.current(T)}},[]),m=h.useCallback(v=>{c(M=>{const A=new Set(M);return A.add(v),A})},[]),g=h.useCallback(v=>{c(M=>{const A=new Set(M);return A.delete(v),A})},[]),x=h.useCallback(()=>{c(Lh(s.current))},[]),y=h.useCallback(()=>{c(new Set)},[]),b=h.useMemo(()=>Tf(r,o,l),[r,o,l]),C=h.useCallback(()=>Ri(s.current,o).map(cn),[o]),j=h.useCallback(()=>Ri(s.current,o).filter(v=>v.checked).map(cn),[o]),S=h.useCallback(()=>Ri(s.current,o).filter(v=>v.disabled).map(cn),[o]),N=h.useCallback(()=>Of(s.current,i.current).map(cn),[]),w=h.useCallback(v=>{const A=Ri(s.current,o).map(cn).filter(_=>!v(_));return{valid:A.length===0,failures:A}},[o]),[D,k]=h.useState(o.length>0?o[0]:null),R=h.useMemo(()=>Tf(r,o,l).map(cn),[r,o,l]);return{nodes:b,expandedIds:l,toggle:p,expand:m,collapse:g,expandAll:x,collapseAll:y,getAll:C,getChecked:j,getDisabled:S,getModified:N,validate:w,visibleNodes:R,focusedId:D,setFocusedId:k}}const ej=(e,t)=>{const{nodes:r,readOnly:a=!1,onChange:s,beforeCheck:i,defaultExpanded:o=!1,expandedIds:l,showBadge:c=!1,showDividers:d=!1,ariaLabel:u,className:f}=e,p=J9(r,{beforeCheck:i,onChange:s,defaultExpanded:o,expandedIds:l,readOnly:a});h.useImperativeHandle(t,()=>({getAll:p.getAll,getChecked:p.getChecked,getDisabled:p.getDisabled,getModified:p.getModified,validate:p.validate}),[p.getAll,p.getChecked,p.getDisabled,p.getModified,p.validate]);const m=h.useRef(new Map);h.useEffect(()=>{p.focusedId&&m.current.get(p.focusedId)?.focus()},[p.focusedId]);const g=p.nodes,x=h.useCallback(S=>{p.expandedIds.has(S)?p.collapse(S):p.expand(S)},[p.expandedIds,p.collapse,p.expand]),y=h.useCallback((S,N)=>{const w=g.findIndex(k=>k.id===N);if(w===-1)return;const D=g[w];switch(S.key){case"ArrowDown":{S.preventDefault(),w<g.length-1&&p.setFocusedId(g[w+1].id);break}case"ArrowUp":{S.preventDefault(),w>0&&p.setFocusedId(g[w-1].id);break}case"ArrowRight":{S.preventDefault();const k=D.childIds.length>0;if(k&&!p.expandedIds.has(N))p.expand(N);else if(k&&p.expandedIds.has(N)){const R=g.findIndex(v=>v.id===D.childIds[0]);R!==-1&&p.setFocusedId(g[R].id)}break}case"ArrowLeft":{S.preventDefault(),D.childIds.length>0&&p.expandedIds.has(N)?p.collapse(N):D.parentId!==null&&p.setFocusedId(D.parentId);break}case" ":{S.preventDefault(),!D.disabled&&!a&&p.toggle(N);break}case"Home":{S.preventDefault(),g.length>0&&p.setFocusedId(g[0].id);break}case"End":{S.preventDefault(),g.length>0&&p.setFocusedId(g[g.length-1].id);break}}},[g,p.expandedIds,p.expand,p.collapse,p.setFocusedId,p.toggle,a]),b=h.useCallback((S,N)=>{if(N){const w=N.querySelector('[role="treeitem"]');m.current.set(S,w??N)}else m.current.delete(S)},[]),C=h.useCallback(S=>{p.setFocusedId(S)},[p.setFocusedId]);let j=0;return g.filter(S=>S.parentId===null).length,n.jsx("div",{role:"tree","aria-label":u,"aria-readonly":a||void 0,className:f,children:g.map(S=>{const N=S.parentId===null,w=d&&N&&j>0;return N&&j++,n.jsxs(h.Fragment,{children:[w&&n.jsx("hr",{className:"border-border-primary dark:border-dark-border-primary my-1"}),n.jsx(tj,{node:S,level:S.depth,expanded:p.expandedIds.has(S.id),hasChildren:S.childIds.length>0,readOnly:a,showBadge:c,childCount:S.childIds.length,onToggle:p.toggle,onExpand:x,tabIndex:S.id===p.focusedId?0:-1,onKeyDown:y,setRef:b,onNodeFocus:C})]},S.id)})})};function tj(e){const{setRef:t,onNodeFocus:r,node:a,...s}=e,i=h.useCallback(l=>{t(a.id,l)},[t,a.id]),o=h.useCallback(()=>{r(a.id)},[r,a.id]);return n.jsx("div",{ref:i,onFocus:o,children:n.jsx(Dh,{node:a,...s})})}const Th=h.forwardRef(ej);Th.displayName="Tree";const rj={es:{search:"Buscar módulo",collapse:"Colapsar",recent:"Recientes",frequent:"Opciones frecuentes",logout:"Cerrar Sesión",account:"Mi Cuenta",notifications:"Notificaciones",billing:"Facturación",darkMode:"Modo Oscuro"},en:{search:"Search module",collapse:"Collapse",recent:"Recent",frequent:"Frequent options",logout:"Sign Out",account:"My Account",notifications:"Notifications",billing:"Billing",darkMode:"Dark Mode"}},nj=({productName:e="Mi Aplicación",siesaLogoPath:t,siesaLogoWidth:r,siesaLogoHeight:a,userDropdown:s,navigationItems:i=[],children:o,className:l="",contentClassName:c="",hideSidebar:d=!1,navbarProps:u={},navigationRailProps:f={},uiPrefix:p="layout",t:m,locale:g="es"})=>{const{t:x}=Ih({locale:g,uiPrefix:p,internalTranslations:rj,tProp:m}),y=h.useCallback(N=>N.map(w=>({...w,label:x(`menu.${w.id}`,w.label),children:w.children?y(w.children):void 0})),[x]),b=h.useMemo(()=>y(i),[i,y]),[C,j]=h.useState("collapsed"),S=N=>{N&&j(N)};return n.jsxs("div",{className:["h-screen","w-full","bg-white","dark:bg-dark-bg-primary","flex","flex-col","overflow-hidden",l].join(" ").replace(/\s+/g," ").trim(),children:[n.jsx(Xs,{productName:e,userDropdown:s,hideActionButtons:!0,showSiesaLogoLeading:!0,showBusinessLogo:!1,siesaLogo:t?n.jsx("img",{src:t,alt:"Siesa",className:"object-contain",style:{width:r||"100%",height:a||"100%"}}):void 0,className:"bg-white dark:bg-dark-bg-primary",t:x,...u}),n.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[!d&&n.jsx(Eo,{state:C,items:b,showSearchButton:!1,onStateChange:S,t:x,labels:{searchPlaceholder:x("search","Buscar módulo"),collapseButton:x("collapse","Colapsar"),recentSection:x("recent","Recientes"),frequentSection:x("frequent","Opciones frecuentes")},...f}),n.jsx("div",{className:["flex-1","overflow-y-auto","bg-gray-50","dark:bg-dark-bg-primary","p-6","flex flex-col",c].join(" ").replace(/\s+/g," ").trim(),children:n.jsx("div",{className:"w-full flex-1 flex flex-col",children:o})})]})]})},aj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8.543 2.232a.75.75 0 0 0-1.085 0l-5.25 5.5A.75.75 0 0 0 2.75 9H4v4a1 1 0 0 0 1 1h1.5a.5.5 0 0 0 .5-.5v-2a1 1 0 0 1 1-1h.5a1 1 0 0 1 1 1v2a.5.5 0 0 0 .5.5H12a1 1 0 0 0 1-1V9h1.25a.75.75 0 0 0 .543-1.268l-5.25-5.5Z"})}),sj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0ZM5.37 2.822a6.493 6.493 0 0 0-2.818 3.428h2.103c.088-.907.254-1.778.494-2.595a8.932 8.932 0 0 1 .221-.833ZM1.5 8c0 .522.062 1.03.179 1.516l.135.484h2.49a16.15 16.15 0 0 1 0-4H1.815L1.68 6.484A6.533 6.533 0 0 0 1.5 8Zm.552 2.75A6.493 6.493 0 0 0 5.37 14.18a8.932 8.932 0 0 1-.221-.833 13.2 13.2 0 0 1-.494-2.595H2.552Zm4.058 0c.083.78.23 1.497.429 2.128.197.622.423 1.07.649 1.357.225.286.401.265.312.265.089 0 .265.021.49-.265.226-.287.452-.735.649-1.357.199-.631.346-1.348.429-2.128H6.11Zm4.234 0a13.198 13.198 0 0 1-.494 2.595 8.938 8.938 0 0 1-.22.833 6.493 6.493 0 0 0 2.817-3.428h-2.103Zm2.104-2h-2.48a16.15 16.15 0 0 0 0-4h2.48l.135.484A6.538 6.538 0 0 1 14.5 8a6.538 6.538 0 0 1-.179 1.516l-.135.484h.162Zm-2.818-4.928c.167.251.394.699.221.833.24.817.406 1.688.494 2.595h2.103a6.493 6.493 0 0 0-2.818-3.428ZM9.89 6h-3.78c.083-.78.23-1.497.429-2.128.197-.622.423-1.07.649-1.357.225-.286.401-.265.312-.265.089 0 .265-.021.49.265.226.287.452.735.649 1.357.199.631.346 1.348.429 2.128Zm-4.234 0H3.553a6.493 6.493 0 0 1 2.818-3.428 8.932 8.932 0 0 0-.221.833c-.24.817-.406 1.688-.494 2.595Zm.144 2a14.65 14.65 0 0 0 0 4h4.4a14.65 14.65 0 0 0 0-4H5.8Z"})}),ij=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm1 5a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5Zm-.5 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5Zm.5 1.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5Z",clipRule:"evenodd"})}),oj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M1 9.5A3.5 3.5 0 0 0 4.5 13H12a3 3 0 0 0 .917-5.857 2.503 2.503 0 0 0-3.198-3.019 3.5 3.5 0 0 0-6.628 2.171A3.5 3.5 0 0 0 1 9.5Z"})}),lj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4ZM10 4a2 2 0 0 1 2-2h.5a.5.5 0 0 1 0 1H12a1 1 0 0 0-1 1v.5a.5.5 0 0 1-1 0V4ZM2 12a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v2ZM10.5 8a.5.5 0 0 0-.5.5V10H8.5a.5.5 0 0 0 0 1H10v1.5a.5.5 0 0 0 1 0V11h1.5a.5.5 0 0 0 0-1H11V8.5a.5.5 0 0 0-.5-.5Z"})}),cj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z"})}),dj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M2.5 4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1ZM4.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM4 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 4 8Zm.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM3 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-.5 4.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z",clipRule:"evenodd"})}),uj=({className:e=""})=>n.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M14 2H2c-.55 0-.95.538-.75 1.032l3 7.5c.127.318.44.528.783.528h5.934c.343 0 .656-.21.783-.528l3-7.5C14.95 2.538 14.55 2 14 2Z"}),n.jsx("path",{d:"M6 12.25v1.25a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1.25H6Z"})]}),fj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),pj=({className:e=""})=>n.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z"}),n.jsx("path",{d:"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z"})]}),mj=({title:e="List View",navbarProductName:t="SB Commercial",tableTitle:r="Usuarios",columns:a,data:s,navigationItems:i,quickFilters:o,actionButtons:l,userDropdown:c,notifications:d,environmentBadge:u,showNavigationRail:f=!0,navigationRailState:p="collapsed",onNavigationRailStateChange:m,onNavItemClick:g,onSearch:x,searchPlaceholder:y="Buscar",onSort:b,sortColumn:C,sortDirection:j,pagination:S,loading:N=!1,loadingRows:w=5,emptyMessage:D="No hay datos disponibles",className:k="",onNotificationsClick:R,viewOptions:v,selectedViewOption:M,onViewOptionChange:A})=>{const[_,L]=h.useState(""),[O,P]=h.useState(!1),z=i||[{id:"home",icon:n.jsx(aj,{className:"w-4 h-4"}),label:"Inicio",active:!0},{id:"option1",icon:n.jsx(sj,{className:"w-4 h-4"}),label:"Opción 1"},{id:"option2",icon:n.jsx(ij,{className:"w-4 h-4"}),label:"Opción 2"},{id:"option3",icon:n.jsx(oj,{className:"w-4 h-4"}),label:"Opción 3"},{id:"more",icon:n.jsx(lj,{className:"w-4 h-4"}),label:"Ver más..."}],T=o||[{id:"paid",label:"Facturas Pagadas",color:"lime"},{id:"pending",label:"Facturas Pendientes por Pago",color:"rose"},{id:"orders",label:"Órdenes de Compra",color:"sky"}],H=l||[{id:"audit",label:"Auditoría",leftIcon:n.jsx(dj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}},{id:"filter",label:"Filtrar",leftIcon:n.jsx(uj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}},{id:"create",label:"Crear",leftIcon:n.jsx(cj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}}],I=Z=>{L(Z.target.value),x?.(Z.target.value)},W=a.map(Z=>({header:Z.header,accessor:Z.accessor,sortable:Z.sortable,render:Z.render,align:Z.align,width:Z.width}));return n.jsxs("div",{className:["bg-background-secondary","dark:bg-dark-bg-primary","flex","w-full","h-full","min-h-screen",k].join(" "),children:[f&&n.jsx(Eo,{state:p,items:z,onStateChange:m,onItemClick:g,showSearchButton:!0}),n.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[n.jsx(Xs,{productName:t,environmentBadge:u,userDropdown:c,notifications:d,hideActionButtons:!1,onNotificationsClick:R,className:"bg-background-secondary dark:bg-dark-bg-primary"}),n.jsx("div",{className:"flex items-center gap-2 px-4 py-2 w-full bg-background-secondary dark:bg-dark-bg-primary",children:T.map(Z=>n.jsx(dr,{color:Z.color,label:Z.label,leftIcon:Z.icon},Z.id))}),n.jsx("div",{className:"flex flex-1 overflow-hidden bg-background-secondary dark:bg-dark-bg-primary",children:n.jsxs("div",{className:"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary p-4 rounded-tl-3xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("h2",{className:"font-bold text-xl leading-7 tracking-[-0.5px] text-content-primary dark:text-dark-content-primary",children:e}),n.jsx("div",{className:"flex items-center gap-2",children:H.map(Z=>n.jsx(ae,{type:Z.type,size:"sm",leftIcon:Z.leftIcon,onClick:Z.onClick,children:Z.label},Z.id))})]}),n.jsxs("div",{className:"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-xl p-8 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-4 w-full",children:[n.jsx("h3",{className:"flex-1 font-bold text-base leading-6 text-content-primary dark:text-dark-content-primary overflow-hidden text-ellipsis whitespace-nowrap",children:r}),n.jsx(Xe,{placeholder:y,leftIcon:n.jsx(pj,{className:"w-4 h-4"}),value:_,onChange:I,className:"w-[200px]"}),v&&n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>P(!O),className:"flex items-center gap-3 px-3 py-2 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-xs hover:bg-background-secondary dark:hover:bg-dark-bg-secondary transition-colors",children:[n.jsx("span",{className:"font-bold text-sm text-content-secondary dark:text-content-secondary",children:"Ver"}),n.jsx(fj,{className:"w-5 h-5 text-content-secondary dark:text-content-secondary"})]}),O&&n.jsx("div",{className:"absolute top-full right-0 mt-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-lg z-10 min-w-[150px]",children:v.map(Z=>n.jsx("button",{onClick:()=>{A?.(Z.id),P(!1)},className:["block","w-full","px-4","py-2","text-left","text-sm","hover:bg-background-secondary","dark:hover:bg-dark-bg-secondary",M===Z.id?"bg-primary-custom-100 dark:bg-primary-custom-600/20":""].join(" "),children:Z.label},Z.id))})]})]}),n.jsx(ra,{columns:W,data:s,variant:"grid",showBorder:!1,showShadow:!1,loading:N,loadingRows:w,emptyMessage:D,onSort:b,sortColumn:C,sortDirection:j,pagination:S,className:"flex-1"})]})]})})]})]})},hj=e=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:[n.jsx("path",{d:"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z"}),n.jsx("path",{d:"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z"})]}),gj=e=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:n.jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}),xj=e=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:[n.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),n.jsx("path",{fillRule:"evenodd",d:"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",clipRule:"evenodd"})]}),bj=({onSubmit:e,onForgotPassword:t,onSignUp:r,isLoading:a=!1,errorMessage:s,className:i="",showBackground:o=!0,variant:l="responsive"})=>{const[c,d]=h.useState(""),[u,f]=h.useState(""),[p,m]=h.useState(!1),[g,x]=h.useState(""),y=j=>{if(j.preventDefault(),!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)){x("Por favor ingresa un email válido");return}x(""),e?.(c,u)},b=j=>{d(j.target.value),g&&x("")},C=()=>{m(!p)};return n.jsxs("div",{className:["relative","min-h-screen","w-full","flex","flex-col","items-center","justify-center","box-border","p-0","md:p-4",i].join(" "),children:[o&&n.jsxs("div",{className:"absolute inset-0 pointer-events-none","aria-hidden":"true",children:[n.jsx("div",{className:"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom"}),n.jsx("img",{src:"/bg_siesa.png",alt:"",className:"absolute inset-0 w-full h-full object-cover opacity-10"})]}),n.jsxs("div",{className:["relative","box-border","flex","flex-col","items-center","justify-center","gap-4","p-16","shrink-0","bg-bg-primary","dark:bg-dark-bg-primary",...l==="mobile"?["w-full","h-full","shadow-none","rounded-none","border-0"]:l==="desktop"?["w-[400px]","h-auto","rounded-2xl","shadow-lg","dark:shadow-2xl","overflow-clip","border","border-transparent","dark:border-dark-border-primary"]:["w-full","h-full","shadow-none","rounded-none","border-0","md:w-[400px]","md:h-auto","md:rounded-2xl","md:shadow-lg","md:dark:shadow-2xl","md:overflow-clip","md:border","md:border-transparent","md:dark:border-dark-border-primary"]].join(" "),children:[n.jsx("div",{className:"w-full flex flex-col items-center pb-4",children:n.jsx("img",{src:"/.Siesa Logo.png",alt:"Siesa",className:"w-[200px] h-[50px] object-contain"})}),n.jsxs("div",{className:"w-full text-center",children:[n.jsx("h1",{className:["text-[20px]","leading-[28px]","font-bold","tracking-[-0.5px]","text-content-primary","dark:text-dark-content-primary"].join(" "),children:"Iniciar Sesión"}),n.jsx("p",{className:["text-[12px]","leading-[16px]","font-normal","text-content-primary","dark:text-dark-content-primary"].join(" "),children:"Inicia sesión ingresando con tu correo electrónico y contraseña."})]}),s&&n.jsx("div",{className:["w-full","p-3","bg-error-bg","dark:bg-error-bg","border","border-error-border","dark:border-error-border","rounded-md","text-error-content","dark:text-error-content","text-sm"].join(" "),role:"alert",children:s}),n.jsxs("form",{onSubmit:y,className:"w-full flex flex-col gap-2",children:[n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsxs("label",{htmlFor:"email-input",className:"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary",children:["Correo Electrónico ",n.jsx("span",{className:"text-red-600",children:"*"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50",children:n.jsx(hj,{className:"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary"})}),n.jsx("input",{id:"email-input",type:"email",placeholder:"ejemplo@miempresa.com",value:c,onChange:b,disabled:a,required:!0,autoComplete:"email",className:["w-full","pl-9","pr-3","py-1.5","text-base","leading-6","bg-bg-primary","dark:bg-dark-bg-primary","border","border-border-primary","dark:border-dark-border-primary","rounded-lg","placeholder:text-content-tertiary","dark:placeholder:text-dark-content-tertiary","text-content-primary","dark:text-dark-content-primary","focus:outline-hidden","focus:border-primary-custom-600","dark:focus:border-dark-border-custom","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-dark-border-custom","transition-all","duration-150",g?"border-error-border!":""].filter(Boolean).join(" ")})]}),g&&n.jsx("p",{className:"text-xs text-error-content dark:text-error-content",children:g})]}),n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{htmlFor:"password-input",className:"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary",children:["Contraseña ",n.jsx("span",{className:"text-red-600",children:"*"})]}),n.jsx("button",{type:"button",onClick:t,className:"text-[12px] leading-4 font-bold text-primary-custom-600 dark:text-[#93d1fd] hover:underline transition-all duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm px-1",children:"Olvidé mi Contraseña"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50",children:n.jsx(gj,{className:"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary"})}),n.jsx("input",{id:"password-input",type:p?"text":"password",placeholder:"••••••••",value:u,onChange:j=>f(j.target.value),disabled:a,required:!0,autoComplete:"current-password",className:["w-full","pl-9","pr-10","py-1.5","text-base","leading-6","bg-bg-primary","dark:bg-dark-bg-primary","border","border-border-primary","dark:border-dark-border-primary","rounded-lg","placeholder:text-content-tertiary","dark:placeholder:text-dark-content-tertiary","text-content-primary","dark:text-dark-content-primary","focus:outline-hidden","focus:border-primary-custom-600","dark:focus:border-dark-border-custom","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-dark-border-custom","transition-all","duration-150"].join(" ")}),n.jsx("button",{type:"button",onClick:C,className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1","aria-label":p?"Ocultar contraseña":"Mostrar contraseña",children:n.jsx(xj,{className:"w-4 h-4"})})]})]}),n.jsx("button",{type:"submit",disabled:a||!c||!u,className:["relative","w-full","px-2.5","py-1.5","flex","items-center","justify-center","gap-2","font-bold","text-sm","leading-5","text-primary-inverse-content","dark:text-[#0e79fd]","bg-[#0e79fd]","dark:bg-dark-bg-inverse","border","border-[#3c9bf6]","dark:border-[#93d1fd]","rounded-md","shadow-button-inset","hover:bg-primary-custom-500","dark:hover:bg-[#93d1fd]","active:scale-95","transition-all","duration-150","focus:outline-hidden","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-[#93d1fd]","focus:ring-offset-2","dark:focus:ring-offset-[#3f3f46]","disabled:opacity-50","disabled:cursor-not-allowed"].join(" "),children:a?"Iniciando sesión...":"Iniciar Sesión"})]}),n.jsx("button",{type:"button",onClick:r,className:["w-full","px-2.5","py-1.5","flex","items-center","justify-center","gap-2","font-bold","text-sm","leading-5","text-[#0e79fd]","dark:text-[#93d1fd]","hover:bg-primary-custom-100","dark:hover:bg-[#93d1fd]/10","rounded-md","transition-all","duration-150","focus:outline-hidden","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-[#93d1fd]","focus:ring-offset-2","dark:focus:ring-offset-[#3f3f46]"].join(" "),children:"¿No tienes una cuenta?"})]})]})},yj=({className:e=""})=>n.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{fillRule:"evenodd",d:"M14 8a.75.75 0 0 1-.75.75H4.56l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 1.06L4.56 7.25h8.69A.75.75 0 0 1 14 8Z",clipRule:"evenodd"})}),vj=({className:e=""})=>n.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"})}),Oh=({tableTitle:e="Mesa 1",changeTableLabel:t="Cambiar Mesa",menusTitle:r="Menús",menus:a=[{id:"1",label:"Corral"},{id:"2",label:"Burguer One"},{id:"3",label:"Andrés Carne de Res"},{id:"4",label:"Aceites"},{id:"5",label:"Kiosco Mac"},{id:"6",label:"Kiosco Qbano"},{id:"7",label:"Premier Dinning"}],selectedMenuId:s="1",onMenuSelect:i,onChangeTable:o,categoryTitle:l="Categoría",categories:c=[],selectedCategoryId:d,onCategorySelect:u,productsTitle:f="Productos",products:p=[],onAddProduct:m,activeTab:g="products",onTabChange:x,orderItems:y=[],onOrderItemQuantityChange:b,onOrderItemDelete:C,subtotal:j="40,000.00",taxes:S="40,000.00",total:N="40,000.00",confirmLabel:w="Confirmar Pedido",onConfirmOrder:D,isLoading:k=!1,errorMessage:R,userAvatar:v,userName:M="Jhonnatan Diaz",userRole:A="Administrador",businessLogo:_,siesaLogo:L,className:O=""})=>n.jsxs("div",{className:`
1821
+ `.trim().replace(/\s+/g," "),children:[n.jsxs("div",{className:"shrink-0 flex items-center gap-3 px-4 py-3 border-b border-border-primary dark:border-dark-border-primary",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s&&n.jsx("button",{type:"button",onClick:s,className:"shrink-0 p-1 -ml-1 rounded-md text-content-primary dark:text-dark-content-primary hover:bg-[rgba(0,0,0,0.03)] dark:hover:bg-white/5 transition-colors cursor-pointer","aria-label":"Volver",children:H9}),n.jsxs("div",{className:"flex flex-col min-w-0",children:[n.jsx("h1",{className:"text-xl font-bold leading-7 tracking-tight text-[#1355b7] dark:text-primary-custom-600 truncate",children:a}),T>0&&n.jsx("div",{className:"mt-1",children:n.jsx(dr,{color:"blue",label:`Modificaciones: ${T}`})})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx(A9,{value:N,onChange:U,placeholder:f}),!d&&n.jsx(ae,{onClick:se,disabled:T===0||R.size>0,leftIcon:V9,children:u})]})]}),L.length>0&&n.jsx("div",{className:"shrink-0",children:n.jsx(D9,{tabs:L,activeId:j,onChange:F})}),n.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 mx-4 my-3 bg-bg-primary dark:bg-dark-bg-primary rounded-xl",children:_.length===0?n.jsx("div",{className:"flex items-center justify-center py-12 text-content-secondary dark:text-dark-content-secondary text-sm",children:"No se encontraron parametros que coincidan con la busqueda."}):n.jsx($9,{parameters:P,sections:z,editedValues:b,originalValues:x.current,validationErrors:R,onChange:I,onValidationError:Z,onEntityDisplayLabel:W,fetcher:r,readOnly:d,onResetToDefault:g})}),D&&n.jsx(B9,{changes:H,onConfirm:te,onCancel:()=>k(!1),onUndoChange:K,saving:M,confirmButtonText:p,cancelButtonText:m})]})},U9=(...e)=>Wa(re(e)),Ah=({checked:e,indeterminate:t,disabled:r,readOnly:a})=>{const i=U9("w-4 h-4 rounded-[4px] flex items-center justify-center",e||t?"bg-primary-custom-600 border-primary-custom-600 shadow-button-inset dark:bg-primary-custom-300":"border border-border-primary bg-bg-primary dark:border-dark-border-primary dark:bg-dark-bg-secondary",r&&"opacity-50",a&&!r&&"opacity-70");return n.jsxs("span",{"data-testid":"tree-checkbox",className:i,children:[e&&!t&&n.jsx(G9,{}),t&&n.jsx(W9,{})]})};Ah.displayName="TreeCheckbox";const G9=()=>n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),W9=()=>n.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:n.jsx("path",{d:"M2.5 6H9.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"})}),ps=(...e)=>Wa(re(e));function K9(e){const{node:t,level:r,expanded:a,hasChildren:s,readOnly:i,showBadge:o,childCount:l,onToggle:c,onExpand:d,tabIndex:u,onKeyDown:f}=e,p=t.disabled,m=!p&&!i,g=`${16+r*24}px`,x=h.useCallback(S=>{S.stopPropagation(),s&&d(t.id)},[s,t.id,d]),y=h.useCallback(S=>{S.stopPropagation(),m&&c(t.id)},[m,t.id,c]),b=h.useCallback(S=>{f(S,t.id)},[t.id,f]),C=ps("flex items-center gap-3 py-1 rounded-md outline-none","transition-colors duration-150",m&&"hover:bg-primary-custom-100 dark:hover:bg-[rgba(14,121,253,0.08)]",m&&"hover:text-primary-custom-600 dark:hover:text-primary-custom-300",p&&"cursor-not-allowed",!p&&i&&"cursor-default"),j=ps("w-4 h-4 transition-transform duration-150",a&&"rotate-90");return n.jsxs("div",{role:"treeitem","aria-expanded":s?a:void 0,"aria-checked":t.indeterminate?"mixed":t.checked?"true":"false","aria-disabled":p?"true":void 0,"aria-level":r+1,tabIndex:u,className:C,style:{paddingLeft:g},onKeyDown:b,children:[n.jsx("button",{type:"button","data-testid":"tree-node-chevron",className:ps("flex-shrink-0 flex items-center justify-center p-0 border-0 bg-transparent",!s&&"invisible",p&&"pointer-events-none"),onClick:x,tabIndex:-1,"aria-hidden":"true",children:n.jsx(le.ChevronRight,{size:16,className:j})}),n.jsx("button",{type:"button","data-testid":"tree-node-checkbox-area",className:"flex-shrink-0 flex items-center justify-center p-0 border-0 bg-transparent",onClick:y,tabIndex:-1,"aria-hidden":"true",children:n.jsx(Ah,{checked:t.checked,indeterminate:t.indeterminate,disabled:p,readOnly:i})}),t.icon!=null&&n.jsx("span",{"data-testid":"tree-node-icon",className:"flex-shrink-0 w-4 h-4 flex items-center justify-center text-content-secondary",children:t.icon}),n.jsx("span",{"data-testid":"tree-node-label",className:ps("flex-1 truncate text-sm select-none","text-content-primary dark:text-dark-content-primary",s?"font-bold":"font-normal"),children:t.label}),o&&s&&n.jsx("span",{"data-testid":"tree-node-badge",className:ps("flex-shrink-0 inline-flex items-center justify-center","min-w-[20px] h-5 px-1.5 rounded-full text-xs font-medium","bg-bg-secondary text-content-secondary","dark:bg-dark-bg-secondary dark:text-dark-content-secondary"),children:l})]})}const Dh=h.memo(K9,(e,t)=>e.node.checked===t.node.checked&&e.node.disabled===t.node.disabled&&e.node.indeterminate===t.node.indeterminate&&e.expanded===t.expanded&&e.tabIndex===t.tabIndex);Dh.displayName="TreeNode";function Z9(e){return{...e,childIds:[...e.childIds]}}function Fh(e){const t=new Map;for(const[r,a]of e)t.set(r,Z9(a));return t}function Cl(e){const t=new Map;function r(a,s,i){for(const o of a){const l=(o.children??[]).map(d=>d.id),c={id:o.id,label:o.label,checked:o.checked,disabled:o.disabled??!1,indeterminate:!1,parentId:s,childIds:l,depth:i,icon:o.icon,data:o.data};t.set(o.id,c),o.children&&o.children.length>0&&r(o.children,o.id,i+1)}}return r(e,null,0),t}function Q9(e,t,r){const a=Fh(r);function s(i){const o=a.get(i);if(o){o.disabled||(o.checked=t);for(const l of o.childIds)s(l)}}return s(e),a}function Y9(e,t){const r=Fh(t),a=r.get(e);if(!a)return r;let s=a.parentId;for(;s!==null;){const i=r.get(s);if(!i)break;const o=i.childIds.map(d=>r.get(d)),l=o.every(d=>d.checked&&!d.indeterminate),c=o.every(d=>!d.checked&&!d.indeterminate);l?(i.checked=!0,i.indeterminate=!1):c?(i.checked=!1,i.indeterminate=!1):(i.checked=!1,i.indeterminate=!0),s=i.parentId}return r}function Ri(e,t){const r=[];function a(s){const i=e.get(s);if(i){r.push(i);for(const o of i.childIds)a(o)}}for(const s of t)a(s);return r}function Tf(e,t,r){const a=[];function s(i){const o=e.get(i);if(o&&(a.push(o),r.has(i)))for(const l of o.childIds)s(l)}for(const i of t)s(i);return a}function Of(e,t){const r=[];for(const[a,s]of e){const i=t.get(a);i!==void 0&&s.checked!==i&&r.push(s)}return r}function Lh(e){const t=new Set;for(const[r,a]of e)a.childIds.length>0&&t.add(r);return t}function X9(e,t){return t?.expandedIds?new Set(t.expandedIds):t?.defaultExpanded?Lh(e):new Set}function cn(e){const t={id:e.id,label:e.label,checked:e.checked};return e.disabled&&(t.disabled=e.disabled),e.icon!==void 0&&(t.icon=e.icon),e.data!==void 0&&(t.data=e.data),t}function J9(e,t){const[r,a]=h.useState(()=>Cl(e)),s=h.useRef(r);s.current=r;const i=h.useRef((()=>{const v=new Map,M=Cl(e);for(const[A,_]of M)v.set(A,_.checked);return v})()),[o]=h.useState(()=>e.map(v=>v.id)),[l,c]=h.useState(()=>X9(Cl(e),t)),d=h.useRef(t?.readOnly??!1);d.current=t?.readOnly??!1;const u=h.useRef(t?.beforeCheck);u.current=t?.beforeCheck;const f=h.useRef(t?.onChange);f.current=t?.onChange;const p=h.useCallback(v=>{const M=s.current,A=M.get(v);if(!A||A.disabled||d.current)return;const _=!A.checked;if(u.current){const T=cn(A),H=u.current(T,_);if(process.env.NODE_ENV!=="production"&&typeof H!="boolean"&&console.warn("Tree: beforeCheck must return a boolean synchronously. Async functions are not supported and will be ignored."),!H)return}const L=Q9(v,_,M),O=Y9(v,L),P=Of(O,i.current);a(O);const z=O.get(v);if(f.current&&z){const T={source:cn(z),affected:P.map(H=>cn(H)),checked:_};f.current(T)}},[]),m=h.useCallback(v=>{c(M=>{const A=new Set(M);return A.add(v),A})},[]),g=h.useCallback(v=>{c(M=>{const A=new Set(M);return A.delete(v),A})},[]),x=h.useCallback(()=>{c(Lh(s.current))},[]),y=h.useCallback(()=>{c(new Set)},[]),b=h.useMemo(()=>Tf(r,o,l),[r,o,l]),C=h.useCallback(()=>Ri(s.current,o).map(cn),[o]),j=h.useCallback(()=>Ri(s.current,o).filter(v=>v.checked).map(cn),[o]),S=h.useCallback(()=>Ri(s.current,o).filter(v=>v.disabled).map(cn),[o]),N=h.useCallback(()=>Of(s.current,i.current).map(cn),[]),w=h.useCallback(v=>{const A=Ri(s.current,o).map(cn).filter(_=>!v(_));return{valid:A.length===0,failures:A}},[o]),[D,k]=h.useState(o.length>0?o[0]:null),R=h.useMemo(()=>Tf(r,o,l).map(cn),[r,o,l]);return{nodes:b,expandedIds:l,toggle:p,expand:m,collapse:g,expandAll:x,collapseAll:y,getAll:C,getChecked:j,getDisabled:S,getModified:N,validate:w,visibleNodes:R,focusedId:D,setFocusedId:k}}const ej=(e,t)=>{const{nodes:r,readOnly:a=!1,onChange:s,beforeCheck:i,defaultExpanded:o=!1,expandedIds:l,showBadge:c=!1,showDividers:d=!1,ariaLabel:u,className:f}=e,p=J9(r,{beforeCheck:i,onChange:s,defaultExpanded:o,expandedIds:l,readOnly:a});h.useImperativeHandle(t,()=>({getAll:p.getAll,getChecked:p.getChecked,getDisabled:p.getDisabled,getModified:p.getModified,validate:p.validate}),[p.getAll,p.getChecked,p.getDisabled,p.getModified,p.validate]);const m=h.useRef(new Map);h.useEffect(()=>{p.focusedId&&m.current.get(p.focusedId)?.focus()},[p.focusedId]);const g=p.nodes,x=h.useCallback(S=>{p.expandedIds.has(S)?p.collapse(S):p.expand(S)},[p.expandedIds,p.collapse,p.expand]),y=h.useCallback((S,N)=>{const w=g.findIndex(k=>k.id===N);if(w===-1)return;const D=g[w];switch(S.key){case"ArrowDown":{S.preventDefault(),w<g.length-1&&p.setFocusedId(g[w+1].id);break}case"ArrowUp":{S.preventDefault(),w>0&&p.setFocusedId(g[w-1].id);break}case"ArrowRight":{S.preventDefault();const k=D.childIds.length>0;if(k&&!p.expandedIds.has(N))p.expand(N);else if(k&&p.expandedIds.has(N)){const R=g.findIndex(v=>v.id===D.childIds[0]);R!==-1&&p.setFocusedId(g[R].id)}break}case"ArrowLeft":{S.preventDefault(),D.childIds.length>0&&p.expandedIds.has(N)?p.collapse(N):D.parentId!==null&&p.setFocusedId(D.parentId);break}case" ":{S.preventDefault(),!D.disabled&&!a&&p.toggle(N);break}case"Home":{S.preventDefault(),g.length>0&&p.setFocusedId(g[0].id);break}case"End":{S.preventDefault(),g.length>0&&p.setFocusedId(g[g.length-1].id);break}}},[g,p.expandedIds,p.expand,p.collapse,p.setFocusedId,p.toggle,a]),b=h.useCallback((S,N)=>{if(N){const w=N.querySelector('[role="treeitem"]');m.current.set(S,w??N)}else m.current.delete(S)},[]),C=h.useCallback(S=>{p.setFocusedId(S)},[p.setFocusedId]);let j=0;return g.filter(S=>S.parentId===null).length,n.jsx("div",{role:"tree","aria-label":u,"aria-readonly":a||void 0,className:f,children:g.map(S=>{const N=S.parentId===null,w=d&&N&&j>0;return N&&j++,n.jsxs(h.Fragment,{children:[w&&n.jsx("hr",{className:"border-border-primary dark:border-dark-border-primary my-1"}),n.jsx(tj,{node:S,level:S.depth,expanded:p.expandedIds.has(S.id),hasChildren:S.childIds.length>0,readOnly:a,showBadge:c,childCount:S.childIds.length,onToggle:p.toggle,onExpand:x,tabIndex:S.id===p.focusedId?0:-1,onKeyDown:y,setRef:b,onNodeFocus:C})]},S.id)})})};function tj(e){const{setRef:t,onNodeFocus:r,node:a,...s}=e,i=h.useCallback(l=>{t(a.id,l)},[t,a.id]),o=h.useCallback(()=>{r(a.id)},[r,a.id]);return n.jsx("div",{ref:i,onFocus:o,children:n.jsx(Dh,{node:a,...s})})}const Th=h.forwardRef(ej);Th.displayName="Tree";const rj={es:{search:"Buscar módulo",collapse:"Colapsar",recent:"Recientes",frequent:"Opciones frecuentes",logout:"Cerrar Sesión",account:"Mi Cuenta",notifications:"Notificaciones",billing:"Facturación",darkMode:"Modo Oscuro"},en:{search:"Search module",collapse:"Collapse",recent:"Recent",frequent:"Frequent options",logout:"Sign Out",account:"My Account",notifications:"Notifications",billing:"Billing",darkMode:"Dark Mode"}},nj=({productName:e="Mi Aplicación",siesaLogoPath:t,siesaLogoWidth:r,siesaLogoHeight:a,userDropdown:s,navigationItems:i=[],children:o,className:l="",contentClassName:c="",hideSidebar:d=!1,navbarProps:u={},navigationRailProps:f={},uiPrefix:p="layout",t:m,locale:g="es"})=>{const{t:x}=Ih({locale:g,uiPrefix:p,internalTranslations:rj,tProp:m}),y=h.useCallback(N=>N.map(w=>({...w,label:x(`menu.${w.id}`,w.label),children:w.children?y(w.children):void 0})),[x]),b=h.useMemo(()=>y(i),[i,y]),[C,j]=h.useState("collapsed"),S=N=>{N&&j(N)};return n.jsxs("div",{className:["h-screen","w-full","bg-white","dark:bg-dark-bg-primary","flex","flex-col","overflow-hidden",l].join(" ").replace(/\s+/g," ").trim(),children:[n.jsx(Xs,{productName:e,userDropdown:s,hideActionButtons:!0,showSiesaLogoLeading:!0,showBusinessLogo:!1,siesaLogo:t?n.jsx("img",{src:t,alt:"Siesa",className:"object-contain",style:{width:r||"100%",height:a||"100%"}}):void 0,className:"bg-white dark:bg-dark-bg-primary",t:x,...u}),n.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[!d&&n.jsx("div",{style:{position:"relative",zIndex:9999},children:n.jsx(Eo,{state:C,items:b,showSearchButton:!1,onStateChange:S,t:x,labels:{searchPlaceholder:x("search","Buscar módulo"),collapseButton:x("collapse","Colapsar"),recentSection:x("recent","Recientes"),frequentSection:x("frequent","Opciones frecuentes")},...f})}),n.jsx("div",{className:["flex-1","overflow-y-auto","bg-gray-50","dark:bg-dark-bg-primary","p-6","flex flex-col",c].join(" ").replace(/\s+/g," ").trim(),children:n.jsx("div",{className:"w-full flex-1 flex flex-col",children:o})})]})]})},aj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8.543 2.232a.75.75 0 0 0-1.085 0l-5.25 5.5A.75.75 0 0 0 2.75 9H4v4a1 1 0 0 0 1 1h1.5a.5.5 0 0 0 .5-.5v-2a1 1 0 0 1 1-1h.5a1 1 0 0 1 1 1v2a.5.5 0 0 0 .5.5H12a1 1 0 0 0 1-1V9h1.25a.75.75 0 0 0 .543-1.268l-5.25-5.5Z"})}),sj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0ZM5.37 2.822a6.493 6.493 0 0 0-2.818 3.428h2.103c.088-.907.254-1.778.494-2.595a8.932 8.932 0 0 1 .221-.833ZM1.5 8c0 .522.062 1.03.179 1.516l.135.484h2.49a16.15 16.15 0 0 1 0-4H1.815L1.68 6.484A6.533 6.533 0 0 0 1.5 8Zm.552 2.75A6.493 6.493 0 0 0 5.37 14.18a8.932 8.932 0 0 1-.221-.833 13.2 13.2 0 0 1-.494-2.595H2.552Zm4.058 0c.083.78.23 1.497.429 2.128.197.622.423 1.07.649 1.357.225.286.401.265.312.265.089 0 .265.021.49-.265.226-.287.452-.735.649-1.357.199-.631.346-1.348.429-2.128H6.11Zm4.234 0a13.198 13.198 0 0 1-.494 2.595 8.938 8.938 0 0 1-.22.833 6.493 6.493 0 0 0 2.817-3.428h-2.103Zm2.104-2h-2.48a16.15 16.15 0 0 0 0-4h2.48l.135.484A6.538 6.538 0 0 1 14.5 8a6.538 6.538 0 0 1-.179 1.516l-.135.484h.162Zm-2.818-4.928c.167.251.394.699.221.833.24.817.406 1.688.494 2.595h2.103a6.493 6.493 0 0 0-2.818-3.428ZM9.89 6h-3.78c.083-.78.23-1.497.429-2.128.197-.622.423-1.07.649-1.357.225-.286.401-.265.312-.265.089 0 .265-.021.49.265.226.287.452.735.649 1.357.199.631.346 1.348.429 2.128Zm-4.234 0H3.553a6.493 6.493 0 0 1 2.818-3.428 8.932 8.932 0 0 0-.221.833c-.24.817-.406 1.688-.494 2.595Zm.144 2a14.65 14.65 0 0 0 0 4h4.4a14.65 14.65 0 0 0 0-4H5.8Z"})}),ij=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M4 2a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V6.414A2 2 0 0 0 13.414 5L10 1.586A2 2 0 0 0 8.586 1H4Zm1 5a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5Zm-.5 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5Zm.5 1.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5Z",clipRule:"evenodd"})}),oj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M1 9.5A3.5 3.5 0 0 0 4.5 13H12a3 3 0 0 0 .917-5.857 2.503 2.503 0 0 0-3.198-3.019 3.5 3.5 0 0 0-6.628 2.171A3.5 3.5 0 0 0 1 9.5Z"})}),lj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4ZM10 4a2 2 0 0 1 2-2h.5a.5.5 0 0 1 0 1H12a1 1 0 0 0-1 1v.5a.5.5 0 0 1-1 0V4ZM2 12a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v2ZM10.5 8a.5.5 0 0 0-.5.5V10H8.5a.5.5 0 0 0 0 1H10v1.5a.5.5 0 0 0 1 0V11h1.5a.5.5 0 0 0 0-1H11V8.5a.5.5 0 0 0-.5-.5Z"})}),cj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z"})}),dj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M2.5 4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1ZM4.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM4 8a.75.75 0 0 1 .75-.75h8.5a.75.75 0 0 1 0 1.5h-8.5A.75.75 0 0 1 4 8Zm.75 3.25a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5h-8.5ZM3 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Zm-.5 4.5a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z",clipRule:"evenodd"})}),uj=({className:e=""})=>n.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M14 2H2c-.55 0-.95.538-.75 1.032l3 7.5c.127.318.44.528.783.528h5.934c.343 0 .656-.21.783-.528l3-7.5C14.95 2.538 14.55 2 14 2Z"}),n.jsx("path",{d:"M6 12.25v1.25a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1.25H6Z"})]}),fj=({className:e=""})=>n.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{fillRule:"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),pj=({className:e=""})=>n.jsxs("svg",{className:e,width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z"}),n.jsx("path",{d:"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z"})]}),mj=({title:e="List View",navbarProductName:t="SB Commercial",tableTitle:r="Usuarios",columns:a,data:s,navigationItems:i,quickFilters:o,actionButtons:l,userDropdown:c,notifications:d,environmentBadge:u,showNavigationRail:f=!0,navigationRailState:p="collapsed",onNavigationRailStateChange:m,onNavItemClick:g,onSearch:x,searchPlaceholder:y="Buscar",onSort:b,sortColumn:C,sortDirection:j,pagination:S,loading:N=!1,loadingRows:w=5,emptyMessage:D="No hay datos disponibles",className:k="",onNotificationsClick:R,viewOptions:v,selectedViewOption:M,onViewOptionChange:A})=>{const[_,L]=h.useState(""),[O,P]=h.useState(!1),z=i||[{id:"home",icon:n.jsx(aj,{className:"w-4 h-4"}),label:"Inicio",active:!0},{id:"option1",icon:n.jsx(sj,{className:"w-4 h-4"}),label:"Opción 1"},{id:"option2",icon:n.jsx(ij,{className:"w-4 h-4"}),label:"Opción 2"},{id:"option3",icon:n.jsx(oj,{className:"w-4 h-4"}),label:"Opción 3"},{id:"more",icon:n.jsx(lj,{className:"w-4 h-4"}),label:"Ver más..."}],T=o||[{id:"paid",label:"Facturas Pagadas",color:"lime"},{id:"pending",label:"Facturas Pendientes por Pago",color:"rose"},{id:"orders",label:"Órdenes de Compra",color:"sky"}],H=l||[{id:"audit",label:"Auditoría",leftIcon:n.jsx(dj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}},{id:"filter",label:"Filtrar",leftIcon:n.jsx(uj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}},{id:"create",label:"Crear",leftIcon:n.jsx(cj,{className:"w-4 h-4"}),type:"default",onClick:()=>{}}],I=Z=>{L(Z.target.value),x?.(Z.target.value)},W=a.map(Z=>({header:Z.header,accessor:Z.accessor,sortable:Z.sortable,render:Z.render,align:Z.align,width:Z.width}));return n.jsxs("div",{className:["bg-background-secondary","dark:bg-dark-bg-primary","flex","w-full","h-full","min-h-screen",k].join(" "),children:[f&&n.jsx(Eo,{state:p,items:z,onStateChange:m,onItemClick:g,showSearchButton:!0}),n.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[n.jsx(Xs,{productName:t,environmentBadge:u,userDropdown:c,notifications:d,hideActionButtons:!1,onNotificationsClick:R,className:"bg-background-secondary dark:bg-dark-bg-primary"}),n.jsx("div",{className:"flex items-center gap-2 px-4 py-2 w-full bg-background-secondary dark:bg-dark-bg-primary",children:T.map(Z=>n.jsx(dr,{color:Z.color,label:Z.label,leftIcon:Z.icon},Z.id))}),n.jsx("div",{className:"flex flex-1 overflow-hidden bg-background-secondary dark:bg-dark-bg-primary",children:n.jsxs("div",{className:"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary p-4 rounded-tl-3xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between w-full",children:[n.jsx("h2",{className:"font-bold text-xl leading-7 tracking-[-0.5px] text-content-primary dark:text-dark-content-primary",children:e}),n.jsx("div",{className:"flex items-center gap-2",children:H.map(Z=>n.jsx(ae,{type:Z.type,size:"sm",leftIcon:Z.leftIcon,onClick:Z.onClick,children:Z.label},Z.id))})]}),n.jsxs("div",{className:"flex flex-col gap-4 flex-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-xl p-8 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-4 w-full",children:[n.jsx("h3",{className:"flex-1 font-bold text-base leading-6 text-content-primary dark:text-dark-content-primary overflow-hidden text-ellipsis whitespace-nowrap",children:r}),n.jsx(Xe,{placeholder:y,leftIcon:n.jsx(pj,{className:"w-4 h-4"}),value:_,onChange:I,className:"w-[200px]"}),v&&n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>P(!O),className:"flex items-center gap-3 px-3 py-2 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-xs hover:bg-background-secondary dark:hover:bg-dark-bg-secondary transition-colors",children:[n.jsx("span",{className:"font-bold text-sm text-content-secondary dark:text-content-secondary",children:"Ver"}),n.jsx(fj,{className:"w-5 h-5 text-content-secondary dark:text-content-secondary"})]}),O&&n.jsx("div",{className:"absolute top-full right-0 mt-1 bg-white dark:bg-dark-bg-primary border border-border-primary dark:border-dark-border-primary rounded-lg shadow-lg z-10 min-w-[150px]",children:v.map(Z=>n.jsx("button",{onClick:()=>{A?.(Z.id),P(!1)},className:["block","w-full","px-4","py-2","text-left","text-sm","hover:bg-background-secondary","dark:hover:bg-dark-bg-secondary",M===Z.id?"bg-primary-custom-100 dark:bg-primary-custom-600/20":""].join(" "),children:Z.label},Z.id))})]})]}),n.jsx(ra,{columns:W,data:s,variant:"grid",showBorder:!1,showShadow:!1,loading:N,loadingRows:w,emptyMessage:D,onSort:b,sortColumn:C,sortDirection:j,pagination:S,className:"flex-1"})]})]})})]})]})},hj=e=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:[n.jsx("path",{d:"M2.5 3A1.5 1.5 0 0 0 1 4.5v.793c.026.009.051.02.076.032L7.674 8.51c.206.1.446.1.652 0l6.598-3.185A.755.755 0 0 1 15 5.293V4.5A1.5 1.5 0 0 0 13.5 3h-11Z"}),n.jsx("path",{d:"M15 6.954 8.978 9.86a2.25 2.25 0 0 1-1.956 0L1 6.954V11.5A1.5 1.5 0 0 0 2.5 13h11a1.5 1.5 0 0 0 1.5-1.5V6.954Z"})]}),gj=e=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:n.jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}),xj=e=>n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...e,children:[n.jsx("path",{d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),n.jsx("path",{fillRule:"evenodd",d:"M1.38 8.28a.87.87 0 0 1 0-.566 7.003 7.003 0 0 1 13.238.006.87.87 0 0 1 0 .56A7.003 7.003 0 0 1 1.379 8.28ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",clipRule:"evenodd"})]}),bj=({onSubmit:e,onForgotPassword:t,onSignUp:r,isLoading:a=!1,errorMessage:s,className:i="",showBackground:o=!0,variant:l="responsive"})=>{const[c,d]=h.useState(""),[u,f]=h.useState(""),[p,m]=h.useState(!1),[g,x]=h.useState(""),y=j=>{if(j.preventDefault(),!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)){x("Por favor ingresa un email válido");return}x(""),e?.(c,u)},b=j=>{d(j.target.value),g&&x("")},C=()=>{m(!p)};return n.jsxs("div",{className:["relative","min-h-screen","w-full","flex","flex-col","items-center","justify-center","box-border","p-0","md:p-4",i].join(" "),children:[o&&n.jsxs("div",{className:"absolute inset-0 pointer-events-none","aria-hidden":"true",children:[n.jsx("div",{className:"absolute inset-0 bg-primary-custom-100 dark:bg-dark-bg-custom"}),n.jsx("img",{src:"/bg_siesa.png",alt:"",className:"absolute inset-0 w-full h-full object-cover opacity-10"})]}),n.jsxs("div",{className:["relative","box-border","flex","flex-col","items-center","justify-center","gap-4","p-16","shrink-0","bg-bg-primary","dark:bg-dark-bg-primary",...l==="mobile"?["w-full","h-full","shadow-none","rounded-none","border-0"]:l==="desktop"?["w-[400px]","h-auto","rounded-2xl","shadow-lg","dark:shadow-2xl","overflow-clip","border","border-transparent","dark:border-dark-border-primary"]:["w-full","h-full","shadow-none","rounded-none","border-0","md:w-[400px]","md:h-auto","md:rounded-2xl","md:shadow-lg","md:dark:shadow-2xl","md:overflow-clip","md:border","md:border-transparent","md:dark:border-dark-border-primary"]].join(" "),children:[n.jsx("div",{className:"w-full flex flex-col items-center pb-4",children:n.jsx("img",{src:"/.Siesa Logo.png",alt:"Siesa",className:"w-[200px] h-[50px] object-contain"})}),n.jsxs("div",{className:"w-full text-center",children:[n.jsx("h1",{className:["text-[20px]","leading-[28px]","font-bold","tracking-[-0.5px]","text-content-primary","dark:text-dark-content-primary"].join(" "),children:"Iniciar Sesión"}),n.jsx("p",{className:["text-[12px]","leading-[16px]","font-normal","text-content-primary","dark:text-dark-content-primary"].join(" "),children:"Inicia sesión ingresando con tu correo electrónico y contraseña."})]}),s&&n.jsx("div",{className:["w-full","p-3","bg-error-bg","dark:bg-error-bg","border","border-error-border","dark:border-error-border","rounded-md","text-error-content","dark:text-error-content","text-sm"].join(" "),role:"alert",children:s}),n.jsxs("form",{onSubmit:y,className:"w-full flex flex-col gap-2",children:[n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsxs("label",{htmlFor:"email-input",className:"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary",children:["Correo Electrónico ",n.jsx("span",{className:"text-red-600",children:"*"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50",children:n.jsx(hj,{className:"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary"})}),n.jsx("input",{id:"email-input",type:"email",placeholder:"ejemplo@miempresa.com",value:c,onChange:b,disabled:a,required:!0,autoComplete:"email",className:["w-full","pl-9","pr-3","py-1.5","text-base","leading-6","bg-bg-primary","dark:bg-dark-bg-primary","border","border-border-primary","dark:border-dark-border-primary","rounded-lg","placeholder:text-content-tertiary","dark:placeholder:text-dark-content-tertiary","text-content-primary","dark:text-dark-content-primary","focus:outline-hidden","focus:border-primary-custom-600","dark:focus:border-dark-border-custom","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-dark-border-custom","transition-all","duration-150",g?"border-error-border!":""].filter(Boolean).join(" ")})]}),g&&n.jsx("p",{className:"text-xs text-error-content dark:text-error-content",children:g})]}),n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("label",{htmlFor:"password-input",className:"font-bold text-sm leading-5 text-content-primary dark:text-dark-content-primary",children:["Contraseña ",n.jsx("span",{className:"text-red-600",children:"*"})]}),n.jsx("button",{type:"button",onClick:t,className:"text-[12px] leading-4 font-bold text-primary-custom-600 dark:text-[#93d1fd] hover:underline transition-all duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-[#93d1fd] rounded-sm px-1",children:"Olvidé mi Contraseña"})]}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none opacity-50",children:n.jsx(gj,{className:"w-4 h-4 text-content-tertiary dark:text-dark-content-tertiary"})}),n.jsx("input",{id:"password-input",type:p?"text":"password",placeholder:"••••••••",value:u,onChange:j=>f(j.target.value),disabled:a,required:!0,autoComplete:"current-password",className:["w-full","pl-9","pr-10","py-1.5","text-base","leading-6","bg-bg-primary","dark:bg-dark-bg-primary","border","border-border-primary","dark:border-dark-border-primary","rounded-lg","placeholder:text-content-tertiary","dark:placeholder:text-dark-content-tertiary","text-content-primary","dark:text-dark-content-primary","focus:outline-hidden","focus:border-primary-custom-600","dark:focus:border-dark-border-custom","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-dark-border-custom","transition-all","duration-150"].join(" ")}),n.jsx("button",{type:"button",onClick:C,className:"absolute right-3 top-1/2 -translate-y-1/2 opacity-50 hover:opacity-100 text-content-tertiary dark:text-dark-content-tertiary transition-opacity duration-150 focus:outline-hidden focus:ring-2 focus:ring-primary-custom-400 dark:focus:ring-dark-border-custom rounded-sm p-1","aria-label":p?"Ocultar contraseña":"Mostrar contraseña",children:n.jsx(xj,{className:"w-4 h-4"})})]})]}),n.jsx("button",{type:"submit",disabled:a||!c||!u,className:["relative","w-full","px-2.5","py-1.5","flex","items-center","justify-center","gap-2","font-bold","text-sm","leading-5","text-primary-inverse-content","dark:text-[#0e79fd]","bg-[#0e79fd]","dark:bg-dark-bg-inverse","border","border-[#3c9bf6]","dark:border-[#93d1fd]","rounded-md","shadow-button-inset","hover:bg-primary-custom-500","dark:hover:bg-[#93d1fd]","active:scale-95","transition-all","duration-150","focus:outline-hidden","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-[#93d1fd]","focus:ring-offset-2","dark:focus:ring-offset-[#3f3f46]","disabled:opacity-50","disabled:cursor-not-allowed"].join(" "),children:a?"Iniciando sesión...":"Iniciar Sesión"})]}),n.jsx("button",{type:"button",onClick:r,className:["w-full","px-2.5","py-1.5","flex","items-center","justify-center","gap-2","font-bold","text-sm","leading-5","text-[#0e79fd]","dark:text-[#93d1fd]","hover:bg-primary-custom-100","dark:hover:bg-[#93d1fd]/10","rounded-md","transition-all","duration-150","focus:outline-hidden","focus:ring-2","focus:ring-primary-custom-400","dark:focus:ring-[#93d1fd]","focus:ring-offset-2","dark:focus:ring-offset-[#3f3f46]"].join(" "),children:"¿No tienes una cuenta?"})]})]})},yj=({className:e=""})=>n.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{fillRule:"evenodd",d:"M14 8a.75.75 0 0 1-.75.75H4.56l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 1.06L4.56 7.25h8.69A.75.75 0 0 1 14 8Z",clipRule:"evenodd"})}),vj=({className:e=""})=>n.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:n.jsx("path",{fillRule:"evenodd",d:"M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"})}),Oh=({tableTitle:e="Mesa 1",changeTableLabel:t="Cambiar Mesa",menusTitle:r="Menús",menus:a=[{id:"1",label:"Corral"},{id:"2",label:"Burguer One"},{id:"3",label:"Andrés Carne de Res"},{id:"4",label:"Aceites"},{id:"5",label:"Kiosco Mac"},{id:"6",label:"Kiosco Qbano"},{id:"7",label:"Premier Dinning"}],selectedMenuId:s="1",onMenuSelect:i,onChangeTable:o,categoryTitle:l="Categoría",categories:c=[],selectedCategoryId:d,onCategorySelect:u,productsTitle:f="Productos",products:p=[],onAddProduct:m,activeTab:g="products",onTabChange:x,orderItems:y=[],onOrderItemQuantityChange:b,onOrderItemDelete:C,subtotal:j="40,000.00",taxes:S="40,000.00",total:N="40,000.00",confirmLabel:w="Confirmar Pedido",onConfirmOrder:D,isLoading:k=!1,errorMessage:R,userAvatar:v,userName:M="Jhonnatan Diaz",userRole:A="Administrador",businessLogo:_,siesaLogo:L,className:O=""})=>n.jsxs("div",{className:`
1822
1822
  min-h-screen
1823
1823
  w-full
1824
1824
  bg-background-secondary