import{i as d}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-2ce7a1bc.js";import{j as i,a as e}from"./Tooltip-5ec3092e.js";import{z as y,m as Q}from"./index-50f78195.js";import{N as j}from"./NoRowsComponent-d1d6636d.js";const{Box:C,Button:v,Card:F,CardHeader:H,Grid:M,Skeleton:w}=await d("@mui/material"),{DataGrid:N,GridToolbarQuickFilter:q}=await d("@mui/x-data-grid"),{useState:s}=await d("react");var L=(t=>(t[t.IZQUIERDA=0]="IZQUIERDA",t[t.DERECHA=1]="DERECHA",t))(L||{});const K=({itemsSinTransferir:t,itemsTransferidos:b,transferirItems:c,itemsLoading:h,deshabilitaAcciones:r,columns:p,columnsTransferidos:R,titulos:a,height:m,cantidadFilasDefault:g})=>{const[o,k]=s([]),[n,z]=s([]),P=()=>{o.length>=1?c(o,1):y.error("Seleccione al menos una opción para transferir")},T=()=>{n.length>=1?c(n,0):y.error("Seleccione al menos una opción para transferir")},[E,I]=s(g!==void 0?g:5),u=(x,S,B,G,D)=>i("div",{children:[e(F,{variant:"outlined",style:{width:"auto",marginBottom:"5px"},children:e(H,{sx:{px:2,py:1,width:"100%"},title:x,subheader:`${B}/${S.length} seleccionados`,titleTypographyProps:{fontSize:"15px"},subheaderTypographyProps:{fontSize:"13px"}})}),e(C,{sx:{width:"100%",height:Q.isTruthy(m)?m:"300px"},children:e(N,{columns:D,rows:S,rowsPerPageOptions:[5,10,20,50,100],pageSize:E,onPageSizeChange:l=>I(l),density:"compact",checkboxSelection:!0,style:{backgroundColor:"white"},isRowSelectable:()=>!G,onSelectionModelChange:l=>{const f=l.map(O=>O.toString());x===a.sinTransferir?k(f):z(f)},components:{NoRowsOverlay:j,Toolbar:U},loading:h,componentsProps:{toolbar:{showQuickFilter:!0,quickFilterProps:{debounceMs:500}}},sx:{"& .MuiDataGrid-cell--textRight":{fontFamily:"monospace"}}})})]});return i("div",{style:{display:"grid",gridTemplateColumns:"1fr max-content 1fr",alignItems:"center",columnGap:"10px"},children:[h?i("div",{children:[e(w,{variant:"rounded",height:52,style:{marginBottom:"5px"}}),e(w,{variant:"rounded",height:298})]}):e("div",{children:u(a.sinTransferir,t,o.length,r,p)}),e("div",{children:i(M,{container:!0,direction:"column",alignItems:"center",children:[e(v,{sx:{my:.5},variant:"outlined",size:"small",onClick:P,disabled:o.length===0||r,"aria-label":"move selected right",children:">"}),e(v,{sx:{my:.5},variant:"outlined",size:"small",onClick:T,disabled:n.length===0||r,"aria-label":"move selected left",children:"<"})]})}),e("div",{children:u(a.transferidos,b,n.length,r,R??p)})]})},U=()=>e(C,{sx:{p:.5,pb:0},children:e(q,{style:{width:"100%"}})});export{L as D,K as O};
