corekit-ui 0.1.21 → 0.1.24

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.
Files changed (118) hide show
  1. package/README.md +41 -39
  2. package/dist/corekit-ui.css +1 -1
  3. package/dist/index.d.ts +4231 -21
  4. package/dist/index.js +5649 -5149
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.umd.cjs +6 -6
  7. package/dist/index.umd.cjs.map +1 -1
  8. package/package.json +143 -132
  9. package/dist/animations/Transiciones.d.ts +0 -9
  10. package/dist/animations/index.d.ts +0 -1
  11. package/dist/badge/Badge.d.ts +0 -3
  12. package/dist/badge/index.d.ts +0 -2
  13. package/dist/badge/types.d.ts +0 -62
  14. package/dist/boton/Boton.d.ts +0 -2
  15. package/dist/boton/index.d.ts +0 -2
  16. package/dist/boton/typesButton.d.ts +0 -35
  17. package/dist/checkbox/Checkbox.d.ts +0 -25
  18. package/dist/checkbox/CheckboxContext.d.ts +0 -3
  19. package/dist/checkbox/CheckboxGroup.d.ts +0 -11
  20. package/dist/checkbox/index.d.ts +0 -4
  21. package/dist/checkbox/types.d.ts +0 -108
  22. package/dist/drawer/Drawer.d.ts +0 -2
  23. package/dist/drawer/index.d.ts +0 -2
  24. package/dist/drawer/types.d.ts +0 -140
  25. package/dist/dropdown/ContextMenu.d.ts +0 -12
  26. package/dist/dropdown/DropdownContext.d.ts +0 -29
  27. package/dist/dropdown/DropdownMenu.d.ts +0 -3
  28. package/dist/dropdown/MenuItem.d.ts +0 -8
  29. package/dist/dropdown/Submenu.d.ts +0 -23
  30. package/dist/dropdown/index.d.ts +0 -11
  31. package/dist/dropdown/types.d.ts +0 -168
  32. package/dist/firma_manual/FirmaManual.d.ts +0 -3
  33. package/dist/firma_manual/Iconografia.d.ts +0 -16
  34. package/dist/firma_manual/TypesFirma.d.ts +0 -22
  35. package/dist/firma_manual/index.d.ts +0 -2
  36. package/dist/firma_manual/useFirmaLogica.d.ts +0 -10
  37. package/dist/hablar_escuchar/BadgeVoz.d.ts +0 -6
  38. package/dist/hablar_escuchar/Iconografia.d.ts +0 -10
  39. package/dist/hablar_escuchar/index.d.ts +0 -3
  40. package/dist/hablar_escuchar/useReconocimientoVoz.d.ts +0 -21
  41. package/dist/input_date/InputDate.d.ts +0 -342
  42. package/dist/input_date/funciones.d.ts +0 -27
  43. package/dist/input_date/index.d.ts +0 -3
  44. package/dist/input_date/types.d.ts +0 -70
  45. package/dist/input_numeric/Iconografia.d.ts +0 -5
  46. package/dist/input_numeric/InputNumeric.d.ts +0 -353
  47. package/dist/input_numeric/funciones.d.ts +0 -64
  48. package/dist/input_numeric/index.d.ts +0 -3
  49. package/dist/input_numeric/types.d.ts +0 -96
  50. package/dist/input_text/Iconografia.d.ts +0 -9
  51. package/dist/input_text/InputText.d.ts +0 -347
  52. package/dist/input_text/index.d.ts +0 -2
  53. package/dist/input_text/types.d.ts +0 -77
  54. package/dist/input_types_compartidos/index.d.ts +0 -1
  55. package/dist/input_types_compartidos/types.d.ts +0 -11
  56. package/dist/modal/Modal.d.ts +0 -2
  57. package/dist/modal/index.d.ts +0 -2
  58. package/dist/modal/types.d.ts +0 -115
  59. package/dist/modal_stack/ModalStack.d.ts +0 -14
  60. package/dist/modal_stack/index.d.ts +0 -2
  61. package/dist/panel_filtros/Iconografia.d.ts +0 -5
  62. package/dist/panel_filtros/PanelFiltros.d.ts +0 -49
  63. package/dist/panel_filtros/index.d.ts +0 -3
  64. package/dist/radio/Radio.d.ts +0 -16
  65. package/dist/radio/RadioContext.d.ts +0 -3
  66. package/dist/radio/RadioGroup.d.ts +0 -11
  67. package/dist/radio/index.d.ts +0 -3
  68. package/dist/radio/types.d.ts +0 -195
  69. package/dist/select/Iconografia.d.ts +0 -10
  70. package/dist/select/Select.d.ts +0 -42
  71. package/dist/select/SelectBase.d.ts +0 -17
  72. package/dist/select/SelectNativo.d.ts +0 -57
  73. package/dist/select/Types.d.ts +0 -629
  74. package/dist/select/funciones.d.ts +0 -244
  75. package/dist/select/index.d.ts +0 -4
  76. package/dist/tabla_datos/TablaDatos.d.ts +0 -80
  77. package/dist/tabla_datos/components/Iconografia.d.ts +0 -17
  78. package/dist/tabla_datos/components/TablaCards.d.ts +0 -1
  79. package/dist/tabla_datos/components/TablaEscritorio.d.ts +0 -1
  80. package/dist/tabla_datos/components/configuraciones/ConfigColumnas.d.ts +0 -1
  81. package/dist/tabla_datos/components/configuraciones/ConfigEncabezado.d.ts +0 -6
  82. package/dist/tabla_datos/components/configuraciones/ConfigFilas.d.ts +0 -1
  83. package/dist/tabla_datos/components/configuraciones/ConfigOpciones.d.ts +0 -6
  84. package/dist/tabla_datos/components/configuraciones/MenuConfiguraciones.d.ts +0 -1
  85. package/dist/tabla_datos/components/skeletons/SkeletonCargando.d.ts +0 -4
  86. package/dist/tabla_datos/components/skeletons/SkeletonCargandoCards.d.ts +0 -2
  87. package/dist/tabla_datos/components/tabla/BarraHerramientas.d.ts +0 -1
  88. package/dist/tabla_datos/components/tabla/BarraSeleccion.d.ts +0 -9
  89. package/dist/tabla_datos/components/tabla/Paginacion.d.ts +0 -1
  90. package/dist/tabla_datos/components/tabla/SinDatos.d.ts +0 -1
  91. package/dist/tabla_datos/components/tabla/tabla_cards/AccionesCards.d.ts +0 -3
  92. package/dist/tabla_datos/components/tabla/tabla_cards/ContenidoCards.d.ts +0 -3
  93. package/dist/tabla_datos/components/tabla/tabla_cards/EncabezadoCards.d.ts +0 -3
  94. package/dist/tabla_datos/constantes/ConstGenerales.d.ts +0 -18
  95. package/dist/tabla_datos/context/ContextTypes.d.ts +0 -23
  96. package/dist/tabla_datos/context/TablaDatosContext.d.ts +0 -3
  97. package/dist/tabla_datos/context/hooks.d.ts +0 -10
  98. package/dist/tabla_datos/hooks/useClickOutside.d.ts +0 -8
  99. package/dist/tabla_datos/hooks/useEscapeKey.d.ts +0 -1
  100. package/dist/tabla_datos/hooks/usePopoverPosition.d.ts +0 -15
  101. package/dist/tabla_datos/hooks/useScrollLock.d.ts +0 -1
  102. package/dist/tabla_datos/index.d.ts +0 -5
  103. package/dist/tabla_datos/types/TablaTypes.d.ts +0 -85
  104. package/dist/tabla_datos/types/tanstack-table.d.ts +0 -8
  105. package/dist/tabla_datos/utils/FuncionesColumnas.d.ts +0 -9
  106. package/dist/tabla_datos/utils/FuncionesPaginacion.d.ts +0 -12
  107. package/dist/tabla_datos/utils/FuncionesTabla.d.ts +0 -54
  108. package/dist/text_area/Iconografia.d.ts +0 -6
  109. package/dist/text_area/TextArea.d.ts +0 -333
  110. package/dist/text_area/index.d.ts +0 -2
  111. package/dist/text_area/types.d.ts +0 -76
  112. package/dist/texts/Texts.d.ts +0 -19
  113. package/dist/toggle/Toggle.d.ts +0 -21
  114. package/dist/toggle/index.d.ts +0 -2
  115. package/dist/toggle/types.d.ts +0 -90
  116. package/dist/tooltip/Tooltip.d.ts +0 -2
  117. package/dist/tooltip/index.d.ts +0 -2
  118. package/dist/tooltip/types.d.ts +0 -83
@@ -1,10 +1,10 @@
1
- (function(X,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],a):(X=typeof globalThis<"u"?globalThis:X||self,a(X.CoreKitUI={},X.jsxRuntime,X.React,X.ReactDOM))})(this,(function(X,a,v,un){"use strict";function zr(e){if(e&&e.__esModule)return e;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const M=zr(v),Io=zr(un);function Vr(e){var n,t,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(n=0;n<r;n++)e[n]&&(t=Vr(e[n]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function K(){for(var e,n,t=0,o="",r=arguments.length;t<r;t++)(e=arguments[t])&&(n=Vr(e))&&(o&&(o+=" "),o+=n);return o}const qr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jr=K,Ea=(e,n)=>t=>{var o;if(n?.variants==null)return jr(e,t?.class,t?.className);const{variants:r,defaultVariants:i}=n,s=Object.keys(r).map(u=>{const f=t?.[u],p=i?.[u];if(f===null)return null;const _=qr(f)||qr(p);return r[u][_]}),l=t&&Object.entries(t).reduce((u,f)=>{let[p,_]=f;return _===void 0||(u[p]=_),u},{}),d=n==null||(o=n.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:p,className:_,...c}=f;return Object.entries(c).every(h=>{let[g,m]=h;return Array.isArray(m)?m.includes({...i,...l}[g]):{...i,...l}[g]===m})?[...u,p,_]:u},[]);return jr(e,s,d,t?.class,t?.className)},Se={boton:"_boton_ofmyy_1",animated:"_animated_ofmyy_61",disabled:"_disabled_ofmyy_61",loading:"_loading_ofmyy_61",content:"_content_ofmyy_69",spinner:"_spinner_ofmyy_71",spinner_icon:"_spinner_icon_ofmyy_111",ripple:"_ripple_ofmyy_147",solid:"_solid_ofmyy_199",bordered:"_bordered_ofmyy_219",ghost:"_ghost_ofmyy_239",light:"_light_ofmyy_263",faded:"_faded_ofmyy_283",shadow:"_shadow_ofmyy_303",only_loading:"_only_loading_ofmyy_355",sm:"_sm_ofmyy_373",md:"_md_ofmyy_389",lg:"_lg_ofmyy_405",full_width:"_full_width_ofmyy_421",icon_only:"_icon_only_ofmyy_429",radius_none:"_radius_none_ofmyy_471",radius_sm:"_radius_sm_ofmyy_479",radius_md:"_radius_md_ofmyy_487",radius_lg:"_radius_lg_ofmyy_495",radius_full:"_radius_full_ofmyy_503",primary:"_primary_ofmyy_511",secondary:"_secondary_ofmyy_521",success:"_success_ofmyy_531",warning:"_warning_ofmyy_541",danger:"_danger_ofmyy_551",default:"_default_ofmyy_561"},Ma=Ea(Se.boton,{variants:{variant:{solid:Se.solid,bordered:Se.bordered,ghost:Se.ghost,light:Se.light,faded:Se.faded,shadow:Se.shadow},color:{default:Se.default,primary:Se.primary,secondary:Se.secondary,success:Se.success,warning:Se.warning,danger:Se.danger},size:{sm:Se.sm,md:Se.md,lg:Se.lg},radius:{none:Se.radius_none,sm:Se.radius_sm,md:Se.radius_md,lg:Se.radius_lg,full:Se.radius_full},fullWidth:{true:Se.full_width},isIconOnly:{true:Se.icon_only},isLoading:{true:Se.loading},onlyLoading:{true:Se.only_loading},isDisabled:{true:Se.disabled},disableAnimation:{false:Se.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),ht=v.forwardRef(({variant:e="solid",color:n="default",size:t="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:s=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:p,spinner:_,spinnerPlacement:c="end",permisos:h,permiso:g,children:m,className:b,onClick:w,style:C,type:S="button","aria-label":k,...$},I)=>{const F=g&&h?!h.includes(g):!1,L=l||i||F,N=E=>{if(L){E.preventDefault();return}if(w?.(E),u||L||!(E.currentTarget instanceof HTMLElement))return;const z=E.currentTarget,A=document.createElement("span"),x=z.getBoundingClientRect(),P=Math.max(x.width,x.height);A.className=Se.ripple,A.style.width=`${P}px`,A.style.height=`${P}px`,A.style.left=`${E.clientX-x.left}px`,A.style.top=`${E.clientY-x.top}px`,A.addEventListener("animationend",()=>A.remove(),{once:!0}),z.appendChild(A)},D=p?{"--btn-color":p,"--btn-text-color":p,...C}:C,V=Ma({variant:e,color:p?void 0:n,size:t,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:s,isDisabled:L,disableAnimation:f}),T=i&&a.jsx("span",{className:Se.spinner,"aria-hidden":s?void 0:"true",children:_||a.jsx("span",{className:Se.spinner_icon})}),y=s&&!k?"Cargando":k;return a.jsxs("button",{...$,ref:I,type:S,"aria-label":y,"aria-busy":i,className:K(V,b),disabled:L,onClick:N,style:D,children:[c==="start"&&T,m&&!s&&a.jsx("span",{className:Se.content,children:m}),c==="end"&&T]})});ht.displayName="Boton";const Ee={dialog:"_dialog_1vo1g_1",modal:"_modal_1vo1g_69",encabezado:"_encabezado_1vo1g_93",titulo:"_titulo_1vo1g_107",boton_cerrar:"_boton_cerrar_1vo1g_121",texto_esc:"_texto_esc_1vo1g_157",icono_x:"_icono_x_1vo1g_171",contenedor_lienzo:"_contenedor_lienzo_1vo1g_181",area_firma:"_area_firma_1vo1g_191",lienzo:"_lienzo_1vo1g_205",lienzo_deshabilitado:"_lienzo_deshabilitado_1vo1g_233",barra_acciones:"_barra_acciones_1vo1g_243",grupo_izquierda:"_grupo_izquierda_1vo1g_259",separador:"_separador_1vo1g_271",boton_accion:"_boton_accion_1vo1g_283",boton_guardar:"_boton_guardar_1vo1g_329",icono:"_icono_1vo1g_171",contenedor_consentimiento:"_contenedor_consentimiento_1vo1g_379",contenedor_checkbox:"_contenedor_checkbox_1vo1g_393",checkbox_nativo:"_checkbox_nativo_1vo1g_409",checkbox_custom:"_checkbox_custom_1vo1g_423",texto_consentimiento:"_texto_consentimiento_1vo1g_489",contenedor_subir:"_contenedor_subir_1vo1g_505",boton_subir:"_boton_subir_1vo1g_515",input_archivo:"_input_archivo_1vo1g_551"},Na=({className:e,title:n="Deshacer"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M3 7v6h6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("path",{d:"M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Fa=({className:e,title:n="Limpiar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Aa=({className:e,title:n="Adjuntar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Pa=({className:e,title:n="Cerrar"})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","aria-hidden":!n,role:"img",children:[a.jsx("title",{children:n}),a.jsx("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),La=()=>{const e=v.useRef(null),[n,t]=v.useState(!1),[o,r]=v.useState(!0),[i,s]=v.useState(null),[l,d]=v.useState([]),[u,f]=v.useState([]),p=v.useCallback(()=>{const S=e.current,k=S?.getContext("2d");S&&k&&(k.clearRect(0,0,S.width,S.height),r(!0),d([]),f([]))},[]),_=v.useCallback(()=>{if(l.length===0)return;const S=l.slice(0,-1);d(S);const k=e.current,$=k?.getContext("2d");!k||!$||($.clearRect(0,0,k.width,k.height),S.forEach(I=>{if(!(I.puntos.length<2)){$.strokeStyle=I.color,$.beginPath(),$.moveTo(I.puntos[0].x,I.puntos[0].y);for(let F=1;F<I.puntos.length;F++)$.lineTo(I.puntos[F].x,I.puntos[F].y);$.stroke()}}),r(S.length===0))},[l]),c=v.useCallback(S=>{const k=e.current;if(!k)return{x:0,y:0};const $=k.getBoundingClientRect(),I=k.width/$.width,F=k.height/$.height;return"touches"in S?{x:(S.touches[0].clientX-$.left)*I,y:(S.touches[0].clientY-$.top)*F}:{x:(S.clientX-$.left)*I,y:(S.clientY-$.top)*F}},[]),h=v.useCallback((S,k)=>{const I=e.current?.getContext("2d");I&&(I.beginPath(),I.moveTo(S.x,S.y),I.lineTo(k.x,k.y),I.stroke(),r(!1))},[]),g=v.useCallback(S=>{S.preventDefault();const k=c(S);t(!0),s(k),f([k])},[c]),m=v.useCallback(S=>{if(!n||!i)return;S.preventDefault();const k=c(S);h(i,k),s(k),f($=>[...$,k])},[n,i,c,h]),b=v.useCallback(()=>{if(n&&u.length>0){const k=e.current?.getContext("2d"),$={puntos:u,color:k?.strokeStyle||"#000000"};d(I=>[...I,$]),f([])}t(!1),s(null)},[n,u]),w=v.useCallback(()=>{const S=e.current;return!S||o?null:S.toDataURL("image/png")},[o]),C=v.useCallback((S,k=!0)=>{const $=e.current,I=$?.getContext("2d");if(!(!$||!I))return I.strokeStyle=S,I.lineWidth=4,I.lineCap="round",I.lineJoin="round",k?($.addEventListener("mousedown",g),$.addEventListener("mousemove",m),$.addEventListener("mouseup",b),$.addEventListener("mouseout",b),$.addEventListener("touchstart",g),$.addEventListener("touchmove",m),$.addEventListener("touchend",b),()=>{$.removeEventListener("mousedown",g),$.removeEventListener("mousemove",m),$.removeEventListener("mouseup",b),$.removeEventListener("mouseout",b),$.removeEventListener("touchstart",g),$.removeEventListener("touchmove",m),$.removeEventListener("touchend",b)}):()=>{}},[g,m,b]);return{canvasRef:e,estaVacio:o,limpiarCanvas:p,deshacerUltimoTrazo:_,puedeDeshacer:l.length>0,obtenerDatosFirma:w,configurarCanvas:C}},Br=v.forwardRef(({isOpen:e=!1,onClose:n,onConfirm:t,titulo:o="Firmar el contrato",textoGuardar:r="Guardar firma",textoModificar:i="Modificar firma",textoDeshacer:s="Deshacer",textoLimpiar:l="Limpiar",textoAdjuntar:d="Adjuntar firma",ancho:u=500,alto:f=200,className:p,textoConsentimiento:_="Al firmar, confirmo que he leído y acepto todos los términos contractuales",mostrarBotonSubir:c=!1,cerrarAlGuardar:h=!1},g)=>{const{canvasRef:m,estaVacio:b,limpiarCanvas:w,deshacerUltimoTrazo:C,obtenerDatosFirma:S,configurarCanvas:k,puedeDeshacer:$}=La(),I=v.useRef(null),F=v.useRef(null),[L,N]=v.useState(!1),[D,V]=v.useState(!1),[T,y]=v.useState(!1);v.useImperativeHandle(g,()=>({limpiar:w,obtenerDatosFirma:S,estaVacio:()=>b})),v.useEffect(()=>{if(e&&m.current){const q=m.current,le=(()=>{const ce=document.documentElement.getAttribute("data-theme"),ie=window.matchMedia("(prefers-color-scheme: dark)").matches;return ce==="dark"||ce===null&&ie})()?"#ffffff":"#000000",oe=k(le,!T),re=new MutationObserver(()=>{const ce=document.documentElement.getAttribute("data-theme"),ie=window.matchMedia("(prefers-color-scheme: dark)").matches,U=ce==="dark"||ce===null&&ie?"#ffffff":"#000000",ne=q.getContext("2d");ne&&(ne.strokeStyle=U)});return re.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{oe?.(),re.disconnect()}}},[e,k,m,T]),v.useEffect(()=>{const q=I.current;if(q)return e?(q.showModal(),document.body.style.overflow="hidden"):(q.close(),document.body.style.overflow=""),()=>{document.body.style.overflow=""}},[e]);const E=v.useCallback(()=>{n&&(V(!1),N(!1),y(!1),n())},[n]);v.useEffect(()=>{if(!e)return;const q=J=>{J.key==="Escape"&&E()};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[e,E]);const z=v.useCallback(q=>{const J=I.current;if(!J)return;const G=J.getBoundingClientRect();(q.clientX<G.left||q.clientX>G.right||q.clientY<G.top||q.clientY>G.bottom)&&E()},[E]),A=()=>{const q=S();q&&t&&L&&(V(!0),t(q),h&&n&&E())},x=()=>{V(!1),y(!1),w()},P=q=>{const J=q.target.files?.[0];if(!J||!m.current)return;const G=new FileReader;G.onload=le=>{const oe=new Image;oe.onload=()=>{const re=m.current,ce=re?.getContext("2d");if(!re||!ce)return;ce.clearRect(0,0,re.width,re.height);const ie=re.width,me=re.height,U=ie/me,ne=oe.width/oe.height;let ee,pe,_e,Z;ne>U?(ee=ie,pe=ie/ne,_e=0,Z=(me-pe)/2):(pe=me,ee=me*ne,_e=(ie-ee)/2,Z=0),ce.drawImage(oe,_e,Z,ee,pe),y(!0)},oe.src=le.target?.result},G.readAsDataURL(J)},O=()=>{F.current?.click()},B=D||T,j=!D&&(b&&!T||!L);return e?a.jsx("dialog",{ref:I,className:`${Ee.dialog} ${p||""}`,onClick:z,"aria-labelledby":"firma-titulo","aria-describedby":"firma-consentimiento",children:a.jsxs("div",{className:Ee.modal,children:[a.jsxs("header",{className:Ee.encabezado,children:[a.jsx("h2",{id:"firma-titulo",className:Ee.titulo,children:o}),a.jsxs("button",{className:Ee.boton_cerrar,onClick:E,type:"button","aria-label":"Cerrar",children:[a.jsx("span",{className:Ee.texto_esc,children:"ESC"}),a.jsx(Pa,{className:Ee.icono_x})]})]}),a.jsx("div",{className:Ee.contenedor_lienzo,children:a.jsxs("div",{className:Ee.area_firma,children:[a.jsx("canvas",{ref:m,className:`${Ee.lienzo} ${B?Ee.lienzo_deshabilitado:""}`,width:u*2,height:f*2,style:{pointerEvents:B?"none":"auto"},"aria-label":"Área de firma"}),a.jsxs("div",{className:Ee.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[a.jsxs("div",{className:Ee.grupo_izquierda,children:[a.jsxs("button",{className:Ee.boton_accion,onClick:C,type:"button",disabled:!$||B,"aria-label":s,children:[a.jsx(Na,{className:Ee.icono,"aria-hidden":"true"}),a.jsx("span",{children:s})]}),a.jsx("span",{className:Ee.separador,"aria-hidden":"true",children:"|"}),a.jsxs("button",{className:Ee.boton_accion,onClick:w,type:"button",disabled:b||B,"aria-label":l,children:[a.jsx(Fa,{className:Ee.icono,"aria-hidden":"true"}),a.jsx("span",{children:l})]})]}),a.jsx("button",{className:Ee.boton_guardar,onClick:D?x:A,type:"button",disabled:j,children:D?i:r})]})]})}),a.jsx("div",{className:Ee.contenedor_consentimiento,children:a.jsxs("label",{className:Ee.contenedor_checkbox,children:[a.jsx("input",{type:"checkbox",className:Ee.checkbox_nativo,checked:L,onChange:q=>N(q.target.checked),"aria-describedby":"firma-consentimiento"}),a.jsx("span",{className:Ee.checkbox_custom,"aria-hidden":"true"}),a.jsx("span",{id:"firma-consentimiento",className:Ee.texto_consentimiento,children:_})]})}),c&&a.jsxs("div",{className:Ee.contenedor_subir,children:[a.jsx("input",{ref:F,type:"file",accept:"image/*",className:Ee.input_archivo,onChange:P,"aria-label":"Subir imagen de firma"}),a.jsxs("button",{className:Ee.boton_subir,onClick:O,type:"button",children:[a.jsx(Aa,{className:Ee.icono,"aria-hidden":"true"}),d]})]})]})}):null});Br.displayName="FirmaManual";const Da="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Nn=(e=21)=>{let n="",t=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)n+=Da[t[e]&63];return n};const Ta=({size:e="1em",...n})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),Oa=({size:e="1em",...n})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[a.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),za=({size:e="1em",...n})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[a.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),a.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),a.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),a.jsx("path",{d:"m2 2 20 20"})]}),De={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Hr=v.forwardRef((e,n)=>{const{type:t="text",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:_,description:c,errorMessage:h,startContent:g,endContent:m,isRequired:b=!1,isReadOnly:w=!1,isDisabled:C=!1,isClearable:S=!1,isInvalid:k,validationState:$,validate:I,className:F,classNames:L,style:N,onChange:D,onClear:V,onValueChange:T,onFocus:y,onBlur:E,onKeyDown:z,id:A,name:x,autoComplete:P,autoFocus:O,maxLength:B,minLength:j,pattern:q,...J}=e,G=v.useRef(null),oe=v.useRef(A??`input-text-${Nn(8)}`).current;v.useImperativeHandle(n,()=>G.current);const re=o!==void 0,[ce,ie]=v.useState(r??""),me=re?o:ce,[U,ne]=v.useState(!1),[ee,pe]=v.useState(!1),_e=v.useMemo(()=>{if(!I)return null;const be=I(me);return be===!0||be==null?null:typeof be=="string"?be:typeof be=="object"&&"message"in be?be.message??"Entrada inválida":"Entrada inválida"},[me,I]),Z=v.useMemo(()=>k!==void 0?k:$==="invalid"?!0:$==="valid"?!1:!!_e,[k,$,_e]),de=$==="valid"&&!Z,ye={invalido:Z,mensaje:_e},ue=me.length>0,Ce=t==="password",W=Ce&&ee?"text":t,R=S&&ue&&!w&&!C,H=v.useCallback(be=>{if(C||w)return;const Ne=be.target.value;re||ie(Ne),D?.(Ne),T?.(Ne)},[re,C,w,D,T]),he=v.useCallback(be=>{ne(!0),y?.(be)},[y]),ge=v.useCallback(be=>{ne(!1),E?.(be)},[E]),ve=v.useCallback(()=>{C||w||(re||ie(""),D?.(""),T?.(""),V?.(),G.current?.focus())},[re,C,w,D,T,V]),We=v.useCallback(be=>{be.key==="Escape"&&S&&ue&&ve(),z?.(be)},[S,ue,ve,z]),ft=v.useCallback(()=>{pe(be=>!be),requestAnimationFrame(()=>G.current?.focus())},[]),nt=c?`${oe}-desc`:void 0,Be=Z?`${oe}-err`:void 0,Ze=[nt,Be].filter(Boolean).join(" ")||void 0,fe=typeof h=="function"?h(ye):h??_e,Qe=K(De.contenedor_base,De[`variante_${s}`],De[`tam_${d}`],De[`radio_${u}`],De[`color_${l}`],{[De.ancho_total]:f,[De.sin_animacion]:p,[De.deshabilitado]:C,[De.solo_lectura]:w,[De.invalido]:Z,[De.valido]:de,[De.enfocado]:U,[De.tiene_contenido]:ue},F,L?.base);return a.jsxs("div",{className:Qe,style:N,children:[_&&a.jsxs("label",{className:K(De.etiqueta,L?.label),htmlFor:oe,children:[_,b&&a.jsx("span",{className:De.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(De.envoltorio_input,L?.inputWrapper),children:[g&&a.jsx("span",{className:De.contenido_inicio,children:g}),a.jsx("div",{className:K(De.envoltorio_interno,L?.innerWrapper),children:a.jsx("input",{...J,ref:G,id:oe,name:x,type:W,value:re?me:void 0,defaultValue:re?void 0:r,placeholder:i,disabled:C,readOnly:w,required:b,autoComplete:P,autoFocus:O,maxLength:B,minLength:j,pattern:q,"aria-invalid":Z||void 0,"aria-describedby":Ze,"aria-required":b,className:K(De.entrada,L?.input),onChange:H,onFocus:he,onBlur:ge,onKeyDown:We})}),R&&a.jsx("button",{type:"button",className:K(De.boton_limpiar,L?.clearButton),onClick:ve,tabIndex:-1,"aria-label":"Limpiar campo",children:a.jsx(Ta,{size:"0.75em"})}),Ce&&a.jsx("button",{type:"button",className:De.boton_password,onClick:ft,tabIndex:-1,"aria-label":ee?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":ee,children:ee?a.jsx(za,{}):a.jsx(Oa,{})}),m&&a.jsx("span",{className:De.contenido_final,children:m})]}),c&&!Z&&a.jsx("div",{id:nt,className:K(De.descripcion,L?.description),children:c}),Z&&fe&&a.jsx("div",{id:Be,className:K(De.mensaje_error,L?.errorMessage),role:"alert",children:fe})]})});Hr.displayName="InputText";function Fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fn(e,n){if(e==null||Number.isNaN(e))return"";const{separadorMiles:t=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:s="",sufijo:l=""}=n;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,f]=d.split(".");let p=u;if(t){const c=typeof t=="string"?t:",";p=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let _=p;return f!==void 0?_+=o+f:i&&r&&r>0&&(_+=o+"0".repeat(r)),`${s}${_}${l}`}function Gr(e,n){if(!e||e.trim()==="")return;const{separadorMiles:t=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:s=!0}=n;let l=e;if(r&&(l=l.replace(new RegExp(`^${Fn(r)}`),"")),i&&(l=l.replace(new RegExp(`${Fn(i)}$`),"")),t){const u=typeof t=="string"?t:",";l=l.replace(new RegExp(Fn(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Fn(o)),".")),s||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function An(e,n,t){let o=e;return n!==void 0&&o<n&&(o=n),t!==void 0&&o>t&&(o=t),o}function Wr(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Rr(e,n){const t=Math.pow(10,n);return Math.round(e*t)/t}const Va=e=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[a.jsx("path",{d:"M5 12h14"}),a.jsx("path",{d:"M12 5v14"})]}),qa=e=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:a.jsx("path",{d:"M5 12h14"})}),Te={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},Kr=v.forwardRef((e,n)=>{const{value:t,defaultValue:o,placeholder:r,variant:i="bordered",color:s="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:p,description:_,errorMessage:c,startContent:h,endContent:g,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:k,className:$,classNames:I,style:F,min:L,max:N,step:D=1,decimalScale:V,fixedDecimalScale:T=!1,thousandSeparator:y=!1,decimalSeparator:E=".",prefix:z="",suffix:A="",allowNegative:x=!0,allowDecimal:P=!0,hideControls:O=!1,clampBehavior:B="blur",onChange:j,onValueChange:q,onFocus:J,onBlur:G,onKeyDown:le,id:oe,name:re,...ce}=e,ie=v.useRef(null),U=v.useRef(oe??`input-numeric-${Nn(8)}`).current;v.useImperativeHandle(n,()=>ie.current);const ne=t!==void 0,[ee,pe]=v.useState(o!==void 0?o:void 0),[_e,Z]=v.useState(""),[de,ye]=v.useState(!1),ue=ne?t===""?void 0:t:ee,Ce=v.useMemo(()=>({separadorMiles:y,separadorDecimal:E,escalaDecimal:P?V:0,decimalesFijos:T,prefijo:z,sufijo:A,permitirNegativo:x}),[y,E,V,T,z,A,x,P]),W=v.useMemo(()=>{if(!k)return null;const te=Wr(k(ue));return te.invalido?te.mensaje:null},[ue,k]),R=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!W,[C,S,W]),H=S==="valid"&&!R,he={invalido:R,mensaje:W},ge=v.useCallback(te=>{ne||pe(te),j?.(te),q?.(fn(te,Ce),te)},[ne,j,q,Ce]),ve=v.useCallback(te=>{let we=(ue??0)+D*te;B!=="none"&&(we=An(we,L,N)),V!==void 0&&(we=Rr(we,V)),ge(we),Z(fn(we,Ce))},[ue,D,L,N,B,V,ge,Ce]),We=v.useCallback(te=>{if(w||b)return;const Fe=te.target.value,we=E===","?",":".";let _t="0-9";P&&(_t+=we),x&&(_t+="-");const gt=new RegExp(`[^${_t}]`,"g");let lt=Fe.replace(gt,"");if(P){const Re=lt.split(we);Re.length>2&&(lt=Re[0]+we+Re.slice(1).join(""))}if(x&&lt.includes("-")){const Re=lt.replace(/-/g,"");lt=lt.startsWith("-")?"-"+Re:Re}Z(lt);const Zt=Gr(lt,Ce);if(B==="strict"&&Zt!==void 0){const Re=An(Zt,L,N);ge(Re)}else ge(Zt)},[w,b,Ce,B,L,N,ge,E,x,P]),ft=v.useCallback(te=>{if(ye(!0),ue!==void 0){let Fe=String(ue);E!=="."&&(Fe=Fe.replace(".",E)),Z(Fe)}J?.(te)},[ue,E,J]),nt=v.useCallback(te=>{if(ye(!1),B==="blur"&&ue!==void 0){const Fe=An(ue,L,N);Fe!==ue&&ge(Fe)}Z(fn(ue,Ce)),G?.(te)},[ue,B,L,N,ge,Ce,G]),Be=v.useCallback(te=>{te.key==="ArrowUp"?(te.preventDefault(),ve(1)):te.key==="ArrowDown"&&(te.preventDefault(),ve(-1));const Fe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],we=te.ctrlKey||te.metaKey,_t=P&&(te.key===E||te.key==="."||te.key===","),gt=te.key==="-"&&x,Xt=/^[0-9]$/.test(te.key);!Fe.includes(te.key)&&!we&&!_t&&!gt&&!Xt&&te.preventDefault(),le?.(te)},[ve,le,E,x,P]);v.useEffect(()=>{de||Z(fn(ue,Ce))},[ue,de,Ce]);const Ze=_?`${U}-desc`:void 0,fe=R?`${U}-err`:void 0,Qe=[Ze,fe].filter(Boolean).join(" ")||void 0,be=typeof c=="function"?c(he):c??W,Ne=N===void 0||(ue??0)<N,it=L===void 0||(ue??0)>L,bt=K(Te.contenedor_base,Te[`variante_${i}`],Te[`tam_${l}`],Te[`radio_${d}`],Te[`color_${s}`],{[Te.ancho_total]:u,[Te.sin_animacion]:f,[Te.deshabilitado]:w,[Te.solo_lectura]:b,[Te.invalido]:R,[Te.valido]:H,[Te.enfocado]:de},$,I?.base);return a.jsxs("div",{className:bt,style:F,children:[p&&a.jsxs("label",{className:K(Te.etiqueta,I?.label),htmlFor:U,children:[p,m&&a.jsx("span",{className:Te.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(Te.envoltorio_input,I?.inputWrapper),children:[a.jsxs("div",{className:K(Te.envoltorio_interno,I?.innerWrapper),children:[h&&a.jsx("span",{className:Te.contenido_inicio,children:h}),a.jsx("input",{...ce,ref:ie,id:U,name:re,type:"text",inputMode:"decimal",value:_e,placeholder:r,disabled:w,readOnly:b,required:m,"aria-invalid":R||void 0,"aria-describedby":Qe,"aria-required":m,className:K(Te.entrada,I?.input),onChange:We,onFocus:ft,onBlur:nt,onKeyDown:Be}),g&&a.jsx("span",{className:Te.contenido_final,children:g})]}),!O&&!b&&!w&&a.jsxs("div",{className:K(Te.controles,I?.controls),children:[a.jsx("button",{type:"button",tabIndex:-1,className:K(Te.boton_control,I?.controlButton),disabled:!it,onClick:()=>ve(-1),"aria-label":"Decrementar valor",children:a.jsx(qa,{})}),a.jsx("button",{type:"button",tabIndex:-1,className:K(Te.boton_control,I?.controlButton),disabled:!Ne,onClick:()=>ve(1),"aria-label":"Incrementar valor",children:a.jsx(Va,{})})]})]}),_&&!R&&a.jsx("div",{id:Ze,className:K(Te.descripcion,I?.description),children:_}),R&&be&&a.jsx("div",{id:fe,className:K(Te.mensaje_error,I?.errorMessage),role:"alert",children:be})]})});Kr.displayName="InputNumeric";function ja(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Ba(e,n="es-CO"){if(!e)return"";const t=new Date(e+"T00:00:00");return Number.isNaN(t.getTime())?"":t.toLocaleDateString(n,{year:"numeric",month:"long",day:"numeric"})}function Ha(){return new Date().toISOString().split("T")[0]}function Ga(e,n,t){if(!e)return!0;const o=new Date(e).getTime();return!(n&&o<new Date(n).getTime()||t&&o>new Date(t).getTime())}const ze={contenedor_base:"_contenedor_base_64bo9_1",tam_sm:"_tam_sm_64bo9_37",tam_lg:"_tam_lg_64bo9_49",radio_none:"_radio_none_64bo9_61",radio_sm:"_radio_sm_64bo9_69",radio_md:"_radio_md_64bo9_77",radio_lg:"_radio_lg_64bo9_85",radio_full:"_radio_full_64bo9_93",color_default:"_color_default_64bo9_101",color_primary:"_color_primary_64bo9_103",color_secondary:"_color_secondary_64bo9_111",color_success:"_color_success_64bo9_119",color_warning:"_color_warning_64bo9_127",color_danger:"_color_danger_64bo9_135",etiqueta:"_etiqueta_64bo9_143",marca_requerido:"_marca_requerido_64bo9_159",envoltorio_input:"_envoltorio_input_64bo9_169",envoltorio_interno:"_envoltorio_interno_64bo9_195",entrada:"_entrada_64bo9_215",icono_calendario_decorativo:"_icono_calendario_decorativo_64bo9_291",enfocado:"_enfocado_64bo9_315",contenido_inicio:"_contenido_inicio_64bo9_323",descripcion:"_descripcion_64bo9_341",mensaje_error:"_mensaje_error_64bo9_353",ancho_total:"_ancho_total_64bo9_365",variante_bordered:"_variante_bordered_64bo9_373",variante_faded:"_variante_faded_64bo9_383",variante_underlined:"_variante_underlined_64bo9_393",variante_ghost:"_variante_ghost_64bo9_427",deshabilitado:"_deshabilitado_64bo9_439",solo_lectura:"_solo_lectura_64bo9_473",valido:"_valido_64bo9_539",invalido:"_invalido_64bo9_547",sin_animacion:"_sin_animacion_64bo9_579"},Wa=({tipo:e})=>e==="time"?a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ze.icono_calendario_decorativo,"aria-hidden":"true",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:ze.icono_calendario_decorativo,"aria-hidden":"true",children:[a.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),Ur=v.forwardRef((e,n)=>{const{type:t="date",value:o,defaultValue:r,placeholder:i,variant:s="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:p=!1,label:_,description:c,errorMessage:h,startContent:g,isRequired:m=!1,isReadOnly:b=!1,isDisabled:w=!1,isInvalid:C,validationState:S,validate:k,className:$,classNames:I,style:F,min:L,max:N,onChange:D,onFocus:V,onBlur:T,id:y,name:E,...z}=e,A=v.useRef(null),P=v.useRef(y??`input-date-${Nn(8)}`).current;v.useImperativeHandle(n,()=>A.current);const O=o!==void 0,[B,j]=v.useState(r??""),q=O?o:B,[J,G]=v.useState(!1),le=v.useMemo(()=>{if(!k)return null;const de=ja(k(q));return de.invalido?de.mensaje:null},[q,k]),oe=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!le,[C,S,le]),re=S==="valid"&&!oe,ce={invalido:oe,mensaje:le},ie=v.useCallback(de=>{if(w||b)return;const ye=de.target.value;O||j(ye),D?.(ye)},[O,w,b,D]),me=v.useCallback(de=>{G(!0),V?.(de)},[V]),U=v.useCallback(de=>{G(!1),T?.(de)},[T]),ne=c?`${P}-desc`:void 0,ee=oe?`${P}-err`:void 0,pe=[ne,ee].filter(Boolean).join(" ")||void 0,_e=typeof h=="function"?h(ce):h??le,Z=K(ze.contenedor_base,ze[`variante_${s}`],ze[`tam_${d}`],ze[`radio_${u}`],ze[`color_${l}`],{[ze.ancho_total]:f,[ze.sin_animacion]:p,[ze.deshabilitado]:w,[ze.solo_lectura]:b,[ze.invalido]:oe,[ze.valido]:re,[ze.enfocado]:J},$,I?.base);return a.jsxs("div",{className:Z,style:F,children:[_&&a.jsxs("label",{className:K(ze.etiqueta,I?.label),htmlFor:P,children:[_,m&&a.jsx("span",{className:ze.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsx("div",{className:K(ze.envoltorio_input,I?.inputWrapper),children:a.jsxs("div",{className:K(ze.envoltorio_interno,I?.innerWrapper),children:[g&&a.jsx("span",{className:ze.contenido_inicio,children:g}),a.jsx("input",{...z,ref:A,id:P,name:E,type:t,value:O?q:void 0,defaultValue:O?void 0:r,placeholder:i,disabled:w,readOnly:b,required:m,min:L,max:N,"aria-invalid":oe||void 0,"aria-describedby":pe,"aria-required":m,className:K(ze.entrada,I?.input),onChange:ie,onFocus:me,onBlur:U}),a.jsx(Wa,{tipo:t})]})}),c&&!oe&&a.jsx("div",{id:ne,className:K(ze.descripcion,I?.description),children:c}),oe&&_e&&a.jsx("div",{id:ee,className:K(ze.mensaje_error,I?.errorMessage),role:"alert",children:_e})]})});Ur.displayName="InputDate";const Ra={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Pn({mostrar:e,children:n,tipo:t="desvanecerDeslizar",className:o,...r}){const[i,s]=v.useState(e),[l,d]=v.useState(e?"entrada":null);e&&!i?(s(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(s(!1),d(null))};if(!i)return null;const f=Ra[t||"desvanecer"],p=l?`transicion_${f}_${l}`:"";return a.jsx("div",{...r,onAnimationEnd:u,className:`${p} ${o||""}`.trim(),children:n})}const St={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function Eo(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:a.jsxs("g",{fill:"currentColor",children:[a.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),a.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Mo(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:a.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function Yr(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[a.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),a.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function No({tipo:e,texto:n,size:t="md",estirar:o}){const r=e==="mic";return a.jsxs("span",{className:K(St.badge_voz,r?St.badge_mic:St.badge_tts,St[`badge_${t}`],o&&St.badge_estirada),"data-tipo":e,children:[a.jsx("span",{className:St.badge_icono,children:r?a.jsx(Eo,{}):a.jsx(Mo,{})}),a.jsx("span",{className:St.badge_texto,children:n}),r?a.jsxs("span",{className:St.badge_ondas,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]}):a.jsxs("span",{className:St.badge_eq,"aria-hidden":"true",children:[a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{}),a.jsx("span",{})]})]})}function Xr({value:e,onChange:n,isDisabled:t,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[s,l]=v.useState(!1),[d,u]=v.useState(!1),[f,p]=v.useState(null),_=v.useRef(null),c=v.useRef(null),h=v.useRef(null),g=v.useRef(""),m=typeof window<"u"&&"speechSynthesis"in window,b=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),w=v.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),m&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[m]),C=v.useCallback(()=>{if(!m||!e)return;if(w(),_.current){try{_.current.stop()}catch(I){console.error("Error stopping recognition:",I)}_.current=null,u(!1)}const $=new SpeechSynthesisUtterance(e);$.lang=i,$.onstart=()=>l(!0),$.onend=()=>{l(!1),c.current=null},$.onerror=()=>{l(!1),c.current=null},c.current=$,window.speechSynthesis.speak($)},[m,e,i,w]),S=v.useCallback(()=>{if(_.current)try{_.current.stop()}catch($){console.error("Error stopping recognition:",$)}u(!1),p(null)},[]),k=v.useCallback(()=>{if(!b||t||o)return;w();const $=window,I=$.SpeechRecognition||$.webkitSpeechRecognition;if(!I){p("Navegador no compatible");return}try{const F=new I;F.continuous=!0,F.interimResults=!0,F.lang=i,F.onstart=()=>{u(!0),p(null),g.current=e||""},F.onend=()=>{u(!1),_.current=null,r?.()},F.onerror=L=>{L.error!=="no-speech"&&(u(!1),_.current=null,L.error!=="aborted"&&p("Error al reconocer voz"))},F.onresult=L=>{try{let N="";for(let T=0;T<L.results.length;T++)N+=L.results[T][0].transcript;const D=g.current&&N?" ":"",V=g.current+D+N;n(V)}catch{p("Error procesando dictado")}},_.current=F,F.start()}catch{p("No se pudo iniciar dictado"),u(!1)}},[b,t,o,e,n,i,w,r]);return v.useEffect(()=>()=>{h.current&&clearTimeout(h.current),m&&window.speechSynthesis.cancel(),_.current&&_.current.abort()},[m]),{puedeHablar:m,puedeEscuchar:b,hablando:s,escuchando:d,errorDictado:f,escuchar:C,detenerHablar:w,dictar:k,detenerDictado:S}}function Ka({size:e="1em",className:n}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:n,"aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const Ae={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},Zr=v.forwardRef((e,n)=>{const{children:t,variant:o="bordered",color:r="default",size:i="md",radius:s="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:p,value:_,defaultValue:c,placeholder:h,isRequired:g=!1,isReadOnly:m=!1,isDisabled:b=!1,isClearable:w=!1,isInvalid:C,validationState:S,validate:k,minRows:$=4,maxRows:I=10,disableAutosize:F=!1,hideVoiceActions:L=!1,className:N,classNames:D,style:V,onChange:T,onClear:y,onFocus:E,onBlur:z,id:A,name:x,rows:P,...O}=e,B=v.useRef(null),q=v.useRef(A??`textarea-${Nn(8)}`).current;v.useImperativeHandle(n,()=>B.current);const J=_!==void 0,[G,le]=v.useState(c??""),oe=J?_:G,[re,ce]=v.useState(!1),ie=v.useMemo(()=>{if(!k)return null;const te=k(oe);return te===!0||te==null?null:typeof te=="string"?te:typeof te=="object"&&"message"in te?te.message??"Entrada inválida":"Entrada inválida"},[oe,k]),me=v.useMemo(()=>C!==void 0?C:S==="invalid"?!0:S==="valid"?!1:!!ie,[C,S,ie]),U=S==="valid"&&!me,ne={invalido:me,mensaje:ie},ee=oe.length>0,pe=v.useCallback(()=>{if(!B.current||F)return;const te=B.current,Fe=window.getComputedStyle(te),we=parseFloat(Fe.lineHeight)||parseFloat(Fe.fontSize)*1.5,_t=parseFloat(Fe.paddingTop)||0,gt=parseFloat(Fe.paddingBottom)||0,Xt=parseFloat(Fe.borderTopWidth)||0,lt=parseFloat(Fe.borderBottomWidth)||0,Zt=$*we+_t+gt+Xt+lt,Re=I*we+_t+gt+Xt+lt;te.style.height="auto";const Tr=te.scrollHeight;te.style.height=`${Math.min(Math.max(Tr,Zt),Re)}px`},[F,$,I]);v.useEffect(()=>{F||pe()},[oe,pe,F]);const _e=v.useCallback(te=>{J||le(te),T?.(te)},[J,T]),{puedeHablar:Z,hablando:de,escuchar:ye,detenerHablar:ue,puedeEscuchar:Ce,escuchando:W,errorDictado:R,dictar:H,detenerDictado:he}=Xr({isDisabled:b||L,isReadOnly:m,value:oe,onChange:_e}),ge=v.useCallback(te=>{if(b||m)return;const Fe=te.target.value;J||le(Fe),T?.(Fe)},[J,b,m,T]),ve=v.useCallback(te=>{ce(!0),E?.(te)},[E]),We=v.useCallback(te=>{ce(!1),z?.(te)},[z]),ft=v.useCallback(()=>{b||m||(J||le(""),T?.(""),y?.(),B.current?.focus())},[J,b,m,T,y]),nt=v.useCallback(()=>{de?ue():ye()},[de,ye,ue]),Be=v.useCallback(()=>{W?he():H()},[W,H,he]),Ze=f?`${q}-desc`:void 0,fe=me||R?`${q}-err`:void 0,Qe=[Ze,fe].filter(Boolean).join(" ")||void 0,be=typeof p=="function"?p(ne):p??ie,Ne=w&&ee&&!m&&!b,it=!L||Ne,bt=K(Ae.contenedor_base,Ae[`variante_${o}`],Ae[`tam_${i}`],Ae[`radio_${s}`],Ae[`color_${r}`],{[Ae.ancho_total]:l,[Ae.sin_animacion]:d,[Ae.deshabilitado]:b,[Ae.solo_lectura]:m,[Ae.invalido]:me,[Ae.valido]:U,[Ae.enfocado]:re},N,D?.base);return a.jsxs("div",{className:bt,style:V,children:[u&&a.jsxs("label",{className:K(Ae.etiqueta,D?.label),htmlFor:q,children:[u,g&&a.jsx("span",{className:Ae.marca_requerido,"aria-hidden":"true",children:"*"})]}),a.jsxs("div",{className:K(Ae.envoltorio_input,D?.inputWrapper),children:[a.jsx("textarea",{...O,ref:B,id:q,name:x,placeholder:h,value:J?oe:void 0,defaultValue:J?void 0:c,onChange:ge,onFocus:ve,onBlur:We,className:K(Ae.entrada,F&&Ae.sin_autosize,D?.input),readOnly:m,disabled:b,rows:P??$,"aria-invalid":me||void 0,"aria-describedby":Qe,"aria-required":g,required:g}),it&&a.jsxs("div",{className:K(Ae.barra_acciones,D?.actions),children:[a.jsxs("div",{className:Ae.badges_contenedor,"aria-live":"polite",role:"status",children:[a.jsx(Pn,{mostrar:W,children:a.jsx(No,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),a.jsx(Pn,{mostrar:de,children:a.jsx(No,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),a.jsxs("div",{className:Ae.botones_grupo,children:[!L&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:K(Ae.boton_accion,de&&Ae.boton_activo_tts),onClick:nt,disabled:!Z||!de&&(!oe||W),title:de?"Detener lectura":"Leer texto","aria-pressed":de,"aria-label":de?"Detener lectura":"Leer texto",children:a.jsx(Mo,{})}),Ce&&a.jsx("button",{type:"button",className:K(Ae.boton_accion,W&&Ae.boton_activo_mic),onClick:Be,disabled:b||m||de,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?a.jsx(Yr,{}):a.jsx(Eo,{})})]}),Ne&&a.jsx("button",{type:"button",className:Ae.boton_limpiar,onClick:ft,title:"Limpiar campo","aria-label":"Limpiar campo",children:a.jsx(Ka,{size:"0.75em"})})]})]})]}),f&&!me&&a.jsx("div",{id:Ze,className:K(Ae.descripcion,D?.description),children:f}),me&&be||R?a.jsxs("div",{id:fe,className:K(Ae.mensaje_error,D?.errorMessage),role:"alert",children:[be,be&&R&&a.jsx("br",{}),R&&a.jsxs("span",{children:["Error de voz: ",R]})]}):null,t]})});Zr.displayName="TextArea";function Ln(){return typeof window<"u"}function At(e){return Fo(e)?(e.nodeName||"").toLowerCase():"#document"}function at(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function wt(e){var n;return(n=(Fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Fo(e){return Ln()?e instanceof Node||e instanceof at(e).Node:!1}function Pe(e){return Ln()?e instanceof Element||e instanceof at(e).Element:!1}function Ve(e){return Ln()?e instanceof HTMLElement||e instanceof at(e).HTMLElement:!1}function Dn(e){return!Ln()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof at(e).ShadowRoot}const Ua=new Set(["inline","contents"]);function _n(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=ct(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!Ua.has(r)}const Ya=new Set(["table","td","th"]);function Xa(e){return Ya.has(At(e))}const Za=[":popover-open",":modal"];function Tn(e){return Za.some(n=>{try{return e.matches(n)}catch{return!1}})}const Qa=["transform","translate","scale","rotate","perspective"],Ja=["transform","translate","scale","rotate","perspective","filter"],el=["paint","layout","strict","content"];function Ao(e){const n=On(),t=Pe(e)?ct(e):e;return Qa.some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||Ja.some(o=>(t.willChange||"").includes(o))||el.some(o=>(t.contain||"").includes(o))}function tl(e){let n=kt(e);for(;Ve(n)&&!$t(n);){if(Ao(n))return n;if(Tn(n))return null;n=kt(n)}return null}function On(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nl=new Set(["html","body","#document"]);function $t(e){return nl.has(At(e))}function ct(e){return at(e).getComputedStyle(e)}function zn(e){return Pe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(At(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Dn(e)&&e.host||wt(e);return Dn(n)?n.host:n}function Qr(e){const n=kt(e);return $t(n)?e.ownerDocument?e.ownerDocument.body:e.body:Ve(n)&&_n(n)?n:Qr(n)}function Pt(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Qr(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=at(r);if(i){const l=Po(s);return n.concat(s,s.visualViewport||[],_n(r)?r:[],l&&t?Pt(l):[])}return n.concat(r,Pt(r,[],t))}function Po(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Lt=Math.min,dt=Math.max,Vn=Math.round,Qt=Math.floor,yt=e=>({x:e,y:e}),ol={left:"right",right:"left",bottom:"top",top:"bottom"},rl={start:"end",end:"start"};function Lo(e,n,t){return dt(e,Lt(n,t))}function Jt(e,n){return typeof e=="function"?e(n):e}function Dt(e){return e.split("-")[0]}function en(e){return e.split("-")[1]}function Jr(e){return e==="x"?"y":"x"}function Do(e){return e==="y"?"height":"width"}const il=new Set(["top","bottom"]);function It(e){return il.has(Dt(e))?"y":"x"}function To(e){return Jr(It(e))}function sl(e,n,t){t===void 0&&(t=!1);const o=en(e),r=To(e),i=Do(r);let s=r==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return n.reference[i]>n.floating[i]&&(s=qn(s)),[s,qn(s)]}function al(e){const n=qn(e);return[Oo(e),n,Oo(n)]}function Oo(e){return e.replace(/start|end/g,n=>rl[n])}const ei=["left","right"],ti=["right","left"],ll=["top","bottom"],cl=["bottom","top"];function dl(e,n,t){switch(e){case"top":case"bottom":return t?n?ti:ei:n?ei:ti;case"left":case"right":return n?ll:cl;default:return[]}}function ul(e,n,t,o){const r=en(e);let i=dl(Dt(e),t==="start",o);return r&&(i=i.map(s=>s+"-"+r),n&&(i=i.concat(i.map(Oo)))),i}function qn(e){return e.replace(/left|right|bottom|top/g,n=>ol[n])}function fl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ni(e){return typeof e!="number"?fl(e):{top:e,right:e,bottom:e,left:e}}function jn(e){const{x:n,y:t,width:o,height:r}=e;return{width:o,height:r,top:t,left:n,right:n+o,bottom:t+r,x:n,y:t}}/*!
1
+ (function(Z,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],s):(Z=typeof globalThis<"u"?globalThis:Z||self,s(Z.CoreKitUI={},Z.jsxRuntime,Z.React,Z.ReactDOM))})(this,(function(Z,s,m,pt){"use strict";function Gr(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=Gr(m),Do=Gr(pt);function Wr(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Wr(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function K(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Wr(e))&&(o&&(o+=" "),o+=t);return o}const Kr=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ur=K,Ta=(e,t)=>n=>{var o;if(t?.variants==null)return Ur(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(u=>{const f=n?.[u],g=i?.[u];if(f===null)return null;const _=Kr(f)||Kr(g);return r[u][_]}),l=n&&Object.entries(n).reduce((u,f)=>{let[g,_]=f;return _===void 0||(u[g]=_),u},{}),d=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((u,f)=>{let{class:g,className:_,...c}=f;return Object.entries(c).every(h=>{let[p,v]=h;return Array.isArray(v)?v.includes({...i,...l}[p]):{...i,...l}[p]===v})?[...u,g,_]:u},[]);return Ur(e,a,d,n?.class,n?.className)},Ie={boton:"_boton_18943_1",animated:"_animated_18943_59",disabled:"_disabled_18943_59",loading:"_loading_18943_59",content:"_content_18943_67",spinner:"_spinner_18943_69",start_content:"_start_content_18943_71",end_content:"_end_content_18943_73",content_item:"_content_item_18943_101",spinner_icon:"_spinner_icon_18943_123",ripple:"_ripple_18943_159",solid:"_solid_18943_211",bordered:"_bordered_18943_231",ghost:"_ghost_18943_251",light:"_light_18943_275",faded:"_faded_18943_295",shadow:"_shadow_18943_315",only_loading:"_only_loading_18943_367",sm:"_sm_18943_385",md:"_md_18943_401",lg:"_lg_18943_417",full_width:"_full_width_18943_433",icon_only:"_icon_only_18943_441",radius_none:"_radius_none_18943_483",radius_sm:"_radius_sm_18943_551",radius_md:"_radius_md_18943_559",radius_lg:"_radius_lg_18943_567",radius_full:"_radius_full_18943_575",primary:"_primary_18943_583",secondary:"_secondary_18943_593",success:"_success_18943_603",warning:"_warning_18943_613",danger:"_danger_18943_623",default:"_default_18943_633"},Oa=Ta(Ie.boton,{variants:{variant:{solid:Ie.solid,bordered:Ie.bordered,ghost:Ie.ghost,light:Ie.light,faded:Ie.faded,shadow:Ie.shadow},color:{default:Ie.default,primary:Ie.primary,secondary:Ie.secondary,success:Ie.success,warning:Ie.warning,danger:Ie.danger},size:{sm:Ie.sm,md:Ie.md,lg:Ie.lg},radius:{none:Ie.radius_none,sm:Ie.radius_sm,md:Ie.radius_md,lg:Ie.radius_lg,full:Ie.radius_full},fullWidth:{true:Ie.full_width},isIconOnly:{true:Ie.icon_only},isLoading:{true:Ie.loading},onlyLoading:{true:Ie.only_loading},isDisabled:{true:Ie.disabled},disableAnimation:{false:Ie.animated}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"md",disableAnimation:!0}}),rn=m.forwardRef(({variant:e="solid",color:t="default",size:n="md",radius:o="md",fullWidth:r=!1,isLoading:i=!1,onlyLoading:a=!1,isDisabled:l=!1,isIconOnly:d=!1,disableRipple:u=!1,disableAnimation:f=!0,customColor:g,startContent:_,endContent:c,spinner:h,spinnerPlacement:p="end",permisos:v,permiso:w,children:C,className:x,onClick:k,style:z,type:L="button","aria-label":N,...P},A)=>{const I=w&&v?!v.includes(w):!1,O=l||i||I,q=F=>{if(O){F.preventDefault();return}if(k?.(F),u||O||!(F.currentTarget instanceof HTMLElement))return;const y=F.currentTarget,M=document.createElement("span"),D=y.getBoundingClientRect(),B=Math.max(D.width,D.height);M.className=Ie.ripple,M.style.width=`${B}px`,M.style.height=`${B}px`,M.style.left=`${F.clientX-D.left}px`,M.style.top=`${F.clientY-D.top}px`,M.addEventListener("animationend",()=>M.remove(),{once:!0}),y.appendChild(M)},$=g?{"--btn-color":g,"--btn-text-color":g,...z}:z,b=Oa({variant:e,color:g?void 0:t,size:n,radius:o,fullWidth:r,isIconOnly:d,isLoading:i,onlyLoading:a,isDisabled:O,disableAnimation:f}),S=i&&s.jsx("span",{className:Ie.spinner,"aria-hidden":a?void 0:"true",children:h||s.jsx("span",{className:Ie.spinner_icon})}),T=a&&!N?"Cargando":N;return s.jsxs("button",{...P,ref:A,type:L,"aria-label":T,"aria-busy":i,className:K(b,x),disabled:O,onClick:q,style:$,children:[p==="start"&&S,_&&!a&&s.jsx("span",{className:K(Ie.start_content,Ie.content_item),children:_}),C&&!a&&s.jsx("span",{className:Ie.content,children:C}),c&&!a&&s.jsx("span",{className:K(Ie.end_content,Ie.content_item),children:c}),p==="end"&&S]})});rn.displayName="Boton";const yn={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},qa=()=>s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:s.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),Rr=({variant:e="solid",color:t="default",size:n="md",radius:o="md",children:r,startIcon:i,endIcon:a,dot:l,dismissible:d,onDismiss:u,customColor:f,className:g="",onClick:_})=>{const c=!!_,h=m.useMemo(()=>{if(!f)return;const w=f,C=`color-mix(in oklab, ${w} 15%, transparent)`;return{solid:{"--badge-custom-bg":w,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":C,"--badge-custom-text":w,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":w,"--badge-custom-border":w},soft:{"--badge-custom-bg":`color-mix(in oklab, ${w} 10%, var(--surface-first))`,"--badge-custom-text":w,"--badge-custom-border":"transparent"}}[e]},[f,e]),p=[yn.badge,yn[`size_${n}`],yn[`radius_${o}`],yn[`variant_${e}`],!f&&yn[`color_${t}`],f&&yn.badge_custom,c&&yn.badge_clickable,g].filter(Boolean).join(" "),v=m.useMemo(()=>f||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[t],[t,f]);return s.jsxs("span",{className:p,style:h,onClick:_,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&s.jsx("span",{className:yn.dot,style:{backgroundColor:v}}),i&&s.jsx("span",{className:yn.icon,children:i}),r,a&&s.jsx("span",{className:yn.icon,children:a}),d&&s.jsx("button",{type:"button",className:yn.dismiss_button,onClick:w=>{w.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:s.jsx(qa,{})})]})},Te={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},Lo=m.forwardRef(({isSelected:e,defaultSelected:t=!1,onChange:n,label:o,description:r,size:i="md",color:a="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:f=!1,isInvalid:g=!1,isRequired:_=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:p="inline",justifyEnd:v=!1,children:w,className:C="",...x},k)=>{const[z,L]=m.useState(t),N=m.useId(),P=x.id||N,A=e!==void 0?e:z,I=F=>{if(u||f)return;const y=F.target.checked;e===void 0&&L(y),n&&n(y)},O=w||o,q=[Te.contenedor_toggle,Te[`tam_${i}`],!l&&Te[`color_${a}`],Te[`variante_${d}`],Te[`label_${h}`],Te[`posicion_${p}`],A&&Te.seleccionado,u&&Te.deshabilitado,f&&Te.solo_lectura,g&&Te.invalido,c&&Te.con_iconos,v&&Te.justify_end,C].filter(Boolean).join(" "),$=l?{"--toggle-custom-color":l}:void 0,b=()=>O?s.jsxs("div",{className:Te.contenedor_label,children:[s.jsxs("span",{className:Te.texto_label,children:[O,_&&s.jsx("span",{className:Te.marca_requerido,children:" *"})]}),r&&s.jsx("span",{className:Te.texto_descripcion,children:r})]}):null,S=()=>d!=="moon"?null:s.jsx("div",{className:Te.icono_moon,children:s.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:s.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),T=()=>!c||d==="moon"?null:s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:Te.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"2,6 5,9 10,3"})}),s.jsxs("svg",{className:Te.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[s.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return s.jsxs("div",{className:q,style:$,children:[p==="top"&&b(),s.jsxs("label",{className:Te.envoltorio_toggle,htmlFor:P,children:[p==="inline"&&h==="left"&&b(),s.jsxs("div",{className:Te.pista_toggle,children:[s.jsx("input",{ref:k,type:"checkbox",id:P,checked:A,disabled:u,readOnly:f,required:_,"aria-invalid":g,className:Te.input,onChange:I,...x}),s.jsx("div",{className:Te.fondo_pista,children:s.jsxs("div",{className:Te.pulgar_toggle,children:[S(),T()]})})]}),p==="inline"&&h==="right"&&b()]})]})});Lo.displayName="Toggle";const Va=({className:e})=>s.jsx("svg",{className:e,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),Xr=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"})}),ja=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})}),Ba=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"})}),Ha=({className:e})=>s.jsx("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M12 20h9M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})}),Ga=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"}),s.jsx("path",{d:"M15 19h6"}),s.jsx("path",{d:"M18 16v6"})]}),Wa=({className:e})=>s.jsxs("svg",{className:e,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"m8.5 12 2.3 2.3 4.7-4.7"})]}),ie={backdrop:"_backdrop_155e9_1",visible:"_visible_155e9_37",modal:"_modal_155e9_61",cuerpo_modal:"_cuerpo_modal_155e9_103",encabezado:"_encabezado_155e9_145",titulo:"_titulo_155e9_159",boton_cerrar:"_boton_cerrar_155e9_173",texto_esc:"_texto_esc_155e9_209",icono_x:"_icono_x_155e9_223",contenedor_lienzo:"_contenedor_lienzo_155e9_233",area_firma:"_area_firma_155e9_243",superficie_lienzo:"_superficie_lienzo_155e9_257",lienzo:"_lienzo_155e9_265",lienzo_deshabilitado:"_lienzo_deshabilitado_155e9_295",barra_acciones:"_barra_acciones_155e9_305",grupo_izquierda:"_grupo_izquierda_155e9_325",grupo_derecha:"_grupo_derecha_155e9_337",separador:"_separador_155e9_349",boton_accion:"_boton_accion_155e9_361",contenedor_guardar:"_contenedor_guardar_155e9_417",boton_texto_con_icono:"_boton_texto_con_icono_155e9_429",accion_texto:"_accion_texto_155e9_441",icono_boton_accion:"_icono_boton_accion_155e9_451",icono:"_icono_155e9_223",contenedor_consentimiento:"_contenedor_consentimiento_155e9_477",texto_consentimiento:"_texto_consentimiento_155e9_491",consentimiento_fila:"_consentimiento_fila_155e9_507",toggle_consentimiento:"_toggle_consentimiento_155e9_521",contenedor_subir_oculto:"_contenedor_subir_oculto_155e9_529",boton_adjuntar:"_boton_adjuntar_155e9_541",input_archivo:"_input_archivo_155e9_577",input_validacion_firma:"_input_validacion_firma_155e9_585",bloque_firma:"_bloque_firma_155e9_613",bloque_encabezado:"_bloque_encabezado_155e9_635",bloque_titulo:"_bloque_titulo_155e9_647",marca_requerido:"_marca_requerido_155e9_663",bloque_preview:"_bloque_preview_155e9_673",bloque_preview_imagen:"_bloque_preview_imagen_155e9_701",bloque_preview_placeholder:"_bloque_preview_placeholder_155e9_715",bloque_acciones:"_bloque_acciones_155e9_729",accion_agregar_firma:"_accion_agregar_firma_155e9_743",accion_eliminar_firma:"_accion_eliminar_firma_155e9_745"},Ka=8,Ua=1.2,Un=4.2,Ra=1.8,Yr=(e,t,n)=>Math.max(t,Math.min(n,e)),Xa=(e,t)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Zr=e=>Number.isFinite(e)?e:performance.now(),Ya=()=>{const e=m.useRef(null),[t,n]=m.useState(!0),[o,r]=m.useState(!1),[i,a]=m.useState([]),l=m.useRef([]),d=m.useRef({color:"#111827",enabled:!0}),u=m.useRef(null),f=m.useRef([]),g=m.useRef(0),_=m.useRef(Un),c=m.useRef(!1),h=m.useCallback(()=>e.current?.getContext("2d")??null,[]),p=m.useCallback(()=>h(),[h]),v=m.useCallback(()=>{const $=e.current,b=h();$&&b&&b.clearRect(0,0,$.width,$.height),n(!0),l.current=[],a([]),f.current=[],u.current=null,_.current=Un,c.current=!1},[h]),w=m.useCallback(()=>{c.current=!0,n(!1)},[]),C=m.useCallback(($,b)=>{const S=Math.max(1,b.t-$.t),F=Xa($,b)/S,M=(Un-F*Ra)*Yr(b.pressure||.5,.35,1),D=Yr(M,Ua,Un),G=_.current+(D-_.current)*.25;return _.current=G,G},[]),x=m.useCallback(($,b)=>{$.strokeStyle=d.current.color,$.lineWidth=b,$.lineCap="round",$.lineJoin="round"},[]),k=m.useCallback(($,b)=>{const S=p();if(!S)return;const T=C($,b);x(S,T),S.beginPath(),S.moveTo($.x,$.y),S.quadraticCurveTo($.x,$.y,b.x,b.y),S.stroke(),n(!1)},[C,p,x]),z=m.useCallback($=>{const b=e.current;if(!b)return{pressure:.5,t:performance.now(),x:0,y:0};const S=b.getBoundingClientRect(),T=b.width/S.width,F=b.height/S.height;return{pressure:$.pressure&&$.pressure>0?$.pressure:.5,t:$.timeStamp||performance.now(),x:($.clientX-S.left)*T,y:($.clientY-S.top)*F}},[]),L=m.useCallback($=>{if(!d.current.enabled)return;$.preventDefault();const b=e.current;if(!b)return;b.setPointerCapture($.pointerId);const S=z($);r(!0),u.current=S,f.current=[S],g.current=Zr($.timeStamp)},[z]),N=m.useCallback($=>{if(!o||!d.current.enabled)return;$.preventDefault();const b=Zr($.timeStamp);if(b-g.current<Ka)return;g.current=b;const S=z($),T=u.current;T&&(k(T,S),u.current=S,f.current.push(S))},[k,o,z]),P=m.useCallback($=>{if($&&e.current?.hasPointerCapture($.pointerId)&&e.current.releasePointerCapture($.pointerId),o&&f.current.length>0){const b=[...l.current,{puntos:[...f.current]}];l.current=b,a(b)}r(!1),u.current=null,f.current=[]},[o]),A=m.useCallback(($,b,S)=>{if(!(b.puntos.length<2))for(let T=1;T<b.puntos.length;T++){const F=b.puntos[T-1],y=b.puntos[T],M=C(F,y);$.strokeStyle=S??d.current.color,$.lineWidth=M,$.lineCap="round",$.lineJoin="round",$.beginPath(),$.moveTo(F.x,F.y),$.quadraticCurveTo(F.x,F.y,y.x,y.y),$.stroke()}},[C]),I=m.useCallback(()=>{if(l.current.length===0)return;const $=l.current.slice(0,-1);l.current=$,a($);const b=e.current;if(!b)return;const S=h();S&&(S.clearRect(0,0,b.width,b.height),_.current=Un,$.forEach(T=>A(S,T)),n($.length===0&&!c.current))},[h,A]),O=m.useCallback(($={})=>{const b=e.current;if(!b||t&&l.current.length===0&&!c.current)return null;const{backgroundColor:S,format:T,quality:F,strokeColor:y}=$;if(!S&&!y)return b.toDataURL("image/png");const M=document.createElement("canvas");M.width=b.width,M.height=b.height;const D=M.getContext("2d");if(!D)return null;S&&(D.fillStyle=S,D.fillRect(0,0,M.width,M.height)),y&&l.current.length>0&&!c.current?(_.current=Un,l.current.forEach(V=>A(D,V,y))):D.drawImage(b,0,0);const B=T??"image/png",G=F??.85;return B==="image/png"?M.toDataURL(B):M.toDataURL(B,G)},[t,A]),q=m.useCallback($=>{const b=e.current,S=h();if(!b||!S)return;if(d.current={color:$.color,enabled:$.enabled??!0},b.style.touchAction="none",b.style.userSelect="none",!d.current.enabled)return()=>{};const T=D=>L(D),F=D=>N(D),y=D=>P(D),M=D=>P(D);return b.addEventListener("pointerdown",T,{passive:!1}),b.addEventListener("pointermove",F,{passive:!1}),b.addEventListener("pointerup",y,{passive:!1}),b.addEventListener("pointerleave",y,{passive:!1}),b.addEventListener("pointercancel",M,{passive:!1}),()=>{b.removeEventListener("pointerdown",T),b.removeEventListener("pointermove",F),b.removeEventListener("pointerup",y),b.removeEventListener("pointerleave",y),b.removeEventListener("pointercancel",M)}},[P,L,N,h]);return m.useEffect(()=>{_.current=Un},[i.length]),{canvasRef:e,configurarCanvas:q,deshacerUltimoTrazo:I,estaVacio:t,limpiarCanvas:v,marcarConContenido:w,obtenerDatosFirma:O,puedeDeshacer:i.length>0}},Jr=m.forwardRef(({alto:e=200,ancho:t=700,aspectRatio:n,className:o,closeOnBackdropClick:r=!1,firmaInicial:i=null,isOpen:a=!1,isRequired:l=!1,mostrarBotonSubir:d=!0,name:u,onClose:f,onConfirm:g,readonly:_=!1,readonlyPostGuardado:c=!1,requiredMessage:h="Se debe registrar una firma para continuar",textoAdjuntar:p="Adjuntar firma",textoConsentimiento:v="Al firmar, confirmo que he leído y acepto todos los términos contractuales",textoDeshacer:w="Deshacer",textoEliminarFirma:C="Eliminar firma",textoEstadoGuardada:x="Guardada",textoEstadoPendiente:k="Pendiente",textoGuardar:z="Guardar firma",textoLimpiar:L="Limpiar",textoModificar:N="Modificar firma",textoReemplazarFirma:P="Reemplazar firma",textoSolicitarFirma:A="Agregar firma",tituloBloque:I="Firma del responsable",titulo:O="Firmar el contrato",mostrarBotonAgregarFirma:q=!0,mostrarBotonEliminarFirma:$=!0},b)=>{const{canvasRef:S,configurarCanvas:T,deshacerUltimoTrazo:F,estaVacio:y,limpiarCanvas:M,marcarConContenido:D,obtenerDatosFirma:B,puedeDeshacer:G}=Ya(),V=m.useRef(null),J=m.useRef(null),U=m.useRef(null),pe=m.useId(),ue=`${pe}-toggle`,se=`${pe}-texto`,he=`${pe}-dialog-title`,fe=`${pe}-dialog-description`,[_e,R]=m.useState(!!a),[te,oe]=m.useState(!1),[ae,ve]=m.useState(i),[ee,we]=m.useState(t),[Se,le]=m.useState(!1),[ye,W]=m.useState(!!i),[j,H]=m.useState(!1),me=Math.round(ee*e/Math.max(1,t)),Y=_||c&&ye,Ce=!_&&!(c&&ye),Re=m.useCallback(ge=>{const xe=S.current,pn=xe?.getContext("2d");if(!xe||!pn)return;const He=new Image;He.onload=()=>{pn.clearRect(0,0,xe.width,xe.height);const wn=xe.width/xe.height,Ge=He.width/He.height;let nt=xe.width,tt=xe.height,No=0,Fo=0;Ge>wn?(tt=xe.width/Ge,Fo=(xe.height-tt)/2):(nt=xe.height*Ge,No=(xe.width-nt)/2),pn.drawImage(He,No,Fo,nt,tt),D(),H(!0)},He.src=ge},[S,D]),dn=m.useCallback(()=>{Y||(M(),ve(null),H(!1),W(!1))},[Y,M]),Ye=m.useCallback(()=>{_||(M(),W(!1),H(!1),le(!1))},[M,_]),Ve=m.useCallback(ge=>{if(Y)return;const xe=ge.target.files?.[0];if(!xe)return;const pn=new FileReader;pn.onload=He=>{const wn=He.target?.result;typeof wn=="string"&&(M(),Re(wn))},pn.readAsDataURL(xe)},[Y,Re,M]),Ze=m.useCallback(()=>{Y||V.current?.click()},[Y]),re=m.useCallback(()=>{le(!1),H(!1),M()},[M]),Be=m.useCallback(ge=>{te||(oe(!0),setTimeout(()=>{R(!1),oe(!1),ge?.()},650))},[te]),be=m.useCallback(()=>{Be(()=>{re(),f?.()})},[Be,re,f]),Ee=m.useCallback(()=>{if(Y||te)return;const ge=B({backgroundColor:"#ffffff",format:"image/jpeg",quality:.82,strokeColor:"#111827"});!ge||!Se||Be(()=>{ve(ge),W(!0),g?.(ge),re(),f?.()})},[Se,Y,Be,re,B,f,g,te]);m.useEffect(()=>{a&&(R(!0),oe(!1))},[a]),m.useEffect(()=>{ve(i),W(!!i)},[i]),m.useEffect(()=>{if(!_e)return;const ge=()=>{const xe=U.current;xe&&we(Math.max(1,Math.floor(xe.clientWidth)))};return ge(),window.addEventListener("resize",ge),()=>window.removeEventListener("resize",ge)},[t,_e]),m.useImperativeHandle(b,()=>({limpiar:M,obtenerDatosFirma:B,estaVacio:()=>y}),[y,M,B]),m.useEffect(()=>{if(!_e)return;const ge=T({color:"#111827",enabled:!Y});return()=>{ge?.()}},[Y,T,_e]),m.useEffect(()=>{if(!_e){document.body.style.overflow="";return}const ge=window.innerWidth-document.documentElement.clientWidth;return document.body.style.overflow="hidden",ge>0&&(document.body.style.paddingRight=`${ge}px`),()=>{document.body.style.overflow="",document.body.style.paddingRight=""}},[_e]),m.useEffect(()=>{_e||re()},[re,_e]),m.useEffect(()=>{if(!_e)return;const ge=xe=>{if(xe.key==="Escape"){be();return}if(xe.ctrlKey&&xe.key.toLowerCase()==="z"){xe.preventDefault(),!Y&&G&&F();return}xe.ctrlKey&&xe.key==="Enter"&&(xe.preventDefault(),Y||Ee())};return document.addEventListener("keydown",ge),()=>document.removeEventListener("keydown",ge)},[Y,F,be,Ee,_e,G]),m.useEffect(()=>{const ge=J.current;if(!ge)return;if(l&&!!!ae){ge.setCustomValidity(h);return}ge.setCustomValidity("")},[ae,l,h]);const on=m.useCallback(ge=>{te||!r||ge.target===ge.currentTarget&&be()},[r,te,be]),fn=Y,Q=Y||j,Fe=Y||!ye&&(y&&!j||!Se),$e=()=>{_||(ae&&Ye(),oe(!1),R(!0))};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`${ie.bloque_firma} ${o||""}`,children:[s.jsxs("div",{className:ie.bloque_encabezado,children:[s.jsxs("span",{className:ie.bloque_titulo,children:[I,l&&s.jsx("span",{className:ie.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx(Rr,{color:ae?"success":"warning",size:"sm",variant:"outline",children:ae?x:k})]}),s.jsxs("div",{className:ie.bloque_preview,style:n?{aspectRatio:n}:void 0,children:[(l||u)&&s.jsx("input",{ref:J,className:ie.input_validacion_firma,"aria-hidden":"true",name:u,required:l,tabIndex:-1,type:"text",value:ae?"signed":"",onChange:()=>{},onInvalid:ge=>{l&&!ae&&ge.currentTarget.setCustomValidity(h)},onInput:ge=>{ge.currentTarget.setCustomValidity("")}}),ae?s.jsx("img",{src:ae,alt:"Firma guardada",className:ie.bloque_preview_imagen}):s.jsx("span",{className:ie.bloque_preview_placeholder,children:"Sin firma registrada"})]}),!_&&(q||$&&!!ae)&&s.jsxs("div",{className:ie.bloque_acciones,children:[q&&s.jsx(rn,{color:"primary",size:"sm",variant:"solid",onClick:$e,className:ie.accion_agregar_firma,isDisabled:Y||te,children:s.jsxs("span",{className:ie.boton_texto_con_icono,children:[ae?s.jsx(Ha,{className:ie.icono_boton_accion}):s.jsx(Ga,{className:ie.icono_boton_accion}),s.jsx("span",{className:ie.accion_texto,children:ae?P:A})]})}),$&&ae&&s.jsx(rn,{color:"default",size:"sm",variant:"bordered",onClick:dn,className:ie.accion_eliminar_firma,isDisabled:Y||te,children:s.jsxs("span",{className:ie.boton_texto_con_icono,children:[s.jsx(Xr,{className:ie.icono_boton_accion}),s.jsx("span",{className:ie.accion_texto,children:C})]})})]})]}),_e&&s.jsx("div",{className:`${ie.backdrop} ${te?"":ie.visible}`,onClick:on,children:s.jsxs("div",{className:`${ie.modal} ${te?"":ie.visible}`,role:"dialog","aria-modal":"true","aria-labelledby":he,"aria-describedby":fe,children:[s.jsxs("header",{className:ie.encabezado,children:[s.jsx("h2",{id:he,className:ie.titulo,children:O}),s.jsxs("button",{className:ie.boton_cerrar,onClick:be,type:"button","aria-label":"Cerrar",children:[s.jsx("span",{className:ie.texto_esc,children:"ESC"}),s.jsx(Va,{className:ie.icono_x})]})]}),s.jsxs("div",{className:ie.cuerpo_modal,children:[s.jsx("div",{className:ie.contenedor_lienzo,ref:U,children:s.jsxs("div",{className:ie.area_firma,children:[s.jsx("div",{className:ie.superficie_lienzo,children:s.jsx("canvas",{ref:S,className:`${ie.lienzo} ${fn?ie.lienzo_deshabilitado:""}`,width:ee,height:me,style:{height:`${me}px`,pointerEvents:Q?"none":"auto",width:"100%"},"aria-label":"Area de firma"})}),Ce&&s.jsxs("div",{className:ie.barra_acciones,role:"toolbar","aria-label":"Herramientas de firma",children:[s.jsxs("div",{className:ie.grupo_izquierda,children:[s.jsxs("button",{className:ie.boton_accion,onClick:F,type:"button",disabled:!G||fn,"aria-label":w,children:[s.jsx(ja,{className:ie.icono,"aria-hidden":"true"}),s.jsx("span",{children:w})]}),s.jsx("span",{className:ie.separador,"aria-hidden":"true",children:"|"}),s.jsxs("button",{className:ie.boton_accion,onClick:dn,type:"button",disabled:y&&!j||fn,"aria-label":L,children:[s.jsx(Xr,{className:ie.icono,"aria-hidden":"true"}),s.jsx("span",{children:L})]})]}),d&&s.jsx("div",{className:ie.grupo_derecha,children:s.jsxs("button",{className:ie.boton_adjuntar,onClick:Ze,type:"button",disabled:Y,children:[s.jsx(Ba,{className:ie.icono,"aria-hidden":"true"}),p]})})]})]})}),Ce&&s.jsxs(s.Fragment,{children:[s.jsx("div",{id:fe,className:ie.contenedor_consentimiento,children:s.jsxs("div",{className:ie.consentimiento_fila,children:[s.jsx(Lo,{id:ue,isSelected:Se,onChange:le,color:"primary",size:"md",isDisabled:Y,"aria-describedby":se,className:ie.toggle_consentimiento}),s.jsx("label",{htmlFor:ue,id:se,className:ie.texto_consentimiento,children:v})]})}),s.jsx("div",{className:ie.contenedor_guardar,children:s.jsx(rn,{color:"primary",variant:"solid",radius:"full",size:"md",onClick:ye&&!c?Ye:Ee,type:"button",isDisabled:Fe,startContent:s.jsx(Wa,{className:ie.icono,"aria-hidden":"true"}),children:ye&&!c?N:z})})]}),Ce&&d&&s.jsx("div",{className:ie.contenedor_subir_oculto,children:s.jsx("input",{ref:V,type:"file",accept:"image/*",className:ie.input_archivo,onChange:Ve,"aria-label":"Subir imagen de firma"})})]})]})})]})});Jr.displayName="Signature";const Za="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Dt=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Za[n[e]&63];return t};const Ja=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Qa=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),el=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),s.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),s.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),s.jsx("path",{d:"m2 2 20 20"})]}),Oe={contenedor_base:"_contenedor_base_lcpd6_1",tam_sm:"_tam_sm_lcpd6_37",tam_lg:"_tam_lg_lcpd6_49",radio_none:"_radio_none_lcpd6_61",radio_sm:"_radio_sm_lcpd6_69",radio_md:"_radio_md_lcpd6_77",radio_lg:"_radio_lg_lcpd6_85",radio_full:"_radio_full_lcpd6_93",color_default:"_color_default_lcpd6_101",color_primary:"_color_primary_lcpd6_103",color_secondary:"_color_secondary_lcpd6_111",color_success:"_color_success_lcpd6_119",color_warning:"_color_warning_lcpd6_127",color_danger:"_color_danger_lcpd6_135",etiqueta:"_etiqueta_lcpd6_143",marca_requerido:"_marca_requerido_lcpd6_159",envoltorio_input:"_envoltorio_input_lcpd6_169",envoltorio_interno:"_envoltorio_interno_lcpd6_197",entrada:"_entrada_lcpd6_213",contenido_inicio:"_contenido_inicio_lcpd6_267",contenido_final:"_contenido_final_lcpd6_269",boton_limpiar:"_boton_limpiar_lcpd6_287",tiene_contenido:"_tiene_contenido_lcpd6_343",boton_password:"_boton_password_lcpd6_353",descripcion:"_descripcion_lcpd6_405",mensaje_error:"_mensaje_error_lcpd6_417",ancho_total:"_ancho_total_lcpd6_429",variante_bordered:"_variante_bordered_lcpd6_437",variante_faded:"_variante_faded_lcpd6_447",variante_underlined:"_variante_underlined_lcpd6_457",variante_ghost:"_variante_ghost_lcpd6_481",deshabilitado:"_deshabilitado_lcpd6_493",solo_lectura:"_solo_lectura_lcpd6_527",enfocado:"_enfocado_lcpd6_581",valido:"_valido_lcpd6_589",invalido:"_invalido_lcpd6_597",sin_animacion:"_sin_animacion_lcpd6_629"},Qr=m.forwardRef((e,t)=>{const{type:n="text",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:g=!1,label:_,description:c,errorMessage:h,startContent:p,endContent:v,isRequired:w=!1,isReadOnly:C=!1,isDisabled:x=!1,isClearable:k=!1,isInvalid:z,validationState:L,validate:N,className:P,classNames:A,style:I,onChange:O,onClear:q,onValueChange:$,onFocus:b,onBlur:S,onKeyDown:T,id:F,name:y,autoComplete:M,autoFocus:D,maxLength:B,minLength:G,pattern:V,...J}=e,U=m.useRef(null),ue=m.useRef(F??`input-text-${Dt(8)}`).current;m.useImperativeHandle(t,()=>U.current);const se=o!==void 0,[he,fe]=m.useState(r??""),_e=se?o:he,[R,te]=m.useState(!1),[oe,ae]=m.useState(!1),ve=m.useMemo(()=>{if(!N)return null;const be=N(_e);return be===!0||be==null?null:typeof be=="string"?be:typeof be=="object"&&"message"in be?be.message??"Entrada inválida":"Entrada inválida"},[_e,N]),ee=m.useMemo(()=>z!==void 0?z:L==="invalid"?!0:L==="valid"?!1:!!ve,[z,L,ve]),we=L==="valid"&&!ee,Se={invalido:ee,mensaje:ve},le=_e.length>0,ye=n==="password",W=ye&&oe?"text":n,j=k&&le&&!C&&!x,H=m.useCallback(be=>{if(x||C)return;const Ee=be.target.value;se||fe(Ee),O?.(Ee),$?.(Ee)},[se,x,C,O,$]),me=m.useCallback(be=>{te(!0),b?.(be)},[b]),Y=m.useCallback(be=>{te(!1),S?.(be)},[S]),Ce=m.useCallback(()=>{x||C||(se||fe(""),O?.(""),$?.(""),q?.(),U.current?.focus())},[se,x,C,O,$,q]),Re=m.useCallback(be=>{be.key==="Escape"&&k&&le&&Ce(),T?.(be)},[k,le,Ce,T]),dn=m.useCallback(()=>{ae(be=>!be),requestAnimationFrame(()=>U.current?.focus())},[]),Ye=c?`${ue}-desc`:void 0,Ve=ee?`${ue}-err`:void 0,Ze=[Ye,Ve].filter(Boolean).join(" ")||void 0,re=typeof h=="function"?h(Se):h??ve,Be=K(Oe.contenedor_base,Oe[`variante_${a}`],Oe[`tam_${d}`],Oe[`radio_${u}`],Oe[`color_${l}`],{[Oe.ancho_total]:f,[Oe.sin_animacion]:g,[Oe.deshabilitado]:x,[Oe.solo_lectura]:C,[Oe.invalido]:ee,[Oe.valido]:we,[Oe.enfocado]:R,[Oe.tiene_contenido]:le},P,A?.base);return s.jsxs("div",{className:Be,style:I,children:[_&&s.jsxs("label",{className:K(Oe.etiqueta,A?.label),htmlFor:ue,children:[_,w&&s.jsx("span",{className:Oe.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(Oe.envoltorio_input,A?.inputWrapper),children:[p&&s.jsx("span",{className:Oe.contenido_inicio,children:p}),s.jsx("div",{className:K(Oe.envoltorio_interno,A?.innerWrapper),children:s.jsx("input",{...J,ref:U,id:ue,name:y,type:W,value:se?_e:void 0,defaultValue:se?void 0:r,placeholder:i,disabled:x,readOnly:C,required:w,autoComplete:M,autoFocus:D,maxLength:B,minLength:G,pattern:V,"aria-invalid":ee||void 0,"aria-describedby":Ze,"aria-required":w,className:K(Oe.entrada,A?.input),onChange:H,onFocus:me,onBlur:Y,onKeyDown:Re})}),j&&s.jsx("button",{type:"button",className:K(Oe.boton_limpiar,A?.clearButton),onClick:Ce,tabIndex:-1,"aria-label":"Limpiar campo",children:s.jsx(Ja,{size:"0.75em"})}),ye&&s.jsx("button",{type:"button",className:Oe.boton_password,onClick:dn,tabIndex:-1,"aria-label":oe?"Ocultar contraseña":"Mostrar contraseña","aria-pressed":oe,children:oe?s.jsx(el,{}):s.jsx(Qa,{})}),v&&s.jsx("span",{className:Oe.contenido_final,children:v})]}),c&&!ee&&s.jsx("div",{id:Ye,className:K(Oe.descripcion,A?.description),children:c}),ee&&re&&s.jsx("div",{id:Ve,className:K(Oe.mensaje_error,A?.errorMessage),role:"alert",children:re})]})});Qr.displayName="InputText";function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ht(e,t){if(e==null||Number.isNaN(e))return"";const{separadorMiles:n=!1,separadorDecimal:o=".",escalaDecimal:r,decimalesFijos:i=!1,prefijo:a="",sufijo:l=""}=t;let d;r!==void 0?d=i?e.toFixed(r):String(Math.round(e*Math.pow(10,r))/Math.pow(10,r)):d=String(e);const[u,f]=d.split(".");let g=u;if(n){const c=typeof n=="string"?n:",";g=u.replace(/\B(?=(\d{3})+(?!\d))/g,c)}let _=g;return f!==void 0?_+=o+f:i&&r&&r>0&&(_+=o+"0".repeat(r)),`${a}${_}${l}`}function ei(e,t){if(!e||e.trim()==="")return;const{separadorMiles:n=!1,separadorDecimal:o=".",prefijo:r="",sufijo:i="",permitirNegativo:a=!0}=t;let l=e;if(r&&(l=l.replace(new RegExp(`^${Lt(r)}`),"")),i&&(l=l.replace(new RegExp(`${Lt(i)}$`),"")),n){const u=typeof n=="string"?n:",";l=l.replace(new RegExp(Lt(u),"g"),"")}o!=="."&&(l=l.replace(new RegExp(Lt(o)),".")),a||(l=l.replace(/-/g,""));const d=parseFloat(l);return Number.isNaN(d)?void 0:d}function Pt(e,t,n){let o=e;return t!==void 0&&o<t&&(o=t),n!==void 0&&o>n&&(o=n),o}function ni(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function ti(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}const nl=e=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[s.jsx("path",{d:"M5 12h14"}),s.jsx("path",{d:"M12 5v14"})]}),tl=e=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:s.jsx("path",{d:"M5 12h14"})}),qe={contenedor_base:"_contenedor_base_1i8i2_1",tam_sm:"_tam_sm_1i8i2_37",tam_lg:"_tam_lg_1i8i2_49",radio_none:"_radio_none_1i8i2_61",radio_sm:"_radio_sm_1i8i2_69",radio_md:"_radio_md_1i8i2_77",radio_lg:"_radio_lg_1i8i2_85",radio_full:"_radio_full_1i8i2_93",color_default:"_color_default_1i8i2_101",color_primary:"_color_primary_1i8i2_103",color_secondary:"_color_secondary_1i8i2_111",color_success:"_color_success_1i8i2_119",color_warning:"_color_warning_1i8i2_127",color_danger:"_color_danger_1i8i2_135",etiqueta:"_etiqueta_1i8i2_143",marca_requerido:"_marca_requerido_1i8i2_159",envoltorio_input:"_envoltorio_input_1i8i2_169",envoltorio_interno:"_envoltorio_interno_1i8i2_195",entrada:"_entrada_1i8i2_213",contenido_inicio:"_contenido_inicio_1i8i2_279",contenido_final:"_contenido_final_1i8i2_281",controles:"_controles_1i8i2_299",boton_control:"_boton_control_1i8i2_315",variante_bordered:"_variante_bordered_1i8i2_369",variante_faded:"_variante_faded_1i8i2_377",variante_underlined:"_variante_underlined_1i8i2_385",variante_ghost:"_variante_ghost_1i8i2_397",descripcion:"_descripcion_1i8i2_445",mensaje_error:"_mensaje_error_1i8i2_457",ancho_total:"_ancho_total_1i8i2_469",deshabilitado:"_deshabilitado_1i8i2_533",solo_lectura:"_solo_lectura_1i8i2_567",enfocado:"_enfocado_1i8i2_621",valido:"_valido_1i8i2_629",invalido:"_invalido_1i8i2_637",sin_animacion:"_sin_animacion_1i8i2_669"},oi=m.forwardRef((e,t)=>{const{value:n,defaultValue:o,placeholder:r,variant:i="bordered",color:a="default",size:l="md",radius:d="md",fullWidth:u=!0,disableAnimation:f=!1,label:g,description:_,errorMessage:c,startContent:h,endContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:k,validate:z,className:L,classNames:N,style:P,min:A,max:I,step:O=1,decimalScale:q,fixedDecimalScale:$=!1,thousandSeparator:b=!1,decimalSeparator:S=".",prefix:T="",suffix:F="",allowNegative:y=!0,allowDecimal:M=!0,hideControls:D=!1,clampBehavior:B="blur",onChange:G,onValueChange:V,onFocus:J,onBlur:U,onKeyDown:pe,id:ue,name:se,...he}=e,fe=m.useRef(null),R=m.useRef(ue??`input-numeric-${Dt(8)}`).current;m.useImperativeHandle(t,()=>fe.current);const te=n!==void 0,[oe,ae]=m.useState(o!==void 0?o:void 0),[ve,ee]=m.useState(""),[we,Se]=m.useState(!1),le=te?n===""?void 0:n:oe,ye=m.useMemo(()=>({separadorMiles:b,separadorDecimal:S,escalaDecimal:M?q:0,decimalesFijos:$,prefijo:T,sufijo:F,permitirNegativo:y}),[b,S,q,$,T,F,y,M]),W=m.useMemo(()=>{if(!z)return null;const Q=ni(z(le));return Q.invalido?Q.mensaje:null},[le,z]),j=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!W,[x,k,W]),H=k==="valid"&&!j,me={invalido:j,mensaje:W},Y=m.useCallback(Q=>{te||ae(Q),G?.(Q),V?.(ht(Q,ye),Q)},[te,G,V,ye]),Ce=m.useCallback(Q=>{let $e=(le??0)+O*Q;B!=="none"&&($e=Pt($e,A,I)),q!==void 0&&($e=ti($e,q)),Y($e),ee(ht($e,ye))},[le,O,A,I,B,q,Y,ye]),Re=m.useCallback(Q=>{if(C||w)return;const Fe=Q.target.value,$e=S===","?",":".";let ge="0-9";M&&(ge+=$e),y&&(ge+="-");const xe=new RegExp(`[^${ge}]`,"g");let He=Fe.replace(xe,"");if(M){const Ge=He.split($e);Ge.length>2&&(He=Ge[0]+$e+Ge.slice(1).join(""))}if(y&&He.includes("-")){const Ge=He.replace(/-/g,"");He=He.startsWith("-")?"-"+Ge:Ge}ee(He);const wn=ei(He,ye);if(B==="strict"&&wn!==void 0){const Ge=Pt(wn,A,I);Y(Ge)}else Y(wn)},[C,w,ye,B,A,I,Y,S,y,M]),dn=m.useCallback(Q=>{if(Se(!0),le!==void 0){let Fe=String(le);S!=="."&&(Fe=Fe.replace(".",S)),ee(Fe)}J?.(Q)},[le,S,J]),Ye=m.useCallback(Q=>{if(Se(!1),B==="blur"&&le!==void 0){const Fe=Pt(le,A,I);Fe!==le&&Y(Fe)}ee(ht(le,ye)),U?.(Q)},[le,B,A,I,Y,ye,U]),Ve=m.useCallback(Q=>{Q.key==="ArrowUp"?(Q.preventDefault(),Ce(1)):Q.key==="ArrowDown"&&(Q.preventDefault(),Ce(-1));const Fe=["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],$e=Q.ctrlKey||Q.metaKey,ge=M&&(Q.key===S||Q.key==="."||Q.key===","),xe=Q.key==="-"&&y,pn=/^[0-9]$/.test(Q.key);!Fe.includes(Q.key)&&!$e&&!ge&&!xe&&!pn&&Q.preventDefault(),pe?.(Q)},[Ce,pe,S,y,M]);m.useEffect(()=>{we||ee(ht(le,ye))},[le,we,ye]);const Ze=_?`${R}-desc`:void 0,re=j?`${R}-err`:void 0,Be=[Ze,re].filter(Boolean).join(" ")||void 0,be=typeof c=="function"?c(me):c??W,Ee=I===void 0||(le??0)<I,on=A===void 0||(le??0)>A,fn=K(qe.contenedor_base,qe[`variante_${i}`],qe[`tam_${l}`],qe[`radio_${d}`],qe[`color_${a}`],{[qe.ancho_total]:u,[qe.sin_animacion]:f,[qe.deshabilitado]:C,[qe.solo_lectura]:w,[qe.invalido]:j,[qe.valido]:H,[qe.enfocado]:we},L,N?.base);return s.jsxs("div",{className:fn,style:P,children:[g&&s.jsxs("label",{className:K(qe.etiqueta,N?.label),htmlFor:R,children:[g,v&&s.jsx("span",{className:qe.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(qe.envoltorio_input,N?.inputWrapper),children:[s.jsxs("div",{className:K(qe.envoltorio_interno,N?.innerWrapper),children:[h&&s.jsx("span",{className:qe.contenido_inicio,children:h}),s.jsx("input",{...he,ref:fe,id:R,name:se,type:"text",inputMode:"decimal",value:ve,placeholder:r,disabled:C,readOnly:w,required:v,"aria-invalid":j||void 0,"aria-describedby":Be,"aria-required":v,className:K(qe.entrada,N?.input),onChange:Re,onFocus:dn,onBlur:Ye,onKeyDown:Ve}),p&&s.jsx("span",{className:qe.contenido_final,children:p})]}),!D&&!w&&!C&&s.jsxs("div",{className:K(qe.controles,N?.controls),children:[s.jsx("button",{type:"button",tabIndex:-1,className:K(qe.boton_control,N?.controlButton),disabled:!on,onClick:()=>Ce(-1),"aria-label":"Decrementar valor",children:s.jsx(tl,{})}),s.jsx("button",{type:"button",tabIndex:-1,className:K(qe.boton_control,N?.controlButton),disabled:!Ee,onClick:()=>Ce(1),"aria-label":"Incrementar valor",children:s.jsx(nl,{})})]})]}),_&&!j&&s.jsx("div",{id:Ze,className:K(qe.descripcion,N?.description),children:_}),j&&be&&s.jsx("div",{id:re,className:K(qe.mensaje_error,N?.errorMessage),role:"alert",children:be})]})});oi.displayName="InputNumeric";function ol(e){return e===!0||e===null||e===void 0?{invalido:!1,mensaje:null}:e===!1?{invalido:!0,mensaje:null}:typeof e=="string"?{invalido:!0,mensaje:e}:typeof e=="object"&&e.message?{invalido:!0,mensaje:e.message}:{invalido:!1,mensaje:null}}function Po(e,t="es-CO"){if(!e)return"";const n=new Date(e+"T00:00:00");return Number.isNaN(n.getTime())?"":n.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}function rl(){return new Date().toISOString().split("T")[0]}function il(e,t,n){if(!e)return!0;const o=new Date(e).getTime();return!(t&&o<new Date(t).getTime()||n&&o>new Date(n).getTime())}const je={contenedor_base:"_contenedor_base_12h7l_1",tam_sm:"_tam_sm_12h7l_37",tam_lg:"_tam_lg_12h7l_49",radio_none:"_radio_none_12h7l_61",radio_sm:"_radio_sm_12h7l_69",radio_md:"_radio_md_12h7l_77",radio_lg:"_radio_lg_12h7l_85",radio_full:"_radio_full_12h7l_93",color_default:"_color_default_12h7l_101",color_primary:"_color_primary_12h7l_103",color_secondary:"_color_secondary_12h7l_111",color_success:"_color_success_12h7l_119",color_warning:"_color_warning_12h7l_127",color_danger:"_color_danger_12h7l_135",etiqueta:"_etiqueta_12h7l_143",marca_requerido:"_marca_requerido_12h7l_159",envoltorio_input:"_envoltorio_input_12h7l_169",envoltorio_interno:"_envoltorio_interno_12h7l_195",entrada:"_entrada_12h7l_215",boton_icono:"_boton_icono_12h7l_267",enfocado:"_enfocado_12h7l_323",deshabilitado:"_deshabilitado_12h7l_331",solo_lectura:"_solo_lectura_12h7l_333",boton_limpiar:"_boton_limpiar_12h7l_343",contenido_inicio:"_contenido_inicio_12h7l_401",descripcion:"_descripcion_12h7l_419",mensaje_error:"_mensaje_error_12h7l_431",ancho_total:"_ancho_total_12h7l_443",variante_bordered:"_variante_bordered_12h7l_451",variante_faded:"_variante_faded_12h7l_461",variante_underlined:"_variante_underlined_12h7l_471",variante_ghost:"_variante_ghost_12h7l_487",valido:"_valido_12h7l_597",invalido:"_invalido_12h7l_605",sin_animacion:"_sin_animacion_12h7l_637"},sl=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("polyline",{points:"12 6 12 12 16 14"})]}),al=()=>s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M8 2v4"}),s.jsx("path",{d:"M16 2v4"}),s.jsx("rect",{height:"18",rx:"2",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"M3 10h18"}),s.jsx("circle",{cx:"8",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"14",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"8",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"12",cy:"18",r:"1",fill:"currentColor",stroke:"none"}),s.jsx("circle",{cx:"16",cy:"18",r:"1",fill:"currentColor",stroke:"none"})]}),ll=()=>s.jsxs("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),cl=({tipo:e,onClick:t,onMouseDown:n})=>s.jsx("button",{type:"button",tabIndex:-1,className:je.boton_icono,onMouseDown:n,onClick:t,"aria-label":e==="time"?"Abrir selector de hora":"Abrir selector de fecha",children:e==="time"?s.jsx(sl,{}):s.jsx(al,{})}),ri=m.forwardRef((e,t)=>{const{type:n="date",value:o,defaultValue:r,placeholder:i,variant:a="bordered",color:l="default",size:d="md",radius:u="md",fullWidth:f=!0,disableAnimation:g=!1,label:_,description:c,errorMessage:h,startContent:p,isRequired:v=!1,isReadOnly:w=!1,isDisabled:C=!1,isInvalid:x,validationState:k,validate:z,className:L,classNames:N,style:P,min:A,max:I,isClearable:O=!1,onChange:q,onFocus:$,onBlur:b,id:S,name:T,...F}=e,y=m.useRef(null),D=m.useRef(S??`input-date-${Dt(8)}`).current;m.useImperativeHandle(t,()=>y.current);const B=o!==void 0,[G,V]=m.useState(r??""),J=B?o:G,[U,pe]=m.useState(!1),ue=m.useRef(!1),se=m.useMemo(()=>{if(J&&n!=="time"&&(A||I)){if(A&&J<A)return`La fecha debe ser ${n==="date"?Po(A):A} o posterior`;if(I&&J>I)return`La fecha debe ser ${n==="date"?Po(I):I} o anterior`}if(!z)return null;const j=ol(z(J));return j.invalido?j.mensaje:null},[J,z,A,I,n]),he=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!se,[x,k,se]),fe=k==="valid"&&!he,_e={invalido:he,mensaje:se},R=m.useCallback(j=>{if(C||w)return;ue.current=!1;const H=j.target.value;B||V(H),q?.(H)},[B,C,w,q]),te=m.useCallback(j=>{pe(!0),$?.(j)},[$]),oe=m.useCallback(j=>{pe(!1),ue.current=!1,b?.(j)},[b]),ae=m.useCallback(j=>{j.preventDefault()},[]),ve=m.useCallback(j=>{if(j.preventDefault(),j.stopPropagation(),!(!y.current||C||w)){if(ue.current){ue.current=!1,y.current.blur();return}y.current.focus();try{y.current.showPicker?.(),ue.current=!0}catch{}}},[C,w]),ee=m.useCallback(j=>{j.preventDefault(),j.stopPropagation(),ue.current=!1,B||V(""),q?.(""),y.current?.focus()},[B,q]),we=c?`${D}-desc`:void 0,Se=he?`${D}-err`:void 0,le=[we,Se].filter(Boolean).join(" ")||void 0,ye=typeof h=="function"?h(_e):h??se,W=K(je.contenedor_base,je[`variante_${a}`],je[`tam_${d}`],je[`radio_${u}`],je[`color_${l}`],{[je.ancho_total]:f,[je.sin_animacion]:g,[je.deshabilitado]:C,[je.solo_lectura]:w,[je.invalido]:he,[je.valido]:fe,[je.enfocado]:U},L,N?.base);return s.jsxs("div",{className:W,style:P,children:[_&&s.jsxs("label",{className:K(je.etiqueta,N?.label),htmlFor:D,children:[_,v&&s.jsx("span",{className:je.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsx("div",{className:K(je.envoltorio_input,N?.inputWrapper),children:s.jsxs("div",{className:K(je.envoltorio_interno,N?.innerWrapper),children:[p&&s.jsx("span",{className:je.contenido_inicio,children:p}),s.jsx("input",{...F,ref:y,id:D,name:T,type:n,value:B?J:void 0,defaultValue:B?void 0:r,placeholder:i,disabled:C,readOnly:w,required:v,min:A,max:I,"aria-invalid":he||void 0,"aria-describedby":le,"aria-required":v,className:K(je.entrada,N?.input),onChange:R,onFocus:te,onBlur:oe}),O&&J&&!C&&!w&&s.jsx("button",{type:"button",tabIndex:-1,className:K(je.boton_limpiar,N?.clearButton),onMouseDown:j=>j.preventDefault(),onClick:ee,"aria-label":"Limpiar fecha",children:s.jsx(ll,{})}),s.jsx(cl,{tipo:n,onClick:ve,onMouseDown:ae})]})}),c&&!he&&s.jsx("div",{id:we,className:K(je.descripcion,N?.description),children:c}),he&&ye&&s.jsx("div",{id:Se,className:K(je.mensaje_error,N?.errorMessage),role:"alert",children:ye})]})});ri.displayName="InputDate";const dl={desvanecerDeslizar:"desvanecer_deslizar",escalar:"escalar"};function Tt({mostrar:e,children:t,tipo:n="desvanecerDeslizar",className:o,...r}){const[i,a]=m.useState(e),[l,d]=m.useState(e?"entrada":null);e&&!i?(a(!0),d("entrada")):!e&&i&&l!=="salida"&&d("salida");const u=()=>{l==="entrada"?d(null):l==="salida"&&(a(!1),d(null))};if(!i)return null;const f=dl[n||"desvanecer"],g=l?`transicion_${f}_${l}`:"";return s.jsx("div",{...r,onAnimationEnd:u,className:`${g} ${o||""}`.trim(),children:t})}const In={badges_wrap:"_badges_wrap_asqih_15",badges_wrap_visible:"_badges_wrap_visible_asqih_23",acciones_grupo:"_acciones_grupo_asqih_33",badge_voz:"_badge_voz_asqih_41",badge_sm:"_badge_sm_asqih_73",badge_md:"_badge_md_asqih_85",badge_lg:"_badge_lg_asqih_97",badge_estirada:"_badge_estirada_asqih_109",badge_icono:"_badge_icono_asqih_129",badge_texto:"_badge_texto_asqih_155",badge_mic:"_badge_mic_asqih_165",badge_tts:"_badge_tts_asqih_173",badge_ondas:"_badge_ondas_asqih_181",badgeOnda:"_badgeOnda_asqih_1",badge_eq:"_badge_eq_asqih_219",badgeEq:"_badgeEq_asqih_1"};function To(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",...e,children:s.jsxs("g",{fill:"currentColor",children:[s.jsx("path",{d:"M5 3a3 3 0 0 1 6 0v4a3 3 0 0 1-6 0z"}),s.jsx("path",{d:"M8 11a4 4 0 0 1-4-4H2a6 6 0 0 0 5 5.917V14H5v2h6v-2H9v-1.083A6 6 0 0 0 14 7h-2a4 4 0 0 1-4 4"})]})})}function Oo(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",...e,children:s.jsx("path",{fill:"currentColor",d:"M18 5.433c0-1.398-1.742-2.036-2.645-.97l-4.086 4.83A2 2 0 0 1 9.743 10H6a4 4 0 0 0-4 4v4a4 4 0 0 0 4 4h3.743a2 2 0 0 1 1.526.708l4.086 4.829c.902 1.066 2.645.428 2.645-.97zm3.433 3.743a1 1 0 0 1 1.391.258c1.465 2.13 2.238 4.324 2.238 6.566s-.773 4.436-2.238 6.567a1 1 0 1 1-1.648-1.133c1.285-1.87 1.887-3.676 1.887-5.434s-.602-3.564-1.887-5.433a1 1 0 0 1 .258-1.39m4.257-3.9a1 1 0 0 0-1.38 1.448c2.387 2.273 3.628 5.739 3.628 9.276s-1.241 7.003-3.628 9.276a1 1 0 0 0 1.38 1.448c2.863-2.727 4.247-6.761 4.247-10.724S28.554 8.003 25.69 5.276"})})}function ii(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 21",...e,children:[s.jsx("circle",{cx:"12",cy:"12",r:"6",fill:"currentColor",opacity:".5"}),s.jsx("path",{fill:"currentColor",d:"M12 2a10 10 0 1 0 10 10A10.01 10.01 0 0 0 12 2m0 16a6 6 0 1 1 6-6a6.007 6.007 0 0 1-6 6"})]})}function qo({tipo:e,texto:t,size:n="md",estirar:o}){const r=e==="mic";return s.jsxs("span",{className:K(In.badge_voz,r?In.badge_mic:In.badge_tts,In[`badge_${n}`],o&&In.badge_estirada),"data-tipo":e,children:[s.jsx("span",{className:In.badge_icono,children:r?s.jsx(To,{}):s.jsx(Oo,{})}),s.jsx("span",{className:In.badge_texto,children:t}),r?s.jsxs("span",{className:In.badge_ondas,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]}):s.jsxs("span",{className:In.badge_eq,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{}),s.jsx("span",{})]})]})}function si({value:e,onChange:t,isDisabled:n,isReadOnly:o,onDictadoCompleto:r,idioma:i="es-ES"}){const[a,l]=m.useState(!1),[d,u]=m.useState(!1),[f,g]=m.useState(null),_=m.useRef(null),c=m.useRef(null),h=m.useRef(null),p=m.useRef(""),v=typeof window<"u"&&"speechSynthesis"in window,w=typeof window<"u"&&!!(window.SpeechRecognition||window.webkitSpeechRecognition),C=m.useCallback(()=>{h.current&&(clearTimeout(h.current),h.current=null),v&&window.speechSynthesis.cancel(),c.current=null,l(!1)},[v]),x=m.useCallback(()=>{if(!v||!e)return;if(C(),_.current){try{_.current.stop()}catch(N){console.error("Error stopping recognition:",N)}_.current=null,u(!1)}const L=new SpeechSynthesisUtterance(e);L.lang=i,L.onstart=()=>l(!0),L.onend=()=>{l(!1),c.current=null},L.onerror=()=>{l(!1),c.current=null},c.current=L,window.speechSynthesis.speak(L)},[v,e,i,C]),k=m.useCallback(()=>{if(_.current)try{_.current.stop()}catch(L){console.error("Error stopping recognition:",L)}u(!1),g(null)},[]),z=m.useCallback(()=>{if(!w||n||o)return;C();const L=window,N=L.SpeechRecognition||L.webkitSpeechRecognition;if(!N){g("Navegador no compatible");return}try{const P=new N;P.continuous=!0,P.interimResults=!0,P.lang=i,P.onstart=()=>{u(!0),g(null),p.current=e||""},P.onend=()=>{u(!1),_.current=null,r?.()},P.onerror=A=>{A.error!=="no-speech"&&(u(!1),_.current=null,A.error!=="aborted"&&g("Error al reconocer voz"))},P.onresult=A=>{try{let I="";for(let $=0;$<A.results.length;$++)I+=A.results[$][0].transcript;const O=p.current&&I?" ":"",q=p.current+O+I;t(q)}catch{g("Error procesando dictado")}},_.current=P,P.start()}catch{g("No se pudo iniciar dictado"),u(!1)}},[w,n,o,e,t,i,C,r]);return m.useEffect(()=>()=>{h.current&&clearTimeout(h.current),v&&window.speechSynthesis.cancel(),_.current&&_.current.abort()},[v]),{puedeHablar:v,puedeEscuchar:w,hablando:a,escuchando:d,errorDictado:f,escuchar:x,detenerHablar:C,dictar:z,detenerDictado:k}}function ul({size:e="1em",className:t}){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:e,height:e,className:t,"aria-hidden":"true",children:[s.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),s.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}const De={contenedor_base:"_contenedor_base_126y1_1",tam_sm:"_tam_sm_126y1_29",tam_lg:"_tam_lg_126y1_41",radio_none:"_radio_none_126y1_53",radio_sm:"_radio_sm_126y1_61",radio_md:"_radio_md_126y1_69",radio_lg:"_radio_lg_126y1_77",radio_full:"_radio_full_126y1_85",color_default:"_color_default_126y1_93",color_primary:"_color_primary_126y1_95",color_secondary:"_color_secondary_126y1_103",color_success:"_color_success_126y1_111",color_warning:"_color_warning_126y1_119",color_danger:"_color_danger_126y1_127",etiqueta:"_etiqueta_126y1_135",marca_requerido:"_marca_requerido_126y1_151",envoltorio_input:"_envoltorio_input_126y1_161",entrada:"_entrada_126y1_187",sin_autosize:"_sin_autosize_126y1_237",barra_acciones:"_barra_acciones_126y1_245",badges_contenedor:"_badges_contenedor_126y1_265",botones_grupo:"_botones_grupo_126y1_279",boton_accion:"_boton_accion_126y1_291",boton_activo_tts:"_boton_activo_tts_126y1_353",haloTts:"_haloTts_126y1_1",boton_activo_mic:"_boton_activo_mic_126y1_383",haloMic:"_haloMic_126y1_1",boton_limpiar:"_boton_limpiar_126y1_471",descripcion:"_descripcion_126y1_519",mensaje_error:"_mensaje_error_126y1_531",ancho_total:"_ancho_total_126y1_543",variante_bordered:"_variante_bordered_126y1_551",variante_faded:"_variante_faded_126y1_561",variante_underlined:"_variante_underlined_126y1_581",variante_ghost:"_variante_ghost_126y1_615",deshabilitado:"_deshabilitado_126y1_635",solo_lectura:"_solo_lectura_126y1_669",enfocado:"_enfocado_126y1_729",valido:"_valido_126y1_737",invalido:"_invalido_126y1_745",sin_animacion:"_sin_animacion_126y1_777"},ai=m.forwardRef((e,t)=>{const{children:n,variant:o="bordered",color:r="default",size:i="md",radius:a="md",fullWidth:l=!0,disableAnimation:d=!1,label:u,description:f,errorMessage:g,value:_,defaultValue:c,placeholder:h,isRequired:p=!1,isReadOnly:v=!1,isDisabled:w=!1,isClearable:C=!1,isInvalid:x,validationState:k,validate:z,minRows:L=4,maxRows:N=10,disableAutosize:P=!1,hideVoiceActions:A=!1,className:I,classNames:O,style:q,onChange:$,onClear:b,onFocus:S,onBlur:T,id:F,name:y,rows:M,...D}=e,B=m.useRef(null),V=m.useRef(F??`textarea-${Dt(8)}`).current;m.useImperativeHandle(t,()=>B.current);const J=_!==void 0,[U,pe]=m.useState(c??""),ue=J?_:U,[se,he]=m.useState(!1),fe=m.useMemo(()=>{if(!z)return null;const Q=z(ue);return Q===!0||Q==null?null:typeof Q=="string"?Q:typeof Q=="object"&&"message"in Q?Q.message??"Entrada inválida":"Entrada inválida"},[ue,z]),_e=m.useMemo(()=>x!==void 0?x:k==="invalid"?!0:k==="valid"?!1:!!fe,[x,k,fe]),R=k==="valid"&&!_e,te={invalido:_e,mensaje:fe},oe=ue.length>0,ae=m.useCallback(()=>{if(!B.current||P)return;const Q=B.current,Fe=window.getComputedStyle(Q),$e=parseFloat(Fe.lineHeight)||parseFloat(Fe.fontSize)*1.5,ge=parseFloat(Fe.paddingTop)||0,xe=parseFloat(Fe.paddingBottom)||0,pn=parseFloat(Fe.borderTopWidth)||0,He=parseFloat(Fe.borderBottomWidth)||0,wn=L*$e+ge+xe+pn+He,Ge=N*$e+ge+xe+pn+He;Q.style.height="auto";const nt=Q.scrollHeight;Q.style.height=`${Math.min(Math.max(nt,wn),Ge)}px`},[P,L,N]);m.useEffect(()=>{P||ae()},[ue,ae,P]);const ve=m.useCallback(Q=>{J||pe(Q),$?.(Q)},[J,$]),{puedeHablar:ee,hablando:we,escuchar:Se,detenerHablar:le,puedeEscuchar:ye,escuchando:W,errorDictado:j,dictar:H,detenerDictado:me}=si({isDisabled:w||A,isReadOnly:v,value:ue,onChange:ve}),Y=m.useCallback(Q=>{if(w||v)return;const Fe=Q.target.value;J||pe(Fe),$?.(Fe)},[J,w,v,$]),Ce=m.useCallback(Q=>{he(!0),S?.(Q)},[S]),Re=m.useCallback(Q=>{he(!1),T?.(Q)},[T]),dn=m.useCallback(()=>{w||v||(J||pe(""),$?.(""),b?.(),B.current?.focus())},[J,w,v,$,b]),Ye=m.useCallback(()=>{we?le():Se()},[we,Se,le]),Ve=m.useCallback(()=>{W?me():H()},[W,H,me]),Ze=f?`${V}-desc`:void 0,re=_e||j?`${V}-err`:void 0,Be=[Ze,re].filter(Boolean).join(" ")||void 0,be=typeof g=="function"?g(te):g??fe,Ee=C&&oe&&!v&&!w,on=!A||Ee,fn=K(De.contenedor_base,De[`variante_${o}`],De[`tam_${i}`],De[`radio_${a}`],De[`color_${r}`],{[De.ancho_total]:l,[De.sin_animacion]:d,[De.deshabilitado]:w,[De.solo_lectura]:v,[De.invalido]:_e,[De.valido]:R,[De.enfocado]:se},I,O?.base);return s.jsxs("div",{className:fn,style:q,children:[u&&s.jsxs("label",{className:K(De.etiqueta,O?.label),htmlFor:V,children:[u,p&&s.jsx("span",{className:De.marca_requerido,"aria-hidden":"true",children:"*"})]}),s.jsxs("div",{className:K(De.envoltorio_input,O?.inputWrapper),children:[s.jsx("textarea",{...D,ref:B,id:V,name:y,placeholder:h,value:J?ue:void 0,defaultValue:J?void 0:c,onChange:Y,onFocus:Ce,onBlur:Re,className:K(De.entrada,P&&De.sin_autosize,O?.input),readOnly:v,disabled:w,rows:M??L,"aria-invalid":_e||void 0,"aria-describedby":Be,"aria-required":p,required:p}),on&&s.jsxs("div",{className:K(De.barra_acciones,O?.actions),children:[s.jsxs("div",{className:De.badges_contenedor,"aria-live":"polite",role:"status",children:[s.jsx(Tt,{mostrar:W,children:s.jsx(qo,{tipo:"mic",texto:"Escuchando...",size:i==="lg"?"md":"sm"})}),s.jsx(Tt,{mostrar:we,children:s.jsx(qo,{tipo:"tts",texto:"Leyendo...",size:i==="lg"?"md":"sm"})})]}),s.jsxs("div",{className:De.botones_grupo,children:[!A&&s.jsxs(s.Fragment,{children:[s.jsx("button",{type:"button",className:K(De.boton_accion,we&&De.boton_activo_tts),onClick:Ye,disabled:!ee||!we&&(!ue||W),title:we?"Detener lectura":"Leer texto","aria-pressed":we,"aria-label":we?"Detener lectura":"Leer texto",children:s.jsx(Oo,{})}),ye&&s.jsx("button",{type:"button",className:K(De.boton_accion,W&&De.boton_activo_mic),onClick:Ve,disabled:w||v||we,title:W?"Detener dictado":"Dictar texto","aria-pressed":W,"aria-label":W?"Detener dictado":"Dictar texto",children:W?s.jsx(ii,{}):s.jsx(To,{})})]}),Ee&&s.jsx("button",{type:"button",className:De.boton_limpiar,onClick:dn,title:"Limpiar campo","aria-label":"Limpiar campo",children:s.jsx(ul,{size:"0.75em"})})]})]})]}),f&&!_e&&s.jsx("div",{id:Ze,className:K(De.descripcion,O?.description),children:f}),_e&&be||j?s.jsxs("div",{id:re,className:K(De.mensaje_error,O?.errorMessage),role:"alert",children:[be,be&&j&&s.jsx("br",{}),j&&s.jsxs("span",{children:["Error de voz: ",j]})]}):null,n]})});ai.displayName="TextArea";function Ot(){return typeof window<"u"}function Pn(e){return Vo(e)?(e.nodeName||"").toLowerCase():"#document"}function gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xn(e){var t;return(t=(Vo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vo(e){return Ot()?e instanceof Node||e instanceof gn(e).Node:!1}function Le(e){return Ot()?e instanceof Element||e instanceof gn(e).Element:!1}function We(e){return Ot()?e instanceof HTMLElement||e instanceof gn(e).HTMLElement:!1}function qt(e){return!Ot()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gn(e).ShadowRoot}const fl=new Set(["inline","contents"]);function mt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=hn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!fl.has(r)}const _l=new Set(["table","td","th"]);function gl(e){return _l.has(Pn(e))}const pl=[":popover-open",":modal"];function Vt(e){return pl.some(t=>{try{return e.matches(t)}catch{return!1}})}const hl=["transform","translate","scale","rotate","perspective"],ml=["transform","translate","scale","rotate","perspective","filter"],vl=["paint","layout","strict","content"];function jo(e){const t=jt(),n=Le(e)?hn(e):e;return hl.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||ml.some(o=>(n.willChange||"").includes(o))||vl.some(o=>(n.contain||"").includes(o))}function bl(e){let t=Mn(e);for(;We(t)&&!En(t);){if(jo(t))return t;if(Vt(t))return null;t=Mn(t)}return null}function jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wl=new Set(["html","body","#document"]);function En(e){return wl.has(Pn(e))}function hn(e){return gn(e).getComputedStyle(e)}function Bt(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Mn(e){if(Pn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qt(e)&&e.host||xn(e);return qt(t)?t.host:t}function li(e){const t=Mn(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&mt(t)?t:li(t)}function Tn(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=li(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=gn(r);if(i){const l=Bo(a);return t.concat(a,a.visualViewport||[],mt(r)?r:[],l&&n?Tn(l):[])}return t.concat(r,Tn(r,[],n))}function Bo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const On=Math.min,mn=Math.max,Ht=Math.round,ot=Math.floor,Sn=e=>({x:e,y:e}),yl={left:"right",right:"left",bottom:"top",top:"bottom"},Cl={start:"end",end:"start"};function Ho(e,t,n){return mn(e,On(t,n))}function rt(e,t){return typeof e=="function"?e(t):e}function qn(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function ci(e){return e==="x"?"y":"x"}function Go(e){return e==="y"?"height":"width"}const xl=new Set(["top","bottom"]);function Nn(e){return xl.has(qn(e))?"y":"x"}function Wo(e){return ci(Nn(e))}function Sl(e,t,n){n===void 0&&(n=!1);const o=it(e),r=Wo(e),i=Go(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Gt(a)),[a,Gt(a)]}function $l(e){const t=Gt(e);return[Ko(e),t,Ko(t)]}function Ko(e){return e.replace(/start|end/g,t=>Cl[t])}const di=["left","right"],ui=["right","left"],kl=["top","bottom"],Il=["bottom","top"];function El(e,t,n){switch(e){case"top":case"bottom":return n?t?ui:di:t?di:ui;case"left":case"right":return t?kl:Il;default:return[]}}function Ml(e,t,n,o){const r=it(e);let i=El(qn(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Ko)))),i}function Gt(e){return e.replace(/left|right|bottom|top/g,t=>yl[t])}function Nl(e){return{top:0,right:0,bottom:0,left:0,...e}}function fi(e){return typeof e!="number"?Nl(e):{top:e,right:e,bottom:e,left:e}}function Wt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
2
2
  * tabbable 6.3.0
3
3
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4
- */var _l=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Bn=_l.join(","),oi=typeof Element>"u",tn=oi?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hn=!oi&&Element.prototype.getRootNode?function(e){var n;return e==null||(n=e.getRootNode)===null||n===void 0?void 0:n.call(e)}:function(e){return e?.ownerDocument},gn=function(n,t){var o;t===void 0&&(t=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert"),i=r===""||r==="true",s=i||t&&n&&gn(n.parentNode);return s},gl=function(n){var t,o=n==null||(t=n.getAttribute)===null||t===void 0?void 0:t.call(n,"contenteditable");return o===""||o==="true"},ri=function(n,t,o){if(gn(n))return[];var r=Array.prototype.slice.apply(n.querySelectorAll(Bn));return t&&tn.call(n,Bn)&&r.unshift(n),r=r.filter(o),r},Gn=function(n,t,o){for(var r=[],i=Array.from(n);i.length;){var s=i.shift();if(!gn(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),d=l.length?l:s.children,u=Gn(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:s,candidates:u})}else{var f=tn.call(s,Bn);f&&o.filter(s)&&(t||!n.includes(s))&&r.push(s);var p=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),_=!gn(p,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(p&&_){var c=Gn(p===!0?s.children:p.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else i.unshift.apply(i,s.children)}}return r},ii=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},si=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||gl(n))&&!ii(n)?0:n.tabIndex},pl=function(n,t){var o=si(n);return o<0&&t&&!ii(n)?0:o},hl=function(n,t){return n.tabIndex===t.tabIndex?n.documentOrder-t.documentOrder:n.tabIndex-t.tabIndex},ai=function(n){return n.tagName==="INPUT"},ml=function(n){return ai(n)&&n.type==="hidden"},vl=function(n){var t=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"});return t},bl=function(n,t){for(var o=0;o<n.length;o++)if(n[o].checked&&n[o].form===t)return n[o]},wl=function(n){if(!n.name)return!0;var t=n.form||Hn(n),o=function(l){return t.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(n.name));else try{r=o(n.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=bl(r,n.form);return!i||i===n},yl=function(n){return ai(n)&&n.type==="radio"},xl=function(n){return yl(n)&&!wl(n)},Cl=function(n){var t,o=n&&Hn(n),r=(t=o)===null||t===void 0?void 0:t.host,i=!1;if(o&&o!==n){var s,l,d;for(i=!!((s=r)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(r)||n!=null&&(d=n.ownerDocument)!==null&&d!==void 0&&d.contains(n));!i&&r;){var u,f,p;o=Hn(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(r))}}return i},li=function(n){var t=n.getBoundingClientRect(),o=t.width,r=t.height;return o===0&&r===0},Sl=function(n,t){var o=t.displayCheck,r=t.getShadowRoot;if(o==="full-native"&&"checkVisibility"in n){var i=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(n).visibility==="hidden")return!0;var s=tn.call(n,"details>summary:first-of-type"),l=s?n.parentElement:n;if(tn.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=n;n;){var u=n.parentElement,f=Hn(n);if(u&&!u.shadowRoot&&r(u)===!0)return li(n);n.assignedSlot?n=n.assignedSlot:!u&&f!==n.ownerDocument?n=f.host:n=u}n=d}if(Cl(n))return!n.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return li(n);return!1},$l=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var t=n.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var o=0;o<t.children.length;o++){var r=t.children.item(o);if(r.tagName==="LEGEND")return tn.call(t,"fieldset[disabled] *")?!0:!r.contains(n)}return!0}t=t.parentElement}return!1},zo=function(n,t){return!(t.disabled||gn(t)||ml(t)||Sl(t,n)||vl(t)||$l(t))},Vo=function(n,t){return!(xl(t)||si(t)<0||!zo(n,t))},kl=function(n){var t=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ci=function(n){var t=[],o=[];return n.forEach(function(r,i){var s=!!r.scopeParent,l=s?r.scopeParent:r,d=pl(l,s),u=s?ci(r.candidates):l;d===0?s?t.push.apply(t,u):t.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:s,content:u})}),o.sort(hl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(t)},Wn=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Gn([n],t.includeContainer,{filter:Vo.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:kl}):o=ri(n,t.includeContainer,Vo.bind(null,t)),ci(o)},Il=function(n,t){t=t||{};var o;return t.getShadowRoot?o=Gn([n],t.includeContainer,{filter:zo.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):o=ri(n,t.includeContainer,zo.bind(null,t)),o},di=function(n,t){if(t=t||{},!n)throw new Error("No node provided");return tn.call(n,Bn)===!1?!1:Vo(t,n)};function ui(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function fi(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(n=>{let{brand:t,version:o}=n;return t+"/"+o}).join(" "):navigator.userAgent}function _i(){return/apple/i.test(navigator.vendor)}function qo(){const e=/android/i;return e.test(ui())||e.test(fi())}function El(){return ui().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function gi(){return fi().includes("jsdom/")}const pi="data-floating-ui-focusable",Ml="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jo="ArrowLeft",Bo="ArrowRight",Nl="ArrowUp",Fl="ArrowDown";function xt(e){let n=e.activeElement;for(;((t=n)==null||(t=t.shadowRoot)==null?void 0:t.activeElement)!=null;){var t;n=n.shadowRoot.activeElement}return n}function Ke(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&Dn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Et(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ho(e,n){if(n==null)return!1;if("composedPath"in e)return e.composedPath().includes(n);const t=e;return t.target!=null&&n.contains(t.target)}function Al(e){return e.matches("html,body")}function Ue(e){return e?.ownerDocument||document}function Go(e){return Ve(e)&&e.matches(Ml)}function Wo(e){return e?e.getAttribute("role")==="combobox"&&Go(e):!1}function Pl(e){if(!e||gi())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Rn(e){return e?e.hasAttribute(pi)?e:e.querySelector("["+pi+"]")||e:null}function Ht(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ht(e,r.id,t)])}function Ll(e,n){let t,o=-1;function r(i,s){s>o&&(t=i,o=s),Ht(e,i).forEach(d=>{r(d.id,s+1)})}return r(n,0),e.find(i=>i.id===t)}function hi(e,n){var t;let o=[],r=(t=e.find(i=>i.id===n))==null?void 0:t.parentId;for(;r;){const i=e.find(s=>s.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function Ye(e){e.preventDefault(),e.stopPropagation()}function Dl(e){return"nativeEvent"in e}function mi(e){return e.mozInputSource===0&&e.isTrusted?!0:qo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function vi(e){return gi()?!1:!qo()&&e.width===0&&e.height===0||qo()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function pn(e,n){const t=["mouse","pen"];return n||t.push("",void 0),t.includes(e)}var Tl=typeof document<"u",Ol=function(){},Le=Tl?v.useLayoutEffect:Ol;const zl={...M};function Ge(e){const n=M.useRef(e);return Le(()=>{n.current=e}),n}const Vl=zl.useInsertionEffect||(e=>e());function qe(e){const n=M.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Vl(()=>{n.current=e}),M.useCallback(function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}function Kn(e,n,t){return Math.floor(e/n)!==t}function hn(e,n){return n<0||n>=e.current.length}function Ro(e,n){return Je(e,{disabledIndices:n})}function bi(e,n){return Je(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function Je(e,n){let{startingIndex:t=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n,s=t;do s+=o?-i:i;while(s>=0&&s<=e.current.length-1&&Un(e,s,r));return s}function ql(e,n){let{event:t,orientation:o,loop:r,rtl:i,cols:s,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:p=!1}=n,_=f;if(t.key===Nl){if(p&&Ye(t),f===-1)_=u;else if(_=Je(e,{startingIndex:_,amount:s,decrement:!0,disabledIndices:l}),r&&(f-s<d||_<0)){const c=f%s,h=u%s,g=u-(h-c);h===c?_=u:_=h>c?g:g-s}hn(e,_)&&(_=f)}if(t.key===Fl&&(p&&Ye(t),f===-1?_=d:(_=Je(e,{startingIndex:f,amount:s,disabledIndices:l}),r&&f+s>u&&(_=Je(e,{startingIndex:f%s-s,amount:s,disabledIndices:l}))),hn(e,_)&&(_=f)),o==="both"){const c=Qt(f/s);t.key===(i?jo:Bo)&&(p&&Ye(t),f%s!==s-1?(_=Je(e,{startingIndex:f,disabledIndices:l}),r&&Kn(_,s,c)&&(_=Je(e,{startingIndex:f-f%s-1,disabledIndices:l}))):r&&(_=Je(e,{startingIndex:f-f%s-1,disabledIndices:l})),Kn(_,s,c)&&(_=f)),t.key===(i?Bo:jo)&&(p&&Ye(t),f%s!==0?(_=Je(e,{startingIndex:f,decrement:!0,disabledIndices:l}),r&&Kn(_,s,c)&&(_=Je(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:l}))):r&&(_=Je(e,{startingIndex:f+(s-f%s),decrement:!0,disabledIndices:l})),Kn(_,s,c)&&(_=f));const h=Qt(u/s)===c;hn(e,_)&&(r&&h?_=t.key===(i?Bo:jo)?u:Je(e,{startingIndex:f-f%s-1,disabledIndices:l}):_=f)}return _}function jl(e,n,t){const o=[];let r=0;return e.forEach((i,s)=>{let{width:l,height:d}=i;if(l>n&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let u=!1;for(t&&(r=0);!u;){const f=[];for(let p=0;p<l;p++)for(let _=0;_<d;_++)f.push(r+p+_*n);r%n+l<=n&&f.every(p=>o[p]==null)?(f.forEach(p=>{o[p]=s}),u=!0):r++}}),[...o]}function Bl(e,n,t,o,r){if(e===-1)return-1;const i=t.indexOf(e),s=n[e];switch(r){case"tl":return i;case"tr":return s?i+s.width-1:i;case"bl":return s?i+(s.height-1)*o:i;case"br":return t.lastIndexOf(e)}}function Hl(e,n){return n.flatMap((t,o)=>e.includes(t)?[o]:[])}function Un(e,n,t){if(typeof t=="function")return t(n);if(t)return t.includes(n);const o=e.current[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const mn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wi(e,n){const t=Wn(e,mn()),o=t.length;if(o===0)return;const r=xt(Ue(e)),i=t.indexOf(r),s=i===-1?n===1?0:o-1:i+n;return t[s]}function yi(e){return wi(Ue(e).body,1)||e}function xi(e){return wi(Ue(e).body,-1)||e}function vn(e,n){const t=n||e.currentTarget,o=e.relatedTarget;return!o||!Ke(t,o)}function Gl(e){Wn(e,mn()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function Ci(e){e.querySelectorAll("[data-tabindex]").forEach(t=>{const o=t.dataset.tabindex;delete t.dataset.tabindex,o?t.setAttribute("tabindex",o):t.removeAttribute("tabindex")})}function Si(e,n,t){let{reference:o,floating:r}=e;const i=It(n),s=To(n),l=Do(s),d=Dt(n),u=i==="y",f=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,_=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:f,y:o.y-r.height};break;case"bottom":c={x:f,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:p};break;case"left":c={x:o.x-r.width,y:p};break;default:c={x:o.x,y:o.y}}switch(en(n)){case"start":c[s]-=_*(t&&u?-1:1);break;case"end":c[s]+=_*(t&&u?-1:1);break}return c}const Wl=async(e,n,t)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=t,l=i.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:r}),{x:f,y:p}=Si(u,o,d),_=o,c={},h=0;for(let g=0;g<l.length;g++){const{name:m,fn:b}=l[g],{x:w,y:C,data:S,reset:k}=await b({x:f,y:p,initialPlacement:o,placement:_,strategy:r,middlewareData:c,rects:u,platform:s,elements:{reference:e,floating:n}});f=w??f,p=C??p,c={...c,[m]:{...c[m],...S}},k&&h<=50&&(h++,typeof k=="object"&&(k.placement&&(_=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:r}):k.rects),{x:f,y:p}=Si(u,_,d)),g=-1)}return{x:f,y:p,placement:_,strategy:r,middlewareData:c}};async function Ko(e,n){var t;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:s,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:p="floating",altBoundary:_=!1,padding:c=0}=Jt(n,e),h=ni(c),m=l[_?p==="floating"?"reference":"floating":p],b=jn(await i.getClippingRect({element:(t=await(i.isElement==null?void 0:i.isElement(m)))==null||t?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:d})),w=p==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},k=jn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:C,strategy:d}):w);return{top:(b.top-k.top+h.top)/S.y,bottom:(k.bottom-b.bottom+h.bottom)/S.y,left:(b.left-k.left+h.left)/S.x,right:(k.right-b.right+h.right)/S.x}}const Rl=e=>({name:"arrow",options:e,async fn(n){const{x:t,y:o,placement:r,rects:i,platform:s,elements:l,middlewareData:d}=n,{element:u,padding:f=0}=Jt(e,n)||{};if(u==null)return{};const p=ni(f),_={x:t,y:o},c=To(r),h=Do(c),g=await s.getDimensions(u),m=c==="y",b=m?"top":"left",w=m?"bottom":"right",C=m?"clientHeight":"clientWidth",S=i.reference[h]+i.reference[c]-_[c]-i.floating[h],k=_[c]-i.reference[c],$=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let I=$?$[C]:0;(!I||!await(s.isElement==null?void 0:s.isElement($)))&&(I=l.floating[C]||i.floating[h]);const F=S/2-k/2,L=I/2-g[h]/2-1,N=Lt(p[b],L),D=Lt(p[w],L),V=N,T=I-g[h]-D,y=I/2-g[h]/2+F,E=Lo(V,y,T),z=!d.arrow&&en(r)!=null&&y!==E&&i.reference[h]/2-(y<V?N:D)-g[h]/2<0,A=z?y<V?y-V:y-T:0;return{[c]:_[c]+A,data:{[c]:E,centerOffset:y-E-A,...z&&{alignmentOffset:A}},reset:z}}}),Kl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:l,platform:d,elements:u}=n,{mainAxis:f=!0,crossAxis:p=!0,fallbackPlacements:_,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=Jt(e,n);if((t=i.arrow)!=null&&t.alignmentOffset)return{};const b=Dt(r),w=It(l),C=Dt(l)===l,S=await(d.isRTL==null?void 0:d.isRTL(u.floating)),k=_||(C||!g?[qn(l)]:al(l)),$=h!=="none";!_&&$&&k.push(...ul(l,g,h,S));const I=[l,...k],F=await Ko(n,m),L=[];let N=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&L.push(F[b]),p){const y=sl(r,s,S);L.push(F[y[0]],F[y[1]])}if(N=[...N,{placement:r,overflows:L}],!L.every(y=>y<=0)){var D,V;const y=(((D=i.flip)==null?void 0:D.index)||0)+1,E=I[y];if(E&&(!(p==="alignment"?w!==It(E):!1)||N.every(x=>It(x.placement)===w?x.overflows[0]>0:!0)))return{data:{index:y,overflows:N},reset:{placement:E}};let z=(V=N.filter(A=>A.overflows[0]<=0).sort((A,x)=>A.overflows[1]-x.overflows[1])[0])==null?void 0:V.placement;if(!z)switch(c){case"bestFit":{var T;const A=(T=N.filter(x=>{if($){const P=It(x.placement);return P===w||P==="y"}return!0}).map(x=>[x.placement,x.overflows.filter(P=>P>0).reduce((P,O)=>P+O,0)]).sort((x,P)=>x[1]-P[1])[0])==null?void 0:T[0];A&&(z=A);break}case"initialPlacement":z=l;break}if(r!==z)return{reset:{placement:z}}}return{}}}},Ul=new Set(["left","top"]);async function Yl(e,n){const{placement:t,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Dt(t),l=en(t),d=It(t)==="y",u=Ul.has(s)?-1:1,f=i&&d?-1:1,p=Jt(n,e);let{mainAxis:_,crossAxis:c,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*f,y:_*u}:{x:_*u,y:c*f}}const Xl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var t,o;const{x:r,y:i,placement:s,middlewareData:l}=n,d=await Yl(n,e);return s===((t=l.offset)==null?void 0:t.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:s}}}}},Zl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:m=>{let{x:b,y:w}=m;return{x:b,y:w}}},...d}=Jt(e,n),u={x:t,y:o},f=await Ko(n,d),p=It(Dt(r)),_=Jr(p);let c=u[_],h=u[p];if(i){const m=_==="y"?"top":"left",b=_==="y"?"bottom":"right",w=c+f[m],C=c-f[b];c=Lo(w,c,C)}if(s){const m=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=h+f[m],C=h-f[b];h=Lo(w,h,C)}const g=l.fn({...n,[_]:c,[p]:h});return{...g,data:{x:g.x-t,y:g.y-o,enabled:{[_]:i,[p]:s}}}}}},Ql=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var t,o;const{placement:r,rects:i,platform:s,elements:l}=n,{apply:d=()=>{},...u}=Jt(e,n),f=await Ko(n,u),p=Dt(r),_=en(r),c=It(r)==="y",{width:h,height:g}=i.floating;let m,b;p==="top"||p==="bottom"?(m=p,b=_===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(b=p,m=_==="end"?"top":"bottom");const w=g-f.top-f.bottom,C=h-f.left-f.right,S=Lt(g-f[m],w),k=Lt(h-f[b],C),$=!n.middlewareData.shift;let I=S,F=k;if((t=n.middlewareData.shift)!=null&&t.enabled.x&&(F=C),(o=n.middlewareData.shift)!=null&&o.enabled.y&&(I=w),$&&!_){const N=dt(f.left,0),D=dt(f.right,0),V=dt(f.top,0),T=dt(f.bottom,0);c?F=h-2*(N!==0||D!==0?N+D:dt(f.left,f.right)):I=g-2*(V!==0||T!==0?V+T:dt(f.top,f.bottom))}await d({...n,availableWidth:F,availableHeight:I});const L=await s.getDimensions(l.floating);return h!==L.width||g!==L.height?{reset:{rects:!0}}:{}}}};function $i(e){const n=ct(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=Ve(e),i=r?e.offsetWidth:t,s=r?e.offsetHeight:o,l=Vn(t)!==i||Vn(o)!==s;return l&&(t=i,o=s),{width:t,height:o,$:l}}function Uo(e){return Pe(e)?e:e.contextElement}function nn(e){const n=Uo(e);if(!Ve(n))return yt(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=$i(n);let s=(i?Vn(t.width):t.width)/o,l=(i?Vn(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Jl=yt(0);function ki(e){const n=at(e);return!On()||!n.visualViewport?Jl:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function ec(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==at(e)?!1:n}function Gt(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Uo(e);let s=yt(1);n&&(o?Pe(o)&&(s=nn(o)):s=nn(e));const l=ec(i,t,o)?ki(i):yt(0);let d=(r.left+l.x)/s.x,u=(r.top+l.y)/s.y,f=r.width/s.x,p=r.height/s.y;if(i){const _=at(i),c=o&&Pe(o)?at(o):o;let h=_,g=Po(h);for(;g&&o&&c!==h;){const m=nn(g),b=g.getBoundingClientRect(),w=ct(g),C=b.left+(g.clientLeft+parseFloat(w.paddingLeft))*m.x,S=b.top+(g.clientTop+parseFloat(w.paddingTop))*m.y;d*=m.x,u*=m.y,f*=m.x,p*=m.y,d+=C,u+=S,h=at(g),g=Po(h)}}return jn({width:f,height:p,x:d,y:u})}function Yn(e,n){const t=zn(e).scrollLeft;return n?n.left+t:Gt(wt(e)).left+t}function Ii(e,n){const t=e.getBoundingClientRect(),o=t.left+n.scrollLeft-Yn(e,t),r=t.top+n.scrollTop;return{x:o,y:r}}function tc(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=wt(o),l=n?Tn(n.floating):!1;if(o===s||l&&i)return t;let d={scrollLeft:0,scrollTop:0},u=yt(1);const f=yt(0),p=Ve(o);if((p||!p&&!i)&&((At(o)!=="body"||_n(s))&&(d=zn(o)),Ve(o))){const c=Gt(o);u=nn(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const _=s&&!p&&!i?Ii(s,d):yt(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-d.scrollLeft*u.x+f.x+_.x,y:t.y*u.y-d.scrollTop*u.y+f.y+_.y}}function nc(e){return Array.from(e.getClientRects())}function oc(e){const n=wt(e),t=zn(e),o=e.ownerDocument.body,r=dt(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=dt(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let s=-t.scrollLeft+Yn(e);const l=-t.scrollTop;return ct(o).direction==="rtl"&&(s+=dt(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Ei=25;function rc(e,n){const t=at(e),o=wt(e),r=t.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,d=0;if(r){i=r.width,s=r.height;const f=On();(!f||f&&n==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=Yn(o);if(u<=0){const f=o.ownerDocument,p=f.body,_=getComputedStyle(p),c=f.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,h=Math.abs(o.clientWidth-p.clientWidth-c);h<=Ei&&(i-=h)}else u<=Ei&&(i+=u);return{width:i,height:s,x:l,y:d}}const ic=new Set(["absolute","fixed"]);function sc(e,n){const t=Gt(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=Ve(e)?nn(e):yt(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:s,height:l,x:d,y:u}}function Mi(e,n,t){let o;if(n==="viewport")o=rc(e,t);else if(n==="document")o=oc(wt(e));else if(Pe(n))o=sc(n,t);else{const r=ki(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return jn(o)}function Ni(e,n){const t=kt(e);return t===n||!Pe(t)||$t(t)?!1:ct(t).position==="fixed"||Ni(t,n)}function ac(e,n){const t=n.get(e);if(t)return t;let o=Pt(e,[],!1).filter(l=>Pe(l)&&At(l)!=="body"),r=null;const i=ct(e).position==="fixed";let s=i?kt(e):e;for(;Pe(s)&&!$t(s);){const l=ct(s),d=Ao(s);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&ic.has(r.position)||_n(s)&&!d&&Ni(e,s))?o=o.filter(f=>f!==s):r=l,s=kt(s)}return n.set(e,o),o}function lc(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const s=[...t==="clippingAncestors"?Tn(n)?[]:ac(n,this._c):[].concat(t),o],l=s[0],d=s.reduce((u,f)=>{const p=Mi(n,f,r);return u.top=dt(p.top,u.top),u.right=Lt(p.right,u.right),u.bottom=Lt(p.bottom,u.bottom),u.left=dt(p.left,u.left),u},Mi(n,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function cc(e){const{width:n,height:t}=$i(e);return{width:n,height:t}}function dc(e,n,t){const o=Ve(n),r=wt(n),i=t==="fixed",s=Gt(e,!0,i,n);let l={scrollLeft:0,scrollTop:0};const d=yt(0);function u(){d.x=Yn(r)}if(o||!o&&!i)if((At(n)!=="body"||_n(r))&&(l=zn(n)),o){const c=Gt(n,!0,i,n);d.x=c.x+n.clientLeft,d.y=c.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?Ii(r,l):yt(0),p=s.left+l.scrollLeft-d.x-f.x,_=s.top+l.scrollTop-d.y-f.y;return{x:p,y:_,width:s.width,height:s.height}}function Yo(e){return ct(e).position==="static"}function Fi(e,n){if(!Ve(e)||ct(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return wt(e)===t&&(t=t.ownerDocument.body),t}function Ai(e,n){const t=at(e);if(Tn(e))return t;if(!Ve(e)){let r=kt(e);for(;r&&!$t(r);){if(Pe(r)&&!Yo(r))return r;r=kt(r)}return t}let o=Fi(e,n);for(;o&&Xa(o)&&Yo(o);)o=Fi(o,n);return o&&$t(o)&&Yo(o)&&!Ao(o)?t:o||tl(e)||t}const uc=async function(e){const n=this.getOffsetParent||Ai,t=this.getDimensions,o=await t(e.floating);return{reference:dc(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function fc(e){return ct(e).direction==="rtl"}const _c={convertOffsetParentRelativeRectToViewportRelativeRect:tc,getDocumentElement:wt,getClippingRect:lc,getOffsetParent:Ai,getElementRects:uc,getClientRects:nc,getDimensions:cc,getScale:nn,isElement:Pe,isRTL:fc};function Pi(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function gc(e,n){let t=null,o;const r=wt(e);function i(){var l;clearTimeout(o),(l=t)==null||l.disconnect(),t=null}function s(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:p,width:_,height:c}=u;if(l||n(),!_||!c)return;const h=Qt(p),g=Qt(r.clientWidth-(f+_)),m=Qt(r.clientHeight-(p+c)),b=Qt(f),C={rootMargin:-h+"px "+-g+"px "+-m+"px "+-b+"px",threshold:dt(0,Lt(1,d))||1};let S=!0;function k($){const I=$[0].intersectionRatio;if(I!==d){if(!S)return s();I?s(!1,I):o=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!Pi(u,e.getBoundingClientRect())&&s(),S=!1}try{t=new IntersectionObserver(k,{...C,root:r.ownerDocument})}catch{t=new IntersectionObserver(k,C)}t.observe(e)}return s(!0),i}function Xn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=Uo(e),f=r||i?[...u?Pt(u):[],...Pt(n)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",t,{passive:!0}),i&&b.addEventListener("resize",t)});const p=u&&l?gc(u,t):null;let _=-1,c=null;s&&(c=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&c&&(c.unobserve(n),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var C;(C=c)==null||C.observe(n)})),t()}),u&&!d&&c.observe(u),c.observe(n));let h,g=d?Gt(e):null;d&&m();function m(){const b=Gt(e);g&&!Pi(g,b)&&t(),g=b,h=requestAnimationFrame(m)}return t(),()=>{var b;f.forEach(w=>{r&&w.removeEventListener("scroll",t),i&&w.removeEventListener("resize",t)}),p?.(),(b=c)==null||b.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const pc=Xl,hc=Zl,mc=Kl,vc=Ql,Li=Rl,bc=(e,n,t)=>{const o=new Map,r={platform:_c,...t},i={...r.platform,_c:o};return Wl(e,n,{...r,platform:i})};var wc=typeof document<"u",yc=function(){},Zn=wc?v.useLayoutEffect:yc;function Qn(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,o,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!==n.length)return!1;for(o=t;o--!==0;)if(!Qn(e[o],n[o]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(o=t;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=t;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Qn(e[i],n[i]))return!1}return!0}return e!==e&&n!==n}function Di(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ti(e,n){const t=Di(e);return Math.round(n*t)/t}function Xo(e){const n=M.useRef(e);return Zn(()=>{n.current=e}),n}function xc(e){e===void 0&&(e={});const{placement:n="bottom",strategy:t="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,p]=M.useState({x:0,y:0,strategy:t,placement:n,middlewareData:{},isPositioned:!1}),[_,c]=M.useState(o);Qn(_,o)||c(o);const[h,g]=M.useState(null),[m,b]=M.useState(null),w=M.useCallback(x=>{x!==$.current&&($.current=x,g(x))},[]),C=M.useCallback(x=>{x!==I.current&&(I.current=x,b(x))},[]),S=i||h,k=s||m,$=M.useRef(null),I=M.useRef(null),F=M.useRef(f),L=d!=null,N=Xo(d),D=Xo(r),V=Xo(u),T=M.useCallback(()=>{if(!$.current||!I.current)return;const x={placement:n,strategy:t,middleware:_};D.current&&(x.platform=D.current),bc($.current,I.current,x).then(P=>{const O={...P,isPositioned:V.current!==!1};y.current&&!Qn(F.current,O)&&(F.current=O,Io.flushSync(()=>{p(O)}))})},[_,n,t,D,V]);Zn(()=>{u===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(x=>({...x,isPositioned:!1})))},[u]);const y=M.useRef(!1);Zn(()=>(y.current=!0,()=>{y.current=!1}),[]),Zn(()=>{if(S&&($.current=S),k&&(I.current=k),S&&k){if(N.current)return N.current(S,k,T);T()}},[S,k,T,N,L]);const E=M.useMemo(()=>({reference:$,floating:I,setReference:w,setFloating:C}),[w,C]),z=M.useMemo(()=>({reference:S,floating:k}),[S,k]),A=M.useMemo(()=>{const x={position:t,left:0,top:0};if(!z.floating)return x;const P=Ti(z.floating,f.x),O=Ti(z.floating,f.y);return l?{...x,transform:"translate("+P+"px, "+O+"px)",...Di(z.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:P,top:O}},[t,l,z.floating,f.x,f.y]);return M.useMemo(()=>({...f,update:T,refs:E,elements:z,floatingStyles:A}),[f,T,E,z,A])}const Cc=e=>{function n(t){return{}.hasOwnProperty.call(t,"current")}return{name:"arrow",options:e,fn(t){const{element:o,padding:r}=typeof e=="function"?e(t):e;return o&&n(o)?o.current!=null?Li({element:o.current,padding:r}).fn(t):{}:o?Li({element:o,padding:r}).fn(t):{}}}},Jn=(e,n)=>({...pc(e),options:[e,n]}),eo=(e,n)=>({...hc(e),options:[e,n]}),to=(e,n)=>({...mc(e),options:[e,n]}),Oi=(e,n)=>({...vc(e),options:[e,n]}),Sc=(e,n)=>({...Cc(e),options:[e,n]});function zi(e){const n=M.useRef(void 0),t=M.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const s=i,l=s(o);return typeof l=="function"?l:()=>{s(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return M.useMemo(()=>e.every(o=>o==null)?null:o=>{n.current&&(n.current(),n.current=void 0),o!=null&&(n.current=t(o))},e)}const $c="data-floating-ui-focusable",Vi="active",qi="selected",bn="ArrowLeft",wn="ArrowRight",ji="ArrowUp",no="ArrowDown",kc={...M};let Bi=!1,Ic=0;const Hi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ic++;function Ec(){const[e,n]=M.useState(()=>Bi?Hi():void 0);return Le(()=>{e==null&&n(Hi())},[]),M.useEffect(()=>{Bi=!0},[]),e}const yn=kc.useId||Ec;let xn;process.env.NODE_ENV!=="production"&&(xn=new Set);function oo(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=xn)!=null&&e.has(r))){var i;(i=xn)==null||i.add(r),console.warn(r)}}function Mc(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];const r="Floating UI: "+t.join(" ");if(!((e=xn)!=null&&e.has(r))){var i;(i=xn)==null||i.add(r),console.error(r)}}const Nc=M.forwardRef(function(n,t){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:s}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:p,stroke:_,d:c,style:{transform:h,...g}={},...m}=n;process.env.NODE_ENV!=="production"&&(t||oo("The `ref` prop is required for `FloatingArrow`."));const b=yn(),[w,C]=M.useState(!1);if(Le(()=>{if(!r)return;ct(r).direction==="rtl"&&C(!0)},[r]),!r)return null;const[S,k]=o.split("-"),$=S==="top"||S==="bottom";let I=p;($&&s!=null&&s.x||!$&&s!=null&&s.y)&&(I=null);const F=f*2,L=F/2,N=l/2*(u/-8+1),D=d/2*u/4,V=!!c,T=I&&k==="end"?"bottom":"top";let y=I&&k==="end"?"right":"left";I&&w&&(y=k==="end"?"left":"right");const E=i?.x!=null?I||i.x:"",z=i?.y!=null?I||i.y:"",A=c||"M0,0"+(" H"+l)+(" L"+(l-N)+","+(d-D))+(" Q"+l/2+","+d+" "+N+","+(d-D))+" Z",x={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[S];return a.jsxs("svg",{...m,"aria-hidden":!0,ref:t,width:V?l:l+F,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[y]:E,[T]:z,[S]:$||V?"100%":"calc(100% - "+F/2+"px)",transform:[x,h].filter(P=>!!P).join(" "),...g},children:[F>0&&a.jsx("path",{clipPath:"url(#"+b+")",fill:"none",stroke:_,strokeWidth:F+(c?0:1),d:A}),a.jsx("path",{stroke:F&&!c?m.fill:"none",d:A}),a.jsx("clipPath",{id:b,children:a.jsx("rect",{x:-L,y:L*(V?-1:1),width:l+F,height:l})})]})});function Gi(){const e=new Map;return{emit(n,t){var o;(o=e.get(n))==null||o.forEach(r=>r(t))},on(n,t){e.has(n)||e.set(n,new Set),e.get(n).add(t)},off(n,t){var o;(o=e.get(n))==null||o.delete(t)}}}const Wi=M.createContext(null),Ri=M.createContext(null),on=()=>{var e;return((e=M.useContext(Wi))==null?void 0:e.id)||null},Wt=()=>M.useContext(Ri);function Ki(e){const n=yn(),t=Wt(),r=on();return Le(()=>{if(!n)return;const i={id:n,parentId:r};return t?.addNode(i),()=>{t?.removeNode(i)}},[t,n,r]),n}function Ui(e){const{children:n,id:t}=e,o=on();return a.jsx(Wi.Provider,{value:M.useMemo(()=>({id:t,parentId:o}),[t,o]),children:n})}function Fc(e){const{children:n}=e,t=M.useRef([]),o=M.useCallback(s=>{t.current=[...t.current,s]},[]),r=M.useCallback(s=>{t.current=t.current.filter(l=>l!==s)},[]),[i]=M.useState(()=>Gi());return a.jsx(Ri.Provider,{value:M.useMemo(()=>({nodesRef:t,addNode:o,removeNode:r,events:i}),[o,r,i]),children:n})}function Rt(e){return"data-floating-ui-"+e}function Xe(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const Yi=Rt("safe-polygon");function Zo(e,n,t){if(t&&!pn(t))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[n]}return e?.[n]}function Qo(e){return typeof e=="function"?e():e}function Jo(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,events:i,elements:s}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:f=!1,restMs:p=0,move:_=!0}=n,c=Wt(),h=on(),g=Ge(u),m=Ge(d),b=Ge(t),w=Ge(p),C=M.useRef(),S=M.useRef(-1),k=M.useRef(),$=M.useRef(-1),I=M.useRef(!0),F=M.useRef(!1),L=M.useRef(()=>{}),N=M.useRef(!1),D=qe(()=>{var A;const x=(A=r.current.openEvent)==null?void 0:A.type;return x?.includes("mouse")&&x!=="mousedown"});M.useEffect(()=>{if(!l)return;function A(x){let{open:P}=x;P||(Xe(S),Xe($),I.current=!0,N.current=!1)}return i.on("openchange",A),()=>{i.off("openchange",A)}},[l,i]),M.useEffect(()=>{if(!l||!g.current||!t)return;function A(P){D()&&o(!1,P,"hover")}const x=Ue(s.floating).documentElement;return x.addEventListener("mouseleave",A),()=>{x.removeEventListener("mouseleave",A)}},[s.floating,t,o,l,g,D]);const V=M.useCallback(function(A,x,P){x===void 0&&(x=!0),P===void 0&&(P="hover");const O=Zo(m.current,"close",C.current);O&&!k.current?(Xe(S),S.current=window.setTimeout(()=>o(!1,A,P),O)):x&&(Xe(S),o(!1,A,P))},[m,o]),T=qe(()=>{L.current(),k.current=void 0}),y=qe(()=>{if(F.current){const A=Ue(s.floating).body;A.style.pointerEvents="",A.removeAttribute(Yi),F.current=!1}}),E=qe(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);M.useEffect(()=>{if(!l)return;function A(j){if(Xe(S),I.current=!1,f&&!pn(C.current)||Qo(w.current)>0&&!Zo(m.current,"open"))return;const q=Zo(m.current,"open",C.current);q?S.current=window.setTimeout(()=>{b.current||o(!0,j,"hover")},q):t||o(!0,j,"hover")}function x(j){if(E()){y();return}L.current();const q=Ue(s.floating);if(Xe($),N.current=!1,g.current&&r.current.floatingContext){t||Xe(S),k.current=g.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){y(),T(),E()||V(j,!0,"safe-polygon")}});const G=k.current;q.addEventListener("mousemove",G),L.current=()=>{q.removeEventListener("mousemove",G)};return}(C.current==="touch"?!Ke(s.floating,j.relatedTarget):!0)&&V(j)}function P(j){E()||r.current.floatingContext&&(g.current==null||g.current({...r.current.floatingContext,tree:c,x:j.clientX,y:j.clientY,onClose(){y(),T(),E()||V(j)}})(j))}function O(){Xe(S)}function B(j){E()||V(j,!1)}if(Pe(s.domReference)){const j=s.domReference,q=s.floating;return t&&j.addEventListener("mouseleave",P),_&&j.addEventListener("mousemove",A,{once:!0}),j.addEventListener("mouseenter",A),j.addEventListener("mouseleave",x),q&&(q.addEventListener("mouseleave",P),q.addEventListener("mouseenter",O),q.addEventListener("mouseleave",B)),()=>{t&&j.removeEventListener("mouseleave",P),_&&j.removeEventListener("mousemove",A),j.removeEventListener("mouseenter",A),j.removeEventListener("mouseleave",x),q&&(q.removeEventListener("mouseleave",P),q.removeEventListener("mouseenter",O),q.removeEventListener("mouseleave",B))}}},[s,l,e,f,_,V,T,y,o,t,b,c,m,g,r,E,w]),Le(()=>{var A;if(l&&t&&(A=g.current)!=null&&(A=A.__options)!=null&&A.blockPointerEvents&&D()){F.current=!0;const P=s.floating;if(Pe(s.domReference)&&P){var x;const O=Ue(s.floating).body;O.setAttribute(Yi,"");const B=s.domReference,j=c==null||(x=c.nodesRef.current.find(q=>q.id===h))==null||(x=x.context)==null?void 0:x.elements.floating;return j&&(j.style.pointerEvents=""),O.style.pointerEvents="none",B.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{O.style.pointerEvents="",B.style.pointerEvents="",P.style.pointerEvents=""}}}},[l,t,h,s,c,g,D]),Le(()=>{t||(C.current=void 0,N.current=!1,T(),y())},[t,T,y]),M.useEffect(()=>()=>{T(),Xe(S),Xe($),y()},[l,s.domReference,T,y]);const z=M.useMemo(()=>{function A(x){C.current=x.pointerType}return{onPointerDown:A,onPointerEnter:A,onMouseMove(x){const{nativeEvent:P}=x;function O(){!I.current&&!b.current&&o(!0,P,"hover")}f&&!pn(C.current)||t||Qo(w.current)===0||N.current&&x.movementX**2+x.movementY**2<2||(Xe($),C.current==="touch"?O():(N.current=!0,$.current=window.setTimeout(O,Qo(w.current))))}}},[f,o,t,b,w]);return M.useMemo(()=>l?{reference:z}:{},[l,z])}let Xi=0;function Kt(e,n){n===void 0&&(n={});const{preventScroll:t=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Xi);const i=()=>e?.focus({preventScroll:t});r?i():Xi=requestAnimationFrame(i)}function er(e,n){if(!e||!n)return!1;const t=n.getRootNode==null?void 0:n.getRootNode();if(e.contains(n))return!0;if(t&&Dn(t)){let o=n;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ac(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pc(e){return e?.ownerDocument||document}const rn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Zi(e){return e==="inert"?rn.inert:e==="aria-hidden"?rn["aria-hidden"]:rn.none}let ro=new WeakSet,io={},tr=0;const Lc=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qi=e=>e&&(e.host||Qi(e.parentNode)),Dc=(e,n)=>n.map(t=>{if(e.contains(t))return t;const o=Qi(t);return e.contains(o)?o:null}).filter(t=>t!=null);function Tc(e,n,t,o){const r="data-floating-ui-inert",i=o?"inert":t?"aria-hidden":null,s=Dc(n,e),l=new Set,d=new Set(s),u=[];io[r]||(io[r]=new WeakMap);const f=io[r];s.forEach(p),_(n),l.clear();function p(c){!c||l.has(c)||(l.add(c),c.parentNode&&p(c.parentNode))}function _(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(At(h)!=="script")if(l.has(h))_(h);else{const g=i?h.getAttribute(i):null,m=g!==null&&g!=="false",b=Zi(i),w=(b.get(h)||0)+1,C=(f.get(h)||0)+1;b.set(h,w),f.set(h,C),u.push(h),w===1&&m&&ro.add(h),C===1&&h.setAttribute(r,""),!m&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return tr++,()=>{u.forEach(c=>{const h=Zi(i),m=(h.get(c)||0)-1,b=(f.get(c)||0)-1;h.set(c,m),f.set(c,b),m||(!ro.has(c)&&i&&c.removeAttribute(i),ro.delete(c)),b||c.removeAttribute(r)}),tr--,tr||(rn.inert=new WeakMap,rn["aria-hidden"]=new WeakMap,rn.none=new WeakMap,ro=new WeakSet,io={})}}function Ji(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);const o=Pc(e[0]).body;return Tc(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,n,t)}const so={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},ao=M.forwardRef(function(n,t){const[o,r]=M.useState();Le(()=>{_i()&&r("button")},[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Rt("focus-guard")]:"",style:so};return a.jsx("span",{...n,...i})}),es=M.createContext(null),ts=Rt("portal");function Oc(e){e===void 0&&(e={});const{id:n,root:t}=e,o=yn(),r=ns(),[i,s]=M.useState(null),l=M.useRef(null);return Le(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Le(()=>{if(!o||l.current)return;const d=n?document.getElementById(n):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(ts,""),d.appendChild(u),l.current=u,s(u)},[n,o]),Le(()=>{if(t===null||!o||l.current)return;let d=t||r?.portalNode;d&&!Fo(d)&&(d=d.current),d=d||document.body;let u=null;n&&(u=document.createElement("div"),u.id=n,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(ts,""),d=u||d,d.appendChild(f),l.current=f,s(f)},[n,t,o,r]),i}function lo(e){const{children:n,id:t,root:o,preserveTabOrder:r=!0}=e,i=Oc({id:t,root:o}),[s,l]=M.useState(null),d=M.useRef(null),u=M.useRef(null),f=M.useRef(null),p=M.useRef(null),_=s?.modal,c=s?.open,h=!!s&&!s.modal&&s.open&&r&&!!(o||i);return M.useEffect(()=>{if(!i||!r||_)return;function g(m){i&&vn(m)&&(m.type==="focusin"?Ci:Gl)(i)}return i.addEventListener("focusin",g,!0),i.addEventListener("focusout",g,!0),()=>{i.removeEventListener("focusin",g,!0),i.removeEventListener("focusout",g,!0)}},[i,r,_]),M.useEffect(()=>{i&&(c||Ci(i))},[c,i]),a.jsxs(es.Provider,{value:M.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:p,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&a.jsx(ao,{"data-type":"outside",ref:d,onFocus:g=>{if(vn(g,i)){var m;(m=f.current)==null||m.focus()}else{const b=s?s.domReference:null,w=xi(b);w?.focus()}}}),h&&i&&a.jsx("span",{"aria-owns":i.id,style:so}),i&&Io.createPortal(n,i),h&&i&&a.jsx(ao,{"data-type":"outside",ref:u,onFocus:g=>{if(vn(g,i)){var m;(m=p.current)==null||m.focus()}else{const b=s?s.domReference:null,w=yi(b);w?.focus(),s?.closeOnFocusOut&&s?.onOpenChange(!1,g.nativeEvent,"focus-out")}}})]})}const ns=()=>M.useContext(es);function os(e){return M.useMemo(()=>n=>{e.forEach(t=>{t&&(t.current=n)})},e)}const zc=20;let Tt=[];function nr(){Tt=Tt.filter(e=>e.isConnected)}function Vc(e){nr(),e&&At(e)!=="body"&&(Tt.push(e),Tt.length>zc&&(Tt=Tt.slice(-20)))}function rs(){return nr(),Tt[Tt.length-1]}function qc(e){const n=mn();return di(e,n)?e:Wn(e,n)[0]||e}function is(e,n){var t;if(!n.current.includes("floating")&&!((t=e.getAttribute("role"))!=null&&t.includes("dialog")))return;const o=mn(),i=Il(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return di(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),s=e.getAttribute("tabindex");n.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const jc=M.forwardRef(function(n,t){return a.jsx("button",{...n,type:"button",ref:t,tabIndex:-1,style:so})});function or(e){const{context:n,children:t,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0,outsideElementsInert:_=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:g,events:m,dataRef:b,elements:{domReference:w,floating:C}}=n,S=qe(()=>{var U;return(U=b.current.floatingContext)==null?void 0:U.nodeId}),k=qe(c),$=typeof s=="number"&&s<0,I=Wo(w)&&$,F=Lc(),L=F?i:!0,N=!L||F&&_,D=Ge(r),V=Ge(s),T=Ge(l),y=Wt(),E=ns(),z=M.useRef(null),A=M.useRef(null),x=M.useRef(!1),P=M.useRef(!1),O=M.useRef(-1),B=M.useRef(-1),j=E!=null,q=Rn(C),J=qe(function(U){return U===void 0&&(U=q),U?Wn(U,mn()):[]}),G=qe(U=>{const ne=J(U);return D.current.map(ee=>w&&ee==="reference"?w:q&&ee==="floating"?q:ne).filter(Boolean).flat()});M.useEffect(()=>{if(o||!u)return;function U(ee){if(ee.key==="Tab"){Ke(q,xt(Ue(q)))&&J().length===0&&!I&&Ye(ee);const pe=G(),_e=Et(ee);D.current[0]==="reference"&&_e===w&&(Ye(ee),ee.shiftKey?Kt(pe[pe.length-1]):Kt(pe[1])),D.current[1]==="floating"&&_e===q&&ee.shiftKey&&(Ye(ee),Kt(pe[0]))}}const ne=Ue(q);return ne.addEventListener("keydown",U),()=>{ne.removeEventListener("keydown",U)}},[o,w,q,u,D,I,J,G]),M.useEffect(()=>{if(o||!C)return;function U(ne){const ee=Et(ne),_e=J().indexOf(ee);_e!==-1&&(O.current=_e)}return C.addEventListener("focusin",U),()=>{C.removeEventListener("focusin",U)}},[o,C,J]),M.useEffect(()=>{if(o||!p)return;function U(){P.current=!0,setTimeout(()=>{P.current=!1})}function ne(_e){const Z=_e.relatedTarget,de=_e.currentTarget,ye=Et(_e);queueMicrotask(()=>{const ue=S(),Ce=!(Ke(w,Z)||Ke(C,Z)||Ke(Z,C)||Ke(E?.portalNode,Z)||Z!=null&&Z.hasAttribute(Rt("focus-guard"))||y&&(Ht(y.nodesRef.current,ue).find(W=>{var R,H;return Ke((R=W.context)==null?void 0:R.elements.floating,Z)||Ke((H=W.context)==null?void 0:H.elements.domReference,Z)})||hi(y.nodesRef.current,ue).find(W=>{var R,H,he;return[(R=W.context)==null?void 0:R.elements.floating,Rn((H=W.context)==null?void 0:H.elements.floating)].includes(Z)||((he=W.context)==null?void 0:he.elements.domReference)===Z})));if(de===w&&q&&is(q,D),d&&de!==w&&!(ye!=null&&ye.isConnected)&&xt(Ue(q))===Ue(q).body){Ve(q)&&q.focus();const W=O.current,R=J(),H=R[W]||R[R.length-1]||q;Ve(H)&&H.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(I||!u)&&Z&&Ce&&!P.current&&Z!==rs()&&(x.current=!0,g(!1,_e,"focus-out"))})}const ee=!!(!y&&E);function pe(){Xe(B),b.current.insideReactTree=!0,B.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}if(C&&Ve(w))return w.addEventListener("focusout",ne),w.addEventListener("pointerdown",U),C.addEventListener("focusout",ne),ee&&C.addEventListener("focusout",pe,!0),()=>{w.removeEventListener("focusout",ne),w.removeEventListener("pointerdown",U),C.removeEventListener("focusout",ne),ee&&C.removeEventListener("focusout",pe,!0)}},[o,w,C,q,u,y,E,g,p,d,J,I,S,D,b]);const le=M.useRef(null),oe=M.useRef(null),re=os([le,E?.beforeInsideRef]),ce=os([oe,E?.afterInsideRef]);M.useEffect(()=>{var U,ne;if(o||!C)return;const ee=Array.from((E==null||(U=E.portalNode)==null?void 0:U.querySelectorAll("["+Rt("portal")+"]"))||[]),_e=(ne=(y?hi(y.nodesRef.current,S()):[]).find(ye=>{var ue;return Wo(((ue=ye.context)==null?void 0:ue.elements.domReference)||null)}))==null||(ne=ne.context)==null?void 0:ne.elements.domReference,Z=[C,_e,...ee,...k(),z.current,A.current,le.current,oe.current,E?.beforeOutsideRef.current,E?.afterOutsideRef.current,D.current.includes("reference")||I?w:null].filter(ye=>ye!=null),de=u||I?Ji(Z,!N,N):Ji(Z);return()=>{de()}},[o,w,C,u,D,E,I,L,N,y,S,k]),Le(()=>{if(o||!Ve(q))return;const U=Ue(q),ne=xt(U);queueMicrotask(()=>{const ee=G(q),pe=V.current,_e=(typeof pe=="number"?ee[pe]:pe.current)||q,Z=Ke(q,ne);!$&&!Z&&h&&Kt(_e,{preventScroll:_e===q})})},[o,h,q,$,G,V]),Le(()=>{if(o||!q)return;const U=Ue(q),ne=xt(U);Vc(ne);function ee(Z){let{reason:de,event:ye,nested:ue}=Z;if(["hover","safe-polygon"].includes(de)&&ye.type==="mouseleave"&&(x.current=!0),de==="outside-press")if(ue)x.current=!1;else if(mi(ye)||vi(ye))x.current=!1;else{let Ce=!1;document.createElement("div").focus({get preventScroll(){return Ce=!0,!1}}),Ce?x.current=!1:x.current=!0}}m.on("openchange",ee);const pe=U.createElement("span");pe.setAttribute("tabindex","-1"),pe.setAttribute("aria-hidden","true"),Object.assign(pe.style,so),j&&w&&w.insertAdjacentElement("afterend",pe);function _e(){if(typeof T.current=="boolean"){const Z=w||rs();return Z&&Z.isConnected?Z:pe}return T.current.current||pe}return()=>{m.off("openchange",ee);const Z=xt(U),de=Ke(C,Z)||y&&Ht(y.nodesRef.current,S(),!1).some(ue=>{var Ce;return Ke((Ce=ue.context)==null?void 0:Ce.elements.floating,Z)}),ye=_e();queueMicrotask(()=>{const ue=qc(ye);T.current&&!x.current&&Ve(ue)&&(!(ue!==Z&&Z!==U.body)||de)&&ue.focus({preventScroll:!0}),pe.remove()})}},[o,C,q,T,b,m,y,j,w,S]),M.useEffect(()=>(queueMicrotask(()=>{x.current=!1}),()=>{queueMicrotask(nr)}),[o]),Le(()=>{if(!o&&E)return E.setFocusManagerState({modal:u,closeOnFocusOut:p,open:h,onOpenChange:g,domReference:w}),()=>{E.setFocusManagerState(null)}},[o,E,u,h,g,p,w]),Le(()=>{o||q&&is(q,D)},[o,q,D]);function ie(U){return o||!f||!u?null:a.jsx(jc,{ref:U==="start"?z:A,onClick:ne=>g(!1,ne.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const me=!o&&L&&(u?!I:!0)&&(j||u);return a.jsxs(a.Fragment,{children:[me&&a.jsx(ao,{"data-type":"inside",ref:re,onFocus:U=>{if(u){const ee=G();Kt(r[0]==="reference"?ee[0]:ee[ee.length-1])}else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(x.current=!1,vn(U,E.portalNode)){const ee=yi(w);ee?.focus()}else{var ne;(ne=E.beforeOutsideRef.current)==null||ne.focus()}}}),!I&&ie("start"),t,ie("end"),me&&a.jsx(ao,{"data-type":"inside",ref:ce,onFocus:U=>{if(u)Kt(G()[0]);else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(p&&(x.current=!0),vn(U,E.portalNode)){const ee=xi(w);ee?.focus()}else{var ne;(ne=E.afterOutsideRef.current)==null||ne.focus()}}})]})}function ss(e){return Ve(e.target)&&e.target.tagName==="BUTTON"}function Bc(e){return Ve(e.target)&&e.target.tagName==="A"}function as(e){return Go(e)}function ls(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:s=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:p=!0}=n,_=M.useRef(),c=M.useRef(!1),h=M.useMemo(()=>({onPointerDown(g){_.current=g.pointerType},onMouseDown(g){const m=_.current;g.button===0&&l!=="click"&&(pn(m,!0)&&u||(t&&d&&(!(r.current.openEvent&&p)||r.current.openEvent.type==="mousedown")?o(!1,g.nativeEvent,"click"):(g.preventDefault(),o(!0,g.nativeEvent,"click"))))},onClick(g){const m=_.current;if(l==="mousedown"&&_.current){_.current=void 0;return}pn(m,!0)&&u||(t&&d&&(!(r.current.openEvent&&p)||r.current.openEvent.type==="click")?o(!1,g.nativeEvent,"click"):o(!0,g.nativeEvent,"click"))},onKeyDown(g){_.current=void 0,!(g.defaultPrevented||!f||ss(g))&&(g.key===" "&&!as(i)&&(g.preventDefault(),c.current=!0),!Bc(g)&&g.key==="Enter"&&o(!(t&&d),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!f||ss(g)||as(i)||g.key===" "&&c.current&&(c.current=!1,o(!(t&&d),g.nativeEvent,"click"))}}),[r,i,l,u,f,o,t,p,d]);return M.useMemo(()=>s?{reference:h}:{},[s,h])}const Hc={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Gc={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},cs=e=>{var n,t;return{escapeKey:typeof e=="boolean"?e:(n=e?.escapeKey)!=null?n:!1,outsidePress:typeof e=="boolean"?e:(t=e?.outsidePress)!=null?t:!0}};function co(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:p="pointerdown",ancestorScroll:_=!1,bubbles:c,capture:h}=n,g=Wt(),m=qe(typeof d=="function"?d:()=>!1),b=typeof d=="function"?m:d,w=M.useRef(!1),{escapeKey:C,outsidePress:S}=cs(c),{escapeKey:k,outsidePress:$}=cs(h),I=M.useRef(!1),F=qe(y=>{var E;if(!t||!s||!l||y.key!=="Escape"||I.current)return;const z=(E=i.current.floatingContext)==null?void 0:E.nodeId,A=g?Ht(g.nodesRef.current,z):[];if(!C&&(y.stopPropagation(),A.length>0)){let x=!0;if(A.forEach(P=>{var O;if((O=P.context)!=null&&O.open&&!P.context.dataRef.current.__escapeKeyBubbles){x=!1;return}}),!x)return}o(!1,Dl(y)?y.nativeEvent:y,"escape-key")}),L=qe(y=>{var E;const z=()=>{var A;F(y),(A=Et(y))==null||A.removeEventListener("keydown",z)};(E=Et(y))==null||E.addEventListener("keydown",z)}),N=qe(y=>{var E;const z=i.current.insideReactTree;i.current.insideReactTree=!1;const A=w.current;if(w.current=!1,u==="click"&&A||z||typeof b=="function"&&!b(y))return;const x=Et(y),P="["+Rt("inert")+"]",O=Ue(r.floating).querySelectorAll(P);let B=Pe(x)?x:null;for(;B&&!$t(B);){const G=kt(B);if($t(G)||!Pe(G))break;B=G}if(O.length&&Pe(x)&&!Al(x)&&!Ke(x,r.floating)&&Array.from(O).every(G=>!Ke(B,G)))return;if(Ve(x)&&T){const G=$t(x),le=ct(x),oe=/auto|scroll/,re=G||oe.test(le.overflowX),ce=G||oe.test(le.overflowY),ie=re&&x.clientWidth>0&&x.scrollWidth>x.clientWidth,me=ce&&x.clientHeight>0&&x.scrollHeight>x.clientHeight,U=le.direction==="rtl",ne=me&&(U?y.offsetX<=x.offsetWidth-x.clientWidth:y.offsetX>x.clientWidth),ee=ie&&y.offsetY>x.clientHeight;if(ne||ee)return}const j=(E=i.current.floatingContext)==null?void 0:E.nodeId,q=g&&Ht(g.nodesRef.current,j).some(G=>{var le;return Ho(y,(le=G.context)==null?void 0:le.elements.floating)});if(Ho(y,r.floating)||Ho(y,r.domReference)||q)return;const J=g?Ht(g.nodesRef.current,j):[];if(J.length>0){let G=!0;if(J.forEach(le=>{var oe;if((oe=le.context)!=null&&oe.open&&!le.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,y,"outside-press")}),D=qe(y=>{var E;const z=()=>{var A;N(y),(A=Et(y))==null||A.removeEventListener(u,z)};(E=Et(y))==null||E.addEventListener(u,z)});M.useEffect(()=>{if(!t||!s)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=S;let y=-1;function E(O){o(!1,O,"ancestor-scroll")}function z(){window.clearTimeout(y),I.current=!0}function A(){y=window.setTimeout(()=>{I.current=!1},On()?5:0)}const x=Ue(r.floating);l&&(x.addEventListener("keydown",k?L:F,k),x.addEventListener("compositionstart",z),x.addEventListener("compositionend",A)),b&&x.addEventListener(u,$?D:N,$);let P=[];return _&&(Pe(r.domReference)&&(P=Pt(r.domReference)),Pe(r.floating)&&(P=P.concat(Pt(r.floating))),!Pe(r.reference)&&r.reference&&r.reference.contextElement&&(P=P.concat(Pt(r.reference.contextElement)))),P=P.filter(O=>{var B;return O!==((B=x.defaultView)==null?void 0:B.visualViewport)}),P.forEach(O=>{O.addEventListener("scroll",E,{passive:!0})}),()=>{l&&(x.removeEventListener("keydown",k?L:F,k),x.removeEventListener("compositionstart",z),x.removeEventListener("compositionend",A)),b&&x.removeEventListener(u,$?D:N,$),P.forEach(O=>{O.removeEventListener("scroll",E)}),window.clearTimeout(y)}},[i,r,l,b,u,t,o,_,s,C,S,F,k,L,N,$,D]),M.useEffect(()=>{i.current.insideReactTree=!1},[i,b,u]);const V=M.useMemo(()=>({onKeyDown:F,...f&&{[Hc[p]]:y=>{o(!1,y.nativeEvent,"reference-press")},...p!=="click"&&{onClick(y){o(!1,y.nativeEvent,"reference-press")}}}}),[F,o,f,p]),T=M.useMemo(()=>({onKeyDown:F,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[Gc[u]]:()=>{i.current.insideReactTree=!0}}),[F,u,i]);return M.useMemo(()=>s?{reference:V,floating:T}:{},[s,V,T])}function Wc(e){const{open:n=!1,onOpenChange:t,elements:o}=e,r=yn(),i=M.useRef({}),[s]=M.useState(()=>Gi()),l=on()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Pe(c)&&Mc("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=M.useState(o.reference),f=qe((c,h,g)=>{i.current.openEvent=c?h:void 0,s.emit("openchange",{open:c,event:h,reason:g,nested:l}),t?.(c,h,g)}),p=M.useMemo(()=>({setPositionReference:u}),[]),_=M.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return M.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:_,events:s,floatingId:r,refs:p}),[n,f,_,s,r,p])}function uo(e){e===void 0&&(e={});const{nodeId:n}=e,t=Wc({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||t,r=o.elements,[i,s]=M.useState(null),[l,d]=M.useState(null),f=r?.domReference||i,p=M.useRef(null),_=Wt();Le(()=>{f&&(p.current=f)},[f]);const c=xc({...e,elements:{...r,...l&&{reference:l}}}),h=M.useCallback(C=>{const S=Pe(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;d(S),c.refs.setReference(S)},[c.refs]),g=M.useCallback(C=>{(Pe(C)||C===null)&&(p.current=C,s(C)),(Pe(c.refs.reference.current)||c.refs.reference.current===null||C!==null&&!Pe(C))&&c.refs.setReference(C)},[c.refs]),m=M.useMemo(()=>({...c.refs,setReference:g,setPositionReference:h,domReference:p}),[c.refs,g,h]),b=M.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),w=M.useMemo(()=>({...c,...o,refs:m,elements:b,nodeId:n}),[c,m,b,n,o]);return Le(()=>{o.dataRef.current.floatingContext=w;const C=_?.nodesRef.current.find(S=>S.id===n);C&&(C.context=w)}),M.useMemo(()=>({...c,context:w,refs:m,elements:b}),[c,m,b,w])}function rr(){return El()&&_i()}function Rc(e,n){n===void 0&&(n={});const{open:t,onOpenChange:o,events:r,dataRef:i,elements:s}=e,{enabled:l=!0,visibleOnly:d=!0}=n,u=M.useRef(!1),f=M.useRef(-1),p=M.useRef(!0);M.useEffect(()=>{if(!l)return;const c=at(s.domReference);function h(){!t&&Ve(s.domReference)&&s.domReference===xt(Ue(s.domReference))&&(u.current=!0)}function g(){p.current=!0}function m(){p.current=!1}return c.addEventListener("blur",h),rr()&&(c.addEventListener("keydown",g,!0),c.addEventListener("pointerdown",m,!0)),()=>{c.removeEventListener("blur",h),rr()&&(c.removeEventListener("keydown",g,!0),c.removeEventListener("pointerdown",m,!0))}},[s.domReference,t,l]),M.useEffect(()=>{if(!l)return;function c(h){let{reason:g}=h;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),M.useEffect(()=>()=>{Xe(f)},[]);const _=M.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=Et(c.nativeEvent);if(d&&Pe(h)){if(rr()&&!c.relatedTarget){if(!p.current&&!Go(h))return}else if(!Pl(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,g=c.nativeEvent,m=Pe(h)&&h.hasAttribute(Rt("focus-guard"))&&h.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var b;const w=xt(s.domReference?s.domReference.ownerDocument:document);!h&&w===s.domReference||Ke((b=i.current.floatingContext)==null?void 0:b.refs.floating.current,w)||Ke(s.domReference,w)||m||o(!1,g,"focus")})}}),[i,s.domReference,o,d]);return M.useMemo(()=>l?{reference:_}:{},[l,_])}function ir(e,n,t){const o=new Map,r=t==="item";let i=e;if(r&&e){const{[Vi]:s,[qi]:l,...d}=e;i=d}return{...t==="floating"&&{tabIndex:-1,[$c]:""},...i,...n.map(s=>{const l=s?s[t]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(d=>{let[u,f]=d;if(!(r&&[Vi,qi].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var p;(p=o.get(u))==null||p.push(f),s[u]=function(){for(var _,c=arguments.length,h=new Array(c),g=0;g<c;g++)h[g]=arguments[g];return(_=o.get(u))==null?void 0:_.map(m=>m(...h)).find(m=>m!==void 0)}}}else s[u]=f}),s),{})}}function fo(e){e===void 0&&(e=[]);const n=e.map(l=>l?.reference),t=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=M.useCallback(l=>ir(l,e,"reference"),n),i=M.useCallback(l=>ir(l,e,"floating"),t),s=M.useCallback(l=>ir(l,e,"item"),o);return M.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}const Kc="Escape";function _o(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function go(e,n){return _o(n,e===ji||e===no,e===bn||e===wn)}function sr(e,n,t){return _o(n,e===no,t?e===bn:e===wn)||e==="Enter"||e===" "||e===""}function ds(e,n,t){return _o(n,t?e===bn:e===wn,e===no)}function us(e,n,t,o){const r=t?e===wn:e===bn,i=e===ji;return n==="both"||n==="horizontal"&&o&&o>1?e===Kc:_o(n,r,i)}function ar(e,n){const{open:t,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:s,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:p=!1,loop:_=!1,nested:c=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:m="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:S="vertical",parentOrientation:k,cols:$=1,scrollItemIntoView:I=!0,virtualItemRef:F,itemSizes:L,dense:N=!1}=n;process.env.NODE_ENV!=="production"&&(p&&(_||oo("`useListNavigation` looping must be enabled to allow escaping."),g||oo("`useListNavigation` must be virtual to allow escaping.")),S==="vertical"&&$>1&&oo("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const D=Rn(r.floating),V=Ge(D),T=on(),y=Wt();Le(()=>{e.dataRef.current.orientation=S},[e,S]);const E=qe(()=>{d(x.current===-1?null:x.current)}),z=Wo(r.domReference),A=M.useRef(m),x=M.useRef(f??-1),P=M.useRef(null),O=M.useRef(!0),B=M.useRef(E),j=M.useRef(!!r.floating),q=M.useRef(t),J=M.useRef(!1),G=M.useRef(!1),le=Ge(C),oe=Ge(t),re=Ge(I),ce=Ge(f),[ie,me]=M.useState(),[U,ne]=M.useState(),ee=qe(()=>{function W(ge){if(g){var ve;(ve=ge.id)!=null&&ve.endsWith("-fui-option")&&(ge.id=i+"-"+Math.random().toString(16).slice(2,10)),me(ge.id),y?.events.emit("virtualfocus",ge),F&&(F.current=ge)}else Kt(ge,{sync:J.current,preventScroll:!0})}const R=s.current[x.current],H=G.current;R&&W(R),(J.current?ge=>ge():requestAnimationFrame)(()=>{const ge=s.current[x.current]||R;if(!ge)return;R||W(ge);const ve=re.current;ve&&_e&&(H||!O.current)&&(ge.scrollIntoView==null||ge.scrollIntoView(typeof ve=="boolean"?{block:"nearest",inline:"nearest"}:ve))})});Le(()=>{u&&(t&&r.floating?A.current&&f!=null&&(G.current=!0,x.current=f,E()):j.current&&(x.current=-1,B.current()))},[u,t,r.floating,f,E]),Le(()=>{if(u&&t&&r.floating)if(l==null){if(J.current=!1,ce.current!=null)return;if(j.current&&(x.current=-1,ee()),(!q.current||!j.current)&&A.current&&(P.current!=null||A.current===!0&&P.current==null)){let W=0;const R=()=>{s.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(R),W++):(x.current=P.current==null||sr(P.current,S,h)||c?Ro(s,le.current):bi(s,le.current),P.current=null,E())};R()}}else hn(s,l)||(x.current=l,ee(),G.current=!1)},[u,t,r.floating,l,ce,c,s,S,h,E,ee,le]),Le(()=>{var W;if(!u||r.floating||!y||g||!j.current)return;const R=y.nodesRef.current,H=(W=R.find(ve=>ve.id===T))==null||(W=W.context)==null?void 0:W.elements.floating,he=xt(Ue(r.floating)),ge=R.some(ve=>ve.context&&Ke(ve.context.elements.floating,he));H&&!ge&&O.current&&H.focus({preventScroll:!0})},[u,r.floating,y,T,g]),Le(()=>{if(!u||!y||!g||T)return;function W(R){ne(R.id),F&&(F.current=R)}return y.events.on("virtualfocus",W),()=>{y.events.off("virtualfocus",W)}},[u,y,g,T,F]),Le(()=>{B.current=E,q.current=t,j.current=!!r.floating}),Le(()=>{t||(P.current=null,A.current=m)},[t,m]);const pe=l!=null,_e=M.useMemo(()=>{function W(H){if(!oe.current)return;const he=s.current.indexOf(H);he!==-1&&x.current!==he&&(x.current=he,E())}return{onFocus(H){let{currentTarget:he}=H;J.current=!0,W(he)},onClick:H=>{let{currentTarget:he}=H;return he.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:he}=H;J.current=!0,G.current=!1,b&&W(he)},onPointerLeave(H){let{pointerType:he}=H;if(!(!O.current||he==="touch")&&(J.current=!0,!!b&&(x.current=-1,E(),!g))){var ge;(ge=V.current)==null||ge.focus({preventScroll:!0})}}}},[oe,V,b,s,E,g]),Z=M.useCallback(()=>{var W;return k??(y==null||(W=y.nodesRef.current.find(R=>R.id===T))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[T,y,k]),de=qe(W=>{if(O.current=!1,J.current=!0,W.which===229||!oe.current&&W.currentTarget===V.current)return;if(c&&us(W.key,S,h,$)){go(W.key,Z())||Ye(W),o(!1,W.nativeEvent,"list-navigation"),Ve(r.domReference)&&(g?y?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const R=x.current,H=Ro(s,C),he=bi(s,C);if(z||(W.key==="Home"&&(Ye(W),x.current=H,E()),W.key==="End"&&(Ye(W),x.current=he,E())),$>1){const ge=L||Array.from({length:s.current.length},()=>({width:1,height:1})),ve=jl(ge,$,N),We=ve.findIndex(Be=>Be!=null&&!Un(s,Be,C)),ft=ve.reduce((Be,Ze,fe)=>Ze!=null&&!Un(s,Ze,C)?fe:Be,-1),nt=ve[ql({current:ve.map(Be=>Be!=null?s.current[Be]:null)},{event:W,orientation:S,loop:_,rtl:h,cols:$,disabledIndices:Hl([...(typeof C!="function"?C:null)||s.current.map((Be,Ze)=>Un(s,Ze,C)?Ze:void 0),void 0],ve),minIndex:We,maxIndex:ft,prevIndex:Bl(x.current>he?H:x.current,ge,ve,$,W.key===no?"bl":W.key===(h?bn:wn)?"tr":"tl"),stopEvent:!0})];if(nt!=null&&(x.current=nt,E()),S==="both")return}if(go(W.key,S)){if(Ye(W),t&&!g&&xt(W.currentTarget.ownerDocument)===W.currentTarget){x.current=sr(W.key,S,h)?H:he,E();return}sr(W.key,S,h)?_?x.current=R>=he?p&&R!==s.current.length?-1:H:Je(s,{startingIndex:R,disabledIndices:C}):x.current=Math.min(he,Je(s,{startingIndex:R,disabledIndices:C})):_?x.current=R<=H?p&&R!==-1?s.current.length:he:Je(s,{startingIndex:R,decrement:!0,disabledIndices:C}):x.current=Math.max(H,Je(s,{startingIndex:R,decrement:!0,disabledIndices:C})),hn(s,x.current)&&(x.current=-1),E()}}),ye=M.useMemo(()=>g&&t&&pe&&{"aria-activedescendant":U||ie},[g,t,pe,U,ie]),ue=M.useMemo(()=>({"aria-orientation":S==="both"?void 0:S,...z?{}:ye,onKeyDown:de,onPointerMove(){O.current=!0}}),[ye,de,S,z]),Ce=M.useMemo(()=>{function W(H){m==="auto"&&mi(H.nativeEvent)&&(A.current=!0)}function R(H){A.current=m,m==="auto"&&vi(H.nativeEvent)&&(A.current=!0)}return{...ye,onKeyDown(H){O.current=!1;const he=H.key.startsWith("Arrow"),ge=["Home","End"].includes(H.key),ve=he||ge,We=ds(H.key,S,h),ft=us(H.key,S,h,$),nt=ds(H.key,Z(),h),Be=go(H.key,S),Ze=(c?nt:Be)||H.key==="Enter"||H.key.trim()==="";if(g&&t){const Ne=y?.nodesRef.current.find(bt=>bt.parentId==null),it=y&&Ne?Ll(y.nodesRef.current,Ne.id):null;if(ve&&it&&F){const bt=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(We||ft){var fe,Qe;const te=((fe=it.context)==null?void 0:fe.elements.domReference)===H.currentTarget,Fe=ft&&!te?(Qe=it.context)==null?void 0:Qe.elements.domReference:We?s.current.find(we=>we?.id===ie):null;Fe&&(Ye(H),Fe.dispatchEvent(bt),ne(void 0))}if((Be||ge)&&it.context&&it.context.open&&it.parentId&&H.currentTarget!==it.context.elements.domReference){var be;Ye(H),(be=it.context.elements.domReference)==null||be.dispatchEvent(bt);return}}return de(H)}if(!(!t&&!w&&he)){if(Ze){const Ne=go(H.key,Z());P.current=c&&Ne?null:H.key}if(c){nt&&(Ye(H),t?(x.current=Ro(s,le.current),E()):o(!0,H.nativeEvent,"list-navigation"));return}Be&&(f!=null&&(x.current=f),Ye(H),!t&&w?o(!0,H.nativeEvent,"list-navigation"):de(H),t&&E())}},onFocus(){t&&!g&&(x.current=-1,E())},onPointerDown:R,onPointerEnter:R,onMouseDown:W,onClick:W}},[ie,ye,$,de,le,m,s,c,E,o,t,w,S,Z,h,f,y,g,F]);return M.useMemo(()=>u?{reference:Ce,floating:ue,item:_e}:{},[u,Ce,ue,_e])}const Uc=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function po(e,n){var t,o;n===void 0&&(n={});const{open:r,elements:i,floatingId:s}=e,{enabled:l=!0,role:d="dialog"}=n,u=yn(),f=((t=i.domReference)==null?void 0:t.id)||u,p=M.useMemo(()=>{var w;return((w=Rn(i.floating))==null?void 0:w.id)||s},[i.floating,s]),_=(o=Uc.get(d))!=null?o:d,h=on()!=null,g=M.useMemo(()=>_==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?p:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":_==="alertdialog"?"dialog":_,"aria-controls":r?p:void 0,..._==="listbox"&&{role:"combobox"},..._==="menu"&&{id:f},..._==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[_,p,h,r,f,d]),m=M.useMemo(()=>{const w={id:p,..._&&{role:_}};return _==="tooltip"||d==="label"?w:{...w,..._==="menu"&&{"aria-labelledby":f}}},[_,p,f,d]),b=M.useCallback(w=>{let{active:C,selected:S}=w;const k={role:"option",...C&&{id:p+"-fui-option"}};switch(d){case"select":case"combobox":return{...k,"aria-selected":S}}return{}},[p,d]);return M.useMemo(()=>l?{reference:g,floating:m,item:b}:{},[l,g,m,b])}const fs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(n,t)=>(t?"-":"")+n.toLowerCase());function sn(e,n){return typeof e=="function"?e(n):e}function Yc(e,n){const[t,o]=M.useState(e);return e&&!t&&o(!0),M.useEffect(()=>{if(!e&&t){const r=setTimeout(()=>o(!1),n);return()=>clearTimeout(r)}},[e,t,n]),t}function Xc(e,n){n===void 0&&(n={});const{open:t,elements:{floating:o}}=e,{duration:r=250}=n,s=(typeof r=="number"?r:r.close)||0,[l,d]=M.useState("unmounted"),u=Yc(t,s);return!u&&l==="close"&&d("unmounted"),Le(()=>{if(o){if(t){d("initial");const f=requestAnimationFrame(()=>{Io.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[t,o]),{isMounted:u,status:l}}function ho(e,n){n===void 0&&(n={});const{initial:t={opacity:0},open:o,close:r,common:i,duration:s=250}=n,l=e.placement,d=l.split("-")[0],u=M.useMemo(()=>({side:d,placement:l}),[d,l]),f=typeof s=="number",p=(f?s:s.open)||0,_=(f?s:s.close)||0,[c,h]=M.useState(()=>({...sn(i,u),...sn(t,u)})),{isMounted:g,status:m}=Xc(e,{duration:s}),b=Ge(t),w=Ge(o),C=Ge(r),S=Ge(i);return Le(()=>{const k=sn(b.current,u),$=sn(C.current,u),I=sn(S.current,u),F=sn(w.current,u)||Object.keys(k).reduce((L,N)=>(L[N]="",L),{});if(m==="initial"&&h(L=>({transitionProperty:L.transitionProperty,...I,...k})),m==="open"&&h({transitionProperty:Object.keys(F).map(fs).join(","),transitionDuration:p+"ms",...I,...F}),m==="close"){const L=$||k;h({transitionProperty:Object.keys(L).map(fs).join(","),transitionDuration:_+"ms",...I,...L})}},[_,C,b,w,S,p,m,u]),{isMounted:g,styles:c}}function _s(e,n){var t;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:s,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:p=750,ignoreKeys:_=[],selectedIndex:c=null}=n,h=M.useRef(-1),g=M.useRef(""),m=M.useRef((t=c??s)!=null?t:-1),b=M.useRef(null),w=qe(l),C=qe(d),S=Ge(f),k=Ge(_);Le(()=>{o&&(Xe(h),b.current=null,g.current="")},[o]),Le(()=>{if(o&&g.current===""){var N;m.current=(N=c??s)!=null?N:-1}},[o,c,s]);const $=qe(N=>{N?r.current.typing||(r.current.typing=N,C(N)):r.current.typing&&(r.current.typing=N,C(N))}),I=qe(N=>{function D(z,A,x){const P=S.current?S.current(A,x):A.find(O=>O?.toLocaleLowerCase().indexOf(x.toLocaleLowerCase())===0);return P?z.indexOf(P):-1}const V=i.current;if(g.current.length>0&&g.current[0]!==" "&&(D(V,V,g.current)===-1?$(!1):N.key===" "&&Ye(N)),V==null||k.current.includes(N.key)||N.key.length!==1||N.ctrlKey||N.metaKey||N.altKey)return;o&&N.key!==" "&&(Ye(N),$(!0)),V.every(z=>{var A,x;return z?((A=z[0])==null?void 0:A.toLocaleLowerCase())!==((x=z[1])==null?void 0:x.toLocaleLowerCase()):!0})&&g.current===N.key&&(g.current="",m.current=b.current),g.current+=N.key,Xe(h),h.current=window.setTimeout(()=>{g.current="",m.current=b.current,$(!1)},p);const y=m.current,E=D(V,[...V.slice((y||0)+1),...V.slice(0,(y||0)+1)],g.current);E!==-1?(w(E),b.current=E):N.key!==" "&&(g.current="",$(!1))}),F=M.useMemo(()=>({onKeyDown:I}),[I]),L=M.useMemo(()=>({onKeyDown:I,onKeyUp(N){N.key===" "&&$(!1)}}),[I,$]);return M.useMemo(()=>u?{reference:F,floating:L}:{},[u,F,L])}function gs(e,n,t){return t===void 0&&(t=!0),e.filter(r=>{var i;return r.parentId===n&&(!t||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...gs(e,r.id,t)])}function ps(e,n){const[t,o]=e;let r=!1;const i=n.length;for(let s=0,l=i-1;s<i;l=s++){const[d,u]=n[s]||[0,0],[f,p]=n[l]||[0,0];u>=o!=p>=o&&t<=(f-d)*(o-u)/(p-u)+d&&(r=!r)}return r}function Zc(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}function hs(e){e===void 0&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,s=null,l=null,d=typeof performance<"u"?performance.now():0;function u(p,_){const c=performance.now(),h=c-d;if(s===null||l===null||h===0)return s=p,l=_,d=c,null;const g=p-s,m=_-l,w=Math.sqrt(g*g+m*m)/h;return s=p,l=_,d=c,w}const f=p=>{let{x:_,y:c,placement:h,elements:g,onClose:m,nodeId:b,tree:w}=p;return function(S){function k(){Xe(r),m()}if(Xe(r),!g.domReference||!g.floating||h==null||_==null||c==null)return;const{clientX:$,clientY:I}=S,F=[$,I],L=Ac(S),N=S.type==="mouseleave",D=er(g.floating,L),V=er(g.domReference,L),T=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),E=h.split("-")[0],z=_>y.right-y.width/2,A=c>y.bottom-y.height/2,x=Zc(F,T),P=y.width>T.width,O=y.height>T.height,B=(P?T:y).left,j=(P?T:y).right,q=(O?T:y).top,J=(O?T:y).bottom;if(D&&(i=!0,!N))return;if(V&&(i=!1),V&&!N){i=!0;return}if(N&&Pe(S.relatedTarget)&&er(g.floating,S.relatedTarget)||w&&gs(w.nodesRef.current,b).length)return;if(E==="top"&&c>=T.bottom-1||E==="bottom"&&c<=T.top+1||E==="left"&&_>=T.right-1||E==="right"&&_<=T.left+1)return k();let G=[];switch(E){case"top":G=[[B,T.top+1],[B,y.bottom-1],[j,y.bottom-1],[j,T.top+1]];break;case"bottom":G=[[B,y.top+1],[B,T.bottom-1],[j,T.bottom-1],[j,y.top+1]];break;case"left":G=[[y.right-1,J],[y.right-1,q],[T.left+1,q],[T.left+1,J]];break;case"right":G=[[T.right-1,J],[T.right-1,q],[y.left+1,q],[y.left+1,J]];break}function le(oe){let[re,ce]=oe;switch(E){case"top":{const ie=[P?re+n/2:z?re+n*4:re-n*4,ce+n+1],me=[P?re-n/2:z?re+n*4:re-n*4,ce+n+1],U=[[y.left,z||P?y.bottom-n:y.top],[y.right,z?P?y.bottom-n:y.top:y.bottom-n]];return[ie,me,...U]}case"bottom":{const ie=[P?re+n/2:z?re+n*4:re-n*4,ce-n],me=[P?re-n/2:z?re+n*4:re-n*4,ce-n],U=[[y.left,z||P?y.top+n:y.bottom],[y.right,z?P?y.top+n:y.bottom:y.top+n]];return[ie,me,...U]}case"left":{const ie=[re+n+1,O?ce+n/2:A?ce+n*4:ce-n*4],me=[re+n+1,O?ce-n/2:A?ce+n*4:ce-n*4];return[...[[A||O?y.right-n:y.left,y.top],[A?O?y.right-n:y.left:y.right-n,y.bottom]],ie,me]}case"right":{const ie=[re-n,O?ce+n/2:A?ce+n*4:ce-n*4],me=[re-n,O?ce-n/2:A?ce+n*4:ce-n*4],U=[[A||O?y.left+n:y.right,y.top],[A?O?y.left+n:y.right:y.left+n,y.bottom]];return[ie,me,...U]}}}if(!ps([$,I],G)){if(i&&!x)return k();if(!N&&o){const oe=u(S.clientX,S.clientY);if(oe!==null&&oe<.1)return k()}ps([$,I],le([_,c]))?!i&&o&&(r.current=window.setTimeout(k,40)):k()}}};return f.__options={blockPointerEvents:t},f}function an(e,n,t){let o=t.initialDeps??[],r;function i(){var s,l,d,u;let f;t.key&&((s=t.debug)!=null&&s.call(t))&&(f=Date.now());const p=e();if(!(p.length!==o.length||p.some((h,g)=>o[g]!==h)))return r;o=p;let c;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(c=Date.now()),r=n(...p),t.key&&((d=t.debug)!=null&&d.call(t))){const h=Math.round((Date.now()-f)*100)/100,g=Math.round((Date.now()-c)*100)/100,m=g/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(g,5)} /${b(h,5)} ms`,`
4
+ */var Fl=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Kt=Fl.join(","),_i=typeof Element>"u",st=_i?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ut=!_i&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},vt=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),i=r===""||r==="true",a=i||n&&t&&vt(t.parentNode);return a},zl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},gi=function(t,n,o){if(vt(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Kt));return n&&st.call(t,Kt)&&r.unshift(t),r=r.filter(o),r},Rt=function(t,n,o){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!vt(a,!1))if(a.tagName==="SLOT"){var l=a.assignedElements(),d=l.length?l:a.children,u=Rt(d,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else{var f=st.call(a,Kt);f&&o.filter(a)&&(n||!t.includes(a))&&r.push(a);var g=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),_=!vt(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(g&&_){var c=Rt(g===!0?a.children:g.children,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else i.unshift.apply(i,a.children)}}return r},pi=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},hi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||zl(t))&&!pi(t)?0:t.tabIndex},Al=function(t,n){var o=hi(t);return o<0&&n&&!pi(t)?0:o},Dl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},mi=function(t){return t.tagName==="INPUT"},Ll=function(t){return mi(t)&&t.type==="hidden"},Pl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Tl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Ol=function(t){if(!t.name)return!0;var n=t.form||Ut(t),o=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=Tl(r,t.form);return!i||i===t},ql=function(t){return mi(t)&&t.type==="radio"},Vl=function(t){return ql(t)&&!Ol(t)},jl=function(t){var n,o=t&&Ut(t),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==t){var a,l,d;for(i=!!((a=r)!==null&&a!==void 0&&(l=a.ownerDocument)!==null&&l!==void 0&&l.contains(r)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!i&&r;){var u,f,g;o=Ut(r),r=(u=o)===null||u===void 0?void 0:u.host,i=!!((f=r)!==null&&f!==void 0&&(g=f.ownerDocument)!==null&&g!==void 0&&g.contains(r))}}return i},vi=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Bl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var a=st.call(t,"details>summary:first-of-type"),l=a?t.parentElement:t;if(st.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=t;t;){var u=t.parentElement,f=Ut(t);if(u&&!u.shadowRoot&&r(u)===!0)return vi(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=d}if(jl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return vi(t);return!1},Hl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return st.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Uo=function(t,n){return!(n.disabled||vt(n)||Ll(n)||Bl(n,t)||Pl(n)||Hl(n))},Ro=function(t,n){return!(Vl(n)||hi(n)<0||!Uo(t,n))},Gl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},bi=function(t){var n=[],o=[];return t.forEach(function(r,i){var a=!!r.scopeParent,l=a?r.scopeParent:r,d=Al(l,a),u=a?bi(r.candidates):l;d===0?a?n.push.apply(n,u):n.push(l):o.push({documentOrder:i,tabIndex:d,item:r,isScope:a,content:u})}),o.sort(Dl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Xt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rt([t],n.includeContainer,{filter:Ro.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Gl}):o=gi(t,n.includeContainer,Ro.bind(null,n)),bi(o)},Wl=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rt([t],n.includeContainer,{filter:Uo.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=gi(t,n.includeContainer,Uo.bind(null,n)),o},wi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return st.call(t,Kt)===!1?!1:Ro(n,t)};function yi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ci(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function xi(){return/apple/i.test(navigator.vendor)}function Xo(){const e=/android/i;return e.test(yi())||e.test(Ci())}function Kl(){return yi().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Si(){return Ci().includes("jsdom/")}const $i="data-floating-ui-focusable",Ul="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Yo="ArrowLeft",Zo="ArrowRight",Rl="ArrowUp",Xl="ArrowDown";function $n(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Qe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&qt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Fn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Jo(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Yl(e){return e.matches("html,body")}function en(e){return e?.ownerDocument||document}function Qo(e){return We(e)&&e.matches(Ul)}function er(e){return e?e.getAttribute("role")==="combobox"&&Qo(e):!1}function Zl(e){if(!e||Si())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Yt(e){return e?e.hasAttribute($i)?e:e.querySelector("["+$i+"]")||e:null}function Rn(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Rn(e,r.id,n)])}function Jl(e,t){let n,o=-1;function r(i,a){a>o&&(n=i,o=a),Rn(e,i).forEach(d=>{r(d.id,a+1)})}return r(t,0),e.find(i=>i.id===n)}function ki(e,t){var n;let o=[],r=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;r;){const i=e.find(a=>a.id===r);r=i?.parentId,i&&(o=o.concat(i))}return o}function nn(e){e.preventDefault(),e.stopPropagation()}function Ql(e){return"nativeEvent"in e}function Ii(e){return e.mozInputSource===0&&e.isTrusted?!0:Xo()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ei(e){return Si()?!1:!Xo()&&e.width===0&&e.height===0||Xo()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function bt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var ec=typeof document<"u",nc=function(){},Pe=ec?m.useLayoutEffect:nc;const tc={...E};function Je(e){const t=E.useRef(e);return Pe(()=>{t.current=e}),t}const oc=tc.useInsertionEffect||(e=>e());function Ke(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return oc(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Zt(e,t,n){return Math.floor(e/t)!==n}function wt(e,t){return t<0||t>=e.current.length}function nr(e,t){return sn(e,{disabledIndices:t})}function Mi(e,t){return sn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function sn(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t,a=n;do a+=o?-i:i;while(a>=0&&a<=e.current.length-1&&Jt(e,a,r));return a}function rc(e,t){let{event:n,orientation:o,loop:r,rtl:i,cols:a,disabledIndices:l,minIndex:d,maxIndex:u,prevIndex:f,stopEvent:g=!1}=t,_=f;if(n.key===Rl){if(g&&nn(n),f===-1)_=u;else if(_=sn(e,{startingIndex:_,amount:a,decrement:!0,disabledIndices:l}),r&&(f-a<d||_<0)){const c=f%a,h=u%a,p=u-(h-c);h===c?_=u:_=h>c?p:p-a}wt(e,_)&&(_=f)}if(n.key===Xl&&(g&&nn(n),f===-1?_=d:(_=sn(e,{startingIndex:f,amount:a,disabledIndices:l}),r&&f+a>u&&(_=sn(e,{startingIndex:f%a-a,amount:a,disabledIndices:l}))),wt(e,_)&&(_=f)),o==="both"){const c=ot(f/a);n.key===(i?Yo:Zo)&&(g&&nn(n),f%a!==a-1?(_=sn(e,{startingIndex:f,disabledIndices:l}),r&&Zt(_,a,c)&&(_=sn(e,{startingIndex:f-f%a-1,disabledIndices:l}))):r&&(_=sn(e,{startingIndex:f-f%a-1,disabledIndices:l})),Zt(_,a,c)&&(_=f)),n.key===(i?Zo:Yo)&&(g&&nn(n),f%a!==0?(_=sn(e,{startingIndex:f,decrement:!0,disabledIndices:l}),r&&Zt(_,a,c)&&(_=sn(e,{startingIndex:f+(a-f%a),decrement:!0,disabledIndices:l}))):r&&(_=sn(e,{startingIndex:f+(a-f%a),decrement:!0,disabledIndices:l})),Zt(_,a,c)&&(_=f));const h=ot(u/a)===c;wt(e,_)&&(r&&h?_=n.key===(i?Zo:Yo)?u:sn(e,{startingIndex:f-f%a-1,disabledIndices:l}):_=f)}return _}function ic(e,t,n){const o=[];let r=0;return e.forEach((i,a)=>{let{width:l,height:d}=i;if(l>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+a+" is greater than grid columns");let u=!1;for(n&&(r=0);!u;){const f=[];for(let g=0;g<l;g++)for(let _=0;_<d;_++)f.push(r+g+_*t);r%t+l<=t&&f.every(g=>o[g]==null)?(f.forEach(g=>{o[g]=a}),u=!0):r++}}),[...o]}function sc(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return n.lastIndexOf(e)}}function ac(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Jt(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const yt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ni(e,t){const n=Xt(e,yt()),o=n.length;if(o===0)return;const r=$n(en(e)),i=n.indexOf(r),a=i===-1?t===1?0:o-1:i+t;return n[a]}function Fi(e){return Ni(en(e).body,1)||e}function zi(e){return Ni(en(e).body,-1)||e}function Ct(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Qe(n,o)}function lc(e){Xt(e,yt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ai(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Di(e,t,n){let{reference:o,floating:r}=e;const i=Nn(t),a=Wo(t),l=Go(a),d=qn(t),u=i==="y",f=o.x+o.width/2-r.width/2,g=o.y+o.height/2-r.height/2,_=o[l]/2-r[l]/2;let c;switch(d){case"top":c={x:f,y:o.y-r.height};break;case"bottom":c={x:f,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:g};break;case"left":c={x:o.x-r.width,y:g};break;default:c={x:o.x,y:o.y}}switch(it(t)){case"start":c[a]-=_*(n&&u?-1:1);break;case"end":c[a]+=_*(n&&u?-1:1);break}return c}const cc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:g}=Di(u,o,d),_=o,c={},h=0;for(let p=0;p<l.length;p++){const{name:v,fn:w}=l[p],{x:C,y:x,data:k,reset:z}=await w({x:f,y:g,initialPlacement:o,placement:_,strategy:r,middlewareData:c,rects:u,platform:a,elements:{reference:e,floating:t}});f=C??f,g=x??g,c={...c,[v]:{...c[v],...k}},z&&h<=50&&(h++,typeof z=="object"&&(z.placement&&(_=z.placement),z.rects&&(u=z.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):z.rects),{x:f,y:g}=Di(u,_,d)),p=-1)}return{x:f,y:g,placement:_,strategy:r,middlewareData:c}};async function tr(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:l,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:_=!1,padding:c=0}=rt(t,e),h=fi(c),v=l[_?g==="floating"?"reference":"floating":g],w=Wt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:f,strategy:d})),C=g==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},z=Wt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:C,offsetParent:x,strategy:d}):C);return{top:(w.top-z.top+h.top)/k.y,bottom:(z.bottom-w.bottom+h.bottom)/k.y,left:(w.left-z.left+h.left)/k.x,right:(z.right-w.right+h.right)/k.x}}const dc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:a,elements:l,middlewareData:d}=t,{element:u,padding:f=0}=rt(e,t)||{};if(u==null)return{};const g=fi(f),_={x:n,y:o},c=Wo(r),h=Go(c),p=await a.getDimensions(u),v=c==="y",w=v?"top":"left",C=v?"bottom":"right",x=v?"clientHeight":"clientWidth",k=i.reference[h]+i.reference[c]-_[c]-i.floating[h],z=_[c]-i.reference[c],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let N=L?L[x]:0;(!N||!await(a.isElement==null?void 0:a.isElement(L)))&&(N=l.floating[x]||i.floating[h]);const P=k/2-z/2,A=N/2-p[h]/2-1,I=On(g[w],A),O=On(g[C],A),q=I,$=N-p[h]-O,b=N/2-p[h]/2+P,S=Ho(q,b,$),T=!d.arrow&&it(r)!=null&&b!==S&&i.reference[h]/2-(b<q?I:O)-p[h]/2<0,F=T?b<q?b-q:b-$:0;return{[c]:_[c]+F,data:{[c]:S,centerOffset:b-S-F,...T&&{alignmentOffset:F}},reset:T}}}),uc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:d,elements:u}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:_,fallbackStrategy:c="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:p=!0,...v}=rt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=qn(r),C=Nn(l),x=qn(l)===l,k=await(d.isRTL==null?void 0:d.isRTL(u.floating)),z=_||(x||!p?[Gt(l)]:$l(l)),L=h!=="none";!_&&L&&z.push(...Ml(l,p,h,k));const N=[l,...z],P=await tr(t,v),A=[];let I=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&A.push(P[w]),g){const b=Sl(r,a,k);A.push(P[b[0]],P[b[1]])}if(I=[...I,{placement:r,overflows:A}],!A.every(b=>b<=0)){var O,q;const b=(((O=i.flip)==null?void 0:O.index)||0)+1,S=N[b];if(S&&(!(g==="alignment"?C!==Nn(S):!1)||I.every(y=>Nn(y.placement)===C?y.overflows[0]>0:!0)))return{data:{index:b,overflows:I},reset:{placement:S}};let T=(q=I.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:q.placement;if(!T)switch(c){case"bestFit":{var $;const F=($=I.filter(y=>{if(L){const M=Nn(y.placement);return M===C||M==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(M=>M>0).reduce((M,D)=>M+D,0)]).sort((y,M)=>y[1]-M[1])[0])==null?void 0:$[0];F&&(T=F);break}case"initialPlacement":T=l;break}if(r!==T)return{reset:{placement:T}}}return{}}}},fc=new Set(["left","top"]);async function _c(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=qn(n),l=it(n),d=Nn(n)==="y",u=fc.has(a)?-1:1,f=i&&d?-1:1,g=rt(t,e);let{mainAxis:_,crossAxis:c,alignmentAxis:h}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&typeof h=="number"&&(c=l==="end"?h*-1:h),d?{x:c*f,y:_*u}:{x:_*u,y:c*f}}const gc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:l}=t,d=await _c(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:i+d.y,data:{...d,placement:a}}}}},pc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:v=>{let{x:w,y:C}=v;return{x:w,y:C}}},...d}=rt(e,t),u={x:n,y:o},f=await tr(t,d),g=Nn(qn(r)),_=ci(g);let c=u[_],h=u[g];if(i){const v=_==="y"?"top":"left",w=_==="y"?"bottom":"right",C=c+f[v],x=c-f[w];c=Ho(C,c,x)}if(a){const v=g==="y"?"top":"left",w=g==="y"?"bottom":"right",C=h+f[v],x=h-f[w];h=Ho(C,h,x)}const p=l.fn({...t,[_]:c,[g]:h});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[_]:i,[g]:a}}}}}},hc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:a,elements:l}=t,{apply:d=()=>{},...u}=rt(e,t),f=await tr(t,u),g=qn(r),_=it(r),c=Nn(r)==="y",{width:h,height:p}=i.floating;let v,w;g==="top"||g==="bottom"?(v=g,w=_===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(w=g,v=_==="end"?"top":"bottom");const C=p-f.top-f.bottom,x=h-f.left-f.right,k=On(p-f[v],C),z=On(h-f[w],x),L=!t.middlewareData.shift;let N=k,P=z;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(N=C),L&&!_){const I=mn(f.left,0),O=mn(f.right,0),q=mn(f.top,0),$=mn(f.bottom,0);c?P=h-2*(I!==0||O!==0?I+O:mn(f.left,f.right)):N=p-2*(q!==0||$!==0?q+$:mn(f.top,f.bottom))}await d({...t,availableWidth:P,availableHeight:N});const A=await a.getDimensions(l.floating);return h!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function Li(e){const t=hn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=We(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,l=Ht(n)!==i||Ht(o)!==a;return l&&(n=i,o=a),{width:n,height:o,$:l}}function or(e){return Le(e)?e:e.contextElement}function at(e){const t=or(e);if(!We(t))return Sn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Li(t);let a=(i?Ht(n.width):n.width)/o,l=(i?Ht(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const mc=Sn(0);function Pi(e){const t=gn(e);return!jt()||!t.visualViewport?mc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gn(e)?!1:t}function Xn(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=or(e);let a=Sn(1);t&&(o?Le(o)&&(a=at(o)):a=at(e));const l=vc(i,n,o)?Pi(i):Sn(0);let d=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,f=r.width/a.x,g=r.height/a.y;if(i){const _=gn(i),c=o&&Le(o)?gn(o):o;let h=_,p=Bo(h);for(;p&&o&&c!==h;){const v=at(p),w=p.getBoundingClientRect(),C=hn(p),x=w.left+(p.clientLeft+parseFloat(C.paddingLeft))*v.x,k=w.top+(p.clientTop+parseFloat(C.paddingTop))*v.y;d*=v.x,u*=v.y,f*=v.x,g*=v.y,d+=x,u+=k,h=gn(p),p=Bo(h)}}return Wt({width:f,height:g,x:d,y:u})}function Qt(e,t){const n=Bt(e).scrollLeft;return t?t.left+n:Xn(xn(e)).left+n}function Ti(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Qt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function bc(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=xn(o),l=t?Vt(t.floating):!1;if(o===a||l&&i)return n;let d={scrollLeft:0,scrollTop:0},u=Sn(1);const f=Sn(0),g=We(o);if((g||!g&&!i)&&((Pn(o)!=="body"||mt(a))&&(d=Bt(o)),We(o))){const c=Xn(o);u=at(o),f.x=c.x+o.clientLeft,f.y=c.y+o.clientTop}const _=a&&!g&&!i?Ti(a,d):Sn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+f.x+_.x,y:n.y*u.y-d.scrollTop*u.y+f.y+_.y}}function wc(e){return Array.from(e.getClientRects())}function yc(e){const t=xn(e),n=Bt(e),o=e.ownerDocument.body,r=mn(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=mn(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Qt(e);const l=-n.scrollTop;return hn(o).direction==="rtl"&&(a+=mn(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:a,y:l}}const Oi=25;function Cc(e,t){const n=gn(e),o=xn(e),r=n.visualViewport;let i=o.clientWidth,a=o.clientHeight,l=0,d=0;if(r){i=r.width,a=r.height;const f=jt();(!f||f&&t==="fixed")&&(l=r.offsetLeft,d=r.offsetTop)}const u=Qt(o);if(u<=0){const f=o.ownerDocument,g=f.body,_=getComputedStyle(g),c=f.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,h=Math.abs(o.clientWidth-g.clientWidth-c);h<=Oi&&(i-=h)}else u<=Oi&&(i+=u);return{width:i,height:a,x:l,y:d}}const xc=new Set(["absolute","fixed"]);function Sc(e,t){const n=Xn(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=We(e)?at(e):Sn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,d=r*i.x,u=o*i.y;return{width:a,height:l,x:d,y:u}}function qi(e,t,n){let o;if(t==="viewport")o=Cc(e,n);else if(t==="document")o=yc(xn(e));else if(Le(t))o=Sc(t,n);else{const r=Pi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Wt(o)}function Vi(e,t){const n=Mn(e);return n===t||!Le(n)||En(n)?!1:hn(n).position==="fixed"||Vi(n,t)}function $c(e,t){const n=t.get(e);if(n)return n;let o=Tn(e,[],!1).filter(l=>Le(l)&&Pn(l)!=="body"),r=null;const i=hn(e).position==="fixed";let a=i?Mn(e):e;for(;Le(a)&&!En(a);){const l=hn(a),d=jo(a);!d&&l.position==="fixed"&&(r=null),(i?!d&&!r:!d&&l.position==="static"&&!!r&&xc.has(r.position)||mt(a)&&!d&&Vi(e,a))?o=o.filter(f=>f!==a):r=l,a=Mn(a)}return t.set(e,o),o}function kc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Vt(t)?[]:$c(t,this._c):[].concat(n),o],l=a[0],d=a.reduce((u,f)=>{const g=qi(t,f,r);return u.top=mn(g.top,u.top),u.right=On(g.right,u.right),u.bottom=On(g.bottom,u.bottom),u.left=mn(g.left,u.left),u},qi(t,l,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Ic(e){const{width:t,height:n}=Li(e);return{width:t,height:n}}function Ec(e,t,n){const o=We(t),r=xn(t),i=n==="fixed",a=Xn(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const d=Sn(0);function u(){d.x=Qt(r)}if(o||!o&&!i)if((Pn(t)!=="body"||mt(r))&&(l=Bt(t)),o){const c=Xn(t,!0,i,t);d.x=c.x+t.clientLeft,d.y=c.y+t.clientTop}else r&&u();i&&!o&&r&&u();const f=r&&!o&&!i?Ti(r,l):Sn(0),g=a.left+l.scrollLeft-d.x-f.x,_=a.top+l.scrollTop-d.y-f.y;return{x:g,y:_,width:a.width,height:a.height}}function rr(e){return hn(e).position==="static"}function ji(e,t){if(!We(e)||hn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xn(e)===n&&(n=n.ownerDocument.body),n}function Bi(e,t){const n=gn(e);if(Vt(e))return n;if(!We(e)){let r=Mn(e);for(;r&&!En(r);){if(Le(r)&&!rr(r))return r;r=Mn(r)}return n}let o=ji(e,t);for(;o&&gl(o)&&rr(o);)o=ji(o,t);return o&&En(o)&&rr(o)&&!jo(o)?n:o||bl(e)||n}const Mc=async function(e){const t=this.getOffsetParent||Bi,n=this.getDimensions,o=await n(e.floating);return{reference:Ec(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Nc(e){return hn(e).direction==="rtl"}const Fc={convertOffsetParentRelativeRectToViewportRelativeRect:bc,getDocumentElement:xn,getClippingRect:kc,getOffsetParent:Bi,getElementRects:Mc,getClientRects:wc,getDimensions:Ic,getScale:at,isElement:Le,isRTL:Nc};function Hi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zc(e,t){let n=null,o;const r=xn(e);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function a(l,d){l===void 0&&(l=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:f,top:g,width:_,height:c}=u;if(l||t(),!_||!c)return;const h=ot(g),p=ot(r.clientWidth-(f+_)),v=ot(r.clientHeight-(g+c)),w=ot(f),x={rootMargin:-h+"px "+-p+"px "+-v+"px "+-w+"px",threshold:mn(0,On(1,d))||1};let k=!0;function z(L){const N=L[0].intersectionRatio;if(N!==d){if(!k)return a();N?a(!1,N):o=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!Hi(u,e.getBoundingClientRect())&&a(),k=!1}try{n=new IntersectionObserver(z,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(z,x)}n.observe(e)}return a(!0),i}function eo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=or(e),f=r||i?[...u?Tn(u):[],...Tn(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const g=u&&l?zc(u,n):null;let _=-1,c=null;a&&(c=new ResizeObserver(w=>{let[C]=w;C&&C.target===u&&c&&(c.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var x;(x=c)==null||x.observe(t)})),n()}),u&&!d&&c.observe(u),c.observe(t));let h,p=d?Xn(e):null;d&&v();function v(){const w=Xn(e);p&&!Hi(p,w)&&n(),p=w,h=requestAnimationFrame(v)}return n(),()=>{var w;f.forEach(C=>{r&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),g?.(),(w=c)==null||w.disconnect(),c=null,d&&cancelAnimationFrame(h)}}const Ac=gc,Dc=pc,Lc=uc,Pc=hc,Gi=dc,Tc=(e,t,n)=>{const o=new Map,r={platform:Fc,...n},i={...r.platform,_c:o};return cc(e,t,{...r,platform:i})};var Oc=typeof document<"u",qc=function(){},no=Oc?m.useLayoutEffect:qc;function to(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!to(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!to(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Wi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ki(e,t){const n=Wi(e);return Math.round(t*n)/n}function ir(e){const t=E.useRef(e);return no(()=>{t.current=e}),t}function Vc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:d,open:u}=e,[f,g]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,c]=E.useState(o);to(_,o)||c(o);const[h,p]=E.useState(null),[v,w]=E.useState(null),C=E.useCallback(y=>{y!==L.current&&(L.current=y,p(y))},[]),x=E.useCallback(y=>{y!==N.current&&(N.current=y,w(y))},[]),k=i||h,z=a||v,L=E.useRef(null),N=E.useRef(null),P=E.useRef(f),A=d!=null,I=ir(d),O=ir(r),q=ir(u),$=E.useCallback(()=>{if(!L.current||!N.current)return;const y={placement:t,strategy:n,middleware:_};O.current&&(y.platform=O.current),Tc(L.current,N.current,y).then(M=>{const D={...M,isPositioned:q.current!==!1};b.current&&!to(P.current,D)&&(P.current=D,Do.flushSync(()=>{g(D)}))})},[_,t,n,O,q]);no(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(y=>({...y,isPositioned:!1})))},[u]);const b=E.useRef(!1);no(()=>(b.current=!0,()=>{b.current=!1}),[]),no(()=>{if(k&&(L.current=k),z&&(N.current=z),k&&z){if(I.current)return I.current(k,z,$);$()}},[k,z,$,I,A]);const S=E.useMemo(()=>({reference:L,floating:N,setReference:C,setFloating:x}),[C,x]),T=E.useMemo(()=>({reference:k,floating:z}),[k,z]),F=E.useMemo(()=>{const y={position:n,left:0,top:0};if(!T.floating)return y;const M=Ki(T.floating,f.x),D=Ki(T.floating,f.y);return l?{...y,transform:"translate("+M+"px, "+D+"px)",...Wi(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:D}},[n,l,T.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:$,refs:S,elements:T,floatingStyles:F}),[f,$,S,T,F])}const jc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Gi({element:o.current,padding:r}).fn(n):{}:o?Gi({element:o,padding:r}).fn(n):{}}}},oo=(e,t)=>({...Ac(e),options:[e,t]}),ro=(e,t)=>({...Dc(e),options:[e,t]}),io=(e,t)=>({...Lc(e),options:[e,t]}),Ui=(e,t)=>({...Pc(e),options:[e,t]}),Bc=(e,t)=>({...jc(e),options:[e,t]});function Ri(e){const t=E.useRef(void 0),n=E.useCallback(o=>{const r=e.map(i=>{if(i!=null){if(typeof i=="function"){const a=i,l=a(o);return typeof l=="function"?l:()=>{a(null)}}return i.current=o,()=>{i.current=null}}});return()=>{r.forEach(i=>i?.())}},e);return E.useMemo(()=>e.every(o=>o==null)?null:o=>{t.current&&(t.current(),t.current=void 0),o!=null&&(t.current=n(o))},e)}const Hc="data-floating-ui-focusable",Xi="active",Yi="selected",xt="ArrowLeft",St="ArrowRight",Zi="ArrowUp",so="ArrowDown",Gc={...E};let Ji=!1,Wc=0;const Qi=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Wc++;function Kc(){const[e,t]=E.useState(()=>Ji?Qi():void 0);return Pe(()=>{e==null&&t(Qi())},[]),E.useEffect(()=>{Ji=!0},[]),e}const $t=Gc.useId||Kc;let kt;process.env.NODE_ENV!=="production"&&(kt=new Set);function ao(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=kt)!=null&&e.has(r))){var i;(i=kt)==null||i.add(r),console.warn(r)}}function Uc(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=kt)!=null&&e.has(r))){var i;(i=kt)==null||i.add(r),console.error(r)}}const Rc=E.forwardRef(function(t,n){const{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:l=14,height:d=7,tipRadius:u=0,strokeWidth:f=0,staticOffset:g,stroke:_,d:c,style:{transform:h,...p}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||ao("The `ref` prop is required for `FloatingArrow`."));const w=$t(),[C,x]=E.useState(!1);if(Pe(()=>{if(!r)return;hn(r).direction==="rtl"&&x(!0)},[r]),!r)return null;const[k,z]=o.split("-"),L=k==="top"||k==="bottom";let N=g;(L&&a!=null&&a.x||!L&&a!=null&&a.y)&&(N=null);const P=f*2,A=P/2,I=l/2*(u/-8+1),O=d/2*u/4,q=!!c,$=N&&z==="end"?"bottom":"top";let b=N&&z==="end"?"right":"left";N&&C&&(b=z==="end"?"left":"right");const S=i?.x!=null?N||i.x:"",T=i?.y!=null?N||i.y:"",F=c||"M0,0"+(" H"+l)+(" L"+(l-I)+","+(d-O))+(" Q"+l/2+","+d+" "+I+","+(d-O))+" Z",y={top:q?"rotate(180deg)":"",left:q?"rotate(90deg)":"rotate(-90deg)",bottom:q?"":"rotate(180deg)",right:q?"rotate(-90deg)":"rotate(90deg)"}[k];return s.jsxs("svg",{...v,"aria-hidden":!0,ref:n,width:q?l:l+P,height:l,viewBox:"0 0 "+l+" "+(d>l?d:l),style:{position:"absolute",pointerEvents:"none",[b]:S,[$]:T,[k]:L||q?"100%":"calc(100% - "+P/2+"px)",transform:[y,h].filter(M=>!!M).join(" "),...p},children:[P>0&&s.jsx("path",{clipPath:"url(#"+w+")",fill:"none",stroke:_,strokeWidth:P+(c?0:1),d:F}),s.jsx("path",{stroke:P&&!c?v.fill:"none",d:F}),s.jsx("clipPath",{id:w,children:s.jsx("rect",{x:-A,y:A*(q?-1:1),width:l+P,height:l})})]})});function es(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const ns=E.createContext(null),ts=E.createContext(null),lt=()=>{var e;return((e=E.useContext(ns))==null?void 0:e.id)||null},Yn=()=>E.useContext(ts);function os(e){const t=$t(),n=Yn(),r=lt();return Pe(()=>{if(!t)return;const i={id:t,parentId:r};return n?.addNode(i),()=>{n?.removeNode(i)}},[n,t,r]),t}function rs(e){const{children:t,id:n}=e,o=lt();return s.jsx(ns.Provider,{value:E.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function Xc(e){const{children:t}=e,n=E.useRef([]),o=E.useCallback(a=>{n.current=[...n.current,a]},[]),r=E.useCallback(a=>{n.current=n.current.filter(l=>l!==a)},[]),[i]=E.useState(()=>es());return s.jsx(ts.Provider,{value:E.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i]),children:t})}function Zn(e){return"data-floating-ui-"+e}function tn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const is=Zn("safe-polygon");function sr(e,t,n){if(n&&!bt(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function ar(e){return typeof e=="function"?e():e}function lr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:a}=e,{enabled:l=!0,delay:d=0,handleClose:u=null,mouseOnly:f=!1,restMs:g=0,move:_=!0}=t,c=Yn(),h=lt(),p=Je(u),v=Je(d),w=Je(n),C=Je(g),x=E.useRef(),k=E.useRef(-1),z=E.useRef(),L=E.useRef(-1),N=E.useRef(!0),P=E.useRef(!1),A=E.useRef(()=>{}),I=E.useRef(!1),O=Ke(()=>{var F;const y=(F=r.current.openEvent)==null?void 0:F.type;return y?.includes("mouse")&&y!=="mousedown"});E.useEffect(()=>{if(!l)return;function F(y){let{open:M}=y;M||(tn(k),tn(L),N.current=!0,I.current=!1)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),E.useEffect(()=>{if(!l||!p.current||!n)return;function F(M){O()&&o(!1,M,"hover")}const y=en(a.floating).documentElement;return y.addEventListener("mouseleave",F),()=>{y.removeEventListener("mouseleave",F)}},[a.floating,n,o,l,p,O]);const q=E.useCallback(function(F,y,M){y===void 0&&(y=!0),M===void 0&&(M="hover");const D=sr(v.current,"close",x.current);D&&!z.current?(tn(k),k.current=window.setTimeout(()=>o(!1,F,M),D)):y&&(tn(k),o(!1,F,M))},[v,o]),$=Ke(()=>{A.current(),z.current=void 0}),b=Ke(()=>{if(P.current){const F=en(a.floating).body;F.style.pointerEvents="",F.removeAttribute(is),P.current=!1}}),S=Ke(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);E.useEffect(()=>{if(!l)return;function F(G){if(tn(k),N.current=!1,f&&!bt(x.current)||ar(C.current)>0&&!sr(v.current,"open"))return;const V=sr(v.current,"open",x.current);V?k.current=window.setTimeout(()=>{w.current||o(!0,G,"hover")},V):n||o(!0,G,"hover")}function y(G){if(S()){b();return}A.current();const V=en(a.floating);if(tn(L),I.current=!1,p.current&&r.current.floatingContext){n||tn(k),z.current=p.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),$(),S()||q(G,!0,"safe-polygon")}});const U=z.current;V.addEventListener("mousemove",U),A.current=()=>{V.removeEventListener("mousemove",U)};return}(x.current==="touch"?!Qe(a.floating,G.relatedTarget):!0)&&q(G)}function M(G){S()||r.current.floatingContext&&(p.current==null||p.current({...r.current.floatingContext,tree:c,x:G.clientX,y:G.clientY,onClose(){b(),$(),S()||q(G)}})(G))}function D(){tn(k)}function B(G){S()||q(G,!1)}if(Le(a.domReference)){const G=a.domReference,V=a.floating;return n&&G.addEventListener("mouseleave",M),_&&G.addEventListener("mousemove",F,{once:!0}),G.addEventListener("mouseenter",F),G.addEventListener("mouseleave",y),V&&(V.addEventListener("mouseleave",M),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",B)),()=>{n&&G.removeEventListener("mouseleave",M),_&&G.removeEventListener("mousemove",F),G.removeEventListener("mouseenter",F),G.removeEventListener("mouseleave",y),V&&(V.removeEventListener("mouseleave",M),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",B))}}},[a,l,e,f,_,q,$,b,o,n,w,c,v,p,r,S,C]),Pe(()=>{var F;if(l&&n&&(F=p.current)!=null&&(F=F.__options)!=null&&F.blockPointerEvents&&O()){P.current=!0;const M=a.floating;if(Le(a.domReference)&&M){var y;const D=en(a.floating).body;D.setAttribute(is,"");const B=a.domReference,G=c==null||(y=c.nodesRef.current.find(V=>V.id===h))==null||(y=y.context)==null?void 0:y.elements.floating;return G&&(G.style.pointerEvents=""),D.style.pointerEvents="none",B.style.pointerEvents="auto",M.style.pointerEvents="auto",()=>{D.style.pointerEvents="",B.style.pointerEvents="",M.style.pointerEvents=""}}}},[l,n,h,a,c,p,O]),Pe(()=>{n||(x.current=void 0,I.current=!1,$(),b())},[n,$,b]),E.useEffect(()=>()=>{$(),tn(k),tn(L),b()},[l,a.domReference,$,b]);const T=E.useMemo(()=>{function F(y){x.current=y.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(y){const{nativeEvent:M}=y;function D(){!N.current&&!w.current&&o(!0,M,"hover")}f&&!bt(x.current)||n||ar(C.current)===0||I.current&&y.movementX**2+y.movementY**2<2||(tn(L),x.current==="touch"?D():(I.current=!0,L.current=window.setTimeout(D,ar(C.current))))}}},[f,o,n,w,C]);return E.useMemo(()=>l?{reference:T}:{},[l,T])}let ss=0;function Jn(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ss);const i=()=>e?.focus({preventScroll:n});r?i():ss=requestAnimationFrame(i)}function cr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&qt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Yc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Zc(e){return e?.ownerDocument||document}const ct={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function as(e){return e==="inert"?ct.inert:e==="aria-hidden"?ct["aria-hidden"]:ct.none}let lo=new WeakSet,co={},dr=0;const Jc=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ls=e=>e&&(e.host||ls(e.parentNode)),Qc=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ls(n);return e.contains(o)?o:null}).filter(n=>n!=null);function ed(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=Qc(t,e),l=new Set,d=new Set(a),u=[];co[r]||(co[r]=new WeakMap);const f=co[r];a.forEach(g),_(t),l.clear();function g(c){!c||l.has(c)||(l.add(c),c.parentNode&&g(c.parentNode))}function _(c){!c||d.has(c)||[].forEach.call(c.children,h=>{if(Pn(h)!=="script")if(l.has(h))_(h);else{const p=i?h.getAttribute(i):null,v=p!==null&&p!=="false",w=as(i),C=(w.get(h)||0)+1,x=(f.get(h)||0)+1;w.set(h,C),f.set(h,x),u.push(h),C===1&&v&&lo.add(h),x===1&&h.setAttribute(r,""),!v&&i&&h.setAttribute(i,i==="inert"?"":"true")}})}return dr++,()=>{u.forEach(c=>{const h=as(i),v=(h.get(c)||0)-1,w=(f.get(c)||0)-1;h.set(c,v),f.set(c,w),v||(!lo.has(c)&&i&&c.removeAttribute(i),lo.delete(c)),w||c.removeAttribute(r)}),dr--,dr||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,ct.none=new WeakMap,lo=new WeakSet,co={})}}function cs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Zc(e[0]).body;return ed(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,n)}const uo={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},fo=E.forwardRef(function(t,n){const[o,r]=E.useState();Pe(()=>{xi()&&r("button")},[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Zn("focus-guard")]:"",style:uo};return s.jsx("span",{...t,...i})}),ds=E.createContext(null),us=Zn("portal");function nd(e){e===void 0&&(e={});const{id:t,root:n}=e,o=$t(),r=fs(),[i,a]=E.useState(null),l=E.useRef(null);return Pe(()=>()=>{i?.remove(),queueMicrotask(()=>{l.current=null})},[i]),Pe(()=>{if(!o||l.current)return;const d=t?document.getElementById(t):null;if(!d)return;const u=document.createElement("div");u.id=o,u.setAttribute(us,""),d.appendChild(u),l.current=u,a(u)},[t,o]),Pe(()=>{if(n===null||!o||l.current)return;let d=n||r?.portalNode;d&&!Vo(d)&&(d=d.current),d=d||document.body;let u=null;t&&(u=document.createElement("div"),u.id=t,d.appendChild(u));const f=document.createElement("div");f.id=o,f.setAttribute(us,""),d=u||d,d.appendChild(f),l.current=f,a(f)},[t,n,o,r]),i}function _o(e){const{children:t,id:n,root:o,preserveTabOrder:r=!0}=e,i=nd({id:n,root:o}),[a,l]=E.useState(null),d=E.useRef(null),u=E.useRef(null),f=E.useRef(null),g=E.useRef(null),_=a?.modal,c=a?.open,h=!!a&&!a.modal&&a.open&&r&&!!(o||i);return E.useEffect(()=>{if(!i||!r||_)return;function p(v){i&&Ct(v)&&(v.type==="focusin"?Ai:lc)(i)}return i.addEventListener("focusin",p,!0),i.addEventListener("focusout",p,!0),()=>{i.removeEventListener("focusin",p,!0),i.removeEventListener("focusout",p,!0)}},[i,r,_]),E.useEffect(()=>{i&&(c||Ai(i))},[c,i]),s.jsxs(ds.Provider,{value:E.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:d,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:g,portalNode:i,setFocusManagerState:l}),[r,i]),children:[h&&i&&s.jsx(fo,{"data-type":"outside",ref:d,onFocus:p=>{if(Ct(p,i)){var v;(v=f.current)==null||v.focus()}else{const w=a?a.domReference:null,C=zi(w);C?.focus()}}}),h&&i&&s.jsx("span",{"aria-owns":i.id,style:uo}),i&&Do.createPortal(t,i),h&&i&&s.jsx(fo,{"data-type":"outside",ref:u,onFocus:p=>{if(Ct(p,i)){var v;(v=g.current)==null||v.focus()}else{const w=a?a.domReference:null,C=Fi(w);C?.focus(),a?.closeOnFocusOut&&a?.onOpenChange(!1,p.nativeEvent,"focus-out")}}})]})}const fs=()=>E.useContext(ds);function _s(e){return E.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const td=20;let Vn=[];function ur(){Vn=Vn.filter(e=>e.isConnected)}function od(e){ur(),e&&Pn(e)!=="body"&&(Vn.push(e),Vn.length>td&&(Vn=Vn.slice(-20)))}function gs(){return ur(),Vn[Vn.length-1]}function rd(e){const t=yt();return wi(e,t)?e:Xt(e,t)[0]||e}function ps(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const o=yt(),i=Wl(e,o).filter(l=>{const d=l.getAttribute("data-tabindex")||"";return wi(l,o)||l.hasAttribute("data-tabindex")&&!d.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const id=E.forwardRef(function(t,n){return s.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:uo})});function fr(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:l=!0,restoreFocus:d=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:g=!0,outsideElementsInert:_=!1,getInsideElements:c=()=>[]}=e,{open:h,onOpenChange:p,events:v,dataRef:w,elements:{domReference:C,floating:x}}=t,k=Ke(()=>{var R;return(R=w.current.floatingContext)==null?void 0:R.nodeId}),z=Ke(c),L=typeof a=="number"&&a<0,N=er(C)&&L,P=Jc(),A=P?i:!0,I=!A||P&&_,O=Je(r),q=Je(a),$=Je(l),b=Yn(),S=fs(),T=E.useRef(null),F=E.useRef(null),y=E.useRef(!1),M=E.useRef(!1),D=E.useRef(-1),B=E.useRef(-1),G=S!=null,V=Yt(x),J=Ke(function(R){return R===void 0&&(R=V),R?Xt(R,yt()):[]}),U=Ke(R=>{const te=J(R);return O.current.map(oe=>C&&oe==="reference"?C:V&&oe==="floating"?V:te).filter(Boolean).flat()});E.useEffect(()=>{if(o||!u)return;function R(oe){if(oe.key==="Tab"){Qe(V,$n(en(V)))&&J().length===0&&!N&&nn(oe);const ae=U(),ve=Fn(oe);O.current[0]==="reference"&&ve===C&&(nn(oe),oe.shiftKey?Jn(ae[ae.length-1]):Jn(ae[1])),O.current[1]==="floating"&&ve===V&&oe.shiftKey&&(nn(oe),Jn(ae[0]))}}const te=en(V);return te.addEventListener("keydown",R),()=>{te.removeEventListener("keydown",R)}},[o,C,V,u,O,N,J,U]),E.useEffect(()=>{if(o||!x)return;function R(te){const oe=Fn(te),ve=J().indexOf(oe);ve!==-1&&(D.current=ve)}return x.addEventListener("focusin",R),()=>{x.removeEventListener("focusin",R)}},[o,x,J]),E.useEffect(()=>{if(o||!g)return;function R(){M.current=!0,setTimeout(()=>{M.current=!1})}function te(ve){const ee=ve.relatedTarget,we=ve.currentTarget,Se=Fn(ve);queueMicrotask(()=>{const le=k(),ye=!(Qe(C,ee)||Qe(x,ee)||Qe(ee,x)||Qe(S?.portalNode,ee)||ee!=null&&ee.hasAttribute(Zn("focus-guard"))||b&&(Rn(b.nodesRef.current,le).find(W=>{var j,H;return Qe((j=W.context)==null?void 0:j.elements.floating,ee)||Qe((H=W.context)==null?void 0:H.elements.domReference,ee)})||ki(b.nodesRef.current,le).find(W=>{var j,H,me;return[(j=W.context)==null?void 0:j.elements.floating,Yt((H=W.context)==null?void 0:H.elements.floating)].includes(ee)||((me=W.context)==null?void 0:me.elements.domReference)===ee})));if(we===C&&V&&ps(V,O),d&&we!==C&&!(Se!=null&&Se.isConnected)&&$n(en(V))===en(V).body){We(V)&&V.focus();const W=D.current,j=J(),H=j[W]||j[j.length-1]||V;We(H)&&H.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(N||!u)&&ee&&ye&&!M.current&&ee!==gs()&&(y.current=!0,p(!1,ve,"focus-out"))})}const oe=!!(!b&&S);function ae(){tn(B),w.current.insideReactTree=!0,B.current=window.setTimeout(()=>{w.current.insideReactTree=!1})}if(x&&We(C))return C.addEventListener("focusout",te),C.addEventListener("pointerdown",R),x.addEventListener("focusout",te),oe&&x.addEventListener("focusout",ae,!0),()=>{C.removeEventListener("focusout",te),C.removeEventListener("pointerdown",R),x.removeEventListener("focusout",te),oe&&x.removeEventListener("focusout",ae,!0)}},[o,C,x,V,u,b,S,p,g,d,J,N,k,O,w]);const pe=E.useRef(null),ue=E.useRef(null),se=_s([pe,S?.beforeInsideRef]),he=_s([ue,S?.afterInsideRef]);E.useEffect(()=>{var R,te;if(o||!x)return;const oe=Array.from((S==null||(R=S.portalNode)==null?void 0:R.querySelectorAll("["+Zn("portal")+"]"))||[]),ve=(te=(b?ki(b.nodesRef.current,k()):[]).find(Se=>{var le;return er(((le=Se.context)==null?void 0:le.elements.domReference)||null)}))==null||(te=te.context)==null?void 0:te.elements.domReference,ee=[x,ve,...oe,...z(),T.current,F.current,pe.current,ue.current,S?.beforeOutsideRef.current,S?.afterOutsideRef.current,O.current.includes("reference")||N?C:null].filter(Se=>Se!=null),we=u||N?cs(ee,!I,I):cs(ee);return()=>{we()}},[o,C,x,u,O,S,N,A,I,b,k,z]),Pe(()=>{if(o||!We(V))return;const R=en(V),te=$n(R);queueMicrotask(()=>{const oe=U(V),ae=q.current,ve=(typeof ae=="number"?oe[ae]:ae.current)||V,ee=Qe(V,te);!L&&!ee&&h&&Jn(ve,{preventScroll:ve===V})})},[o,h,V,L,U,q]),Pe(()=>{if(o||!V)return;const R=en(V),te=$n(R);od(te);function oe(ee){let{reason:we,event:Se,nested:le}=ee;if(["hover","safe-polygon"].includes(we)&&Se.type==="mouseleave"&&(y.current=!0),we==="outside-press")if(le)y.current=!1;else if(Ii(Se)||Ei(Se))y.current=!1;else{let ye=!1;document.createElement("div").focus({get preventScroll(){return ye=!0,!1}}),ye?y.current=!1:y.current=!0}}v.on("openchange",oe);const ae=R.createElement("span");ae.setAttribute("tabindex","-1"),ae.setAttribute("aria-hidden","true"),Object.assign(ae.style,uo),G&&C&&C.insertAdjacentElement("afterend",ae);function ve(){if(typeof $.current=="boolean"){const ee=C||gs();return ee&&ee.isConnected?ee:ae}return $.current.current||ae}return()=>{v.off("openchange",oe);const ee=$n(R),we=Qe(x,ee)||b&&Rn(b.nodesRef.current,k(),!1).some(le=>{var ye;return Qe((ye=le.context)==null?void 0:ye.elements.floating,ee)}),Se=ve();queueMicrotask(()=>{const le=rd(Se);$.current&&!y.current&&We(le)&&(!(le!==ee&&ee!==R.body)||we)&&le.focus({preventScroll:!0}),ae.remove()})}},[o,x,V,$,w,v,b,G,C,k]),E.useEffect(()=>(queueMicrotask(()=>{y.current=!1}),()=>{queueMicrotask(ur)}),[o]),Pe(()=>{if(!o&&S)return S.setFocusManagerState({modal:u,closeOnFocusOut:g,open:h,onOpenChange:p,domReference:C}),()=>{S.setFocusManagerState(null)}},[o,S,u,h,p,g,C]),Pe(()=>{o||V&&ps(V,O)},[o,V,O]);function fe(R){return o||!f||!u?null:s.jsx(id,{ref:R==="start"?T:F,onClick:te=>p(!1,te.nativeEvent),children:typeof f=="string"?f:"Dismiss"})}const _e=!o&&A&&(u?!N:!0)&&(G||u);return s.jsxs(s.Fragment,{children:[_e&&s.jsx(fo,{"data-type":"inside",ref:se,onFocus:R=>{if(u){const oe=U();Jn(r[0]==="reference"?oe[0]:oe[oe.length-1])}else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(y.current=!1,Ct(R,S.portalNode)){const oe=Fi(C);oe?.focus()}else{var te;(te=S.beforeOutsideRef.current)==null||te.focus()}}}),!N&&fe("start"),n,fe("end"),_e&&s.jsx(fo,{"data-type":"inside",ref:he,onFocus:R=>{if(u)Jn(U()[0]);else if(S!=null&&S.preserveTabOrder&&S.portalNode)if(g&&(y.current=!0),Ct(R,S.portalNode)){const oe=zi(C);oe?.focus()}else{var te;(te=S.afterOutsideRef.current)==null||te.focus()}}})]})}function hs(e){return We(e.target)&&e.target.tagName==="BUTTON"}function sd(e){return We(e.target)&&e.target.tagName==="A"}function ms(e){return Qo(e)}function vs(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:a=!0,event:l="click",toggle:d=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0,stickIfOpen:g=!0}=t,_=E.useRef(),c=E.useRef(!1),h=E.useMemo(()=>({onPointerDown(p){_.current=p.pointerType},onMouseDown(p){const v=_.current;p.button===0&&l!=="click"&&(bt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){const v=_.current;if(l==="mousedown"&&_.current){_.current=void 0;return}bt(v,!0)&&u||(n&&d&&(!(r.current.openEvent&&g)||r.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){_.current=void 0,!(p.defaultPrevented||!f||hs(p))&&(p.key===" "&&!ms(i)&&(p.preventDefault(),c.current=!0),!sd(p)&&p.key==="Enter"&&o(!(n&&d),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!f||hs(p)||ms(i)||p.key===" "&&c.current&&(c.current=!1,o(!(n&&d),p.nativeEvent,"click"))}}),[r,i,l,u,f,o,n,g,d]);return E.useMemo(()=>a?{reference:h}:{},[a,h])}const ad={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ld={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},bs=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function go(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:d=!0,outsidePressEvent:u="pointerdown",referencePress:f=!1,referencePressEvent:g="pointerdown",ancestorScroll:_=!1,bubbles:c,capture:h}=t,p=Yn(),v=Ke(typeof d=="function"?d:()=>!1),w=typeof d=="function"?v:d,C=E.useRef(!1),{escapeKey:x,outsidePress:k}=bs(c),{escapeKey:z,outsidePress:L}=bs(h),N=E.useRef(!1),P=Ke(b=>{var S;if(!n||!a||!l||b.key!=="Escape"||N.current)return;const T=(S=i.current.floatingContext)==null?void 0:S.nodeId,F=p?Rn(p.nodesRef.current,T):[];if(!x&&(b.stopPropagation(),F.length>0)){let y=!0;if(F.forEach(M=>{var D;if((D=M.context)!=null&&D.open&&!M.context.dataRef.current.__escapeKeyBubbles){y=!1;return}}),!y)return}o(!1,Ql(b)?b.nativeEvent:b,"escape-key")}),A=Ke(b=>{var S;const T=()=>{var F;P(b),(F=Fn(b))==null||F.removeEventListener("keydown",T)};(S=Fn(b))==null||S.addEventListener("keydown",T)}),I=Ke(b=>{var S;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const F=C.current;if(C.current=!1,u==="click"&&F||T||typeof w=="function"&&!w(b))return;const y=Fn(b),M="["+Zn("inert")+"]",D=en(r.floating).querySelectorAll(M);let B=Le(y)?y:null;for(;B&&!En(B);){const U=Mn(B);if(En(U)||!Le(U))break;B=U}if(D.length&&Le(y)&&!Yl(y)&&!Qe(y,r.floating)&&Array.from(D).every(U=>!Qe(B,U)))return;if(We(y)&&$){const U=En(y),pe=hn(y),ue=/auto|scroll/,se=U||ue.test(pe.overflowX),he=U||ue.test(pe.overflowY),fe=se&&y.clientWidth>0&&y.scrollWidth>y.clientWidth,_e=he&&y.clientHeight>0&&y.scrollHeight>y.clientHeight,R=pe.direction==="rtl",te=_e&&(R?b.offsetX<=y.offsetWidth-y.clientWidth:b.offsetX>y.clientWidth),oe=fe&&b.offsetY>y.clientHeight;if(te||oe)return}const G=(S=i.current.floatingContext)==null?void 0:S.nodeId,V=p&&Rn(p.nodesRef.current,G).some(U=>{var pe;return Jo(b,(pe=U.context)==null?void 0:pe.elements.floating)});if(Jo(b,r.floating)||Jo(b,r.domReference)||V)return;const J=p?Rn(p.nodesRef.current,G):[];if(J.length>0){let U=!0;if(J.forEach(pe=>{var ue;if((ue=pe.context)!=null&&ue.open&&!pe.context.dataRef.current.__outsidePressBubbles){U=!1;return}}),!U)return}o(!1,b,"outside-press")}),O=Ke(b=>{var S;const T=()=>{var F;I(b),(F=Fn(b))==null||F.removeEventListener(u,T)};(S=Fn(b))==null||S.addEventListener(u,T)});E.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=k;let b=-1;function S(D){o(!1,D,"ancestor-scroll")}function T(){window.clearTimeout(b),N.current=!0}function F(){b=window.setTimeout(()=>{N.current=!1},jt()?5:0)}const y=en(r.floating);l&&(y.addEventListener("keydown",z?A:P,z),y.addEventListener("compositionstart",T),y.addEventListener("compositionend",F)),w&&y.addEventListener(u,L?O:I,L);let M=[];return _&&(Le(r.domReference)&&(M=Tn(r.domReference)),Le(r.floating)&&(M=M.concat(Tn(r.floating))),!Le(r.reference)&&r.reference&&r.reference.contextElement&&(M=M.concat(Tn(r.reference.contextElement)))),M=M.filter(D=>{var B;return D!==((B=y.defaultView)==null?void 0:B.visualViewport)}),M.forEach(D=>{D.addEventListener("scroll",S,{passive:!0})}),()=>{l&&(y.removeEventListener("keydown",z?A:P,z),y.removeEventListener("compositionstart",T),y.removeEventListener("compositionend",F)),w&&y.removeEventListener(u,L?O:I,L),M.forEach(D=>{D.removeEventListener("scroll",S)}),window.clearTimeout(b)}},[i,r,l,w,u,n,o,_,a,x,k,P,z,A,I,L,O]),E.useEffect(()=>{i.current.insideReactTree=!1},[i,w,u]);const q=E.useMemo(()=>({onKeyDown:P,...f&&{[ad[g]]:b=>{o(!1,b.nativeEvent,"reference-press")},...g!=="click"&&{onClick(b){o(!1,b.nativeEvent,"reference-press")}}}}),[P,o,f,g]),$=E.useMemo(()=>({onKeyDown:P,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[ld[u]]:()=>{i.current.insideReactTree=!0}}),[P,u,i]);return E.useMemo(()=>a?{reference:q,floating:$}:{},[a,q,$])}function cd(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=$t(),i=E.useRef({}),[a]=E.useState(()=>es()),l=lt()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Le(c)&&Uc("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,u]=E.useState(o.reference),f=Ke((c,h,p)=>{i.current.openEvent=c?h:void 0,a.emit("openchange",{open:c,event:h,reason:p,nested:l}),n?.(c,h,p)}),g=E.useMemo(()=>({setPositionReference:u}),[]),_=E.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return E.useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:_,events:a,floatingId:r,refs:g}),[t,f,_,a,r,g])}function po(e){e===void 0&&(e={});const{nodeId:t}=e,n=cd({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=E.useState(null),[l,d]=E.useState(null),f=r?.domReference||i,g=E.useRef(null),_=Yn();Pe(()=>{f&&(g.current=f)},[f]);const c=Vc({...e,elements:{...r,...l&&{reference:l}}}),h=E.useCallback(x=>{const k=Le(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),getClientRects:()=>x.getClientRects(),contextElement:x}:x;d(k),c.refs.setReference(k)},[c.refs]),p=E.useCallback(x=>{(Le(x)||x===null)&&(g.current=x,a(x)),(Le(c.refs.reference.current)||c.refs.reference.current===null||x!==null&&!Le(x))&&c.refs.setReference(x)},[c.refs]),v=E.useMemo(()=>({...c.refs,setReference:p,setPositionReference:h,domReference:g}),[c.refs,p,h]),w=E.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),C=E.useMemo(()=>({...c,...o,refs:v,elements:w,nodeId:t}),[c,v,w,t,o]);return Pe(()=>{o.dataRef.current.floatingContext=C;const x=_?.nodesRef.current.find(k=>k.id===t);x&&(x.context=C)}),E.useMemo(()=>({...c,context:C,refs:v,elements:w}),[c,v,w,C])}function _r(){return Kl()&&xi()}function dd(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,events:r,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:d=!0}=t,u=E.useRef(!1),f=E.useRef(-1),g=E.useRef(!0);E.useEffect(()=>{if(!l)return;const c=gn(a.domReference);function h(){!n&&We(a.domReference)&&a.domReference===$n(en(a.domReference))&&(u.current=!0)}function p(){g.current=!0}function v(){g.current=!1}return c.addEventListener("blur",h),_r()&&(c.addEventListener("keydown",p,!0),c.addEventListener("pointerdown",v,!0)),()=>{c.removeEventListener("blur",h),_r()&&(c.removeEventListener("keydown",p,!0),c.removeEventListener("pointerdown",v,!0))}},[a.domReference,n,l]),E.useEffect(()=>{if(!l)return;function c(h){let{reason:p}=h;(p==="reference-press"||p==="escape-key")&&(u.current=!0)}return r.on("openchange",c),()=>{r.off("openchange",c)}},[r,l]),E.useEffect(()=>()=>{tn(f)},[]);const _=E.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(c){if(u.current)return;const h=Fn(c.nativeEvent);if(d&&Le(h)){if(_r()&&!c.relatedTarget){if(!g.current&&!Qo(h))return}else if(!Zl(h))return}o(!0,c.nativeEvent,"focus")},onBlur(c){u.current=!1;const h=c.relatedTarget,p=c.nativeEvent,v=Le(h)&&h.hasAttribute(Zn("focus-guard"))&&h.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{var w;const C=$n(a.domReference?a.domReference.ownerDocument:document);!h&&C===a.domReference||Qe((w=i.current.floatingContext)==null?void 0:w.refs.floating.current,C)||Qe(a.domReference,C)||v||o(!1,p,"focus")})}}),[i,a.domReference,o,d]);return E.useMemo(()=>l?{reference:_}:{},[l,_])}function gr(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Xi]:a,[Yi]:l,...d}=e;i=d}return{...n==="floating"&&{tabIndex:-1,[Hc]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(d=>{let[u,f]=d;if(!(r&&[Xi,Yi].includes(u)))if(u.indexOf("on")===0){if(o.has(u)||o.set(u,[]),typeof f=="function"){var g;(g=o.get(u))==null||g.push(f),a[u]=function(){for(var _,c=arguments.length,h=new Array(c),p=0;p<c;p++)h[p]=arguments[p];return(_=o.get(u))==null?void 0:_.map(v=>v(...h)).find(v=>v!==void 0)}}}else a[u]=f}),a),{})}}function ho(e){e===void 0&&(e=[]);const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=E.useCallback(l=>gr(l,e,"reference"),t),i=E.useCallback(l=>gr(l,e,"floating"),n),a=E.useCallback(l=>gr(l,e,"item"),o);return E.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:a}),[r,i,a])}const ud="Escape";function mo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function vo(e,t){return mo(t,e===Zi||e===so,e===xt||e===St)}function pr(e,t,n){return mo(t,e===so,n?e===xt:e===St)||e==="Enter"||e===" "||e===""}function ws(e,t,n){return mo(t,n?e===xt:e===St,e===so)}function ys(e,t,n,o){const r=n?e===St:e===xt,i=e===Zi;return t==="both"||t==="horizontal"&&o&&o>1?e===ud:mo(t,r,i)}function hr(e,t){const{open:n,onOpenChange:o,elements:r,floatingId:i}=e,{listRef:a,activeIndex:l,onNavigate:d=()=>{},enabled:u=!0,selectedIndex:f=null,allowEscape:g=!1,loop:_=!1,nested:c=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:v="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:C=!0,disabledIndices:x=void 0,orientation:k="vertical",parentOrientation:z,cols:L=1,scrollItemIntoView:N=!0,virtualItemRef:P,itemSizes:A,dense:I=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(_||ao("`useListNavigation` looping must be enabled to allow escaping."),p||ao("`useListNavigation` must be virtual to allow escaping.")),k==="vertical"&&L>1&&ao("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const O=Yt(r.floating),q=Je(O),$=lt(),b=Yn();Pe(()=>{e.dataRef.current.orientation=k},[e,k]);const S=Ke(()=>{d(y.current===-1?null:y.current)}),T=er(r.domReference),F=E.useRef(v),y=E.useRef(f??-1),M=E.useRef(null),D=E.useRef(!0),B=E.useRef(S),G=E.useRef(!!r.floating),V=E.useRef(n),J=E.useRef(!1),U=E.useRef(!1),pe=Je(x),ue=Je(n),se=Je(N),he=Je(f),[fe,_e]=E.useState(),[R,te]=E.useState(),oe=Ke(()=>{function W(Y){if(p){var Ce;(Ce=Y.id)!=null&&Ce.endsWith("-fui-option")&&(Y.id=i+"-"+Math.random().toString(16).slice(2,10)),_e(Y.id),b?.events.emit("virtualfocus",Y),P&&(P.current=Y)}else Jn(Y,{sync:J.current,preventScroll:!0})}const j=a.current[y.current],H=U.current;j&&W(j),(J.current?Y=>Y():requestAnimationFrame)(()=>{const Y=a.current[y.current]||j;if(!Y)return;j||W(Y);const Ce=se.current;Ce&&ve&&(H||!D.current)&&(Y.scrollIntoView==null||Y.scrollIntoView(typeof Ce=="boolean"?{block:"nearest",inline:"nearest"}:Ce))})});Pe(()=>{u&&(n&&r.floating?F.current&&f!=null&&(U.current=!0,y.current=f,S()):G.current&&(y.current=-1,B.current()))},[u,n,r.floating,f,S]),Pe(()=>{if(u&&n&&r.floating)if(l==null){if(J.current=!1,he.current!=null)return;if(G.current&&(y.current=-1,oe()),(!V.current||!G.current)&&F.current&&(M.current!=null||F.current===!0&&M.current==null)){let W=0;const j=()=>{a.current[0]==null?(W<2&&(W?requestAnimationFrame:queueMicrotask)(j),W++):(y.current=M.current==null||pr(M.current,k,h)||c?nr(a,pe.current):Mi(a,pe.current),M.current=null,S())};j()}}else wt(a,l)||(y.current=l,oe(),U.current=!1)},[u,n,r.floating,l,he,c,a,k,h,S,oe,pe]),Pe(()=>{var W;if(!u||r.floating||!b||p||!G.current)return;const j=b.nodesRef.current,H=(W=j.find(Ce=>Ce.id===$))==null||(W=W.context)==null?void 0:W.elements.floating,me=$n(en(r.floating)),Y=j.some(Ce=>Ce.context&&Qe(Ce.context.elements.floating,me));H&&!Y&&D.current&&H.focus({preventScroll:!0})},[u,r.floating,b,$,p]),Pe(()=>{if(!u||!b||!p||$)return;function W(j){te(j.id),P&&(P.current=j)}return b.events.on("virtualfocus",W),()=>{b.events.off("virtualfocus",W)}},[u,b,p,$,P]),Pe(()=>{B.current=S,V.current=n,G.current=!!r.floating}),Pe(()=>{n||(M.current=null,F.current=v)},[n,v]);const ae=l!=null,ve=E.useMemo(()=>{function W(H){if(!ue.current)return;const me=a.current.indexOf(H);me!==-1&&y.current!==me&&(y.current=me,S())}return{onFocus(H){let{currentTarget:me}=H;J.current=!0,W(me)},onClick:H=>{let{currentTarget:me}=H;return me.focus({preventScroll:!0})},onMouseMove(H){let{currentTarget:me}=H;J.current=!0,U.current=!1,w&&W(me)},onPointerLeave(H){let{pointerType:me}=H;if(!(!D.current||me==="touch")&&(J.current=!0,!!w&&(y.current=-1,S(),!p))){var Y;(Y=q.current)==null||Y.focus({preventScroll:!0})}}}},[ue,q,w,a,S,p]),ee=E.useCallback(()=>{var W;return z??(b==null||(W=b.nodesRef.current.find(j=>j.id===$))==null||(W=W.context)==null||(W=W.dataRef)==null?void 0:W.current.orientation)},[$,b,z]),we=Ke(W=>{if(D.current=!1,J.current=!0,W.which===229||!ue.current&&W.currentTarget===q.current)return;if(c&&ys(W.key,k,h,L)){vo(W.key,ee())||nn(W),o(!1,W.nativeEvent,"list-navigation"),We(r.domReference)&&(p?b?.events.emit("virtualfocus",r.domReference):r.domReference.focus());return}const j=y.current,H=nr(a,x),me=Mi(a,x);if(T||(W.key==="Home"&&(nn(W),y.current=H,S()),W.key==="End"&&(nn(W),y.current=me,S())),L>1){const Y=A||Array.from({length:a.current.length},()=>({width:1,height:1})),Ce=ic(Y,L,I),Re=Ce.findIndex(Ve=>Ve!=null&&!Jt(a,Ve,x)),dn=Ce.reduce((Ve,Ze,re)=>Ze!=null&&!Jt(a,Ze,x)?re:Ve,-1),Ye=Ce[rc({current:Ce.map(Ve=>Ve!=null?a.current[Ve]:null)},{event:W,orientation:k,loop:_,rtl:h,cols:L,disabledIndices:ac([...(typeof x!="function"?x:null)||a.current.map((Ve,Ze)=>Jt(a,Ze,x)?Ze:void 0),void 0],Ce),minIndex:Re,maxIndex:dn,prevIndex:sc(y.current>me?H:y.current,Y,Ce,L,W.key===so?"bl":W.key===(h?xt:St)?"tr":"tl"),stopEvent:!0})];if(Ye!=null&&(y.current=Ye,S()),k==="both")return}if(vo(W.key,k)){if(nn(W),n&&!p&&$n(W.currentTarget.ownerDocument)===W.currentTarget){y.current=pr(W.key,k,h)?H:me,S();return}pr(W.key,k,h)?_?y.current=j>=me?g&&j!==a.current.length?-1:H:sn(a,{startingIndex:j,disabledIndices:x}):y.current=Math.min(me,sn(a,{startingIndex:j,disabledIndices:x})):_?y.current=j<=H?g&&j!==-1?a.current.length:me:sn(a,{startingIndex:j,decrement:!0,disabledIndices:x}):y.current=Math.max(H,sn(a,{startingIndex:j,decrement:!0,disabledIndices:x})),wt(a,y.current)&&(y.current=-1),S()}}),Se=E.useMemo(()=>p&&n&&ae&&{"aria-activedescendant":R||fe},[p,n,ae,R,fe]),le=E.useMemo(()=>({"aria-orientation":k==="both"?void 0:k,...T?{}:Se,onKeyDown:we,onPointerMove(){D.current=!0}}),[Se,we,k,T]),ye=E.useMemo(()=>{function W(H){v==="auto"&&Ii(H.nativeEvent)&&(F.current=!0)}function j(H){F.current=v,v==="auto"&&Ei(H.nativeEvent)&&(F.current=!0)}return{...Se,onKeyDown(H){D.current=!1;const me=H.key.startsWith("Arrow"),Y=["Home","End"].includes(H.key),Ce=me||Y,Re=ws(H.key,k,h),dn=ys(H.key,k,h,L),Ye=ws(H.key,ee(),h),Ve=vo(H.key,k),Ze=(c?Ye:Ve)||H.key==="Enter"||H.key.trim()==="";if(p&&n){const Ee=b?.nodesRef.current.find(fn=>fn.parentId==null),on=b&&Ee?Jl(b.nodesRef.current,Ee.id):null;if(Ce&&on&&P){const fn=new KeyboardEvent("keydown",{key:H.key,bubbles:!0});if(Re||dn){var re,Be;const Q=((re=on.context)==null?void 0:re.elements.domReference)===H.currentTarget,Fe=dn&&!Q?(Be=on.context)==null?void 0:Be.elements.domReference:Re?a.current.find($e=>$e?.id===fe):null;Fe&&(nn(H),Fe.dispatchEvent(fn),te(void 0))}if((Ve||Y)&&on.context&&on.context.open&&on.parentId&&H.currentTarget!==on.context.elements.domReference){var be;nn(H),(be=on.context.elements.domReference)==null||be.dispatchEvent(fn);return}}return we(H)}if(!(!n&&!C&&me)){if(Ze){const Ee=vo(H.key,ee());M.current=c&&Ee?null:H.key}if(c){Ye&&(nn(H),n?(y.current=nr(a,pe.current),S()):o(!0,H.nativeEvent,"list-navigation"));return}Ve&&(f!=null&&(y.current=f),nn(H),!n&&C?o(!0,H.nativeEvent,"list-navigation"):we(H),n&&S())}},onFocus(){n&&!p&&(y.current=-1,S())},onPointerDown:j,onPointerEnter:j,onMouseDown:W,onClick:W}},[fe,Se,L,we,pe,v,a,c,S,o,n,C,k,ee,h,f,b,p,P]);return E.useMemo(()=>u?{reference:ye,floating:le,item:ve}:{},[u,ye,le,ve])}const fd=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bo(e,t){var n,o;t===void 0&&(t={});const{open:r,elements:i,floatingId:a}=e,{enabled:l=!0,role:d="dialog"}=t,u=$t(),f=((n=i.domReference)==null?void 0:n.id)||u,g=E.useMemo(()=>{var C;return((C=Yt(i.floating))==null?void 0:C.id)||a},[i.floating,a]),_=(o=fd.get(d))!=null?o:d,h=lt()!=null,p=E.useMemo(()=>_==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:r?g:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":_==="alertdialog"?"dialog":_,"aria-controls":r?g:void 0,..._==="listbox"&&{role:"combobox"},..._==="menu"&&{id:f},..._==="menu"&&h&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[_,g,h,r,f,d]),v=E.useMemo(()=>{const C={id:g,..._&&{role:_}};return _==="tooltip"||d==="label"?C:{...C,..._==="menu"&&{"aria-labelledby":f}}},[_,g,f,d]),w=E.useCallback(C=>{let{active:x,selected:k}=C;const z={role:"option",...x&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...z,"aria-selected":k}}return{}},[g,d]);return E.useMemo(()=>l?{reference:p,floating:v,item:w}:{},[l,p,v,w])}const Cs=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function dt(e,t){return typeof e=="function"?e(t):e}function _d(e,t){const[n,o]=E.useState(e);return e&&!n&&o(!0),E.useEffect(()=>{if(!e&&n){const r=setTimeout(()=>o(!1),t);return()=>clearTimeout(r)}},[e,n,t]),n}function gd(e,t){t===void 0&&(t={});const{open:n,elements:{floating:o}}=e,{duration:r=250}=t,a=(typeof r=="number"?r:r.close)||0,[l,d]=E.useState("unmounted"),u=_d(n,a);return!u&&l==="close"&&d("unmounted"),Pe(()=>{if(o){if(n){d("initial");const f=requestAnimationFrame(()=>{Do.flushSync(()=>{d("open")})});return()=>{cancelAnimationFrame(f)}}d("close")}},[n,o]),{isMounted:u,status:l}}function wo(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:o,close:r,common:i,duration:a=250}=t,l=e.placement,d=l.split("-")[0],u=E.useMemo(()=>({side:d,placement:l}),[d,l]),f=typeof a=="number",g=(f?a:a.open)||0,_=(f?a:a.close)||0,[c,h]=E.useState(()=>({...dt(i,u),...dt(n,u)})),{isMounted:p,status:v}=gd(e,{duration:a}),w=Je(n),C=Je(o),x=Je(r),k=Je(i);return Pe(()=>{const z=dt(w.current,u),L=dt(x.current,u),N=dt(k.current,u),P=dt(C.current,u)||Object.keys(z).reduce((A,I)=>(A[I]="",A),{});if(v==="initial"&&h(A=>({transitionProperty:A.transitionProperty,...N,...z})),v==="open"&&h({transitionProperty:Object.keys(P).map(Cs).join(","),transitionDuration:g+"ms",...N,...P}),v==="close"){const A=L||z;h({transitionProperty:Object.keys(A).map(Cs).join(","),transitionDuration:_+"ms",...N,...A})}},[_,x,w,C,k,g,v,u]),{isMounted:p,styles:c}}function xs(e,t){var n;const{open:o,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:l,onTypingChange:d,enabled:u=!0,findMatch:f=null,resetMs:g=750,ignoreKeys:_=[],selectedIndex:c=null}=t,h=E.useRef(-1),p=E.useRef(""),v=E.useRef((n=c??a)!=null?n:-1),w=E.useRef(null),C=Ke(l),x=Ke(d),k=Je(f),z=Je(_);Pe(()=>{o&&(tn(h),w.current=null,p.current="")},[o]),Pe(()=>{if(o&&p.current===""){var I;v.current=(I=c??a)!=null?I:-1}},[o,c,a]);const L=Ke(I=>{I?r.current.typing||(r.current.typing=I,x(I)):r.current.typing&&(r.current.typing=I,x(I))}),N=Ke(I=>{function O(T,F,y){const M=k.current?k.current(F,y):F.find(D=>D?.toLocaleLowerCase().indexOf(y.toLocaleLowerCase())===0);return M?T.indexOf(M):-1}const q=i.current;if(p.current.length>0&&p.current[0]!==" "&&(O(q,q,p.current)===-1?L(!1):I.key===" "&&nn(I)),q==null||z.current.includes(I.key)||I.key.length!==1||I.ctrlKey||I.metaKey||I.altKey)return;o&&I.key!==" "&&(nn(I),L(!0)),q.every(T=>{var F,y;return T?((F=T[0])==null?void 0:F.toLocaleLowerCase())!==((y=T[1])==null?void 0:y.toLocaleLowerCase()):!0})&&p.current===I.key&&(p.current="",v.current=w.current),p.current+=I.key,tn(h),h.current=window.setTimeout(()=>{p.current="",v.current=w.current,L(!1)},g);const b=v.current,S=O(q,[...q.slice((b||0)+1),...q.slice(0,(b||0)+1)],p.current);S!==-1?(C(S),w.current=S):I.key!==" "&&(p.current="",L(!1))}),P=E.useMemo(()=>({onKeyDown:N}),[N]),A=E.useMemo(()=>({onKeyDown:N,onKeyUp(I){I.key===" "&&L(!1)}}),[N,L]);return E.useMemo(()=>u?{reference:P,floating:A}:{},[u,P,A])}function Ss(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Ss(e,r.id,n)])}function $s(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,l=i-1;a<i;l=a++){const[d,u]=t[a]||[0,0],[f,g]=t[l]||[0,0];u>=o!=g>=o&&n<=(f-d)*(o-u)/(g-u)+d&&(r=!r)}return r}function pd(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function ks(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,a=null,l=null,d=typeof performance<"u"?performance.now():0;function u(g,_){const c=performance.now(),h=c-d;if(a===null||l===null||h===0)return a=g,l=_,d=c,null;const p=g-a,v=_-l,C=Math.sqrt(p*p+v*v)/h;return a=g,l=_,d=c,C}const f=g=>{let{x:_,y:c,placement:h,elements:p,onClose:v,nodeId:w,tree:C}=g;return function(k){function z(){tn(r),v()}if(tn(r),!p.domReference||!p.floating||h==null||_==null||c==null)return;const{clientX:L,clientY:N}=k,P=[L,N],A=Yc(k),I=k.type==="mouseleave",O=cr(p.floating,A),q=cr(p.domReference,A),$=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),S=h.split("-")[0],T=_>b.right-b.width/2,F=c>b.bottom-b.height/2,y=pd(P,$),M=b.width>$.width,D=b.height>$.height,B=(M?$:b).left,G=(M?$:b).right,V=(D?$:b).top,J=(D?$:b).bottom;if(O&&(i=!0,!I))return;if(q&&(i=!1),q&&!I){i=!0;return}if(I&&Le(k.relatedTarget)&&cr(p.floating,k.relatedTarget)||C&&Ss(C.nodesRef.current,w).length)return;if(S==="top"&&c>=$.bottom-1||S==="bottom"&&c<=$.top+1||S==="left"&&_>=$.right-1||S==="right"&&_<=$.left+1)return z();let U=[];switch(S){case"top":U=[[B,$.top+1],[B,b.bottom-1],[G,b.bottom-1],[G,$.top+1]];break;case"bottom":U=[[B,b.top+1],[B,$.bottom-1],[G,$.bottom-1],[G,b.top+1]];break;case"left":U=[[b.right-1,J],[b.right-1,V],[$.left+1,V],[$.left+1,J]];break;case"right":U=[[$.right-1,J],[$.right-1,V],[b.left+1,V],[b.left+1,J]];break}function pe(ue){let[se,he]=ue;switch(S){case"top":{const fe=[M?se+t/2:T?se+t*4:se-t*4,he+t+1],_e=[M?se-t/2:T?se+t*4:se-t*4,he+t+1],R=[[b.left,T||M?b.bottom-t:b.top],[b.right,T?M?b.bottom-t:b.top:b.bottom-t]];return[fe,_e,...R]}case"bottom":{const fe=[M?se+t/2:T?se+t*4:se-t*4,he-t],_e=[M?se-t/2:T?se+t*4:se-t*4,he-t],R=[[b.left,T||M?b.top+t:b.bottom],[b.right,T?M?b.top+t:b.bottom:b.top+t]];return[fe,_e,...R]}case"left":{const fe=[se+t+1,D?he+t/2:F?he+t*4:he-t*4],_e=[se+t+1,D?he-t/2:F?he+t*4:he-t*4];return[...[[F||D?b.right-t:b.left,b.top],[F?D?b.right-t:b.left:b.right-t,b.bottom]],fe,_e]}case"right":{const fe=[se-t,D?he+t/2:F?he+t*4:he-t*4],_e=[se-t,D?he-t/2:F?he+t*4:he-t*4],R=[[F||D?b.left+t:b.right,b.top],[F?D?b.left+t:b.right:b.left+t,b.bottom]];return[fe,_e,...R]}}}if(!$s([L,N],U)){if(i&&!y)return z();if(!I&&o){const ue=u(k.clientX,k.clientY);if(ue!==null&&ue<.1)return z()}$s([L,N],pe([_,c]))?!i&&o&&(r.current=window.setTimeout(z,40)):z()}}};return f.__options={blockPointerEvents:n},f}function ut(e,t,n){let o=n.initialDeps??[],r;function i(){var a,l,d,u;let f;n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now());const g=e();if(!(g.length!==o.length||g.some((h,p)=>o[p]!==h)))return r;o=g;let c;if(n.key&&((l=n.debug)!=null&&l.call(n))&&(c=Date.now()),r=t(...g),n.key&&((d=n.debug)!=null&&d.call(n))){const h=Math.round((Date.now()-f)*100)/100,p=Math.round((Date.now()-c)*100)/100,v=p/16,w=(C,x)=>{for(C=String(C);C.length<x;)C=" "+C;return C};console.info(`%c⏱ ${w(p,5)} /${w(h,5)} ms`,`
5
5
  font-size: .6rem;
6
6
  font-weight: bold;
7
- color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,t?.key)}return(u=t?.onChange)==null||u.call(t,r),r}return i.updateDeps=s=>{o=s},i}function ms(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Qc=(e,n)=>Math.abs(e-n)<1.01,Jc=(e,n,t)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>n.apply(this,r),t)}},vs=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},ed=e=>e,td=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=n;r<=t;r++)o.push(r);return o},nd=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;const r=s=>{const{width:l,height:d}=s;n({width:Math.round(l),height:Math.round(d)})};if(r(vs(t)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(s=>{const l=()=>{const d=s[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(vs(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},bs={passive:!0},ws=typeof window>"u"?!0:"onscrollend"in window,od=(e,n)=>{const t=e.scrollElement;if(!t)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&ws?()=>{}:Jc(o,()=>{n(r,!1)},e.options.isScrollingResetDelay),s=f=>()=>{const{horizontal:p,isRtl:_}=e.options;r=p?t.scrollLeft*(_&&-1||1):t.scrollTop,i(),n(r,f)},l=s(!0),d=s(!1);d(),t.addEventListener("scroll",l,bs);const u=e.options.useScrollendEvent&&ws;return u&&t.addEventListener("scrollend",d,bs),()=>{t.removeEventListener("scroll",l),u&&t.removeEventListener("scrollend",d)}},rd=(e,n,t)=>{if(n?.borderBoxSize){const o=n.borderBoxSize[0];if(o)return Math.round(o[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},id=(e,{adjustments:n=0,behavior:t},o)=>{var r,i;const s=e+n;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:s,behavior:t})};class sd{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const o=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),t=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([o,r])=>{typeof r>"u"&&delete t[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ed,rangeExtractor:td,onChange:()=>{},measureElement:rd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,t)},this.maybeNotify=an(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,o)=>{const r=new Map,i=new Map;for(let s=o-1;s>=0;s--){const l=t[s];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,l)=>s.end===l.end?s.index-l.index:s.end-l.end)[0]:void 0},this.getMeasurementOptions=an(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,o,r,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=an(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:s},l)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<t;f++){const p=i(f),_=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=_?_.end+this.options.gap:o+r,h=l.get(p),g=typeof h=="number"?h:this.options.estimateSize(f),m=c+g,b=_?_.lane:f%this.options.lanes;u[f]={index:f,start:c,size:g,end:m,key:p,lane:b}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=an(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,o,r,i)=>this.range=t.length>0&&o>0?ad({measurements:t,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=an(()=>{let t=null,o=null;const r=this.calculateRange();return r&&(t=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,o]},(t,o,r,i,s)=>i===null||s===null?[]:t({startIndex:i,endIndex:s,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const o=this.options.indexAttribute,r=t.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(t,o)=>{const r=this.indexFromElement(t),i=this.measurementsCache[r];if(!i)return;const s=i.key,l=this.elementsCache.get(s);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(s,t)),t.isConnected&&this.resizeItem(r,this.options.measureElement(t,o,this))},this.resizeItem=(t,o)=>{const r=this.measurementsCache[t];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,s=o-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(t,void 0)},this.getVirtualItems=an(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,o)=>{const r=[];for(let i=0,s=t.length;i<s;i++){const l=t[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const o=this.getMeasurements();if(o.length!==0)return ms(o[ys(0,o.length-1,r=>ms(o[r]).start,t)])},this.getOffsetForAlignment=(t,o,r=0)=>{const i=this.getSize(),s=this.getScrollOffset();o==="auto"&&(o=t>=s+i?"end":"start"),o==="center"?t+=(r-i)/2:o==="end"&&(t-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,t),0)},this.getOffsetForIndex=(t,o="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const r=this.measurementsCache[t];if(!r)return;const i=this.getSize(),s=this.getScrollOffset();if(o==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=s+this.options.scrollPaddingStart)o="start";else return[s,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(t,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1));let i=0;const s=10,l=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(t,u);if(!f){console.warn("Failed to get offset for index:",t);return}const[p,_]=f;this._scrollToOffset(p,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(t,_);if(!h){console.warn("Failed to get offset for index:",t);return}Qc(h[0],c)||d(_)})},d=u=>{this.targetWindow&&(i++,i<s?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,s),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${t} after ${s} attempts.`))};l(o)},this.scrollBy=(t,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var t;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((t=o[o.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=o.length-1;for(;s>=0&&i.some(l=>l===null);){const l=o[s];i[l.lane]===null&&(i[l.lane]=l.end),s--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:o,behavior:r})=>{this.options.scrollToFn(t,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(n)}}const ys=(e,n,t,o)=>{for(;e<=n;){const r=(e+n)/2|0,i=t(r);if(i<o)e=r+1;else if(i>o)n=r-1;else return r}return e>0?e-1:0};function ad({measurements:e,outerSize:n,scrollOffset:t,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let s=ys(0,r,i,t),l=s;if(o===1)for(;l<r&&e[l].end<t+n;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(f=>f<t+n);){const f=e[l];d[f.lane]=f.end,l++}const u=Array(o).fill(t+n);for(;s>=0&&u.some(f=>f>=t);){const f=e[s];u[f.lane]=f.start,s--}s=Math.max(0,s-s%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:s,endIndex:l}}const xs=typeof document<"u"?M.useLayoutEffect:M.useEffect;function ld(e){const n=M.useReducer(()=>({}),{})[1],t={...e,onChange:(r,i)=>{var s;i?un.flushSync(n):n(),(s=e.onChange)==null||s.call(e,r,i)}},[o]=M.useState(()=>new sd(t));return o.setOptions(t),xs(()=>o._didMount(),[]),xs(()=>o._willUpdate()),o}function cd(e){return ld({observeElementRect:nd,observeElementOffset:od,scrollToFn:id,...e})}function dd(e,n){const[t,o]=M.useState(e);return M.useEffect(()=>{const r=setTimeout(()=>{o(e)},n);return()=>{clearTimeout(r)}},[e,n]),t}function mo(e){const n=M.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),t=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return M.useSyncExternalStore(n,t,o)}function lr(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function Cn(e,n){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[n]??"":e)}function vo(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function Cs(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ss(e,n,t,o){if(!n.trim())return e;const r=Cs(n.trim());return o?e.filter(i=>o(i,n)):e.filter(i=>Cs(lr(i,t)).includes(r))}function ud(e){if(e.length===0)return!1;const n=e[0];return typeof n=="object"&&n!==null&&"grupo"in n&&"opciones"in n&&Array.isArray(n.opciones)}function fd(e){const n=[];let t=0;for(const o of e){n.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:t++});for(const r of o.opciones)n.push({tipo:"opcion",datos:r,indice:t++})}return n}function _d(e,n,t,o){return n.trim()?e.map(r=>({...r,opciones:Ss(r.opciones,n,t,o)})).filter(r=>r.opciones.length>0):e}function gd(e){return e.map((n,t)=>n.tipo==="grupo"||n.datos&&vo(n.datos)?t:null).filter(n=>n!==null)}function pd(e,n){if(!n)return null;const t=n(e);return t===!0||t==null?null:typeof t=="string"?t:typeof t=="object"&&"message"in t?t.message??"Selección inválida":"Selección inválida"}function hd(e,n,t){return e!==void 0?e:n==="invalid"?!0:n==="valid"?!1:!!t}function md(e,n="Opción"){return Array.from({length:e},(t,o)=>`${n} ${o+1}`)}function vd(e){return Array.from({length:e},(n,t)=>({id:`usr-${t+1}`,nombre:`Usuario ${t+1}`,email:`usuario${t+1}@test.com`}))}const $s=({size:e="1em",...n})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:a.jsx("path",{d:"m6 9 6 6 6-6"})}),ks=({size:e="1em",...n})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[a.jsx("path",{d:"M18 6 6 18"}),a.jsx("path",{d:"m6 6 12 12"})]}),bd=({size:e="1em",...n})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:a.jsx("path",{d:"M20 6 9 17l-5-5"})}),wd=({size:e="1em",...n})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:[a.jsx("circle",{cx:"11",cy:"11",r:"8"}),a.jsx("path",{d:"m21 21-4.3-4.3"})]}),yd=({size:e="1em",...n})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n,children:a.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Y={contenedor_base:"_contenedor_base_1co2q_1",tam_sm:"_tam_sm_1co2q_41",tam_lg:"_tam_lg_1co2q_55",radio_none:"_radio_none_1co2q_69",radio_sm:"_radio_sm_1co2q_77",radio_md:"_radio_md_1co2q_85",radio_lg:"_radio_lg_1co2q_93",radio_full:"_radio_full_1co2q_101",color_default:"_color_default_1co2q_109",color_primary:"_color_primary_1co2q_111",color_secondary:"_color_secondary_1co2q_119",color_success:"_color_success_1co2q_127",color_warning:"_color_warning_1co2q_135",color_danger:"_color_danger_1co2q_143",etiqueta:"_etiqueta_1co2q_151",marca_requerido:"_marca_requerido_1co2q_167",trigger:"_trigger_1co2q_177",trigger_expandido:"_trigger_expandido_1co2q_213",variante_bordered:"_variante_bordered_1co2q_223",variante_faded:"_variante_faded_1co2q_233",variante_underlined:"_variante_underlined_1co2q_243",variante_ghost:"_variante_ghost_1co2q_259",deshabilitado:"_deshabilitado_1co2q_271",solo_lectura:"_solo_lectura_1co2q_291",valor_texto:"_valor_texto_1co2q_307",abierto:"_abierto_1co2q_335",valido:"_valido_1co2q_343",invalido:"_invalido_1co2q_351",contenido_inicio:"_contenido_inicio_1co2q_403",contenido_final:"_contenido_final_1co2q_405",valor_wrapper:"_valor_wrapper_1co2q_423",mostrar_todos:"_mostrar_todos_1co2q_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1co2q_453",placeholder:"_placeholder_1co2q_469",chip_multi:"_chip_multi_1co2q_479",chip_texto:"_chip_texto_1co2q_513",chip_cerrar:"_chip_cerrar_1co2q_525",contador_multi:"_contador_multi_1co2q_565",acciones:"_acciones_1co2q_579",boton_limpiar:"_boton_limpiar_1co2q_593",tiene_valor:"_tiene_valor_1co2q_645",icono_chevron:"_icono_chevron_1co2q_655",icono_spinner:"_icono_spinner_1co2q_677",girarSpinner:"_girarSpinner_1co2q_1",menu:"_menu_1co2q_711",buscador_wrapper:"_buscador_wrapper_1co2q_741",buscador_interno:"_buscador_interno_1co2q_753",icono_buscar:"_icono_buscar_1co2q_783",input_busqueda:"_input_busqueda_1co2q_795",lista_opciones:"_lista_opciones_1co2q_827",lista_virtual:"_lista_virtual_1co2q_853",contenedor_virtual:"_contenedor_virtual_1co2q_865",encabezado_grupo:"_encabezado_grupo_1co2q_873",opcion:"_opcion_1co2q_905",opcion_virtual:"_opcion_virtual_1co2q_931",activo:"_activo_1co2q_939",seleccionado:"_seleccionado_1co2q_947",opcion_check:"_opcion_check_1co2q_979",opcion_contenido:"_opcion_contenido_1co2q_1007",sin_resultados:"_sin_resultados_1co2q_1023",descripcion:"_descripcion_1co2q_1047",mensaje_error:"_mensaje_error_1co2q_1059",ancho_total:"_ancho_total_1co2q_1071",sin_animacion:"_sin_animacion_1co2q_1079",contenedor_nativo:"_contenedor_nativo_1co2q_1089",select_nativo:"_select_nativo_1co2q_1097",input_validacion:"_input_validacion_1co2q_1125"};function xd(e){const{options:n=[],value:t,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:s="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:p=!1,isInvalid:_,id:c,name:h,classNames:g,startContent:m,endContent:b,esInvalido:w,estaDeshabilitadoReal:C,clasesBase:S,renderizarValorMostrado:k}=e,$=v.useId(),I=c??`select-nativo-${$}`,F=u?`${I}-desc`:void 0,L=w?`${I}-err`:void 0,N=v.useCallback(z=>lr(z,i),[i]),D=v.useCallback(z=>Cn(z,s),[s]),V=v.useCallback(z=>{o?.(z),r?.(z)},[o,r]),T=v.useCallback(z=>{const A=z.target.value;if(!A){V(null);return}const x=n.find(P=>D(P)===A);x&&V(x)},[n,D,V]),y=typeof _=="string"?_:null,E=typeof f=="function"?f({invalido:w,mensaje:y}):f??y;return a.jsxs("div",{className:S,children:[l&&a.jsxs("label",{className:K(Y.etiqueta,g?.label),htmlFor:I,children:[l,p&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{className:Y.contenedor_nativo,children:[a.jsxs("div",{className:K(Y.trigger,g?.trigger),children:[m&&a.jsx("span",{className:Y.contenido_inicio,children:m}),a.jsx("div",{className:K(Y.valor_wrapper,g?.value),children:k()}),a.jsxs("div",{className:Y.acciones,children:[b&&a.jsx("span",{className:Y.contenido_final,children:b}),a.jsx("span",{className:Y.icono_chevron,children:a.jsx($s,{size:"1em"})})]})]}),a.jsxs("select",{id:I,name:h,className:Y.select_nativo,value:t?D(t):"",onChange:T,disabled:C,required:p,children:[a.jsx("option",{value:"",children:d}),n.map(z=>a.jsx("option",{value:D(z),disabled:vo(z),children:N(z)},D(z)))]})]}),u&&!w&&a.jsx("div",{id:F,className:K(Y.descripcion,g?.description),children:u}),w&&E&&a.jsx("div",{id:L,className:K(Y.mensaje_error,g?.errorMessage),children:E})]})}const Cd="(max-width: 768px)",Sd=40,cr=320,bo=100,$d=200,kd=5;function Id(e,n){const{options:t=[],value:o,defaultValue:r,onChange:i,onValueChange:s,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:p="bordered",color:_="default",size:c="md",radius:h="md",fullWidth:g=!0,disableAnimation:m=!1,label:b,placeholder:w="",description:C,errorMessage:S,emptyMessage:k="No hay opciones",noResultsMessage:$="Sin resultados",isRequired:I=!1,isDisabled:F=!1,isReadOnly:L=!1,isLoading:N=!1,isClearable:D=!0,isInvalid:V,validationState:T,isMultiple:y=!1,mostrarTodos:E=!1,isSearchable:z=!1,isVirtualized:A=!1,estimatedOptionHeight:x=Sd,filterFn:P,validate:O,onOpen:B,onClose:j,onSearchChange:q,onClear:J,onFocus:G,onBlur:le,id:oe,name:re,className:ce,classNames:ie,style:me,startContent:U,endContent:ne,menuZIndex:ee,portalContainer:pe}=e,_e=v.useRef(null),Z=v.useRef([]),de=v.useRef(null),ye=v.useRef(null),ue=v.useId(),Ce=oe??`select-${ue}`,R=mo(Cd)&&!z&&!y,[H,he]=v.useState(!1),[ge,ve]=v.useState(null),[We,ft]=v.useState(""),nt=o!==void 0,[Be,Ze]=v.useState(r??null),fe=nt?o:Be,Qe=F||N,be=v.useCallback(Q=>lr(Q,l),[l]),Ne=v.useCallback(Q=>Cn(Q,d),[d]),it=v.useMemo(()=>{const Q=new Set;if(!fe)return Q;try{if(y&&Array.isArray(fe))for(const Ie of fe)Q.add(Cn(Ie,d));else fe&&Q.add(Cn(fe,d))}catch{}return Q},[fe,y,d]),bt=v.useCallback(Q=>{try{return it.has(Cn(Q,d))}catch{return!1}},[it,d]),te=v.useMemo(()=>ud(t),[t]),Fe=v.useMemo(()=>{if(!z||!We.trim())return t;try{return te?_d(t,We,l,P):Ss(t,We,l,P)}catch{return t}},[t,We,z,P,l,te]),we=v.useMemo(()=>te?fd(Fe):Fe.map((Q,Ie)=>({tipo:"opcion",datos:Q,indice:Ie})),[Fe,te]),_t=v.useMemo(()=>pd(fe,O),[fe,O]),gt=v.useMemo(()=>hd(V,T,_t),[V,T,_t]),Xt=T==="valid"&&!gt,{refs:lt,floatingStyles:Zt,context:Re,placement:Tr}=uo({open:H,onOpenChange:Q=>{Qe||L||(he(Q),Q?(B?.(),ft(""),ve(0)):j?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[Jn(4),to({padding:8}),eo({padding:8}),Oi({apply({rects:Q,elements:Ie}){Object.assign(Ie.floating.style,{width:`${Q.reference.width}px`})},padding:8})],whileElementsMounted:Xn}),Or=Tr.startsWith("top"),{isMounted:mf,styles:vf}=ho(Re,{duration:m||we.length>$d?0:200,initial:{opacity:0,transform:Or?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:Or?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:Or?"bottom":"top"}}),va=cd({count:we.length,getScrollElement:()=>de.current,estimateSize:()=>x,overscan:kd,enabled:A&&H&&we.length>bo}),bf=ls(Re,{enabled:!Qe&&!L}),wf=co(Re),yf=po(Re,{role:"listbox"}),xf=v.useMemo(()=>{try{return gd(we)}catch{return[]}},[we]),Cf=ar(Re,{listRef:Z,activeIndex:ge,onNavigate:ve,loop:!0,virtual:A,disabledIndices:xf}),ba=v.useRef([]);v.useEffect(()=>{ba.current=we.map(Q=>Q.tipo==="opcion"&&Q.datos?be(Q.datos):null)},[we,be]);const Sf=_s(Re,{listRef:ba,activeIndex:ge,onMatch:H?ve:void 0,enabled:!z}),{getReferenceProps:$f,getFloatingProps:kf,getItemProps:wa}=fo([bf,wf,yf,Cf,Sf]),Bt=v.useCallback(Q=>{nt||Ze(Q),i?.(Q),s?.(Q)},[nt,i,s]),$o=v.useCallback(Q=>{if(!vo(Q))if(y){const Ie=Array.isArray(fe)?fe:[],Ct=Ie.some(st=>Ne(st)===Ne(Q));Bt(Ct?Ie.filter(st=>Ne(st)!==Ne(Q)):[...Ie,Q])}else Bt(Q),he(!1)},[y,fe,Ne,Bt]),If=v.useCallback(Q=>{Q.stopPropagation(),Bt(y?[]:null),J?.(),_e.current?.focus()},[y,Bt,J]),ya=v.useCallback((Q,Ie)=>{Ie.stopPropagation(),!(!y||!Array.isArray(fe))&&Bt(fe.filter(Ct=>Ne(Ct)!==Ne(Q)))},[y,fe,Ne,Bt]),Ef=v.useCallback(Q=>{const Ie=Q.target.value;ft(Ie),q?.(Ie),ve(0)},[q]),Mf=v.useCallback(Q=>{if(Q.key==="Enter"&&ge!==null){Q.preventDefault();const Ie=we[ge];Ie?.tipo==="opcion"&&Ie.datos&&$o(Ie.datos)}},[ge,we,$o]);v.useEffect(()=>{H&&z&&requestAnimationFrame(()=>ye.current?.focus())},[H,z]),v.useEffect(()=>()=>{Z.current=[]},[we.length]),v.useImperativeHandle(n,()=>({focus:()=>_e.current?.focus(),blur:()=>_e.current?.blur(),open:()=>he(!0),close:()=>he(!1),clear:()=>Bt(y?[]:null)}));const ko=y?Array.isArray(fe)&&fe.length>0:fe!=null&&fe!=="",xa=v.useCallback(()=>{if(f)return f(fe??null);if(!ko)return a.jsx("span",{className:Y.placeholder,children:w});if(y&&Array.isArray(fe)){if(fe.length===0)return a.jsx("span",{className:Y.placeholder,children:w});const Q=E?fe:fe.slice(0,2),Ie=E?0:Math.max(0,fe.length-2);return a.jsxs(a.Fragment,{children:[Q.map(Ct=>a.jsxs("span",{className:Y.chip_multi,children:[a.jsx("span",{className:Y.chip_texto,children:be(Ct)}),!L&&!Qe&&a.jsx("button",{type:"button",className:Y.chip_cerrar,onClick:st=>ya(Ct,st),children:a.jsx(ks,{size:"1em"})})]},Ne(Ct))),Ie>0&&a.jsxs("span",{className:Y.contador_multi,children:["+",Ie]})]})}return a.jsx("span",{className:Y.valor_texto,children:be(fe)})},[f,fe,ko,w,y,E,L,Qe,Ne,be,ya]),Ca=v.useCallback((Q,Ie,Ct)=>{try{if(Q.tipo==="grupo")return a.jsx("li",{className:K(Y.encabezado_grupo,A&&Y.opcion_virtual),style:Ct,children:Q.nombreGrupo},`grupo-${Q.nombreGrupo}`);const st=Q.datos;if(!st)return null;const ka=bt(st),Ia=ge===Ie,Nf=vo(st),Ff=u?u(st,{isSelected:ka,isActive:Ia}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:Y.opcion_check,children:a.jsx(bd,{size:"1em"})}),a.jsx("span",{className:Y.opcion_contenido,children:be(st)})]}),Af=Ne(st);return a.jsx("li",{ref:Pf=>{Z.current[Ie]=Pf},className:K(Y.opcion,A&&Y.opcion_virtual,{[Y.activo]:Ia,[Y.seleccionado]:ka,[Y.deshabilitado]:Nf},ie?.option),style:Ct,...wa({onClick:()=>$o(st)}),children:Ff},Af)}catch(st){return console.error("Error rendering select item:",st),null}},[A,ge,bt,u,be,Ne,ie?.option,wa,$o]),Sa=typeof S=="function"?S({invalido:gt,mensaje:_t}):S??_t,$a=K(Y.contenedor_base,Y[`variante_${p}`],Y[`tam_${c}`],Y[`radio_${h}`],Y[`color_${_}`],{[Y.ancho_total]:g,[Y.sin_animacion]:m,[Y.deshabilitado]:Qe,[Y.solo_lectura]:L,[Y.invalido]:gt,[Y.valido]:Xt,[Y.abierto]:H,[Y.tiene_valor]:ko},ie?.base,ce);return R&&!te?a.jsx(xd,{...e,esInvalido:gt,estaDeshabilitadoReal:Qe,clasesBase:$a,renderizarValorMostrado:xa}):a.jsxs("div",{className:$a,style:me,children:[b&&a.jsxs("label",{id:`${Ce}-label`,className:K(Y.etiqueta,ie?.label),children:[b,I&&a.jsx("span",{className:Y.marca_requerido,children:"*"})]}),a.jsxs("div",{ref:Q=>{lt.setReference(Q),_e.current=Q},id:Ce,tabIndex:Qe?-1:0,className:K(Y.trigger,E&&y&&Y.trigger_expandido,ie?.trigger),"aria-labelledby":b?`${Ce}-label`:void 0,onFocus:G,onBlur:le,...$f(),children:[U&&a.jsx("span",{className:Y.contenido_inicio,children:U}),a.jsx("div",{className:K(Y.valor_wrapper,E&&y&&Y.mostrar_todos,E&&y&&Y.valor_wrapper_expandido,ie?.value),children:xa()}),a.jsxs("div",{className:Y.acciones,children:[D&&ko&&!L&&!Qe&&a.jsx("button",{type:"button",className:K(Y.boton_limpiar,ie?.clearButton),onClick:If,tabIndex:-1,children:a.jsx(ks,{size:"1em"})}),ne&&a.jsx("span",{className:Y.contenido_final,children:ne}),N?a.jsx("span",{className:Y.icono_spinner,children:a.jsx(yd,{size:"1em"})}):a.jsx("span",{className:Y.icono_chevron,children:a.jsx($s,{size:"1em"})})]})]}),(re||I)&&a.jsx("input",{type:"text",name:re,required:I,value:y&&Array.isArray(fe)?fe.map(Ne).join(","):fe?Ne(fe):"",onChange:()=>{},onFocus:Q=>Q.target.blur(),"aria-hidden":"true",className:Y.input_validacion}),mf&&a.jsx(lo,{root:pe,children:a.jsx(or,{context:Re,modal:!1,initialFocus:z?ye:-1,children:a.jsxs("div",{ref:lt.setFloating,style:{...Zt,...vf,zIndex:ee??"var(--z-popover)"},className:K(Y.menu,ie?.menu),...kf(),children:[z&&a.jsx("div",{className:Y.buscador_wrapper,children:a.jsxs("div",{className:Y.buscador_interno,children:[a.jsx("span",{className:Y.icono_buscar,children:a.jsx(wd,{size:"1em"})}),a.jsx("input",{ref:ye,type:"text",className:K(Y.input_busqueda,ie?.searchInput),placeholder:"Buscar...",value:We,onChange:Ef,onKeyDown:Mf})]})}),a.jsx("ul",{ref:de,className:K(Y.lista_opciones,A&&Y.lista_virtual),style:{height:A&&we.length>bo?`${cr}px`:`${Math.min(we.length*x,cr)}px`,maxHeight:`${cr}px`,overflow:"auto",position:A&&we.length>bo?"relative":void 0},children:we.length===0?a.jsx("li",{className:Y.sin_resultados,children:We?$:k}):A&&we.length>bo?a.jsx(a.Fragment,{children:a.jsx("div",{style:{height:`${va.getTotalSize()}px`,position:"relative",width:"100%"},children:va.getVirtualItems().map(Q=>{const Ie=we[Q.index];return Ie?a.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${Q.size}px`,transform:`translateY(${Q.start}px)`},children:Ca(Ie,Q.index)},`virtual-${Q.index}`):null})})}):we.map((Q,Ie)=>Ca(Q,Ie))})]})})}),C&&!gt&&a.jsx("div",{className:K(Y.descripcion,ie?.description),children:C}),gt&&Sa&&a.jsx("div",{className:K(Y.mensaje_error,ie?.errorMessage),children:Sa})]})}const Ed=v.forwardRef(Id),Is=v.memo(Ed);Is.displayName="SelectBase";function Md(e,n){const{options:t=[],value:o,onChange:r,onValueChange:i,optionValueKey:s,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,...f}=e,p=v.useMemo(()=>t.length>0&&typeof t[0]=="object",[t]),_=v.useMemo(()=>{if(!p||!s)return null;const g=new Map;for(const m of t)g.set(String(m[s]),m);return g},[t,s,p]),c=v.useMemo(()=>{if(o==null||!p||u)return o;const g=m=>_?.get(String(m));return d&&Array.isArray(o)?o.map(g).filter(m=>m!==void 0):g(o)??null},[o,_,d,u,p]),h=v.useCallback(g=>{const m=r||i;if(!m)return;if(g===null){m(d?[]:u||!p?null:"");return}if(u||!p){m(g);return}const b=w=>typeof w=="string"?w:w[s];m(d&&Array.isArray(g)?g.map(b):b(g))},[r,i,u,d,s,p]);return a.jsx(Is,{...f,ref:n,options:t,value:c,onChange:h,optionValueKey:s,optionLabelKey:l,isMultiple:d})}const Es=v.forwardRef(Md);Es.displayName="Select";/**
7
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return(u=n?.onChange)==null||u.call(n,r),r}return i.updateDeps=a=>{o=a},i}function Is(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const hd=(e,t)=>Math.abs(e-t)<1.01,md=(e,t,n)=>{let o;return function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)}},Es=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},vd=e=>e,bd=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let r=t;r<=n;r++)o.push(r);return o},wd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const r=a=>{const{width:l,height:d}=a;t({width:Math.round(l),height:Math.round(d)})};if(r(Es(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(a=>{const l=()=>{const d=a[0];if(d?.borderBoxSize){const u=d.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(Es(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},Ms={passive:!0},Ns=typeof window>"u"?!0:"onscrollend"in window,yd=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;let r=0;const i=e.options.useScrollendEvent&&Ns?()=>{}:md(o,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=f=>()=>{const{horizontal:g,isRtl:_}=e.options;r=g?n.scrollLeft*(_&&-1||1):n.scrollTop,i(),t(r,f)},l=a(!0),d=a(!1);d(),n.addEventListener("scroll",l,Ms);const u=e.options.useScrollendEvent&&Ns;return u&&n.addEventListener("scrollend",d,Ms),()=>{n.removeEventListener("scroll",l),u&&n.removeEventListener("scrollend",d)}},Cd=(e,t,n)=>{if(t?.borderBoxSize){const o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},xd=(e,{adjustments:t=0,behavior:n},o)=>{var r,i;const a=e+t;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:a,behavior:n})};class Sd{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=o())==null||r.disconnect(),n=null},observe:r=>{var i;return(i=o())==null?void 0:i.observe(r,{box:"border-box"})},unobserve:r=>{var i;return(i=o())==null?void 0:i.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,r])=>{typeof r>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:vd,rangeExtractor:bd,onChange:()=>{},measureElement:Cd,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,r;(r=(o=this.options).onChange)==null||r.call(o,this,n)},this.maybeNotify=ut(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const r=new Map,i=new Map;for(let a=o-1;a>=0;a--){const l=n[a];if(r.has(l.lane))continue;const d=i.get(l.lane);if(d==null||l.end>d.end?i.set(l.lane,l):l.end<d.end&&r.set(l.lane,!0),r.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,l)=>a.end===l.end?a.index-l.index:a.end-l.end)[0]:void 0},this.getMeasurementOptions=ut(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,o,r,i,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a}),{key:!1}),this.getMeasurements=ut(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:r,getItemKey:i,enabled:a},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let f=d;f<n;f++){const g=i(f),_=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f),c=_?_.end+this.options.gap:o+r,h=l.get(g),p=typeof h=="number"?h:this.options.estimateSize(f),v=c+p,w=_?_.lane:f%this.options.lanes;u[f]={index:f,start:c,size:p,end:v,key:g,lane:w}}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=ut(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,r,i)=>this.range=n.length>0&&o>0?$d({measurements:n,outerSize:o,scrollOffset:r,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=ut(()=>{let n=null,o=null;const r=this.calculateRange();return r&&(n=r.startIndex,o=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,r,i,a)=>i===null||a===null?[]:n({startIndex:i,endIndex:a,overscan:o,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,r=n.getAttribute(o);return r?parseInt(r,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const r=this.indexFromElement(n),i=this.measurementsCache[r];if(!i)return;const a=i.key,l=this.elementsCache.get(a);l!==n&&(l&&this.observer.unobserve(l),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const r=this.measurementsCache[n];if(!r)return;const i=this.itemSizeCache.get(r.key)??r.size,a=o-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,r)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=ut(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const r=[];for(let i=0,a=n.length;i<a;i++){const l=n[i],d=o[l];r.push(d)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return Is(o[Fs(0,o.length-1,r=>Is(o[r]).start,n)])},this.getOffsetForAlignment=(n,o,r=0)=>{const i=this.getSize(),a=this.getScrollOffset();o==="auto"&&(o=n>=a+i?"end":"start"),o==="center"?n+=(r-i)/2:o==="end"&&(n-=i);const l=this.getTotalSize()+this.options.scrollMargin-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const i=this.getSize(),a=this.getScrollOffset();if(o==="auto")if(r.end>=a+i-this.options.scrollPaddingEnd)o="end";else if(r.start<=a+this.options.scrollPaddingStart)o="start";else return[a,o];const l=o==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,o,r.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:o="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let i=0;const a=10,l=u=>{if(!this.targetWindow)return;const f=this.getOffsetForIndex(n,u);if(!f){console.warn("Failed to get offset for index:",n);return}const[g,_]=f;this._scrollToOffset(g,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const c=this.getScrollOffset(),h=this.getOffsetForIndex(n,_);if(!h){console.warn("Failed to get offset for index:",n);return}hd(h[0],c)||d(_)})},d=u=>{this.targetWindow&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>l(u))):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};l(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=o.length-1;for(;a>=0&&i.some(l=>l===null);){const l=o[a];i[l.lane]===null&&(i[l.lane]=l.end),a--}r=Math.max(...i.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Fs=(e,t,n,o)=>{for(;e<=t;){const r=(e+t)/2|0,i=n(r);if(i<o)e=r+1;else if(i>o)t=r-1;else return r}return e>0?e-1:0};function $d({measurements:e,outerSize:t,scrollOffset:n,lanes:o}){const r=e.length-1,i=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:r};let a=Fs(0,r,i,n),l=a;if(o===1)for(;l<r&&e[l].end<n+t;)l++;else if(o>1){const d=Array(o).fill(0);for(;l<r&&d.some(f=>f<n+t);){const f=e[l];d[f.lane]=f.end,l++}const u=Array(o).fill(n+t);for(;a>=0&&u.some(f=>f>=n);){const f=e[a];u[f.lane]=f.start,a--}a=Math.max(0,a-a%o),l=Math.min(r,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}const zs=typeof document<"u"?E.useLayoutEffect:E.useEffect;function kd(e){const t=E.useReducer(()=>({}),{})[1],n={...e,onChange:(r,i)=>{var a;i?pt.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,i)}},[o]=E.useState(()=>new Sd(n));return o.setOptions(n),zs(()=>o._didMount(),[]),zs(()=>o._willUpdate()),o}function Id(e){return kd({observeElementRect:wd,observeElementOffset:yd,scrollToFn:xd,...e})}function Ed(e,t){const[n,o]=E.useState(e);return E.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(r)}},[e,t]),n}function yo(e){const t=E.useCallback(r=>{const i=window.matchMedia(e);return i.addEventListener("change",r),()=>{i.removeEventListener("change",r)}},[e]),n=()=>window.matchMedia(e).matches,o=()=>{throw Error("useMediaQuery is a client-only hook")};return E.useSyncExternalStore(t,n,o)}function mr(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function It(e,t){return typeof e=="string"?e:String(typeof e=="object"&&e!==null?e[t]??"":e)}function Co(e){return typeof e=="object"&&e!==null?!!e.disabled:!1}function As(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}function Ds(e,t,n,o){if(!t.trim())return e;const r=As(t.trim());return o?e.filter(i=>o(i,t)):e.filter(i=>As(mr(i,n)).includes(r))}function Md(e){if(e.length===0)return!1;const t=e[0];return typeof t=="object"&&t!==null&&"grupo"in t&&"opciones"in t&&Array.isArray(t.opciones)}function Nd(e){const t=[];let n=0;for(const o of e){t.push({tipo:"grupo",datos:null,nombreGrupo:o.grupo,indice:n++});for(const r of o.opciones)t.push({tipo:"opcion",datos:r,indice:n++})}return t}function Fd(e,t,n,o){return t.trim()?e.map(r=>({...r,opciones:Ds(r.opciones,t,n,o)})).filter(r=>r.opciones.length>0):e}function zd(e){return e.map((t,n)=>t.tipo==="grupo"||t.datos&&Co(t.datos)?n:null).filter(t=>t!==null)}function Ad(e,t){if(!t)return null;const n=t(e);return n===!0||n==null?null:typeof n=="string"?n:typeof n=="object"&&"message"in n?n.message??"Selección inválida":"Selección inválida"}function Dd(e,t,n){return e!==void 0?e:t==="invalid"?!0:t==="valid"?!1:!!n}function Ld(e,t="Opción"){return Array.from({length:e},(n,o)=>`${t} ${o+1}`)}function Pd(e){return Array.from({length:e},(t,n)=>({id:`usr-${n+1}`,nombre:`Usuario ${n+1}`,email:`usuario${n+1}@test.com`}))}const Ls=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"m6 9 6 6 6-6"})}),Ps=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("path",{d:"M18 6 6 18"}),s.jsx("path",{d:"m6 6 12 12"})]}),Td=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M20 6 9 17l-5-5"})}),Od=({size:e="1em",...t})=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[s.jsx("circle",{cx:"11",cy:"11",r:"8"}),s.jsx("path",{d:"m21 21-4.3-4.3"})]}),qd=({size:e="1em",...t})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:e,fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:s.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),X={contenedor_base:"_contenedor_base_1qm8z_1",tam_sm:"_tam_sm_1qm8z_41",tam_lg:"_tam_lg_1qm8z_55",radio_none:"_radio_none_1qm8z_69",radio_sm:"_radio_sm_1qm8z_77",radio_md:"_radio_md_1qm8z_85",radio_lg:"_radio_lg_1qm8z_93",radio_full:"_radio_full_1qm8z_101",color_default:"_color_default_1qm8z_109",color_primary:"_color_primary_1qm8z_111",color_secondary:"_color_secondary_1qm8z_119",color_success:"_color_success_1qm8z_127",color_warning:"_color_warning_1qm8z_135",color_danger:"_color_danger_1qm8z_143",etiqueta:"_etiqueta_1qm8z_151",marca_requerido:"_marca_requerido_1qm8z_167",trigger:"_trigger_1qm8z_177",trigger_expandido:"_trigger_expandido_1qm8z_213",variante_bordered:"_variante_bordered_1qm8z_223",variante_faded:"_variante_faded_1qm8z_233",variante_underlined:"_variante_underlined_1qm8z_243",variante_ghost:"_variante_ghost_1qm8z_259",deshabilitado:"_deshabilitado_1qm8z_271",solo_lectura:"_solo_lectura_1qm8z_291",valor_texto:"_valor_texto_1qm8z_307",abierto:"_abierto_1qm8z_335",valido:"_valido_1qm8z_343",invalido:"_invalido_1qm8z_351",contenido_inicio:"_contenido_inicio_1qm8z_403",contenido_final:"_contenido_final_1qm8z_405",valor_wrapper:"_valor_wrapper_1qm8z_423",mostrar_todos:"_mostrar_todos_1qm8z_443",valor_wrapper_expandido:"_valor_wrapper_expandido_1qm8z_453",placeholder:"_placeholder_1qm8z_469",chip_multi:"_chip_multi_1qm8z_479",chip_texto:"_chip_texto_1qm8z_513",chip_cerrar:"_chip_cerrar_1qm8z_525",contador_multi:"_contador_multi_1qm8z_565",acciones:"_acciones_1qm8z_579",boton_limpiar:"_boton_limpiar_1qm8z_593",tiene_valor:"_tiene_valor_1qm8z_645",icono_chevron:"_icono_chevron_1qm8z_655",icono_spinner:"_icono_spinner_1qm8z_677",girarSpinner:"_girarSpinner_1qm8z_1",menu:"_menu_1qm8z_711",buscador_wrapper:"_buscador_wrapper_1qm8z_741",buscador_interno:"_buscador_interno_1qm8z_753",icono_buscar:"_icono_buscar_1qm8z_783",input_busqueda:"_input_busqueda_1qm8z_795",lista_opciones:"_lista_opciones_1qm8z_827",lista_virtual:"_lista_virtual_1qm8z_853",contenedor_virtual:"_contenedor_virtual_1qm8z_865",encabezado_grupo:"_encabezado_grupo_1qm8z_873",opcion:"_opcion_1qm8z_905",opcion_virtual:"_opcion_virtual_1qm8z_931",activo:"_activo_1qm8z_939",seleccionado:"_seleccionado_1qm8z_947",opcion_check:"_opcion_check_1qm8z_979",opcion_contenido:"_opcion_contenido_1qm8z_1007",sin_resultados:"_sin_resultados_1qm8z_1023",descripcion:"_descripcion_1qm8z_1047",mensaje_error:"_mensaje_error_1qm8z_1059",ancho_total:"_ancho_total_1qm8z_1071",sin_animacion:"_sin_animacion_1qm8z_1079",contenedor_nativo:"_contenedor_nativo_1qm8z_1089",select_nativo:"_select_nativo_1qm8z_1097",input_validacion:"_input_validacion_1qm8z_1125"};function Vd(e){const{options:t=[],value:n,onChange:o,onValueChange:r,optionLabelKey:i="label",optionValueKey:a="id",label:l,placeholder:d="Seleccione una opción",description:u,errorMessage:f,isRequired:g=!1,isInvalid:_,id:c,name:h,classNames:p,startContent:v,endContent:w,esInvalido:C,estaDeshabilitadoReal:x,clasesBase:k,renderizarValorMostrado:z}=e,L=m.useId(),N=c??`select-nativo-${L}`,P=u?`${N}-desc`:void 0,A=C?`${N}-err`:void 0,I=m.useCallback(T=>mr(T,i),[i]),O=m.useCallback(T=>It(T,a),[a]),q=m.useCallback(T=>{o?.(T),r?.(T)},[o,r]),$=m.useCallback(T=>{const F=T.target.value;if(!F){q(null);return}const y=t.find(M=>O(M)===F);y&&q(y)},[t,O,q]),b=typeof _=="string"?_:null,S=typeof f=="function"?f({invalido:C,mensaje:b}):f??b;return s.jsxs("div",{className:k,children:[l&&s.jsxs("label",{className:K(X.etiqueta,p?.label),htmlFor:N,children:[l,g&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{className:X.contenedor_nativo,children:[s.jsxs("div",{className:K(X.trigger,p?.trigger),children:[v&&s.jsx("span",{className:X.contenido_inicio,children:v}),s.jsx("div",{className:K(X.valor_wrapper,p?.value),children:z()}),s.jsxs("div",{className:X.acciones,children:[w&&s.jsx("span",{className:X.contenido_final,children:w}),s.jsx("span",{className:X.icono_chevron,children:s.jsx(Ls,{size:"1em"})})]})]}),s.jsxs("select",{id:N,name:h,className:X.select_nativo,value:n?O(n):"",onChange:$,disabled:x,required:g,children:[s.jsx("option",{value:"",children:d}),t.map(T=>s.jsx("option",{value:O(T),disabled:Co(T),children:I(T)},O(T)))]})]}),u&&!C&&s.jsx("div",{id:P,className:K(X.descripcion,p?.description),children:u}),C&&S&&s.jsx("div",{id:A,className:K(X.mensaje_error,p?.errorMessage),children:S})]})}const jd="(max-width: 768px)",Bd=40,vr=320,xo=100,Hd=200,Gd=5;function Wd(e,t){const{options:n=[],value:o,defaultValue:r,onChange:i,onValueChange:a,optionLabelKey:l="label",optionValueKey:d="id",renderOption:u,renderValue:f,variant:g="bordered",color:_="default",size:c="md",radius:h="md",fullWidth:p=!0,disableAnimation:v=!1,label:w,placeholder:C="",description:x,errorMessage:k,emptyMessage:z="No hay opciones",noResultsMessage:L="Sin resultados",isRequired:N=!1,isDisabled:P=!1,isReadOnly:A=!1,isLoading:I=!1,isClearable:O=!0,isInvalid:q,validationState:$,isMultiple:b=!1,mostrarTodos:S=!1,isSearchable:T=!1,isVirtualized:F=!1,estimatedOptionHeight:y=Bd,filterFn:M,validate:D,onOpen:B,onClose:G,onSearchChange:V,onClear:J,onFocus:U,onBlur:pe,id:ue,name:se,className:he,classNames:fe,style:_e,startContent:R,endContent:te,menuZIndex:oe,portalContainer:ae}=e,ve=m.useRef(null),ee=m.useRef([]),we=m.useRef(null),Se=m.useRef(null),le=m.useId(),ye=ue??`select-${le}`,j=yo(jd)&&!T&&!b,[H,me]=m.useState(!1),[Y,Ce]=m.useState(null),[Re,dn]=m.useState(""),Ye=o!==void 0,[Ve,Ze]=m.useState(r??null),re=Ye?o:Ve,Be=P||I,be=m.useCallback(ne=>mr(ne,l),[l]),Ee=m.useCallback(ne=>It(ne,d),[d]),on=m.useMemo(()=>{const ne=new Set;if(!re)return ne;try{if(b&&Array.isArray(re))for(const ze of re)ne.add(It(ze,d));else re&&ne.add(It(re,d))}catch{}return ne},[re,b,d]),fn=m.useCallback(ne=>{try{return on.has(It(ne,d))}catch{return!1}},[on,d]),Q=m.useMemo(()=>Md(n),[n]),Fe=m.useMemo(()=>{if(!T||!Re.trim())return n;try{return Q?Fd(n,Re,l,M):Ds(n,Re,l,M)}catch{return n}},[n,Re,T,M,l,Q]),$e=m.useMemo(()=>Q?Nd(Fe):Fe.map((ne,ze)=>({tipo:"opcion",datos:ne,indice:ze})),[Fe,Q]),ge=m.useMemo(()=>Ad(re,D),[re,D]),xe=m.useMemo(()=>Dd(q,$,ge),[q,$,ge]),pn=$==="valid"&&!xe,{refs:He,floatingStyles:wn,context:Ge,placement:nt}=po({open:H,onOpenChange:ne=>{Be||A||(me(ne),ne?(B?.(),dn(""),Ce(0)):G?.())},strategy:"fixed",transform:!1,placement:"bottom-start",middleware:[oo(4),io({padding:8}),ro({padding:8}),Ui({apply({rects:ne,elements:ze}){Object.assign(ze.floating.style,{width:`${ne.reference.width}px`})},padding:8})],whileElementsMounted:eo}),tt=nt.startsWith("top"),{isMounted:No,styles:Fo}=wo(Ge,{duration:v||$e.length>Hd?0:200,initial:{opacity:0,transform:tt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},open:{opacity:1,transform:"translateY(0) scale(1)"},close:{opacity:0,transform:tt?"translateY(8px) scale(0.95)":"translateY(-8px) scale(0.95)"},common:{transformOrigin:tt?"bottom":"top"}}),Ia=Id({count:$e.length,getScrollElement:()=>we.current,estimateSize:()=>y,overscan:Gd,enabled:F&&H&&$e.length>xo}),Df=vs(Ge,{enabled:!Be&&!A}),Lf=go(Ge),Pf=bo(Ge,{role:"listbox"}),Tf=m.useMemo(()=>{try{return zd($e)}catch{return[]}},[$e]),Of=hr(Ge,{listRef:ee,activeIndex:Y,onNavigate:Ce,loop:!0,virtual:F,disabledIndices:Tf}),Ea=m.useRef([]);m.useEffect(()=>{Ea.current=$e.map(ne=>ne.tipo==="opcion"&&ne.datos?be(ne.datos):null)},[$e,be]);const qf=xs(Ge,{listRef:Ea,activeIndex:Y,onMatch:H?Ce:void 0,enabled:!T}),{getReferenceProps:Vf,getFloatingProps:jf,getItemProps:Ma}=ho([Df,Lf,Pf,Of,qf]),Kn=m.useCallback(ne=>{Ye||Ze(ne),i?.(ne),a?.(ne)},[Ye,i,a]),zo=m.useCallback(ne=>{if(!Co(ne))if(b){const ze=Array.isArray(re)?re:[],kn=ze.some(_n=>Ee(_n)===Ee(ne));Kn(kn?ze.filter(_n=>Ee(_n)!==Ee(ne)):[...ze,ne])}else Kn(ne),me(!1)},[b,re,Ee,Kn]),Bf=m.useCallback(ne=>{ne.stopPropagation(),Kn(b?[]:null),J?.(),ve.current?.focus()},[b,Kn,J]),Na=m.useCallback((ne,ze)=>{ze.stopPropagation(),!(!b||!Array.isArray(re))&&Kn(re.filter(kn=>Ee(kn)!==Ee(ne)))},[b,re,Ee,Kn]),Hf=m.useCallback(ne=>{const ze=ne.target.value;dn(ze),V?.(ze),Ce(0)},[V]),Gf=m.useCallback(ne=>{if(ne.key==="Enter"&&Y!==null){ne.preventDefault();const ze=$e[Y];ze?.tipo==="opcion"&&ze.datos&&zo(ze.datos)}},[Y,$e,zo]);m.useEffect(()=>{H&&T&&requestAnimationFrame(()=>Se.current?.focus())},[H,T]),m.useEffect(()=>()=>{ee.current=[]},[$e.length]),m.useImperativeHandle(t,()=>({focus:()=>ve.current?.focus(),blur:()=>ve.current?.blur(),open:()=>me(!0),close:()=>me(!1),clear:()=>Kn(b?[]:null)}));const Ao=b?Array.isArray(re)&&re.length>0:re!=null&&re!=="",Fa=m.useCallback(()=>{if(f)return f(re??null);if(!Ao)return s.jsx("span",{className:X.placeholder,children:C});if(b&&Array.isArray(re)){if(re.length===0)return s.jsx("span",{className:X.placeholder,children:C});const ne=S?re:re.slice(0,2),ze=S?0:Math.max(0,re.length-2);return s.jsxs(s.Fragment,{children:[ne.map(kn=>s.jsxs("span",{className:X.chip_multi,children:[s.jsx("span",{className:X.chip_texto,children:be(kn)}),!A&&!Be&&s.jsx("button",{type:"button",className:X.chip_cerrar,onClick:_n=>Na(kn,_n),children:s.jsx(Ps,{size:"1em"})})]},Ee(kn))),ze>0&&s.jsxs("span",{className:X.contador_multi,children:["+",ze]})]})}return s.jsx("span",{className:X.valor_texto,children:be(re)})},[f,re,Ao,C,b,S,A,Be,Ee,be,Na]),za=m.useCallback((ne,ze,kn)=>{try{if(ne.tipo==="grupo")return s.jsx("li",{className:K(X.encabezado_grupo,F&&X.opcion_virtual),style:kn,children:ne.nombreGrupo},`grupo-${ne.nombreGrupo}`);const _n=ne.datos;if(!_n)return null;const La=fn(_n),Pa=Y===ze,Wf=Co(_n),Kf=u?u(_n,{isSelected:La,isActive:Pa}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:X.opcion_check,children:s.jsx(Td,{size:"1em"})}),s.jsx("span",{className:X.opcion_contenido,children:be(_n)})]}),Uf=Ee(_n);return s.jsx("li",{ref:Rf=>{ee.current[ze]=Rf},className:K(X.opcion,F&&X.opcion_virtual,{[X.activo]:Pa,[X.seleccionado]:La,[X.deshabilitado]:Wf},fe?.option),style:kn,...Ma({onClick:()=>zo(_n)}),children:Kf},Uf)}catch(_n){return console.error("Error rendering select item:",_n),null}},[F,Y,fn,u,be,Ee,fe?.option,Ma,zo]),Aa=typeof k=="function"?k({invalido:xe,mensaje:ge}):k??ge,Da=K(X.contenedor_base,X[`variante_${g}`],X[`tam_${c}`],X[`radio_${h}`],X[`color_${_}`],{[X.ancho_total]:p,[X.sin_animacion]:v,[X.deshabilitado]:Be,[X.solo_lectura]:A,[X.invalido]:xe,[X.valido]:pn,[X.abierto]:H,[X.tiene_valor]:Ao},fe?.base,he);return j&&!Q?s.jsx(Vd,{...e,esInvalido:xe,estaDeshabilitadoReal:Be,clasesBase:Da,renderizarValorMostrado:Fa}):s.jsxs("div",{className:Da,style:_e,children:[w&&s.jsxs("label",{id:`${ye}-label`,className:K(X.etiqueta,fe?.label),children:[w,N&&s.jsx("span",{className:X.marca_requerido,children:"*"})]}),s.jsxs("div",{ref:ne=>{He.setReference(ne),ve.current=ne},id:ye,tabIndex:Be?-1:0,className:K(X.trigger,S&&b&&X.trigger_expandido,fe?.trigger),"aria-labelledby":w?`${ye}-label`:void 0,onFocus:U,onBlur:pe,...Vf(),children:[R&&s.jsx("span",{className:X.contenido_inicio,children:R}),s.jsx("div",{className:K(X.valor_wrapper,S&&b&&X.mostrar_todos,S&&b&&X.valor_wrapper_expandido,fe?.value),children:Fa()}),s.jsxs("div",{className:X.acciones,children:[O&&Ao&&!A&&!Be&&s.jsx("button",{type:"button",className:K(X.boton_limpiar,fe?.clearButton),onClick:Bf,tabIndex:-1,children:s.jsx(Ps,{size:"1em"})}),te&&s.jsx("span",{className:X.contenido_final,children:te}),I?s.jsx("span",{className:X.icono_spinner,children:s.jsx(qd,{size:"1em"})}):s.jsx("span",{className:X.icono_chevron,children:s.jsx(Ls,{size:"1em"})})]})]}),(se||N)&&s.jsx("input",{type:"text",name:se,required:N,value:b&&Array.isArray(re)?re.map(Ee).join(","):re?Ee(re):"",onChange:()=>{},onFocus:ne=>ne.target.blur(),"aria-hidden":"true",className:X.input_validacion}),No&&s.jsx(_o,{root:ae,children:s.jsx(fr,{context:Ge,modal:!1,initialFocus:T?Se:-1,children:s.jsxs("div",{ref:He.setFloating,style:{...wn,...Fo,zIndex:oe??"var(--z-popover)"},className:K(X.menu,fe?.menu),...jf(),children:[T&&s.jsx("div",{className:X.buscador_wrapper,children:s.jsxs("div",{className:X.buscador_interno,children:[s.jsx("span",{className:X.icono_buscar,children:s.jsx(Od,{size:"1em"})}),s.jsx("input",{ref:Se,type:"text",className:K(X.input_busqueda,fe?.searchInput),placeholder:"Buscar...",value:Re,onChange:Hf,onKeyDown:Gf})]})}),s.jsx("ul",{ref:we,className:K(X.lista_opciones,F&&X.lista_virtual),style:{height:F&&$e.length>xo?`${vr}px`:`${Math.min($e.length*y,vr)}px`,maxHeight:`${vr}px`,overflow:"auto",position:F&&$e.length>xo?"relative":void 0},children:$e.length===0?s.jsx("li",{className:X.sin_resultados,children:Re?L:z}):F&&$e.length>xo?s.jsx(s.Fragment,{children:s.jsx("div",{style:{height:`${Ia.getTotalSize()}px`,position:"relative",width:"100%"},children:Ia.getVirtualItems().map(ne=>{const ze=$e[ne.index];return ze?s.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,width:"100%",height:`${ne.size}px`,transform:`translateY(${ne.start}px)`},children:za(ze,ne.index)},`virtual-${ne.index}`):null})})}):$e.map((ne,ze)=>za(ne,ze))})]})})}),x&&!xe&&s.jsx("div",{className:K(X.descripcion,fe?.description),children:x}),xe&&Aa&&s.jsx("div",{className:K(X.mensaje_error,fe?.errorMessage),children:Aa})]})}const Kd=m.forwardRef(Wd),Ts=m.memo(Kd);Ts.displayName="SelectBase";function Ud(e,t){const{options:n=[],value:o,onChange:r,onValueChange:i,optionValueKey:a,optionLabelKey:l="label",isMultiple:d=!1,devolverObjeto:u=!1,...f}=e,g=m.useMemo(()=>n.length>0&&typeof n[0]=="object",[n]),_=m.useMemo(()=>{if(!g||!a)return null;const p=new Map;for(const v of n)p.set(String(v[a]),v);return p},[n,a,g]),c=m.useMemo(()=>{if(o==null||!g||u)return o;const p=v=>_?.get(String(v));return d&&Array.isArray(o)?o.map(p).filter(v=>v!==void 0):p(o)??null},[o,_,d,u,g]),h=m.useCallback(p=>{const v=r||i;if(!v)return;if(p===null){v(d?[]:u||!g?null:"");return}if(u||!g){v(p);return}const w=C=>typeof C=="string"?C:C[a];v(d&&Array.isArray(p)?p.map(w):w(p))},[r,i,u,d,a,g]);return s.jsx(Ts,{...f,ref:t,options:n,value:c,onChange:h,optionValueKey:a,optionLabelKey:l,isMultiple:d})}const Os=m.forwardRef(Ud);Os.displayName="Select";/**
8
8
  * table-core
9
9
  *
10
10
  * Copyright (c) TanStack
@@ -13,10 +13,10 @@
13
13
  * LICENSE.md file in the root directory of this source tree.
14
14
  *
15
15
  * @license MIT
16
- */function Ot(e,n){return typeof e=="function"?e(n):e}function ut(e,n){return t=>{n.setState(o=>({...o,[e]:Ot(t,o[e])}))}}function wo(e){return e instanceof Function}function Nd(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function Fd(e,n){const t=[],o=r=>{r.forEach(i=>{t.push(i);const s=n(i);s!=null&&s.length&&o(s)})};return o(e),t}function se(e,n,t){let o=[],r;return i=>{let s;t.key&&t.debug&&(s=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((f,p)=>o[p]!==f)))return r;o=l;let u;if(t.key&&t.debug&&(u=Date.now()),r=n(...l),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const f=Math.round((Date.now()-s)*100)/100,p=Math.round((Date.now()-u)*100)/100,_=p/16,c=(h,g)=>{for(h=String(h);h.length<g;)h=" "+h;return h};console.info(`%c⏱ ${c(p,5)} /${c(f,5)} ms`,`
16
+ */function jn(e,t){return typeof e=="function"?e(t):e}function vn(e,t){return n=>{t.setState(o=>({...o,[e]:jn(n,o[e])}))}}function So(e){return e instanceof Function}function Rd(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Xd(e,t){const n=[],o=r=>{r.forEach(i=>{n.push(i);const a=t(i);a!=null&&a.length&&o(a)})};return o(e),n}function ce(e,t,n){let o=[],r;return i=>{let a;n.key&&n.debug&&(a=Date.now());const l=e(i);if(!(l.length!==o.length||l.some((f,g)=>o[g]!==f)))return r;o=l;let u;if(n.key&&n.debug&&(u=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){const f=Math.round((Date.now()-a)*100)/100,g=Math.round((Date.now()-u)*100)/100,_=g/16,c=(h,p)=>{for(h=String(h);h.length<p;)h=" "+h;return h};console.info(`%c⏱ ${c(g,5)} /${c(f,5)} ms`,`
17
17
  font-size: .6rem;
18
18
  font-weight: bold;
19
- color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,t?.key)}return r}}function ae(e,n,t,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[n]},key:process.env.NODE_ENV==="development"&&t,onChange:o}}function Ad(e,n,t,o){const r=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:se(()=>[e,t,n,i],(s,l,d,u)=>({table:s,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ae(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,t,n,e)},{}),i}function Pd(e,n,t,o){var r,i;const l={...e._getDefaultColumnDef(),...n},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:d&&(d.includes(".")?f=_=>{let c=_;for(const g of d.split(".")){var h;c=(h=c)==null?void 0:h[g],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${g}" in deeply nested key "${d}" returned undefined.`)}return c}:f=_=>_[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let p={id:`${String(u)}`,accessorFn:f,parent:o,depth:t,columnDef:l,columns:[],getFlatColumns:se(()=>[!0],()=>{var _;return[p,...(_=p.columns)==null?void 0:_.flatMap(c=>c.getFlatColumns())]},ae(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:se(()=>[e._getOrderColumnsFn()],_=>{var c;if((c=p.columns)!=null&&c.length){let h=p.columns.flatMap(g=>g.getLeafColumns());return _(h)}return[p]},ae(e.options,"debugColumns","column.getLeafColumns"))};for(const _ of e._features)_.createColumn==null||_.createColumn(p,e);return p}const et="debugHeaders";function Ms(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),s.push(d)};return l(i),s},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Ld={createTable:e=>{e.getHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,s;const l=(i=o?.map(p=>t.find(_=>_.id===p)).filter(Boolean))!=null?i:[],d=(s=r?.map(p=>t.find(_=>_.id===p)).filter(Boolean))!=null?s:[],u=t.filter(p=>!(o!=null&&o.includes(p.id))&&!(r!=null&&r.includes(p.id)));return yo(n,[...l,...u,...d],e)},ae(e.options,et,"getHeaderGroups")),e.getCenterHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),yo(n,t,e,"center")),ae(e.options,et,"getCenterHeaderGroups")),e.getLeftHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return yo(n,i,e,"left")},ae(e.options,et,"getLeftHeaderGroups")),e.getRightHeaderGroups=se(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o?.map(s=>t.find(l=>l.id===s)).filter(Boolean))!=null?r:[];return yo(n,i,e,"right")},ae(e.options,et,"getRightHeaderGroups")),e.getFooterGroups=se(()=>[e.getHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getFooterGroups")),e.getLeftFooterGroups=se(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getLeftFooterGroups")),e.getCenterFooterGroups=se(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getCenterFooterGroups")),e.getRightFooterGroups=se(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),ae(e.options,et,"getRightFooterGroups")),e.getFlatHeaders=se(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getFlatHeaders")),e.getLeftFlatHeaders=se(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getLeftFlatHeaders")),e.getCenterFlatHeaders=se(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getCenterFlatHeaders")),e.getRightFlatHeaders=se(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),ae(e.options,et,"getRightFlatHeaders")),e.getCenterLeafHeaders=se(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getCenterLeafHeaders")),e.getLeftLeafHeaders=se(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getLeftLeafHeaders")),e.getRightLeafHeaders=se(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),ae(e.options,et,"getRightLeafHeaders")),e.getLeafHeaders=se(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,s,l,d,u;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},ae(e.options,et,"getLeafHeaders"))}};function yo(e,n,t,o){var r,i;let s=0;const l=function(_,c){c===void 0&&(c=1),s=Math.max(s,c),_.filter(h=>h.getIsVisible()).forEach(h=>{var g;(g=h.columns)!=null&&g.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(_,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},g=[];_.forEach(m=>{const b=[...g].reverse()[0],w=m.column.depth===h.depth;let C,S=!1;if(w&&m.column.parent?C=m.column.parent:(C=m.column,S=!0),b&&b?.column===C)b.subHeaders.push(m);else{const k=Ms(t,C,{id:[o,c,C.id,m?.id].filter(Boolean).join("_"),isPlaceholder:S,placeholderId:S?`${g.filter($=>$.column===C).length}`:void 0,depth:c,index:g.length});k.subHeaders.push(m),g.push(k)}h.headers.push(m),m.headerGroup=h}),d.push(h),c>0&&u(g,c-1)},f=n.map((_,c)=>Ms(t,_,{depth:s,index:c}));u(f,s-1),d.reverse();const p=_=>_.filter(h=>h.column.getIsVisible()).map(h=>{let g=0,m=0,b=[0];h.subHeaders&&h.subHeaders.length?(b=[],p(h.subHeaders).forEach(C=>{let{colSpan:S,rowSpan:k}=C;g+=S,b.push(k)})):g=1;const w=Math.min(...b);return m=m+w,h.colSpan=g,h.rowSpan=m,{colSpan:g,rowSpan:m}});return p((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const dr=(e,n,t,o,r,i,s)=>{let l={id:n,index:o,original:t,depth:r,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Fd(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const f=u.getParentRow();if(!f)break;d.push(f),u=f}return d.reverse()},getAllCells:se(()=>[e.getAllLeafColumns()],d=>d.map(u=>Ad(e,l,u,u.id)),ae(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:se(()=>[l.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),ae(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(l,e)}return l},Dd={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ns=(e,n,t)=>{var o,r;const i=t==null||(o=t.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(n))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Ns.autoRemove=e=>mt(e);const Fs=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};Fs.autoRemove=e=>mt(e);const As=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===t?.toLowerCase()};As.autoRemove=e=>mt(e);const Ps=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};Ps.autoRemove=e=>mt(e);const Ls=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});Ls.autoRemove=e=>mt(e)||!(e!=null&&e.length);const Ds=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Ds.autoRemove=e=>mt(e)||!(e!=null&&e.length);const Ts=(e,n,t)=>e.getValue(n)===t;Ts.autoRemove=e=>mt(e);const Os=(e,n,t)=>e.getValue(n)==t;Os.autoRemove=e=>mt(e);const ur=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};ur.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,s=t===null||Number.isNaN(r)?1/0:r;if(i>s){const l=i;i=s,s=l}return[i,s]},ur.autoRemove=e=>mt(e)||mt(e[0])&&mt(e[1]);const Mt={includesString:Ns,includesStringSensitive:Fs,equalsString:As,arrIncludes:Ps,arrIncludesAll:Ls,arrIncludesSome:Ds,equals:Ts,weakEquals:Os,inNumberRange:ur};function mt(e){return e==null||e===""}const Td={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:ut("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);return typeof o=="string"?Mt.includesString:typeof o=="number"?Mt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Mt.equals:Array.isArray(o)?Mt.arrIncludes:Mt.weakEquals},e.getFilterFn=()=>{var t,o;return wo(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:Mt[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(f=>f.id===e.id),s=Ot(t,i?i.value:void 0);if(zs(r,s,e)){var l;return(l=o?.filter(f=>f.id!==e.id))!=null?l:[]}const d={id:e.id,value:s};if(i){var u;return(u=o?.map(f=>f.id===e.id?d:f))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=Ot(n,r))==null?void 0:i.filter(s=>{const l=t.find(d=>d.id===s.id);if(l){const d=l.getFilterFn();if(zs(d,s.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function zs(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const fr={sum:(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,n,t)=>{let o,r;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(o===void 0?s>=s&&(o=r=s):(o>s&&(o=s),r<s&&(r=s)))}),[o,r]},mean:(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},median:(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!Nd(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,s)=>i-s);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),uniqueCount:(e,n)=>new Set(n.map(t=>t.getValue(e))).size,count:(e,n)=>n.length},Od={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:ut("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((o=n.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t?.getValue(e.id);if(typeof o=="number")return fr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return fr.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return wo(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:fr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function zd(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(s=>s.id===i)).filter(Boolean),...o]}const Vd={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:ut("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=se(t=>[Sn(n,t)],t=>t.findIndex(o=>o.id===e.id),ae(n.options,"debugColumns","getIndex")),e.getIsFirstColumn=t=>{var o;return((o=Sn(n,t)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=t=>{var o;const r=Sn(n,t);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=se(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const s=[...n],l=[...r];for(;l.length&&s.length;){const d=s.shift(),u=l.findIndex(f=>f.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return zd(i,t,o)},ae(e.options,"debugTable","_getOrderColumnsFn"))}},_r=()=>({left:[],right:[]}),qd={getInitialState:e=>({columnPinning:_r(),...e}),getDefaultOptions:e=>({onColumnPinningChange:ut("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,s;if(t==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(p=>!(o!=null&&o.includes(p))),right:[...((d=r?.right)!=null?d:[]).filter(p=>!(o!=null&&o.includes(p))),...o]}}if(t==="left"){var u,f;return{left:[...((u=r?.left)!=null?u:[]).filter(p=>!(o!=null&&o.includes(p))),...o],right:((f=r?.right)!=null?f:[]).filter(p=>!(o!=null&&o.includes(p)))}}return{left:((i=r?.left)!=null?i:[]).filter(p=>!(o!=null&&o.includes(p))),right:((s=r?.right)!=null?s:[]).filter(p=>!(o!=null&&o.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,s;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(s=n.options.enableColumnPinning)!=null?s:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>r?.includes(l));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(s=>!i.includes(s.column.id))},ae(n.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ae(n.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=se(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ae(n.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?_r():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:_r())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),ae(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=se(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},ae(e.options,"debugColumns","getCenterLeafColumns"))}};function jd(e){return e||(typeof document<"u"?document:null)}const xo={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},gr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Bd={getDefaultColumnDef:()=>xo,getInitialState:e=>({columnSizing:{},columnSizingInfo:gr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:ut("columnSizing",e),onColumnSizingInfoChange:ut("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:xo.minSize,(o=i??e.columnDef.size)!=null?o:xo.size),(r=e.columnDef.maxSize)!=null?r:xo.maxSize)},e.getStart=se(t=>[t,Sn(n,t),n.getState().columnSizing],(t,o)=>o.slice(0,e.getIndex(t)).reduce((r,i)=>r+i.getSize(),0),ae(n.options,"debugColumns","getStart")),e.getAfter=se(t=>[t,Sn(n,t),n.getState().columnSizing],(t,o)=>o.slice(e.getIndex(t)+1).reduce((r,i)=>r+i.getSize(),0),ae(n.options,"debugColumns","getAfter")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),pr(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),l=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[o.id,o.getSize()]],d=pr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(b,w)=>{typeof w=="number"&&(n.setColumnSizingInfo(C=>{var S,k;const $=n.options.columnResizeDirection==="rtl"?-1:1,I=(w-((S=C?.startOffset)!=null?S:0))*$,F=Math.max(I/((k=C?.startSize)!=null?k:0),-.999999);return C.columnSizingStart.forEach(L=>{let[N,D]=L;u[N]=Math.round(Math.max(D+D*F,0)*100)/100}),{...C,deltaOffset:I,deltaPercentage:F}}),(n.options.columnResizeMode==="onChange"||b==="end")&&n.setColumnSizing(C=>({...C,...u})))},p=b=>f("move",b),_=b=>{f("end",b),n.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=jd(t),h={moveHandler:b=>p(b.clientX),upHandler:b=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),_(b.clientX)}},g={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),p(b.touches[0].clientX),!1),upHandler:b=>{var w;c?.removeEventListener("touchmove",g.moveHandler),c?.removeEventListener("touchend",g.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),_((w=b.touches[0])==null?void 0:w.clientX)}},m=Hd()?{passive:!1}:!1;pr(i)?(c?.addEventListener("touchmove",g.moveHandler,m),c?.addEventListener("touchend",g.upHandler,m)):(c?.addEventListener("mousemove",h.moveHandler,m),c?.addEventListener("mouseup",h.upHandler,m)),n.setColumnSizingInfo(b=>({...b,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?gr():(t=e.initialState.columnSizingInfo)!=null?t:gr())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let Co=null;function Hd(){if(typeof Co=="boolean")return Co;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Co=e,Co}function pr(e){return e.type==="touchstart"}const Gd={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:ut("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;const r=e.columns;return(t=r.length?r.some(i=>i.getIsVisible()):(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=se(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),ae(n.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=se(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],ae(n.options,"debugRows","getVisibleCells"))},createTable:e=>{const n=(t,o)=>se(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ae(e.options,"debugColumns",t));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}};function Sn(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Wd={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Rd={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:ut("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Mt.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return wo(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:Mt[o]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Kd={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:ut("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");o=Math.max(o,s.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let s={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(l=>{s[l]=!0}):s=o,t=(r=t)!=null?r:!i,!i&&t)return{...s,[e.id]:!0};if(i&&!t){const{[e.id]:l,...d}=s;return d}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o?.[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},hr=0,mr=10,vr=()=>({pageIndex:hr,pageSize:mr}),Ud={getInitialState:e=>({...e,pagination:{...vr(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:ut("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>Ot(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?vr():(r=e.initialState.pagination)!=null?r:vr())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Ot(o,r.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?hr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:hr)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?mr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:mr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,Ot(o,r.pageSize)),s=r.pageSize*r.pageIndex,l=Math.floor(s/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let s=Ot(o,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...r,pageCount:s}}),e.getPageOptions=se(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,s)=>s)),r},ae(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},br=()=>({top:[],bottom:[]}),Yd={getInitialState:e=>({rowPinning:br(),...e}),getDefaultOptions:e=>({onRowPinningChange:ut("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],s=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...s,e.id,...i]);n.setRowPinning(d=>{var u,f;if(t==="bottom"){var p,_;return{top:((p=d?.top)!=null?p:[]).filter(g=>!(l!=null&&l.has(g))),bottom:[...((_=d?.bottom)!=null?_:[]).filter(g=>!(l!=null&&l.has(g))),...Array.from(l)]}}if(t==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(g=>!(l!=null&&l.has(g))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(g=>!(l!=null&&l.has(g)))}}return{top:((u=d?.top)!=null?u:[]).filter(g=>!(l!=null&&l.has(g))),bottom:((f=d?.bottom)!=null?f:[]).filter(g=>!(l!=null&&l.has(g)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(l=>o?.includes(l)),s=t.some(l=>r?.includes(l));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=r==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(s=>{let{id:l}=s;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?br():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:br())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=(n,t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(t??[]).map(s=>{const l=e.getRow(s,!0);return l.getIsAllParentsExpanded()?l:null}):(t??[]).map(s=>n.find(l=>l.id===s))).filter(Boolean).map(s=>({...s,position:o}))},e.getTopRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),ae(e.options,"debugRows","getTopRows")),e.getBottomRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),ae(e.options,"debugRows","getBottomRows")),e.getCenterRows=se(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},ae(e.options,"debugRows","getCenterRows"))}},Xd={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:ut("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{wr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=se(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=se(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=se(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?yr(e,t):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var s;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const l={...i};return wr(l,e.id,t,(s=o?.selectChildren)!=null?s:!0,n),l})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return xr(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return Cr(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return Cr(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},wr=(e,n,t,o,r)=>{var i;const s=r.getRow(n,!0);t?(s.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),s.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(l=>wr(e,l.id,t,o,r))};function yr(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(s,l){return s.map(d=>{var u;const f=xr(d,t);if(f&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function xr(e,n){var t;return(t=n[e.id])!=null?t:!1}function Cr(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!r)&&(s.getCanSelect()&&(xr(s,n)?i=!0:r=!1),s.subRows&&s.subRows.length)){const l=Cr(s,n);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Sr=/([0-9]+)/gm,Zd=(e,n,t)=>Vs(zt(e.getValue(t)).toLowerCase(),zt(n.getValue(t)).toLowerCase()),Qd=(e,n,t)=>Vs(zt(e.getValue(t)),zt(n.getValue(t))),Jd=(e,n,t)=>$r(zt(e.getValue(t)).toLowerCase(),zt(n.getValue(t)).toLowerCase()),eu=(e,n,t)=>$r(zt(e.getValue(t)),zt(n.getValue(t))),tu=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},nu=(e,n,t)=>$r(e.getValue(t),n.getValue(t));function $r(e,n){return e===n?0:e>n?1:-1}function zt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Vs(e,n){const t=e.split(Sr).filter(Boolean),o=n.split(Sr).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),s=parseInt(r,10),l=parseInt(i,10),d=[s,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>l)return 1;if(l>s)return-1}return t.length-o.length}const $n={alphanumeric:Zd,alphanumericCaseSensitive:Qd,text:Jd,textCaseSensitive:eu,datetime:tu,basic:nu},ou=[Ld,Gd,Vd,qd,Dd,Td,Wd,Rd,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:ut("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return $n.datetime;if(typeof i=="string"&&(o=!0,i.split(Sr).length>1))return $n.alphanumeric}return o?$n.text:$n.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return wo(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:$n[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(s=>{const l=s?.find(c=>c.id===e.id),d=s?.findIndex(c=>c.id===e.id);let u=[],f,p=i?t:r==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&o?l?f="toggle":f="add":s!=null&&s.length&&d!==s.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var _;u=[...s,{id:e.id,desc:p}],u.splice(0,u.length-((_=n.options.maxMultiSortColCount)!=null?_:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=s.map(c=>c.id===e.id?{...c,desc:p}:c):f==="remove"?u=s.filter(c=>c.id!==e.id):u=[{id:e.id,desc:p}];return u})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Od,Kd,Ud,Yd,Xd,Bd];function ru(e){var n,t;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...ou,...(n=e._features)!=null?n:[]];let r={_features:o};const i=r._features.reduce((_,c)=>Object.assign(_,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),s=_=>r.options.mergeOptions?r.options.mergeOptions(i,_):{...i,..._};let d={...{},...(t=e.initialState)!=null?t:{}};r._features.forEach(_=>{var c;d=(c=_.getInitialState==null?void 0:_.getInitialState(d))!=null?c:d});const u=[];let f=!1;const p={_features:o,options:{...i,...e},initialState:d,_queue:_=>{u.push(_),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:_=>{const c=Ot(_,r.options);r.options=s(c)},getState:()=>r.options.state,setState:_=>{r.options.onStateChange==null||r.options.onStateChange(_)},_getRowId:(_,c,h)=>{var g;return(g=r.options.getRowId==null?void 0:r.options.getRowId(_,c,h))!=null?g:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(_,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[_];if(!h&&(h=r.getCoreRowModel().rowsById[_],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${_}`):new Error;return h},_getDefaultColumnDef:se(()=>[r.options.defaultColumn],_=>{var c;return _=(c=_)!=null?c:{},{header:h=>{const g=h.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:h=>{var g,m;return(g=(m=h.renderValue())==null||m.toString==null?void 0:m.toString())!=null?g:null},...r._features.reduce((h,g)=>Object.assign(h,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),..._}},ae(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:se(()=>[r._getColumnDefs()],_=>{const c=function(h,g,m){return m===void 0&&(m=0),h.map(b=>{const w=Pd(r,b,m,g),C=b;return w.columns=C.columns?c(C.columns,w,m+1):[],w})};return c(_)},ae(e,"debugColumns","getAllColumns")),getAllFlatColumns:se(()=>[r.getAllColumns()],_=>_.flatMap(c=>c.getFlatColumns()),ae(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:se(()=>[r.getAllFlatColumns()],_=>_.reduce((c,h)=>(c[h.id]=h,c),{}),ae(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:se(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(_,c)=>{let h=_.flatMap(g=>g.getLeafColumns());return c(h)},ae(e,"debugColumns","getAllLeafColumns")),getColumn:_=>{const c=r._getAllFlatColumnsById()[_];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${_}' does not exist.`),c}};Object.assign(r,p);for(let _=0;_<r._features.length;_++){const c=r._features[_];c==null||c.createTable==null||c.createTable(r)}return r}function iu(){return e=>se(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,s){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const f=dr(e,e._getRowId(r[u],u,s),r[u],u,i,void 0,s?.id);if(t.flatRows.push(f),t.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[u],u),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return l};return t.rows=o(n),t},ae(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function su(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}function au(e,n,t){return t.options.filterFromLeafRows?lu(e,n,t):cu(e,n,t)}function lu(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){var p;let c=d[_];const h=dr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(p=c.subRows)!=null&&p.length&&u<s){if(h.subRows=l(c.subRows,u+1),c=h,n(c)&&!h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(n(c)||h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=h,n(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:l(e),flatRows:r,rowsById:i}}function cu(e,n,t){var o;const r=[],i={},s=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){let c=d[_];if(n(c)){var p;if((p=c.subRows)!=null&&p.length&&u<s){const g=dr(t,c.id,c.original,c.index,c.depth,void 0,c.parentId);g.subRows=l(c.subRows,u+1),c=g}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:l(e),flatRows:r,rowsById:i}}function du(){return e=>se(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let _=0;_<n.flatRows.length;_++)n.flatRows[_].columnFilters={},n.flatRows[_].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(_=>{var c;const h=e.getColumn(_.id);if(!h)return;const g=h.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}r.push({id:_.id,filterFn:g,resolvedValue:(c=g.resolveFilterValue==null?void 0:g.resolveFilterValue(_.value))!=null?c:_.value})});const s=(t??[]).map(_=>_.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(_=>_.getCanGlobalFilter());o&&l&&d.length&&(s.push("__global__"),d.forEach(_=>{var c;i.push({id:_.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,f;for(let _=0;_<n.flatRows.length;_++){const c=n.flatRows[_];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const g=u.id;c.columnFilters[g]=u.filterFn(c,g,u.resolvedValue,m=>{c.columnFiltersMeta[g]=m})}if(i.length){for(let h=0;h<i.length;h++){f=i[h];const g=f.id;if(f.filterFn(c,g,f.resolvedValue,m=>{c.columnFiltersMeta[g]=m})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const p=_=>{for(let c=0;c<s.length;c++)if(_.columnFilters[s[c]]===!1)return!1;return!0};return au(n.rows,p,e)},ae(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function uu(e){return n=>se(()=>[n.getState().pagination,n.getPrePaginationRowModel(),n.options.paginateExpandedRows?void 0:n.getState().expanded],(t,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=t;let{rows:s,flatRows:l,rowsById:d}=o;const u=r*i,f=u+r;s=s.slice(u,f);let p;n.options.paginateExpandedRows?p={rows:s,flatRows:l,rowsById:d}:p=su({rows:s,flatRows:l,rowsById:d}),p.flatRows=[];const _=c=>{p.flatRows.push(c),c.subRows.length&&c.subRows.forEach(_)};return p.rows.forEach(_),p},ae(n.options,"debugTable","getPaginationRowModel"))}function fu(){return e=>se(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),s={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(s[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(f=>({...f}));return u.sort((f,p)=>{for(let c=0;c<i.length;c+=1){var _;const h=i[c],g=s[h.id],m=g.sortUndefined,b=(_=h?.desc)!=null?_:!1;let w=0;if(m){const C=f.getValue(h.id),S=p.getValue(h.id),k=C===void 0,$=S===void 0;if(k||$){if(m==="first")return k?-1:1;if(m==="last")return k?1:-1;w=k&&$?0:k?m:-m}}if(w===0&&(w=g.sortingFn(f,p,h.id)),w!==0)return b&&(w*=-1),g.invertSorting&&(w*=-1),w}return f.index-p.index}),u.forEach(f=>{var p;r.push(f),(p=f.subRows)!=null&&p.length&&(f.subRows=l(f.subRows))}),u};return{rows:l(t.rows),flatRows:r,rowsById:t.rowsById}},ae(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
19
+ color: hsl(${Math.max(0,Math.min(120-120*_,120))}deg 100% 31%);`,n?.key)}return r}}function de(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:o}}function Yd(e,t,n,o){const r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:ce(()=>[e,n,t,i],(a,l,d,u)=>({table:a,column:l,row:d,cell:u,getValue:u.getValue,renderValue:u.renderValue}),de(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function Zd(e,t,n,o){var r,i;const l={...e._getDefaultColumnDef(),...t},d=l.accessorKey;let u=(r=(i=l.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,f;if(l.accessorFn?f=l.accessorFn:d&&(d.includes(".")?f=_=>{let c=_;for(const p of d.split(".")){var h;c=(h=c)==null?void 0:h[p],process.env.NODE_ENV!=="production"&&c===void 0&&console.warn(`"${p}" in deeply nested key "${d}" returned undefined.`)}return c}:f=_=>_[l.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(l.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let g={id:`${String(u)}`,accessorFn:f,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:ce(()=>[!0],()=>{var _;return[g,...(_=g.columns)==null?void 0:_.flatMap(c=>c.getFlatColumns())]},de(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:ce(()=>[e._getOrderColumnsFn()],_=>{var c;if((c=g.columns)!=null&&c.length){let h=g.columns.flatMap(p=>p.getLeafColumns());return _(h)}return[g]},de(e.options,"debugColumns","column.getLeafColumns"))};for(const _ of e._features)_.createColumn==null||_.createColumn(g,e);return g}const an="debugHeaders";function qs(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const a=[],l=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(l),a.push(d)};return l(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}const Jd={createTable:e=>{e.getHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,a;const l=(i=o?.map(g=>n.find(_=>_.id===g)).filter(Boolean))!=null?i:[],d=(a=r?.map(g=>n.find(_=>_.id===g)).filter(Boolean))!=null?a:[],u=n.filter(g=>!(o!=null&&o.includes(g.id))&&!(r!=null&&r.includes(g.id)));return $o(t,[...l,...u,...d],e)},de(e.options,an,"getHeaderGroups")),e.getCenterHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),$o(t,n,e,"center")),de(e.options,an,"getCenterHeaderGroups")),e.getLeftHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return $o(t,i,e,"left")},de(e.options,an,"getLeftHeaderGroups")),e.getRightHeaderGroups=ce(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;const i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return $o(t,i,e,"right")},de(e.options,an,"getRightHeaderGroups")),e.getFooterGroups=ce(()=>[e.getHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getFooterGroups")),e.getLeftFooterGroups=ce(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getLeftFooterGroups")),e.getCenterFooterGroups=ce(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getCenterFooterGroups")),e.getRightFooterGroups=ce(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),de(e.options,an,"getRightFooterGroups")),e.getFlatHeaders=ce(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getFlatHeaders")),e.getLeftFlatHeaders=ce(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getLeftFlatHeaders")),e.getCenterFlatHeaders=ce(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getCenterFlatHeaders")),e.getRightFlatHeaders=ce(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),de(e.options,an,"getRightFlatHeaders")),e.getCenterLeafHeaders=ce(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getCenterLeafHeaders")),e.getLeftLeafHeaders=ce(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getLeftLeafHeaders")),e.getRightLeafHeaders=ce(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),de(e.options,an,"getRightLeafHeaders")),e.getLeafHeaders=ce(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,a,l,d,u;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(d=(u=o[0])==null?void 0:u.headers)!=null?d:[]].map(f=>f.getLeafHeaders()).flat()},de(e.options,an,"getLeafHeaders"))}};function $o(e,t,n,o){var r,i;let a=0;const l=function(_,c){c===void 0&&(c=1),a=Math.max(a,c),_.filter(h=>h.getIsVisible()).forEach(h=>{var p;(p=h.columns)!=null&&p.length&&l(h.columns,c+1)},0)};l(e);let d=[];const u=(_,c)=>{const h={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},p=[];_.forEach(v=>{const w=[...p].reverse()[0],C=v.column.depth===h.depth;let x,k=!1;if(C&&v.column.parent?x=v.column.parent:(x=v.column,k=!0),w&&w?.column===x)w.subHeaders.push(v);else{const z=qs(n,x,{id:[o,c,x.id,v?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${p.filter(L=>L.column===x).length}`:void 0,depth:c,index:p.length});z.subHeaders.push(v),p.push(z)}h.headers.push(v),v.headerGroup=h}),d.push(h),c>0&&u(p,c-1)},f=t.map((_,c)=>qs(n,_,{depth:a,index:c}));u(f,a-1),d.reverse();const g=_=>_.filter(h=>h.column.getIsVisible()).map(h=>{let p=0,v=0,w=[0];h.subHeaders&&h.subHeaders.length?(w=[],g(h.subHeaders).forEach(x=>{let{colSpan:k,rowSpan:z}=x;p+=k,w.push(z)})):p=1;const C=Math.min(...w);return v=v+C,h.colSpan=p,h.rowSpan=v,{colSpan:p,rowSpan:v}});return g((r=(i=d[0])==null?void 0:i.headers)!=null?r:[]),d}const br=(e,t,n,o,r,i,a)=>{let l={id:t,index:o,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(l._valuesCache.hasOwnProperty(d))return l._valuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return l._valuesCache[d]=u.accessorFn(l.original,o),l._valuesCache[d]},getUniqueValues:d=>{if(l._uniqueValuesCache.hasOwnProperty(d))return l._uniqueValuesCache[d];const u=e.getColumn(d);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[d]=u.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[d]):(l._uniqueValuesCache[d]=[l.getValue(d)],l._uniqueValuesCache[d])},renderValue:d=>{var u;return(u=l.getValue(d))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Xd(l.subRows,d=>d.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let d=[],u=l;for(;;){const f=u.getParentRow();if(!f)break;d.push(f),u=f}return d.reverse()},getAllCells:ce(()=>[e.getAllLeafColumns()],d=>d.map(u=>Yd(e,l,u,u.id)),de(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:ce(()=>[l.getAllCells()],d=>d.reduce((u,f)=>(u[f.column.id]=f,u),{}),de(e.options,"debugRows","getAllCellsByColumnId"))};for(let d=0;d<e._features.length;d++){const u=e._features[d];u==null||u.createRow==null||u.createRow(l,e)}return l},Qd={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Vs=(e,t,n)=>{var o,r;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Vs.autoRemove=e=>Cn(e);const js=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};js.autoRemove=e=>Cn(e);const Bs=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};Bs.autoRemove=e=>Cn(e);const Hs=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};Hs.autoRemove=e=>Cn(e);const Gs=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});Gs.autoRemove=e=>Cn(e)||!(e!=null&&e.length);const Ws=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Ws.autoRemove=e=>Cn(e)||!(e!=null&&e.length);const Ks=(e,t,n)=>e.getValue(t)===n;Ks.autoRemove=e=>Cn(e);const Us=(e,t,n)=>e.getValue(t)==n;Us.autoRemove=e=>Cn(e);const wr=(e,t,n)=>{let[o,r]=n;const i=e.getValue(t);return i>=o&&i<=r};wr.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(i>a){const l=i;i=a,a=l}return[i,a]},wr.autoRemove=e=>Cn(e)||Cn(e[0])&&Cn(e[1]);const zn={includesString:Vs,includesStringSensitive:js,equalsString:Bs,arrIncludes:Hs,arrIncludesAll:Gs,arrIncludesSome:Ws,equals:Ks,weakEquals:Us,inNumberRange:wr};function Cn(e){return e==null||e===""}const eu={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:vn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?zn.includesString:typeof o=="number"?zn.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?zn.equals:Array.isArray(o)?zn.arrIncludes:zn.weakEquals},e.getFilterFn=()=>{var n,o;return So(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:zn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{const r=e.getFilterFn(),i=o?.find(f=>f.id===e.id),a=jn(n,i?i.value:void 0);if(Rs(r,a,e)){var l;return(l=o?.filter(f=>f.id!==e.id))!=null?l:[]}const d={id:e.id,value:a};if(i){var u;return(u=o?.map(f=>f.id===e.id?d:f))!=null?u:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),o=r=>{var i;return(i=jn(t,r))==null?void 0:i.filter(a=>{const l=n.find(d=>d.id===a.id);if(l){const d=l.getFilterFn();if(Rs(d,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Rs(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const yr={sum:(e,t,n)=>n.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),min:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},max:(e,t,n)=>{let o;return n.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},extent:(e,t,n)=>{let o,r;return n.forEach(i=>{const a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[o,r]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Rd(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),r=n.sort((i,a)=>i-a);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},unique:(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(n=>n.getValue(e))).size,count:(e,t)=>t.length},nu={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:vn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return yr.sum;if(Object.prototype.toString.call(o)==="[object Date]")return yr.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return So(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:yr[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function tu(e,t,n){if(!(t!=null&&t.length)||!n)return e;const o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...o]}const ou={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:vn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ce(n=>[Et(t,n)],n=>n.findIndex(o=>o.id===e.id),de(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=Et(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const r=Et(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=ce(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{const a=[...t],l=[...r];for(;l.length&&a.length;){const d=a.shift(),u=l.findIndex(f=>f.id===d);u>-1&&i.push(l.splice(u,1)[0])}i=[...i,...l]}return tu(i,n,o)},de(e.options,"debugTable","_getOrderColumnsFn"))}},Cr=()=>({left:[],right:[]}),ru={getInitialState:e=>({columnPinning:Cr(),...e}),getDefaultOptions:e=>({onColumnPinningChange:vn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,a;if(n==="right"){var l,d;return{left:((l=r?.left)!=null?l:[]).filter(g=>!(o!=null&&o.includes(g))),right:[...((d=r?.right)!=null?d:[]).filter(g=>!(o!=null&&o.includes(g))),...o]}}if(n==="left"){var u,f;return{left:[...((u=r?.left)!=null?u:[]).filter(g=>!(o!=null&&o.includes(g))),...o],right:((f=r?.right)!=null?f:[]).filter(g=>!(o!=null&&o.includes(g)))}}return{left:((i=r?.left)!=null?i:[]).filter(g=>!(o!=null&&o.includes(g))),right:((a=r?.right)!=null?a:[]).filter(g=>!(o!=null&&o.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{const i=[...o??[],...r??[]];return n.filter(a=>!i.includes(a.column.id))},de(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),de(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=ce(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),de(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?Cr():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Cr())},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),de(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),de(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=ce(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{const r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},de(e.options,"debugColumns","getCenterLeafColumns"))}};function iu(e){return e||(typeof document<"u"?document:null)}const ko={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},xr=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),su={getDefaultColumnDef:()=>ko,getInitialState:e=>({columnSizing:{},columnSizingInfo:xr(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:vn("columnSizing",e),onColumnSizingInfoChange:vn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:ko.minSize,(o=i??e.columnDef.size)!=null?o:ko.size),(r=e.columnDef.maxSize)!=null?r:ko.maxSize)},e.getStart=ce(n=>[n,Et(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),de(t.options,"debugColumns","getStart")),e.getAfter=ce(n=>[n,Et(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),de(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),Sr(i)&&i.touches&&i.touches.length>1))return;const a=e.getSize(),l=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[o.id,o.getSize()]],d=Sr(i)?Math.round(i.touches[0].clientX):i.clientX,u={},f=(w,C)=>{typeof C=="number"&&(t.setColumnSizingInfo(x=>{var k,z;const L=t.options.columnResizeDirection==="rtl"?-1:1,N=(C-((k=x?.startOffset)!=null?k:0))*L,P=Math.max(N/((z=x?.startSize)!=null?z:0),-.999999);return x.columnSizingStart.forEach(A=>{let[I,O]=A;u[I]=Math.round(Math.max(O+O*P,0)*100)/100}),{...x,deltaOffset:N,deltaPercentage:P}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},g=w=>f("move",w),_=w=>{f("end",w),t.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=iu(n),h={moveHandler:w=>g(w.clientX),upHandler:w=>{c?.removeEventListener("mousemove",h.moveHandler),c?.removeEventListener("mouseup",h.upHandler),_(w.clientX)}},p={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),g(w.touches[0].clientX),!1),upHandler:w=>{var C;c?.removeEventListener("touchmove",p.moveHandler),c?.removeEventListener("touchend",p.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),_((C=w.touches[0])==null?void 0:C.clientX)}},v=au()?{passive:!1}:!1;Sr(i)?(c?.addEventListener("touchmove",p.moveHandler,v),c?.addEventListener("touchend",p.upHandler,v)):(c?.addEventListener("mousemove",h.moveHandler,v),c?.addEventListener("mouseup",h.upHandler,v)),t.setColumnSizingInfo(w=>({...w,startOffset:d,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?xr():(n=e.initialState.columnSizingInfo)!=null?n:xr())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}};let Io=null;function au(){if(typeof Io=="boolean")return Io;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Io=e,Io}function Sr(e){return e.type==="touchstart"}const lu={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:vn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ce(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),de(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=ce(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],de(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,o)=>ce(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),de(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Et(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const cu={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},du={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:vn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>zn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return So(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:zn[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},uu={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:vn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const a=i.split(".");o=Math.max(o,a.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let a={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,n=(r=n)!=null?r:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){const{[e.id]:l,...d}=a;return d}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},$r=0,kr=10,Ir=()=>({pageIndex:$r,pageSize:kr}),fu={getInitialState:e=>({...e,pagination:{...Ir(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:vn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{const r=i=>jn(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Ir():(r=e.initialState.pagination)!=null?r:Ir())},e.setPageIndex=o=>{e.setPagination(r=>{let i=jn(o,r.pageIndex);const a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?$r:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:$r)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?kr:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:kr)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,jn(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=jn(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=ce(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},de(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Er=()=>({top:[],bottom:[]}),_u={getInitialState:e=>({rowPinning:Er(),...e}),getDefaultOptions:e=>({onRowPinningChange:vn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{const i=o?e.getLeafRows().map(d=>{let{id:u}=d;return u}):[],a=r?e.getParentRows().map(d=>{let{id:u}=d;return u}):[],l=new Set([...a,e.id,...i]);t.setRowPinning(d=>{var u,f;if(n==="bottom"){var g,_;return{top:((g=d?.top)!=null?g:[]).filter(p=>!(l!=null&&l.has(p))),bottom:[...((_=d?.bottom)!=null?_:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)]}}if(n==="top"){var c,h;return{top:[...((c=d?.top)!=null?c:[]).filter(p=>!(l!=null&&l.has(p))),...Array.from(l)],bottom:((h=d?.bottom)!=null?h:[]).filter(p=>!(l!=null&&l.has(p)))}}return{top:((u=d?.top)!=null?u:[]).filter(p=>!(l!=null&&l.has(p))),bottom:((f=d?.bottom)!=null?f:[]).filter(p=>!(l!=null&&l.has(p)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;const r=e.getIsPinned();if(!r)return-1;const i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Er():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Er())},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(a=>{const l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),de(e.options,"debugRows","getTopRows")),e.getBottomRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),de(e.options,"debugRows","getBottomRows")),e.getCenterRows=ce(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{const r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},de(e.options,"debugRows","getCenterRows"))}},gu={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:vn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Mr(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=ce(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Nr(e,n):{rows:[],flatRows:[],rowsById:{}},de(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const r=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;const l={...i};return Mr(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Fr(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return zr(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return zr(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Mr=(e,t,n,o,r)=>{var i;const a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Mr(e,l.id,n,o,r))};function Nr(e,t){const n=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(d=>{var u;const f=Fr(d,n);if(f&&(o.push(d),r[d.id]=d),(u=d.subRows)!=null&&u.length&&(d={...d,subRows:i(d.subRows)}),f)return d}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function Fr(e,t){var n;return(n=t[e.id])!=null?n:!1}function zr(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(Fr(a,t)?i=!0:r=!1),a.subRows&&a.subRows.length)){const l=zr(a,t);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Ar=/([0-9]+)/gm,pu=(e,t,n)=>Xs(Bn(e.getValue(n)).toLowerCase(),Bn(t.getValue(n)).toLowerCase()),hu=(e,t,n)=>Xs(Bn(e.getValue(n)),Bn(t.getValue(n))),mu=(e,t,n)=>Dr(Bn(e.getValue(n)).toLowerCase(),Bn(t.getValue(n)).toLowerCase()),vu=(e,t,n)=>Dr(Bn(e.getValue(n)),Bn(t.getValue(n))),bu=(e,t,n)=>{const o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},wu=(e,t,n)=>Dr(e.getValue(n),t.getValue(n));function Dr(e,t){return e===t?0:e>t?1:-1}function Bn(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Xs(e,t){const n=e.split(Ar).filter(Boolean),o=t.split(Ar).filter(Boolean);for(;n.length&&o.length;){const r=n.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),d=[a,l].sort();if(isNaN(d[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(d[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-o.length}const Mt={alphanumeric:pu,alphanumericCaseSensitive:hu,text:mu,textCaseSensitive:vu,datetime:bu,basic:wu},yu=[Jd,lu,ou,ru,Qd,eu,cu,du,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:vn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of n){const i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Mt.datetime;if(typeof i=="string"&&(o=!0,i.split(Ar).length>1))return Mt.alphanumeric}return o?Mt.text:Mt.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return So(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Mt[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{const l=a?.find(c=>c.id===e.id),d=a?.findIndex(c=>c.id===e.id);let u=[],f,g=i?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?f="toggle":f="add":a!=null&&a.length&&d!==a.length-1?f="replace":l?f="toggle":f="replace",f==="toggle"&&(i||r||(f="remove")),f==="add"){var _;u=[...a,{id:e.id,desc:g}],u.splice(0,u.length-((_=t.options.maxMultiSortColCount)!=null?_:Number.MAX_SAFE_INTEGER))}else f==="toggle"?u=a.map(c=>c.id===e.id?{...c,desc:g}:c):f==="remove"?u=a.filter(c=>c.id!==e.id):u=[{id:e.id,desc:g}];return u})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},nu,uu,fu,_u,gu,su];function Cu(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const o=[...yu,...(t=e._features)!=null?t:[]];let r={_features:o};const i=r._features.reduce((_,c)=>Object.assign(_,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=_=>r.options.mergeOptions?r.options.mergeOptions(i,_):{...i,..._};let d={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(_=>{var c;d=(c=_.getInitialState==null?void 0:_.getInitialState(d))!=null?c:d});const u=[];let f=!1;const g={_features:o,options:{...i,...e},initialState:d,_queue:_=>{u.push(_),f||(f=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();f=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:_=>{const c=jn(_,r.options);r.options=a(c)},getState:()=>r.options.state,setState:_=>{r.options.onStateChange==null||r.options.onStateChange(_)},_getRowId:(_,c,h)=>{var p;return(p=r.options.getRowId==null?void 0:r.options.getRowId(_,c,h))!=null?p:`${h?[h.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(_,c)=>{let h=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[_];if(!h&&(h=r.getCoreRowModel().rowsById[_],!h))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${_}`):new Error;return h},_getDefaultColumnDef:ce(()=>[r.options.defaultColumn],_=>{var c;return _=(c=_)!=null?c:{},{header:h=>{const p=h.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:h=>{var p,v;return(p=(v=h.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...r._features.reduce((h,p)=>Object.assign(h,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),..._}},de(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:ce(()=>[r._getColumnDefs()],_=>{const c=function(h,p,v){return v===void 0&&(v=0),h.map(w=>{const C=Zd(r,w,v,p),x=w;return C.columns=x.columns?c(x.columns,C,v+1):[],C})};return c(_)},de(e,"debugColumns","getAllColumns")),getAllFlatColumns:ce(()=>[r.getAllColumns()],_=>_.flatMap(c=>c.getFlatColumns()),de(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:ce(()=>[r.getAllFlatColumns()],_=>_.reduce((c,h)=>(c[h.id]=h,c),{}),de(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:ce(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(_,c)=>{let h=_.flatMap(p=>p.getLeafColumns());return c(h)},de(e,"debugColumns","getAllLeafColumns")),getColumn:_=>{const c=r._getAllFlatColumnsById()[_];return process.env.NODE_ENV!=="production"&&!c&&console.error(`[Table] Column with id '${_}' does not exist.`),c}};Object.assign(r,g);for(let _=0;_<r._features.length;_++){const c=r._features[_];c==null||c.createTable==null||c.createTable(r)}return r}function xu(){return e=>ce(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);const l=[];for(let u=0;u<r.length;u++){const f=br(e,e._getRowId(r[u],u,a),r[u],u,i,void 0,a?.id);if(n.flatRows.push(f),n.rowsById[f.id]=f,l.push(f),e.options.getSubRows){var d;f.originalSubRows=e.options.getSubRows(r[u],u),(d=f.originalSubRows)!=null&&d.length&&(f.subRows=o(f.originalSubRows,i+1,f))}}return l};return n.rows=o(t),n},de(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Su(e){const t=[],n=o=>{var r;t.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function $u(e,t,n){return n.options.filterFromLeafRows?ku(e,t,n):Iu(e,t,n)}function ku(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){var g;let c=d[_];const h=br(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(h.columnFilters=c.columnFilters,(g=c.subRows)!=null&&g.length&&u<a){if(h.subRows=l(c.subRows,u+1),c=h,t(c)&&!h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}if(t(c)||h.subRows.length){f.push(c),i[c.id]=c,r.push(c);continue}}else c=h,t(c)&&(f.push(c),i[c.id]=c,r.push(c))}return f};return{rows:l(e),flatRows:r,rowsById:i}}function Iu(e,t,n){var o;const r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(d,u){u===void 0&&(u=0);const f=[];for(let _=0;_<d.length;_++){let c=d[_];if(t(c)){var g;if((g=c.subRows)!=null&&g.length&&u<a){const p=br(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);p.subRows=l(c.subRows,u+1),c=p}f.push(c),r.push(c),i[c.id]=c}}return f};return{rows:l(e),flatRows:r,rowsById:i}}function Eu(){return e=>ce(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let _=0;_<t.flatRows.length;_++)t.flatRows[_].columnFilters={},t.flatRows[_].columnFiltersMeta={};return t}const r=[],i=[];(n??[]).forEach(_=>{var c;const h=e.getColumn(_.id);if(!h)return;const p=h.getFilterFn();if(!p){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${h.id}.`);return}r.push({id:_.id,filterFn:p,resolvedValue:(c=p.resolveFilterValue==null?void 0:p.resolveFilterValue(_.value))!=null?c:_.value})});const a=(n??[]).map(_=>_.id),l=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(_=>_.getCanGlobalFilter());o&&l&&d.length&&(a.push("__global__"),d.forEach(_=>{var c;i.push({id:_.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let u,f;for(let _=0;_<t.flatRows.length;_++){const c=t.flatRows[_];if(c.columnFilters={},r.length)for(let h=0;h<r.length;h++){u=r[h];const p=u.id;c.columnFilters[p]=u.filterFn(c,p,u.resolvedValue,v=>{c.columnFiltersMeta[p]=v})}if(i.length){for(let h=0;h<i.length;h++){f=i[h];const p=f.id;if(f.filterFn(c,p,f.resolvedValue,v=>{c.columnFiltersMeta[p]=v})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}const g=_=>{for(let c=0;c<a.length;c++)if(_.columnFilters[a[c]]===!1)return!1;return!0};return $u(t.rows,g,e)},de(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Mu(e){return t=>ce(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,o)=>{if(!o.rows.length)return o;const{pageSize:r,pageIndex:i}=n;let{rows:a,flatRows:l,rowsById:d}=o;const u=r*i,f=u+r;a=a.slice(u,f);let g;t.options.paginateExpandedRows?g={rows:a,flatRows:l,rowsById:d}:g=Su({rows:a,flatRows:l,rowsById:d}),g.flatRows=[];const _=c=>{g.flatRows.push(c),c.subRows.length&&c.subRows.forEach(_)};return g.rows.forEach(_),g},de(t.options,"debugTable","getPaginationRowModel"))}function Nu(){return e=>ce(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const o=e.getState().sorting,r=[],i=o.filter(d=>{var u;return(u=e.getColumn(d.id))==null?void 0:u.getCanSort()}),a={};i.forEach(d=>{const u=e.getColumn(d.id);u&&(a[d.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=d=>{const u=d.map(f=>({...f}));return u.sort((f,g)=>{for(let c=0;c<i.length;c+=1){var _;const h=i[c],p=a[h.id],v=p.sortUndefined,w=(_=h?.desc)!=null?_:!1;let C=0;if(v){const x=f.getValue(h.id),k=g.getValue(h.id),z=x===void 0,L=k===void 0;if(z||L){if(v==="first")return z?-1:1;if(v==="last")return z?1:-1;C=z&&L?0:z?v:-v}}if(C===0&&(C=p.sortingFn(f,g,h.id)),C!==0)return w&&(C*=-1),p.invertSorting&&(C*=-1),C}return f.index-g.index}),u.forEach(f=>{var g;r.push(f),(g=f.subRows)!=null&&g.length&&(f.subRows=l(f.subRows))}),u};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},de(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
20
20
  * react-table
21
21
  *
22
22
  * Copyright (c) TanStack
@@ -25,5 +25,5 @@
25
25
  * LICENSE.md file in the root directory of this source tree.
26
26
  *
27
27
  * @license MIT
28
- */function ln(e,n){return e?_u(e)?M.createElement(e,n):e:null}function _u(e){return gu(e)||typeof e=="function"||pu(e)}function gu(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function pu(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function hu(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=M.useState(()=>({current:ru(n)})),[o,r]=M.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:s=>{r(s),e.onStateChange==null||e.onStateChange(s)}})),t.current}const $e={checkbox_container:"_checkbox_container_3vmyh_1",checkbox_wrapper:"_checkbox_wrapper_3vmyh_13",label_text:"_label_text_3vmyh_33",hint_text:"_hint_text_3vmyh_51",checkbox:"_checkbox_3vmyh_1",input:"_input_3vmyh_99",checkbox_svg:"_checkbox_svg_3vmyh_153",custom_icon:"_custom_icon_3vmyh_195",checked:"_checked_3vmyh_225",indeterminate:"_indeterminate_3vmyh_227",radius_none:"_radius_none_3vmyh_235",radius_sm:"_radius_sm_3vmyh_243",radius_md:"_radius_md_3vmyh_251",radius_lg:"_radius_lg_3vmyh_259",radius_full:"_radius_full_3vmyh_267",sm:"_sm_3vmyh_275",lg:"_lg_3vmyh_301",secondary:"_secondary_3vmyh_327",success:"_success_3vmyh_335",warning:"_warning_3vmyh_343",danger:"_danger_3vmyh_351",solid:"_solid_3vmyh_377",outline:"_outline_3vmyh_391",disabled:"_disabled_3vmyh_439",readonly:"_readonly_3vmyh_509",no_animation:"_no_animation_3vmyh_589",line_through:"_line_through_3vmyh_607",lineThrough:"_lineThrough_3vmyh_1",checkbox_group:"_checkbox_group_3vmyh_651",label:"_label_3vmyh_33",marca_requerido:"_marca_requerido_3vmyh_677",description:"_description_3vmyh_685",checkboxes:"_checkboxes_3vmyh_699",vertical:"_vertical_3vmyh_709",horizontal:"_horizontal_3vmyh_717",error_message:"_error_message_3vmyh_725",invalid:"_invalid_3vmyh_737"},qs=v.createContext(null),js=()=>v.useContext(qs),cn=v.forwardRef((e,n)=>{const{children:t,label:o,hint:r,isSelected:i,defaultChecked:s,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:f=!1,lineThrough:p=!1,onlyIcon:_=!1,disableAnimation:c=!1,customCheckIcon:h,size:g="md",color:m="primary",customColor:b,radius:w="md",variant:C="solid",className:S="",classNames:k={},onChange:$,value:I,name:F,...L}=e,N=js(),D=v.useId(),V=v.useRef(null),T=i!==void 0,[y,E]=v.useState(s??!1),z=!!N,A=z&&I?N.value.includes(I):!1,x=z?A:T?i:y,P=d||N?.isDisabled,O=u||N?.isReadOnly,B=f||N?.isRequired,j=F||N?.name;v.useEffect(()=>{const G=V.current||(n&&typeof n=="object"?n.current:null);G&&(G.indeterminate=l??!1)},[l,n]);const q=G=>{if(P||O)return;const le=G.target.checked;z&&I?N.onChange(I):(T||E(le),$?.(le))},J=o||t;return a.jsxs("div",{className:K($e.checkbox_container,{[$e.disabled]:P,[$e.readonly]:O},k.base,S),children:[a.jsxs("label",{className:K($e.checkbox_wrapper,$e[g],!b&&$e[m],$e[C],$e[`radius_${w}`],{[$e.checked]:x,[$e.indeterminate]:l,[$e.disabled]:P,[$e.readonly]:O,[$e.line_through]:p&&x,[$e.no_animation]:c}),style:b?{"--checkbox-custom-color":b}:void 0,children:[a.jsxs("span",{className:$e.checkbox,children:[a.jsx("input",{ref:G=>{V.current=G,typeof n=="function"?n(G):n&&(n.current=G)},id:D,type:"checkbox",className:$e.input,checked:x,onChange:q,disabled:P,readOnly:O,required:B,value:I,name:j,...L}),h?a.jsx("span",{className:$e.custom_icon,children:h}):a.jsx("svg",{className:$e.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:a.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!_&&J&&a.jsx("span",{className:K($e.label_text,k.label),children:J})]}),r&&a.jsx("span",{className:K($e.hint_text,k.label),children:r})]})});cn.displayName="Checkbox";const Bs=({label:e,children:n,description:t,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:s,value:l,defaultValue:d=[],onChange:u,isDisabled:f=!1,isReadOnly:p=!1,isRequired:_=!1,name:c,options:h,optionValueKey:g,optionLabelKey:m,optionDisabledKey:b,optionDescriptionKey:w})=>{const C=l!==void 0,[S,k]=v.useState(d),$=C?l:S,I=F=>{if(f||p)return;const L=$.includes(F)?$.filter(N=>N!==F):[...$,F];C||k(L),u?.(L)};return a.jsxs("div",{className:K($e.checkbox_group,$e[i],{[$e.invalid]:r,[$e.disabled]:f,[$e.readonly]:p},s),role:"group","aria-required":_,"aria-invalid":r,children:[e&&a.jsxs("div",{className:$e.label,children:[e,_&&a.jsx("span",{className:$e.marca_requerido,children:" *"})]}),t&&a.jsx("div",{className:$e.description,children:t}),a.jsx(qs.Provider,{value:{value:$,onChange:I,isDisabled:f,isReadOnly:p,isRequired:_,name:c},children:a.jsx("div",{className:K($e.checkboxes,$e[i]),children:h&&h.length>0?h.map((F,L)=>{let N,D,V=!1,T;if(typeof F=="object"&&F!==null){const y=g??"value",E=m??"label",z=b??"isDisabled",A=w??"description",x=F[y],P=F[E];N=String(x!==void 0?x:L),D=P;const O=F[z];V=typeof O=="boolean"?O:!1;const B=F[A];T=typeof B=="string"?B:void 0}else N=String(F),D=F;return a.jsx(cn,{value:N,isDisabled:V,hint:T,children:D},N)}):n})}),o&&r&&a.jsx("div",{className:$e.error_message,children:o})]})};Bs.displayName="CheckboxGroup";const kn={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function In({content:e,children:n,placement:t="top",variant:o="default",size:r="md",offset:i=8,delayShow:s=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:f="320px",isInteractive:p=!1,className:_="",onOpen:c,onClose:h,isOpen:g,onOpenChange:m}){const[b,w]=v.useState(!1),C=v.useRef(null),S=g!==void 0?g:b,k=v.useCallback(O=>{d||(m?m(O):w(O),O?c?.():h?.())},[d,m,c,h]),{refs:$,floatingStyles:I,context:F,isPositioned:L}=uo({open:S,onOpenChange:k,placement:t,strategy:"fixed",middleware:[Jn(i+(u?8:0)),to({fallbackAxisSideDirection:"start",padding:8}),eo({padding:8}),u?Sc({element:C}):void 0].filter(Boolean),whileElementsMounted:Xn}),N=Jo(F,{delay:{open:s,close:p?200:l||100},enabled:!d,move:!1,handleClose:null}),D=Rc(F,{enabled:!d}),V=co(F,{enabled:!d}),T=po(F,{role:"tooltip"}),{getReferenceProps:y,getFloatingProps:E}=fo([N,D,V,T]),{isMounted:z,styles:A}=ho(F,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=v.useMemo(()=>[kn.tooltip,kn[`size_${r}`],kn[`variant_${o}`],_].filter(Boolean).join(" "),[r,o,_]),P=v.useMemo(()=>v.cloneElement(n,y({ref:$.setReference,...n.props})),[n,y,$.setReference]);return!e||d?n:a.jsxs(a.Fragment,{children:[P,z&&a.jsx(lo,{children:a.jsx("div",{ref:$.setFloating,className:kn.tooltip_positioner,style:{...I,maxWidth:f,zIndex:9999,pointerEvents:"none"},children:a.jsxs("div",{className:x,style:{...A,pointerEvents:p?"auto":"none",visibility:L||!S?"visible":"hidden"},...E(),children:[e,u&&a.jsx(Nc,{ref:C,context:F,className:kn.arrow})]})})})]})}const je={contenedor:"_contenedor_hurn6_1",contenedor_superior:"_contenedor_superior_hurn6_17",input_con_icono:"_input_con_icono_hurn6_35",icono_busqueda:"_icono_busqueda_hurn6_49",input_busqueda:"_input_busqueda_hurn6_75",contenedor_acciones_botones:"_contenedor_acciones_botones_hurn6_147",contenedor_acciones:"_contenedor_acciones_hurn6_147",columna:"_columna_hurn6_183",encabezados:"_encabezados_hurn6_201",boton_basico:"_boton_basico_hurn6_265",texto_filtros:"_texto_filtros_hurn6_289",menu_configuraciones:"_menu_configuraciones_hurn6_321",boton_excel:"_boton_excel_hurn6_349",contenedor_tabla:"_contenedor_tabla_hurn6_369",contenedor_datos:"_contenedor_datos_hurn6_387",datos:"_datos_hurn6_395",seleccionada:"_seleccionada_hurn6_431",boton_acciones:"_boton_acciones_hurn6_475"};function mu(e,n,t=3){const o=Math.floor(t/2);let r=e-o;r<1&&(r=1),r+t-1>n&&(r=Math.max(1,n-t+1));const i=Math.min(t,n);return Array.from({length:i},(s,l)=>r+l)}function vu(e,n){return n===0?0:e>=n?n-1:e<0?0:e}function bu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function dn(e,n){const t=new Map;n.getFlatHeaders().forEach(s=>t.set(s.column.id,s));const o=t.get(e);if(o)return ln(o.column.columnDef.header,o.getContext());const r=n.getAllLeafColumns().find(s=>s.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function Hs(e,n){const t=e.getVisibleCells().find(o=>o.column.id===n);return t?ln(t.column.columnDef.cell,t.getContext()):null}function Gs(e,n){return n?e.getVisibleCells().map(o=>o.column.id).includes(n):!1}function wu(e,n,t){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==n&&o.column.id!==t)}function yu(e,n){if(n===0)return"";if(n===1)return kr(e[0].nombre.toLowerCase());if(n===2)return`${kr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const t=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=n-2;return`${kr(t.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function kr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ws(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const Rs=v.createContext(null),Ir=Rs;function xu({children:e,data:n,columns:t,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:s=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:p}){const[_,c]=v.useState(""),h=dd(_,200),g=mo("only screen and (max-width: 830px)"),[m,b]=v.useState({pageIndex:0,pageSize:s}),[w,C]=v.useState({}),S=v.useMemo(()=>{const x=[];if(f.length>0&&!g){const P={id:"select",header:({table:O})=>a.jsx(cn,{color:"secondary",isSelected:O.getIsAllPageRowsSelected(),isIndeterminate:O.getIsSomePageRowsSelected()&&!O.getIsAllPageRowsSelected(),onChange:B=>O.toggleAllPageRowsSelected(!!B)}),cell:({row:O})=>a.jsx(cn,{color:"primary",isSelected:O.getIsSelected(),isDisabled:!O.getCanSelect(),onChange:B=>O.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};x.push(P)}if(x.push(...t),o?.length){const P={id:"actions",header:"Acciones",cell:O=>a.jsx("div",{className:je.contenedor_acciones,children:o.map(B=>a.jsx(In,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:a.jsx("button",{type:"button",onClick:()=>B.evento(O.row.original),className:je.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1};x.push(P)}return x},[t,o,f,g]),k=v.useMemo(()=>{const x=S.map(O=>"accessorKey"in O?String(O.accessorKey):"id"in O?String(O.id):"").filter(Boolean),P=x.indexOf("actions");return P>-1&&P<x.length-1&&(x.splice(P,1),x.push("actions")),x},[S]),[$,I]=v.useState(k),F=v.useCallback((x,P,O)=>{if(!O)return!0;const B=Ws(O),j=x.getValue(P);return j==null?!1:Ws(String(j)).includes(B)},[]),L=hu({data:n,columns:S,state:{pagination:m,globalFilter:h,columnOrder:$,rowSelection:w},globalFilterFn:F,enableRowSelection:f.length>0,onRowSelectionChange:C,onPaginationChange:b,onColumnOrderChange:I,getCoreRowModel:iu(),getSortedRowModel:fu(),getFilteredRowModel:du(),getPaginationRowModel:uu(),autoResetPageIndex:!1}),N=L.getPageCount();v.useEffect(()=>{const x=vu(m.pageIndex,N);x!==m.pageIndex&&b(P=>({...P,pageIndex:x}))},[N]),v.useEffect(()=>{h!==void 0&&L.setPageIndex(0)},[h]);const D=v.useMemo(()=>L.getAllLeafColumns().filter(x=>x.id!=="actions"&&x.id!=="select"&&x.getCanHide?.()),[L]),V=v.useCallback(x=>{const O=t.find(B=>"accessorKey"in B?B.accessorKey===x:B.id===x)?.header;return typeof O=="string"||typeof O=="number"?String(O):x},[t]),T=v.useCallback(()=>{L.setColumnVisibility({}),L.setPageSize(s),L.setPageIndex(0),L.resetRowSelection(),I(k)},[L,s,k]),y=v.useCallback(x=>{const P=Math.max(1,Math.min(200,x));L.setPageSize(P),L.setPageIndex(0)},[L]),E=v.useCallback(x=>{I(P=>typeof x=="function"?x(P):x)},[]),A={state:{ordenColumnas:$,table:L,columns:S,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:_,setInputBusqueda:c,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:p},todasLasColumnas:D,etiquetaColumna:V,restaurarConfiguracion:T,cambiarPageSize:y,cambiarOrdenColumnas:E};return a.jsx(Rs.Provider,{value:A,children:e})}function Cu(){const e=v.useContext(Ir);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Vt(){const e=v.useContext(Ir);return e||null}const Nt={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function Ks(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function Us(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function Su(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function $u(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function ku(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function Iu(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[a.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),a.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function Eu(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("circle",{cx:"12",cy:"12",r:"3"}),a.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function Mu(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function Nu(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[a.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),a.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Fu(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Au(e){return a.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[a.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),a.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function Ys(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function Pu(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function Lu(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:a.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}const Du=({titulo:e,onBack:n})=>a.jsxs("header",{className:Nt.header,children:[a.jsx(ht,{isIconOnly:!0,variant:"light",onClick:n,"aria-label":"Regresar",children:a.jsx(Ks,{})}),a.jsx("h3",{className:Nt.titulo,children:e})]}),Ut={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function Tu(){const e=Vt(),[n,t]=v.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:s}=e,{ordenColumnas:l}=o,d=p=>_=>{t(p),_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",p)},u=p=>_=>{_.preventDefault(),!(!n||n===p)&&s?.(c=>{const h=[...c],g=h.indexOf(n),m=h.indexOf(p);return g===-1||m===-1?c:(h.splice(g,1),h.splice(m,0,n),h)})},f=()=>t(null);return a.jsx("div",{className:Ut.contenedor,children:a.jsx("ul",{className:Ut.lista,children:l.map(p=>{const _=r.find(m=>m.id===p);if(!_)return null;const c=_.getCanHide?.()??!0,h=_.getIsVisible(),g=n===_.id;return a.jsxs("li",{className:`${Ut.item} ${g?Ut.item_dragging:""}`,draggable:!0,onDragStart:d(_.id),onDragOver:u(_.id),onDrop:f,onDragEnd:f,children:[a.jsx("span",{className:Ut.icono_drag,"aria-label":"Arrastrar columna",children:a.jsx(Nu,{})}),a.jsx("span",{className:Ut.nombre,children:i(_.id)}),a.jsx(cn,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:m=>_.toggleVisibility(m),className:Ut.checkbox})]},_.id)})})})}const En={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function Ou(){const e=Vt(),[n,t]=v.useState(""),o=v.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(v.useEffect(()=>t(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,s=p=>Math.max(Er,Math.min(Mr,p)),l=p=>{const _=r+p;_>=Er&&_<=Mr&&i?.(_)},d=()=>{const p=parseInt(n,10),_=!isNaN(p)&&p>0?s(p):r;i?.(_),t(String(_))},u=p=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{t(String(r)),o.current?.blur()},ArrowUp:()=>{p.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{p.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[p.key]?.()},f=p=>{const _=p.target.value;(_===""||/^\d+$/.test(_))&&t(_)};return a.jsxs("div",{className:En.contenido,children:[a.jsx("p",{className:En.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),a.jsxs("div",{className:En.control,children:[a.jsx(ht,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Er,children:a.jsx(Pu,{style:{fontSize:"var(--gaps-6)"}})}),a.jsx("div",{className:En.valor,children:a.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:n,onChange:f,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:En.input,"aria-label":"Número de filas por página"})}),a.jsx(ht,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Mr,children:a.jsx(Ys,{})})]})]})}const ot={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function zu({navegar:e}){const n=Vt();return a.jsxs("div",{className:ot.contenedor,children:[a.jsx("nav",{className:ot.menu,children:ju.map(({id:t,icono:o,nombre:r,descripcion:i})=>a.jsxs("button",{className:ot.item,onClick:()=>e(t),children:[a.jsx("div",{className:ot.icono_contenedor,children:a.jsx(o,{})}),a.jsxs("div",{className:ot.texto,children:[a.jsx("span",{className:ot.nombre,children:r}),a.jsx("span",{className:ot.descripcion,children:i})]}),a.jsx(Us,{className:ot.chevron})]},t))}),a.jsx("div",{className:ot.divider}),a.jsx("div",{className:ot.menu,children:a.jsxs("button",{className:ot.item,onClick:n?.restaurarConfiguracion,children:[a.jsx("div",{className:ot.icono_contenedor,children:a.jsx(Mu,{})}),a.jsxs("div",{className:ot.texto,children:[a.jsx("span",{className:ot.nombre,children:"Restaurar configuración"}),a.jsx("span",{className:ot.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Er=1,Mr=200,Xs=250,Vu=200,qu={panelPrincipal:{component:zu},panelColumnas:{component:Tu,titulo:"Columnas visibles"},panelFilas:{component:Ou,titulo:"Filas por página"}},ju=[{id:"panelColumnas",icono:Fu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Au,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function Bu(e,n,t){const o=v.useRef(t);o.current=t;const r=v.useRef(e);r.current=e;const i=v.useCallback(s=>{const l=s.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);v.useEffect(()=>{if(!n)return;const s=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(s),document.removeEventListener("mousedown",i)}},[n,i])}function Zs(e,n){v.useEffect(()=>{if(!n)return;const t=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,e])}function Hu(e,n,t,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:s=0,offsetTop:l=0,offsetBottom:d=0}){const[u,f]=v.useState({top:0,left:0}),p=mo("only screen and (max-width: 480px)");return v.useEffect(()=>{if(!t||!e.current)return;const _=()=>{const c=e.current.getBoundingClientRect();let h=c.bottom+l,g=0;if(p)g=window.innerWidth-o-r;else{const b=c.right-o+i-s;g=Math.max(r,Math.min(b,window.innerWidth-o-r))}const m=n.current?.offsetHeight||400;h+m>window.innerHeight-r&&(h=c.top-m-d,h<r&&(h=c.bottom+l)),f({top:h,left:g})};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[t,p,o,r,i,s,l,d,e,n]),u}function Gu(e){v.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function Wu(){const[e,n]=v.useState(!1),[t,o]=v.useState(!1),[r,i]=v.useState("panelPrincipal"),[s,l]=v.useState(null),d=v.useRef(null),u=v.useRef(null),f=v.useRef(null);Gu(t),Bu(()=>_(),t,[d,u]),Zs(()=>_(),t);const p=Hu(d,u,t,{width:Xs,offsetRight:6,offsetTop:-2});v.useEffect(()=>{e&&(o(!0),l(null))},[e]),v.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function _(){t&&(n(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},Vu))}function c(m){l(m==="panelPrincipal"?"backward":"forward"),i(m)}const h=qu[r],g=h.component;return a.jsxs("div",{className:Nt.contenedor,children:[a.jsx(ht,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>n(m=>!m),"aria-haspopup":"dialog","aria-expanded":e,children:a.jsx(Eu,{})}),t&&d.current&&un.createPortal(a.jsx("div",{ref:u,className:`${Nt.popover} ${e?Nt.popover_entrada:Nt.popover_salida}`,role:"dialog",style:{top:`${p.top}px`,left:`${p.left}px`,width:Xs},children:a.jsx("div",{className:Nt.ventana,children:a.jsxs("div",{className:K([Nt.panel,Nt[`panel_${s}`]]),children:[h.titulo&&a.jsx(Du,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),a.jsx(g,{navegar:c})]},r)})}),document.body)]})}function Ru(){const e=Vt();if(!e)return null;const{state:n}=e,{inputBusqueda:t,setInputBusqueda:o,filtros:r,actualizarTabla:i,descargarExcel:s}=n,{abrirFiltros:l,filtrosAplicados:d=[]}=r||{},u=d?.length||0;return a.jsxs("section",{className:je.contenedor_superior,children:[a.jsxs("div",{className:je.input_con_icono,children:[a.jsx(Su,{className:je.icono_busqueda}),a.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:t??"",onChange:f=>o&&o(f.target.value),className:je.input_busqueda})]}),a.jsxs("div",{className:je.contenedor_acciones_botones,children:[a.jsxs("div",{className:je.contenedor_acciones,children:[i!==void 0&&a.jsxs(ht,{variant:"light",className:je.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:[a.jsx(Iu,{}),i?.cargando?"Actualizando...":"Actualizar tabla"]}),l!==void 0&&a.jsxs(ht,{onClick:l,variant:"light",className:je.boton_basico,children:[a.jsx(ku,{})," Filtros"]}),u>0?a.jsxs("div",{className:je.texto_filtros,children:[a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:a.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),a.jsx("p",{children:yu(d,u)})]}):null]}),s!==void 0?a.jsxs(ht,{onClick:s,className:`${je.boton_basico} ${je.boton_excel}`,children:[a.jsx($u,{})," Excel"]}):null]}),a.jsx("div",{className:je.menu_configuraciones,children:a.jsx(Wu,{})})]})}const qt={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function Ku(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t}=n,o=t.getPrePaginationRowModel().rows.length,r=t.getPageCount()||1,{pageIndex:i}=t.getState().pagination,s=i+1,l=mu(s,r),d=t.getCanPreviousPage(),u=t.getCanNextPage(),f=r>1,p=()=>{d&&t.previousPage()},_=()=>{u&&t.nextPage()},c=h=>{t.setPageIndex(h-1)};return a.jsxs("section",{className:qt.contenedor_paginacion,children:[a.jsxs("p",{className:qt.info_paginacion,children:["Documentos: ",o]}),f&&a.jsxs("div",{className:qt.contenedor_botones,children:[d&&a.jsx(Ks,{onClick:p,"aria-disabled":!d,className:qt.boton_paginacion}),l.map(h=>a.jsx("button",{type:"button",onClick:()=>c(h),className:h===s?qt.pagina_activa:qt.boton_num_paginacion,children:h},h)),u&&a.jsx(Us,{onClick:_,"aria-disabled":!u,className:qt.boton_paginacion})]}),a.jsxs("p",{className:qt.info_paginacion,children:["Página ",s," de ",r]})]})}const ke={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"};function Qs(e,n){if(n)return e.find(t=>t.accessorKey===n||t.id!==void 0&&t.id===String(n))}function Js(e){if(e)return e.id??e.accessorKey}const Ft={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function Uu({filas:e,cantidadControles:n=0,table:t,idPrimeraColumna:o,idSegundaColumna:r}){const s=t.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return a.jsx("section",{className:ke.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>a.jsxs("article",{className:ke.contenedor_card,children:[a.jsxs("div",{className:ke.contenedor_encabezado_card,children:[a.jsx("div",{className:ke.contenedor_columna_card,children:o&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(o,t)}),a.jsx("div",{className:ke.card_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado}`})})]})}),a.jsx("div",{className:ke.contenedor_columna_card,children:r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(r,t)}),a.jsx("div",{className:ke.card_segundo_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado_segundo}`})})]})})]}),a.jsx("div",{className:ke.contenedor_contenido_cards,children:s.map((f,p)=>a.jsxs("div",{className:ke.contenedor_fila_card,children:[a.jsx("div",{className:ke.card_fila_label,children:dn(f.id,t)}),a.jsx("div",{className:ke.card_fila_valor,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_contenido}`,style:{width:l[p%l.length]}})})]},f.id))}),n>0&&a.jsx("div",{className:ke.contenedor_acciones_card,children:Array.from({length:Math.min(n,3)}).map((f,p)=>a.jsx("div",{className:Ft.skeleton_accion,children:a.jsx("div",{className:`${Ft.skeleton_elemento} ${Ft.skeleton_elemento_encabezado}`})},`accion-${p}`))})]},`skeleton-card-${u}`))})}const jt={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129",boton_agregar:"_boton_agregar_53kvd_145"};function ea(){const e=v.useContext(Ir),{sinDatosProps:n}=e?.state||{},{alAgregarRegistro:t,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=n||{};return a.jsxs("div",{className:jt.contenedor,children:[a.jsx(Yu,{}),a.jsxs("div",{className:jt.envolvedor_contenido,children:[a.jsx(Xu,{}),a.jsx("h3",{className:jt.titulo,children:o}),a.jsx("p",{className:jt.descripcion,children:r}),t?a.jsxs(ht,{onClick:t,variant:"bordered",className:jt.boton_agregar,children:[a.jsx(Ys,{})," ",i]}):null]})]})}function Yu(){return a.jsx("div",{className:jt.envolvedor_cuadricula,children:a.jsxs("svg",{className:jt.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("defs",{children:a.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:a.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function Xu(){return a.jsxs("svg",{className:jt.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),a.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),a.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),a.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),a.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const Zu=({fila:e,controls:n})=>(n?.length??0)>0?a.jsx("div",{className:ke.contenedor_acciones_card,children:n?.map(o=>a.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${ke.boton_acciones} ${ke.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,Qu=({columnasRestantes:e,table:n})=>e.length===0?null:a.jsx("div",{className:ke.contenedor_contenido_cards,children:e.map(t=>a.jsxs("div",{className:ke.contenedor_fila_card,children:[a.jsx("div",{className:ke.card_fila_label,children:dn(t.column.id,n)}),a.jsx("div",{className:ke.card_fila_valor,children:ln(t.column.columnDef.cell,t.getContext())})]},t.id))}),Ju=({fila:e,table:n,idPrimeraColumna:t,idSegundaColumna:o})=>{const r=Gs(e,t),i=Gs(e,o);return a.jsxs("div",{className:ke.contenedor_encabezado_card,children:[a.jsx("div",{className:ke.contenedor_columna_card,children:t&&r&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(t,n)}),a.jsx("div",{className:ke.card_valor,children:Hs(e,t)})]})}),a.jsx("div",{className:ke.contenedor_columna_card,children:o&&i&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:ke.card_label,children:dn(o,n)}),a.jsx("div",{className:ke.card_segundo_valor,children:Hs(e,o)})]})})]})};function ef(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t,controls:o,primerasColumnas:r,loading:i,columns:s}=n;if(!t)return null;const l=s&&r?Qs(s,r[0]):void 0,d=s&&r?Qs(s,r[1]):void 0,u=Js(l),f=Js(d);if(i)return a.jsx(Uu,{filas:3,cantidadControles:o?.length??0,table:t,idPrimeraColumna:u,idSegundaColumna:f});const p=t.getRowModel().rows;return p.length===0?a.jsx("article",{className:ke.contenedor_card,children:a.jsx(ea,{})}):a.jsx("section",{className:ke.contenedor_tabla_cards,children:p.map(_=>{const c=wu(_,u,f);return a.jsxs("article",{className:ke.contenedor_card,children:[a.jsx(Ju,{fila:_,table:t,idPrimeraColumna:u,idSegundaColumna:f}),a.jsx(Qu,{columnasRestantes:c,table:t}),a.jsx(Zu,{fila:_,controls:o})]},_.id)})})}const ta={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},tf=({columnas:e,filas:n})=>a.jsx(a.Fragment,{children:Array.from({length:n}).map((t,o)=>a.jsx("tr",{className:ta.filas,children:Array.from({length:e}).map((r,i)=>a.jsx("td",{className:ta.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),Yt={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function nf({totalSeleccionadas:e,acciones:n,filasSeleccionadas:t,onLimpiarSeleccion:o}){const[r,i]=v.useState(0),[s,l]=v.useState([]),[d,u]=v.useState([]),f=e>0,p=v.useRef(null);return Zs(o,f),v.useEffect(()=>{f&&(i(e),l(n),u(t))},[e,n,t,f]),a.jsx(Pn,{mostrar:f,tipo:"escalar",className:Yt.contenedor,children:a.jsxs("div",{ref:p,className:Yt.barra,children:[a.jsxs("div",{className:Yt.info,children:[a.jsx(ht,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:Yt.btn_cerrar,children:a.jsx(Lu,{})}),a.jsxs("p",{className:Yt.contador,children:[r," filas seleccionadas"]})]}),a.jsx("div",{className:Yt.separador}),a.jsx("div",{className:Yt.acciones,children:s.map(_=>a.jsx("div",{children:_.componente(d)},_.id))})]})})}function of(){const e=Vt();if(!e)return null;const{state:n}=e,{table:t,loading:o,columns:r,selectorFilas:i=[]}=n;if(!t)return null;const s=t.getHeaderGroups(),l=t.getRowModel().rows,d=r?.length??0,u=t.getSelectedRowModel().rows,f=u.length,p=()=>{t.resetRowSelection()};return a.jsxs(a.Fragment,{children:[a.jsxs("table",{className:je.contenedor_tabla,children:[a.jsx("thead",{children:s.map(_=>a.jsx("tr",{children:_.headers.map(c=>{const h=c.column.columnDef.meta?.style;return a.jsx("th",{className:je.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?a.jsx("div",{children:ln(c.column.columnDef.header,c.getContext())}):a.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[ln(c.column.columnDef.header,c.getContext()),bu(c.column.getIsSorted())]})},c.id)})},_.id))}),a.jsx("tbody",{className:je.contenedor_datos,children:o?a.jsx(tf,{columnas:d,filas:10}):l.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:a.jsx(ea,{})})}):l.map(_=>a.jsx("tr",{className:`${je.datos} ${_.getIsSelected()?je.seleccionada:""}`,children:_.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return a.jsx("td",{className:je.columna,style:h,"data-columna":c.column.id,children:ln(c.column.columnDef.cell,c.getContext())},c.id)})},_.id))})]}),i?.length>0?a.jsx(nf,{totalSeleccionadas:f,acciones:i,filasSeleccionadas:u.map(_=>_.original),onLimpiarSeleccion:p}):null]})}function rf({id:e}){const n=mo("only screen and (max-width: 830px)");return a.jsxs("main",{className:je.contenedor,id:e,children:[a.jsx(Ru,{}),n?a.jsx(ef,{}):a.jsx(of,{}),a.jsx(Ku,{})]})}function sf({id:e,...n}){return a.jsx(xu,{...n,children:a.jsx(rf,{id:e})})}const Me={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},na=v.createContext(void 0),af=()=>v.useContext(na),Nr=v.memo(v.forwardRef(({value:e,label:n,description:t,size:o="md",color:r="primary",customColor:i,variant:s="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:f=!1,children:p,className:_="",onChange:c,...h},g)=>{const m=af(),b=v.useId(),w=h.id||b,C=m?.name||h.name,S=m?.size||o,k=m?.color||r,$=m?.customColor||i,I=m?.variant||s,F=m?.isDisabled||l,L=m?.isReadOnly||d,N=m?.isInvalid||u,D=m?.isRequired||f,V=m?.value!==void 0?m.value===e:void 0,T=p||n,y=A=>{F||L||(m?.onChange&&m.onChange(e),c&&c(A))},E=[Me.contenedor_radio,Me[`tam_${S}`],!$&&Me[`color_${k}`],Me[`variante_${I}`],F&&Me.deshabilitado,L&&Me.solo_lectura,N&&Me.invalido,V&&Me.seleccionado,_].filter(Boolean).join(" "),z=$?{"--radio-custom-color":$}:void 0;return a.jsx("div",{className:E,style:z,children:a.jsxs("label",{className:Me.envoltorio_radio,htmlFor:w,children:[a.jsxs("div",{className:Me.radio,children:[a.jsx("input",{ref:g,type:"radio",id:w,name:C,value:e,checked:V,disabled:F,readOnly:L,required:D,"aria-invalid":N,className:Me.input,onChange:y,...h}),a.jsx("div",{className:Me.circulo_radio,children:a.jsx("div",{className:Me.punto_radio})})]})," ",T&&a.jsxs("div",{className:Me.contenedor_label,children:[a.jsxs("span",{className:Me.texto_label,children:[T,f&&!m&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),t&&a.jsx("span",{className:Me.texto_descripcion,children:t})]})]})})}));Nr.displayName="Radio";const oa=({name:e,value:n,defaultValue:t,onChange:o,orientation:r="horizontal",label:i,description:s,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:f=!1,errorMessage:p,size:_,color:c,customColor:h,variant:g,justifyContent:m="flex-start",children:b,className:w="",options:C,optionValueKey:S,optionLabelKey:k,optionDisabledKey:$,optionDescriptionKey:I})=>{const[F,L]=v.useState(String(t??"")),N=n!==void 0?String(n):F,V={name:e,value:N,onChange:E=>{l||d||(n===void 0&&L(E),o&&o(E))},size:_,color:c,customColor:h,variant:g,isDisabled:l,isReadOnly:d,isInvalid:f,isRequired:u},T=[Me.grupo_radio,Me[`orientacion_${r}`],f&&Me.grupo_invalido,l&&Me.grupo_deshabilitado,d&&Me.grupo_solo_lectura,w].filter(Boolean).join(" "),y=m==="center"?"center":m==="flex-end"?"right":"left";return a.jsx(na.Provider,{value:V,children:a.jsxs("div",{className:T,role:"radiogroup","aria-required":u,"aria-invalid":f,style:{textAlign:y},children:[i&&a.jsxs("div",{className:Me.encabezado_grupo,children:[a.jsxs("label",{className:Me.label_grupo,children:[i,u&&a.jsx("span",{className:Me.marca_requerido,children:" *"})]}),s&&a.jsx("span",{className:Me.descripcion_grupo,children:s})]}),a.jsx("div",{className:Me.contenedor_radios,style:{justifyContent:m},children:C&&C.length>0?C.map((E,z)=>{let A,x,P=!1,O;if(typeof E=="object"&&E!==null){const B=S??"value",j=k??"label",q=$??"isDisabled",J=I??"description",G=E[B],le=E[j];A=String(G!==void 0?G:z),x=le;const oe=E[q];P=typeof oe=="boolean"?oe:!1;const re=E[J];O=typeof re=="string"?re:void 0}else A=String(E),x=E;return a.jsx(Nr,{value:A,isDisabled:P,description:O,children:x},A)}):b}),f&&p&&a.jsx("span",{className:Me.mensaje_error,children:p})]})})};oa.displayName="RadioGroup";const Oe={contenedor_toggle:"_contenedor_toggle_1ow2e_5",envoltorio_toggle:"_envoltorio_toggle_1ow2e_19",contenedor_label:"_contenedor_label_1ow2e_37",texto_label:"_texto_label_1ow2e_49",texto_descripcion:"_texto_descripcion_1ow2e_65",marca_requerido:"_marca_requerido_1ow2e_75",pista_toggle:"_pista_toggle_1ow2e_83",input:"_input_1ow2e_117",fondo_pista:"_fondo_pista_1ow2e_143",pulgar_toggle:"_pulgar_toggle_1ow2e_171",icono_check:"_icono_check_1ow2e_205",icono_x:"_icono_x_1ow2e_207",seleccionado:"_seleccionado_1ow2e_275",con_iconos:"_con_iconos_1ow2e_307",tam_sm:"_tam_sm_1ow2e_317",icono_moon:"_icono_moon_1ow2e_321",tam_lg:"_tam_lg_1ow2e_371",color_primary:"_color_primary_1ow2e_415",color_secondary:"_color_secondary_1ow2e_423",color_success:"_color_success_1ow2e_431",color_warning:"_color_warning_1ow2e_439",color_danger:"_color_danger_1ow2e_447",label_left:"_label_left_1ow2e_455",deshabilitado:"_deshabilitado_1ow2e_463",solo_lectura:"_solo_lectura_1ow2e_531",invalido:"_invalido_1ow2e_597",variante_moon:"_variante_moon_1ow2e_663",posicion_top:"_posicion_top_1ow2e_709",justify_end:"_justify_end_1ow2e_727",posicion_inline:"_posicion_inline_1ow2e_737"},ra=v.forwardRef(({isSelected:e,defaultSelected:n=!1,onChange:t,label:o,description:r,size:i="md",color:s="primary",customColor:l,variant:d="default",isDisabled:u=!1,isReadOnly:f=!1,isInvalid:p=!1,isRequired:_=!1,showIcons:c=!1,labelPlacement:h="right",labelPosition:g="inline",justifyEnd:m=!1,children:b,className:w="",...C},S)=>{const[k,$]=v.useState(n),I=v.useId(),F=C.id||I,L=e!==void 0?e:k,N=A=>{if(u||f)return;const x=A.target.checked;e===void 0&&$(x),t&&t(x)},D=b||o,V=[Oe.contenedor_toggle,Oe[`tam_${i}`],!l&&Oe[`color_${s}`],Oe[`variante_${d}`],Oe[`label_${h}`],Oe[`posicion_${g}`],L&&Oe.seleccionado,u&&Oe.deshabilitado,f&&Oe.solo_lectura,p&&Oe.invalido,c&&Oe.con_iconos,m&&Oe.justify_end,w].filter(Boolean).join(" "),T=l?{"--toggle-custom-color":l}:void 0,y=()=>D?a.jsxs("div",{className:Oe.contenedor_label,children:[a.jsxs("span",{className:Oe.texto_label,children:[D,_&&a.jsx("span",{className:Oe.marca_requerido,children:" *"})]}),r&&a.jsx("span",{className:Oe.texto_descripcion,children:r})]}):null,E=()=>d!=="moon"?null:a.jsx("div",{className:Oe.icono_moon,children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",children:a.jsx("path",{d:"M5,1 L5,1 C2.790861,1 1,2.790861 1,5 L1,5 C1,7.209139 2.790861,9 5,9 L5,9 C7.209139,9 9,7.209139 9,5 L9,5 C9,2.790861 7.209139,1 5,1 L5,9 L5,1 Z"})})}),z=()=>!c||d==="moon"?null:a.jsxs(a.Fragment,{children:[a.jsx("svg",{className:Oe.icono_check,width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"2,6 5,9 10,3"})}),a.jsxs("svg",{className:Oe.icono_x,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"2",y1:"2",x2:"8",y2:"8"}),a.jsx("line",{x1:"8",y1:"2",x2:"2",y2:"8"})]})]});return a.jsxs("div",{className:V,style:T,children:[g==="top"&&y(),a.jsxs("label",{className:Oe.envoltorio_toggle,htmlFor:F,children:[g==="inline"&&h==="left"&&y(),a.jsxs("div",{className:Oe.pista_toggle,children:[a.jsx("input",{ref:S,type:"checkbox",id:F,checked:L,disabled:u,readOnly:f,required:_,"aria-invalid":p,className:Oe.input,onChange:N,...C}),a.jsx("div",{className:Oe.fondo_pista,children:a.jsxs("div",{className:Oe.pulgar_toggle,children:[E(),z()]})})]}),g==="inline"&&h==="right"&&y()]})]})});ra.displayName="Toggle";const rt={backdrop:"_backdrop_1cxqc_1",visible:"_visible_1cxqc_39",drawer:"_drawer_1cxqc_51",posicion_right:"_posicion_right_1cxqc_81",slideInRight:"_slideInRight_1cxqc_1",drawer_detras:"_drawer_detras_1cxqc_145",posicion_left:"_posicion_left_1cxqc_153",slideInLeft:"_slideInLeft_1cxqc_1",radio_none:"_radio_none_1cxqc_225",radio_sm:"_radio_sm_1cxqc_233",posicion_top:"_posicion_top_1cxqc_233",posicion_bottom:"_posicion_bottom_1cxqc_243",radio_md:"_radio_md_1cxqc_253",radio_lg:"_radio_lg_1cxqc_273",radio_xl:"_radio_xl_1cxqc_293",slideInTop:"_slideInTop_1cxqc_1",slideInBottom:"_slideInBottom_1cxqc_1",tamano_sm:"_tamano_sm_1cxqc_457",tamano_md:"_tamano_md_1cxqc_467",tamano_lg:"_tamano_lg_1cxqc_477",tamano_xl:"_tamano_xl_1cxqc_487",tamano_full:"_tamano_full_1cxqc_497",encabezado:"_encabezado_1cxqc_557",titulo:"_titulo_1cxqc_577",boton_cerrar:"_boton_cerrar_1cxqc_597",contenido:"_contenido_1cxqc_651",pie:"_pie_1cxqc_663",loading_overlay:"_loading_overlay_1cxqc_683",spinner:"_spinner_1cxqc_709",spin:"_spin_1cxqc_709",loading_text:"_loading_text_1cxqc_739",resize_handle:"_resize_handle_1cxqc_751"},ia=v.forwardRef(({isOpen:e,onClose:n,position:t="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:s=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:f,children:p,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",onOpen:m,backdropVariant:b="normal",borderRadius:w,resizable:C=!1,zIndex:S,getContainer:k},$)=>{const I=v.useRef(null),[F,L]=v.useState(!1),N=v.useCallback(()=>{L(!0),setTimeout(()=>{n?.(),L(!1)},350)},[n]);v.useEffect(()=>{if(e){if(m?.(),d){const j=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",j>0&&(document.body.style.paddingRight=`${j}px`)}if(l){const j=q=>{q.key==="Escape"&&N()};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,N,l,d,m]);const D=j=>{s&&j.target===I.current&&N()},V=w?rt[`radio_${w}`]:void 0,T=[rt.drawer,rt[`posicion_${t}`],rt[`tamano_${o}`],V,_].filter(Boolean).join(" "),y=[rt.contenido,c].filter(Boolean).join(" "),E=[rt.backdrop,e&&!F&&rt.visible].filter(Boolean).join(" "),z=S||500,A={transparente:{opacity:0,blur:0},sutil:{opacity:.2,blur:0},normal:{opacity:.4,blur:1},intermedio:{opacity:.6,blur:3},intenso:{opacity:.8,blur:6}},{opacity:x,blur:P}=A[b],O={background:`rgb(0 0 0 / ${x})`,backdropFilter:`blur(${P}px)`,zIndex:z,...k&&{position:"absolute"}},B=a.jsx("div",{className:E,ref:I,onClick:D,style:O,children:a.jsxs("div",{ref:$,className:T,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&a.jsx("div",{className:rt.encabezado,children:u||a.jsxs(a.Fragment,{children:[a.jsx("h2",{id:"drawer-title",className:rt.titulo,children:r}),i&&a.jsx("button",{type:"button",className:rt.boton_cerrar,onClick:N,"aria-label":"Cerrar",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),a.jsx("div",{className:y,children:p}),f&&a.jsx("div",{className:rt.pie,children:f}),h&&a.jsxs("div",{className:rt.loading_overlay,children:[a.jsx("div",{className:rt.spinner}),a.jsx("span",{className:rt.loading_text,children:g})]}),C&&a.jsx("div",{className:rt.resize_handle})]})});if(k){const j=typeof k=="function"?k():k;if(j&&j instanceof HTMLElement)return un.createPortal(B,j)}return B});ia.displayName="Drawer";const tt={backdrop:"_backdrop_rrtrc_1",visible:"_visible_rrtrc_41",centrado:"_centrado_rrtrc_53",modal:"_modal_rrtrc_61",scaleInModal:"_scaleInModal_rrtrc_1",tamano_sm:"_tamano_sm_rrtrc_133",tamano_md:"_tamano_md_rrtrc_141",tamano_lg:"_tamano_lg_rrtrc_149",tamano_xl:"_tamano_xl_rrtrc_157",tamano_formulario:"_tamano_formulario_rrtrc_165",tamano_full:"_tamano_full_rrtrc_173",tamano_auto:"_tamano_auto_rrtrc_181",encabezado:"_encabezado_rrtrc_191",contenedor_titulo_completo:"_contenedor_titulo_completo_rrtrc_205",contenedor_titulo_icono:"_contenedor_titulo_icono_rrtrc_215",boton_atras:"_boton_atras_rrtrc_227",icono_titulo:"_icono_titulo_rrtrc_269",titulo:"_titulo_rrtrc_283",contenido:"_contenido_rrtrc_303",pie:"_pie_rrtrc_315",loading_overlay:"_loading_overlay_rrtrc_335",spinner:"_spinner_rrtrc_361",spin:"_spin_rrtrc_361",loading_text:"_loading_text_rrtrc_391"},sa=v.forwardRef(({isOpen:e,onClose:n,size:t="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:s=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:f,children:p,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:g="Cargando...",backdropVariant:m="normal",showIconTitle:b=!1,onOpen:w},C)=>{const S=v.useRef(null),k=v.useCallback(()=>{h||n?.()},[n,h]);v.useEffect(()=>{if(e){if(w?.(),l){const y=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",y>0&&(document.body.style.paddingRight=`${y}px`)}if(s){const y=E=>{E.key==="Escape"&&k()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,k,s,l,w]);const $=y=>{i&&y.target===S.current&&k()},I=[tt.backdrop,d&&tt.centrado,e&&tt.visible].filter(Boolean).join(" "),F=[tt.modal,tt[`tamano_${t}`],_].filter(Boolean).join(" "),L=[tt.contenido,c].filter(Boolean).join(" "),N={transparente:{opacity:0,blur:0},sutil:{opacity:.3,blur:1},normal:{opacity:.5,blur:4},intermedio:{opacity:.7,blur:8},intenso:{opacity:.9,blur:12}},{opacity:D,blur:V}=N[m]||N.normal,T={background:`rgb(0 0 0 / ${D})`,backdropFilter:`blur(${V}px)`};return a.jsx("div",{className:I,ref:S,onClick:$,style:T,children:a.jsxs("div",{ref:C,className:F,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&a.jsx("div",{className:tt.encabezado,children:a.jsx("div",{className:tt.contenedor_titulo_completo,children:u||a.jsx(a.Fragment,{children:a.jsxs("div",{className:tt.contenedor_titulo_icono,children:[b&&r!==void 0&&(typeof r=="string"?a.jsx("span",{className:tt.icono_titulo,children:r}):r),b&&r===void 0&&a.jsx("span",{className:tt.icono_titulo,children:"📄"}),a.jsx("h2",{id:"modal-title",className:tt.titulo,children:o})]})})})}),a.jsx("div",{className:L,children:p}),f&&a.jsx("div",{className:tt.pie,children:f}),h&&a.jsxs("div",{className:tt.loading_overlay,children:[a.jsx("div",{className:tt.spinner}),a.jsx("span",{className:tt.loading_text,children:g})]})]})})});sa.displayName="Modal";const pt={overlay:"_overlay_1d3xw_1",container:"_container_1d3xw_29",modal:"_modal_1d3xw_47",modal_closing:"_modal_closing_1d3xw_85",modal_detras:"_modal_detras_1d3xw_95",header:"_header_1d3xw_171",button_back:"_button_back_1d3xw_187",title_container:"_title_container_1d3xw_243",title_icon:"_title_icon_1d3xw_259",title:"_title_1d3xw_243",content:"_content_1d3xw_291",footer:"_footer_1d3xw_303"};function lf({modals:e,onClose:n}){const[t,o]=v.useState([]),[r,i]=v.useState(!1);v.useEffect(()=>{const _=()=>{i(window.innerWidth<=768)};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const s=_=>{o(c=>[...c,_]),setTimeout(()=>{n(_),o(c=>c.filter(h=>h!==_))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,f=e.length*d+(e.length-1)*u,p=e.length>1?f/2-d/2-l*(d+u):0;return a.jsx("div",{className:pt.overlay,children:a.jsx("div",{className:pt.container,style:r?void 0:{transform:`translateX(${p}px)`},children:e.map((_,c)=>{const h=t.includes(_.id),g=c===e.length-1,m=[pt.modal,h&&pt.modal_closing,!g&&pt.modal_detras].filter(Boolean).join(" ");return a.jsxs("div",{className:m,children:[a.jsxs("div",{className:pt.header,children:[a.jsx("button",{type:"button",className:pt.button_back,onClick:()=>s(_.id),"aria-label":"Volver",children:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:a.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),a.jsxs("div",{className:pt.title_container,children:[_.titleIcon&&a.jsx("span",{className:pt.title_icon,children:_.titleIcon}),a.jsx("h2",{className:pt.title,children:_.title})]})]}),a.jsx("div",{className:pt.content,children:_.content}),_.footer&&a.jsx("div",{className:pt.footer,children:_.footer})]},_.id)})})})}const Fr=v.createContext(null),Ar=()=>{const e=v.useContext(Fr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},Mn=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,aa=e=>e.type==="checkbox",la=e=>e.type==="radio",ca=e=>e.type==="separator",da=e=>e.type==="label",xe={menu:"_menu_1bgl0_1",variant_default:"_variant_default_1bgl0_49",variant_elevated:"_variant_elevated_1bgl0_59",variant_bordered:"_variant_bordered_1bgl0_69",variant_glass:"_variant_glass_1bgl0_83",size_sm:"_size_sm_1bgl0_97",size_md:"_size_md_1bgl0_113",size_lg:"_size_lg_1bgl0_127",item:"_item_1bgl0_143",disabled:"_disabled_1bgl0_201",active:"_active_1bgl0_203",danger:"_danger_1bgl0_249",has_submenu:"_has_submenu_1bgl0_263",submenu_open:"_submenu_open_1bgl0_271",indicator:"_indicator_1bgl0_279",start_icon:"_start_icon_1bgl0_309",content:"_content_1bgl0_351",label_text:"_label_text_1bgl0_369",description:"_description_1bgl0_381",shortcut:"_shortcut_1bgl0_399",end_icon:"_end_icon_1bgl0_423",submenu_arrow:"_submenu_arrow_1bgl0_453",separator:"_separator_1bgl0_489",label:"_label_1bgl0_369",menuEnter:"_menuEnter_1bgl0_1",context_menu_trigger:"_context_menu_trigger_1bgl0_623"},cf=()=>a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})}),df=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),uf=({marcado:e})=>a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&a.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Pr=v.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=Ar();if(ca(e))return a.jsx("div",{className:K(xe.separator,i.classNames?.separator),role:"separator"});if(da(e))return a.jsx("div",{className:K(xe.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const s=n===t,l=aa(e),d=la(e),u=$=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect($),i.closeOnSelect&&!Mn(e)&&i.cerrarMenu())},f=$=>{u($)},p=$=>{"isDisabled"in e&&e.isDisabled||($.key==="Enter"||$.key===" ")&&($.preventDefault(),u($))},_=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,g="description"in e?e.description:void 0,m="shortcut"in e?e.shortcut:void 0,b="startIcon"in e?e.startIcon:void 0,w="endIcon"in e?e.endIcon:void 0,C="isDisabled"in e?e.isDisabled:!1,S="isDanger"in e?e.isDanger:!1,k="className"in e?e.className:void 0;return a.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?_:d?c:void 0,"aria-disabled":C,tabIndex:s?0:-1,className:K(xe.item,xe[`size_${i.size}`],s&&xe.active,C&&xe.disabled,S&&xe.danger,Mn(e)&&xe.has_submenu,k,i.classNames?.item),onClick:f,onKeyDown:p,...o(),children:[(l||d)&&a.jsxs("span",{className:xe.indicator,children:[l&&_&&a.jsx(cf,{}),d&&a.jsx(uf,{marcado:c})]}),b&&a.jsx("span",{className:xe.start_icon,children:b}),a.jsxs("span",{className:xe.content,children:[a.jsx("span",{className:xe.label_text,children:h}),g&&a.jsx("span",{className:xe.description,children:g})]}),m&&a.jsx("kbd",{className:xe.shortcut,children:m}),w&&a.jsx("span",{className:xe.end_icon,children:w}),Mn(e)&&a.jsx("span",{className:xe.submenu_arrow,children:a.jsx(df,{})})]})});Pr.displayName="MenuItem";const ff=()=>a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),So=({items:e,activeIndex:n,getItemProps:t,listRef:o})=>a.jsx(a.Fragment,{children:e.map((r,i)=>Mn(r)?a.jsx(Lr,{ref:s=>{o.current[i]=s},item:r,index:i,activeIndex:n,getItemProps:t},r.id):a.jsx(Pr,{ref:s=>{o.current[i]=s},item:r,index:i,activeIndex:n,getItemProps:t},r.id))});So.displayName="MenuList";const Lr=v.forwardRef(({item:e,index:n,activeIndex:t,getItemProps:o},r)=>{const i=Ar(),[s,l]=v.useState(!1),d=Wt(),u=Ki(),f=v.useRef([]),[p,_]=v.useState(null),{refs:c,floatingStyles:h,context:g,isPositioned:m}=uo({nodeId:u,open:s,onOpenChange:l,placement:"right-start",middleware:[Jn({mainAxis:4,alignmentAxis:-4}),to(),eo({padding:8})],whileElementsMounted:Xn}),{isMounted:b,styles:w}=ho(g,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),C=Jo(g,{enabled:!e.isDisabled,delay:{open:75},handleClose:hs({blockPointerEvents:!0})}),S=po(g,{role:"menu"}),k=co(g,{bubbles:!0}),$=ar(g,{listRef:f,activeIndex:p,onNavigate:_,nested:!0}),{getReferenceProps:I,getFloatingProps:F,getItemProps:L}=fo([C,S,k,$]);v.useEffect(()=>{if(!d)return;const V=()=>l(!1);return d.events.on("click",V),()=>{d.events.off("click",V)}},[d]);const N=n===t,D=zi([c.setReference,r]);return a.jsxs(Ui,{id:u,children:[a.jsxs("div",{ref:D,role:"menuitem","aria-haspopup":"menu","aria-expanded":s,"aria-disabled":e.isDisabled,tabIndex:N?0:-1,className:K(xe.item,xe[`size_${i.size}`],N&&xe.active,e.isDisabled&&xe.disabled,e.isDanger&&xe.danger,xe.has_submenu,s&&xe.submenu_open,e.className,i.classNames?.item),...I(o()),children:[e.startIcon&&a.jsx("span",{className:xe.start_icon,children:e.startIcon}),a.jsxs("span",{className:xe.content,children:[a.jsx("span",{className:xe.label_text,children:e.label}),e.description&&a.jsx("span",{className:xe.description,children:e.description})]}),e.shortcut&&a.jsx("kbd",{className:xe.shortcut,children:e.shortcut}),a.jsx("span",{className:xe.submenu_arrow,children:a.jsx(ff,{})})]}),b&&a.jsx(lo,{root:i.portalContainer,children:a.jsx(or,{context:g,modal:!1,initialFocus:-1,returnFocus:!1,children:a.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:a.jsx("div",{className:K(xe.menu,xe[`variant_${i.variant}`],i.classNames?.menu),style:{...w,pointerEvents:"auto",visibility:m||!s?"visible":"hidden"},...F(),children:a.jsx(So,{items:e.children,activeIndex:p,getItemProps:L,listRef:f})})})})})]})});Lr.displayName="Submenu";const ua=v.forwardRef(({children:e,items:n,triggerAction:t="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:s=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:f=!1,closeOnClickOutside:p=!0,closeOnEscape:_=!0,closeOnSelect:c=!0,className:h,classNames:g,style:m,onOpen:b,onClose:w,onOpenChange:C,onContextMenu:S,isOpen:k,zIndex:$,portalContainer:I,radioValue:F,onRadioChange:L},N)=>{const[D,V]=v.useState(!1),[T,y]=v.useState(null),[E,z]=v.useState(0),A=v.useRef([]),x=v.useRef([]),P=Ki(),O=k!==void 0,B=O?k:D,j=v.useCallback(R=>{s&&R||(O||V(R),C?.(R),R?b?.():w?.())},[s,O,C,b,w]);v.useEffect(()=>{x.current=n.filter(R=>R.type!=="separator"&&R.type!=="label").map(R=>"label"in R&&typeof R.label=="string"?R.label:"")},[n]);const{refs:q,floatingStyles:J,context:G,isPositioned:le}=uo({nodeId:P,open:B,onOpenChange:j,placement:o,strategy:"fixed",middleware:[Jn(l),to({fallbackAxisSideDirection:"start",padding:8}),eo({padding:8}),u?Oi({apply({rects:R,elements:H}){Object.assign(H.floating.style,{minWidth:`${R.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:Xn}),oe=ls(G,{enabled:!s&&(t==="click"||t==="both"),toggle:!0}),re=Jo(G,{enabled:!s&&t==="hover",delay:{open:150,close:150},handleClose:hs()}),ce=co(G,{enabled:_||p,escapeKey:_,outsidePress:p}),ie=po(G,{role:"menu"}),me=ar(G,{listRef:A,activeIndex:T,onNavigate:y,loop:!0}),U=_s(G,{listRef:x,activeIndex:T,onMatch:y,enabled:B}),{getReferenceProps:ne,getFloatingProps:ee,getItemProps:pe}=fo([oe,re,ce,ie,me,U]),{isMounted:_e,styles:Z}=ho(G,{duration:f?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:f?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});v.useImperativeHandle(N,()=>({open:()=>j(!0),close:()=>j(!1),toggle:()=>j(!B),isOpen:B}),[j,B]);const de=v.useMemo(()=>({radioValue:F,onRadioChange:L,cerrarMenu:()=>j(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:f,classNames:g,portalContainer:I,zIndex:$}),[F,L,j,c,i,r,f,g,I,$]),ye=v.isValidElement(e)?e:null,ue=zi([q.setReference,ye?.ref||null]);if(!ye)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const Ce=t==="contextmenu"||t==="both"?{onContextMenu:R=>{R.preventDefault();const H={x:R.clientX,y:R.clientY};S?.(R,H),j(!1),z(he=>he+1),requestAnimationFrame(()=>{q.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:H.x,y:H.y,top:H.y,left:H.x,right:H.x,bottom:H.y}}}),j(!0)})},onClick:()=>{B&&t==="contextmenu"&&j(!1)}}:{},W=v.cloneElement(e,ne({...e.props,...Ce,ref:ue,"aria-haspopup":"menu","aria-expanded":B}));return a.jsx(Fr.Provider,{value:de,children:a.jsxs(Ui,{id:P,children:[W,_e&&a.jsx(lo,{root:I,children:a.jsx(or,{context:G,modal:!1,initialFocus:-1,returnFocus:!0,children:a.jsx("div",{ref:q.setFloating,style:{...J,zIndex:$??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:a.jsx("div",{role:"menu","aria-orientation":"vertical",className:K(xe.menu,xe[`variant_${r}`],xe[`size_${i}`],h,g?.menu),style:{...Z,minWidth:d,...m,transform:[Z.transform,m?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:le||!B?"visible":"hidden"},...ee(),children:a.jsx(So,{items:n,activeIndex:T,getItemProps:pe,listRef:A})},E)})})})]})})});ua.displayName="DropdownMenuInner";const Dr=v.forwardRef((e,n)=>a.jsx(Fc,{children:a.jsx(ua,{...e,ref:n})}));Dr.displayName="DropdownMenu";const fa=v.forwardRef(({isEnabled:e=!0,children:n,...t},o)=>a.jsx(Dr,{...t,ref:o,triggerAction:"contextmenu",isDisabled:!e||t.isDisabled,children:n}));fa.displayName="ContextMenu";const _a=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),ga=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),pa=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),ha=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"15 18 9 12 15 6"})}),ma=()=>a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"9 18 15 12 9 6"})}),He={overlay:"_overlay_e2tbk_1",backdrop:"_backdrop_e2tbk_25",visible:"_visible_e2tbk_51",layout:"_layout_e2tbk_63",columna_acciones:"_columna_acciones_e2tbk_127",boton_flotante:"_boton_flotante_e2tbk_147",boton_primario:"_boton_primario_e2tbk_221",boton_peligro:"_boton_peligro_e2tbk_231",panel:"_panel_e2tbk_249",encabezado:"_encabezado_e2tbk_277",titulo:"_titulo_e2tbk_295",contenido:"_contenido_e2tbk_311",paginacion:"_paginacion_e2tbk_325",texto_paginacion:"_texto_paginacion_e2tbk_351"},_f={transparente:{background:"transparent",backdropFilter:"none"},sutil:{background:"rgb(0 0 0 / 20%)",backdropFilter:"blur(0px)"},normal:{background:"rgb(0 0 0 / 40%)",backdropFilter:"blur(2px)"},intenso:{background:"rgb(0 0 0 / 60%)",backdropFilter:"blur(4px)"}},gf=({isOpen:e,onClose:n,onApply:t,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:s=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[f,p]=v.useState(!1),[_,c]=v.useState(0),h=l||i==="transparente",g=v.useCallback(()=>{p(!0),setTimeout(()=>{n(),p(!1),c(0)},400)},[n]);v.useEffect(()=>{if(!e)return;const D=V=>V.key==="Escape"&&g();return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[e,g]);const m=v.useCallback(D=>{s&&D.target===D.currentTarget&&g()},[s,g]),b=v.useCallback(D=>{document.activeElement?.blur(),D?.()},[]),{pages:w,totalPages:C,hasPagination:S}=v.useMemo(()=>{const D=Array.isArray(u)?u:[u];return{pages:D,totalPages:D.length,hasPagination:D.length>1}},[u]),{background:k,backdropFilter:$}=_f[i],I={background:k,backdropFilter:$,pointerEvents:h?"none":"auto"},F=d?{position:"absolute"}:{},L=d?{position:"relative"}:{},N=a.jsxs("div",{className:He.overlay,role:"dialog","aria-modal":"true",style:F,children:[a.jsx("div",{className:`${He.backdrop} ${e&&!f?He.visible:""}`,style:I,onClick:m}),a.jsxs("div",{className:`${He.layout} ${e&&!f?He.visible:""}`,style:L,children:[a.jsxs("aside",{className:He.columna_acciones,children:[a.jsx(In,{content:"Cerrar",placement:"left",children:a.jsx("button",{className:He.boton_flotante,onClick:()=>b(g),"aria-label":"Cerrar panel",children:a.jsx(_a,{})})}),a.jsx(In,{content:"Aplicar filtros",placement:"left",children:a.jsx("button",{className:`${He.boton_flotante} ${He.boton_primario}`,onClick:()=>b(t),children:a.jsx(ga,{})})}),a.jsx(In,{content:"Limpiar filtros",placement:"left",children:a.jsx("button",{className:`${He.boton_flotante} ${He.boton_peligro}`,onClick:()=>b(o),children:a.jsx(pa,{})})}),S&&a.jsxs("div",{className:He.paginacion,children:[a.jsx("button",{className:He.boton_flotante,style:{width:36,height:36},onClick:()=>c(D=>Math.max(0,D-1)),disabled:_===0,"aria-label":"Página anterior",children:a.jsx(ha,{})}),a.jsxs("span",{className:He.texto_paginacion,children:[_+1," / ",C]}),a.jsx("button",{className:He.boton_flotante,style:{width:36,height:36},onClick:()=>c(D=>Math.min(C-1,D+1)),disabled:_===C-1,"aria-label":"Página siguiente",children:a.jsx(ma,{})})]})]}),a.jsxs("main",{className:He.panel,children:[a.jsx("header",{className:He.encabezado,children:a.jsx("h2",{className:He.titulo,children:r})}),a.jsx("div",{className:He.contenido,children:a.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:w[_]},_)})]})]})]});if(d){const D=typeof d=="function"?d():d;if(D&&D instanceof HTMLElement)return un.createPortal(N,D)}return N},vt={badge:"_badge_jvdik_1",badge_clickable:"_badge_clickable_jvdik_41",size_sm:"_size_sm_jvdik_65",size_md:"_size_md_jvdik_77",size_lg:"_size_lg_jvdik_89",radius_none:"_radius_none_jvdik_101",radius_sm:"_radius_sm_jvdik_109",radius_md:"_radius_md_jvdik_117",radius_lg:"_radius_lg_jvdik_125",radius_full:"_radius_full_jvdik_133",dot:"_dot_jvdik_141",pulse:"_pulse_jvdik_1",icon:"_icon_jvdik_187",dismiss_button:"_dismiss_button_jvdik_199",variant_solid:"_variant_solid_jvdik_259",color_default:"_color_default_jvdik_267",color_primary:"_color_primary_jvdik_277",color_secondary:"_color_secondary_jvdik_287",color_success:"_color_success_jvdik_297",color_warning:"_color_warning_jvdik_307",color_danger:"_color_danger_jvdik_317",color_info:"_color_info_jvdik_327",color_brand:"_color_brand_jvdik_337",variant_subtle:"_variant_subtle_jvdik_347",variant_outline:"_variant_outline_jvdik_427",variant_soft:"_variant_soft_jvdik_523",badge_custom:"_badge_custom_jvdik_603"},pf=()=>a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:a.jsx("path",{d:"M2 2L8 8M8 2L2 8"})}),hf=({variant:e="solid",color:n="default",size:t="md",radius:o="md",children:r,startIcon:i,endIcon:s,dot:l,dismissible:d,onDismiss:u,customColor:f,className:p="",onClick:_})=>{const c=!!_,h=v.useMemo(()=>{if(!f)return;const b=f,w=`color-mix(in oklab, ${b} 15%, transparent)`;return{solid:{"--badge-custom-bg":b,"--badge-custom-text":"white","--badge-custom-border":"transparent"},subtle:{"--badge-custom-bg":w,"--badge-custom-text":b,"--badge-custom-border":"transparent"},outline:{"--badge-custom-bg":"transparent","--badge-custom-text":b,"--badge-custom-border":b},soft:{"--badge-custom-bg":`color-mix(in oklab, ${b} 10%, var(--surface-first))`,"--badge-custom-text":b,"--badge-custom-border":"transparent"}}[e]},[f,e]),g=[vt.badge,vt[`size_${t}`],vt[`radius_${o}`],vt[`variant_${e}`],!f&&vt[`color_${n}`],f&&vt.badge_custom,c&&vt.badge_clickable,p].filter(Boolean).join(" "),m=v.useMemo(()=>f||{default:"var(--gray-11)",primary:"var(--brand-6)",secondary:"var(--brand-6-secondary)",success:"var(--color-add-green-6)",warning:"var(--color-add-orange-6)",danger:"var(--color-add-red-6)",info:"var(--color-add-blue-6)",brand:"var(--brand-6)"}[n],[n,f]);return a.jsxs("span",{className:g,style:h,onClick:_,role:c?"button":void 0,tabIndex:c?0:void 0,children:[l&&a.jsx("span",{className:vt.dot,style:{backgroundColor:m}}),i&&a.jsx("span",{className:vt.icon,children:i}),r,s&&a.jsx("span",{className:vt.icon,children:s}),d&&a.jsx("button",{type:"button",className:vt.dismiss_button,onClick:b=>{b.stopPropagation(),u?.()},"aria-label":"Eliminar badge",children:a.jsx(pf,{})})]})};X.Badge=hf,X.BadgeVoz=No,X.Boton=ht,X.Checkbox=cn,X.CheckboxGroup=Bs,X.ContextMenu=fa,X.Drawer=ia,X.DropdownContext=Fr,X.DropdownMenu=Dr,X.FirmaManual=Br,X.GrabacionIcono=Yr,X.IconoCerrar=_a,X.IconoDerecha=ma,X.IconoFiltroAplicar=ga,X.IconoFiltroLimpiar=pa,X.IconoIzquierda=ha,X.InputDate=Ur,X.InputNumeric=Kr,X.InputText=Hr,X.MenuItem=Pr,X.MenuList=So,X.MicrofonoIcono=Eo,X.Modal=sa,X.ModalStack=lf,X.PanelFiltros=gf,X.Radio=Nr,X.RadioGroup=oa,X.Select=Es,X.SonidoIcono=Mo,X.Submenu=Lr,X.TablaDatos=sf,X.TextArea=Zr,X.Toggle=ra,X.Tooltip=In,X.Transicion=Pn,X.esCheckbox=aa,X.esLabel=da,X.esRadio=la,X.esSeparador=ca,X.fechaEnRango=Ga,X.formatearFecha=Ba,X.formatearNumero=fn,X.generarOpcionesAleatorias=md,X.generarUsuariosPrueba=vd,X.obtenerFechaHoy=Ha,X.parsearNumero=Gr,X.procesarValidacion=Wr,X.redondearDecimales=Rr,X.restringirRango=An,X.tieneHijos=Mn,X.useCheckboxGroupContext=js,X.useDropdownContext=Ar,X.useReconocimientoVoz=Xr,X.useTablaContext=Cu,X.useTablaContextSafe=Vt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
28
+ */function ft(e,t){return e?Fu(e)?E.createElement(e,t):e:null}function Fu(e){return zu(e)||typeof e=="function"||Au(e)}function zu(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Au(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Du(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=E.useState(()=>({current:Cu(t)})),[o,r]=E.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}const Me={checkbox_container:"_checkbox_container_3vmyh_1",checkbox_wrapper:"_checkbox_wrapper_3vmyh_13",label_text:"_label_text_3vmyh_33",hint_text:"_hint_text_3vmyh_51",checkbox:"_checkbox_3vmyh_1",input:"_input_3vmyh_99",checkbox_svg:"_checkbox_svg_3vmyh_153",custom_icon:"_custom_icon_3vmyh_195",checked:"_checked_3vmyh_225",indeterminate:"_indeterminate_3vmyh_227",radius_none:"_radius_none_3vmyh_235",radius_sm:"_radius_sm_3vmyh_243",radius_md:"_radius_md_3vmyh_251",radius_lg:"_radius_lg_3vmyh_259",radius_full:"_radius_full_3vmyh_267",sm:"_sm_3vmyh_275",lg:"_lg_3vmyh_301",secondary:"_secondary_3vmyh_327",success:"_success_3vmyh_335",warning:"_warning_3vmyh_343",danger:"_danger_3vmyh_351",solid:"_solid_3vmyh_377",outline:"_outline_3vmyh_391",disabled:"_disabled_3vmyh_439",readonly:"_readonly_3vmyh_509",no_animation:"_no_animation_3vmyh_589",line_through:"_line_through_3vmyh_607",lineThrough:"_lineThrough_3vmyh_1",checkbox_group:"_checkbox_group_3vmyh_651",label:"_label_3vmyh_33",marca_requerido:"_marca_requerido_3vmyh_677",description:"_description_3vmyh_685",checkboxes:"_checkboxes_3vmyh_699",vertical:"_vertical_3vmyh_709",horizontal:"_horizontal_3vmyh_717",error_message:"_error_message_3vmyh_725",invalid:"_invalid_3vmyh_737"},Ys=m.createContext(null),Zs=()=>m.useContext(Ys),_t=m.forwardRef((e,t)=>{const{children:n,label:o,hint:r,isSelected:i,defaultChecked:a,isIndeterminate:l=!1,isDisabled:d=!1,isReadOnly:u=!1,isRequired:f=!1,lineThrough:g=!1,onlyIcon:_=!1,disableAnimation:c=!1,customCheckIcon:h,size:p="md",color:v="primary",customColor:w,radius:C="md",variant:x="solid",className:k="",classNames:z={},onChange:L,value:N,name:P,...A}=e,I=Zs(),O=m.useId(),q=m.useRef(null),$=i!==void 0,[b,S]=m.useState(a??!1),T=!!I,F=T&&N?I.value.includes(N):!1,y=T?F:$?i:b,M=d||I?.isDisabled,D=u||I?.isReadOnly,B=f||I?.isRequired,G=P||I?.name;m.useEffect(()=>{const U=q.current||(t&&typeof t=="object"?t.current:null);U&&(U.indeterminate=l??!1)},[l,t]);const V=U=>{if(M||D)return;const pe=U.target.checked;T&&N?I.onChange(N):($||S(pe),L?.(pe))},J=o||n;return s.jsxs("div",{className:K(Me.checkbox_container,{[Me.disabled]:M,[Me.readonly]:D},z.base,k),children:[s.jsxs("label",{className:K(Me.checkbox_wrapper,Me[p],!w&&Me[v],Me[x],Me[`radius_${C}`],{[Me.checked]:y,[Me.indeterminate]:l,[Me.disabled]:M,[Me.readonly]:D,[Me.line_through]:g&&y,[Me.no_animation]:c}),style:w?{"--checkbox-custom-color":w}:void 0,children:[s.jsxs("span",{className:Me.checkbox,children:[s.jsx("input",{ref:U=>{q.current=U,typeof t=="function"?t(U):t&&(t.current=U)},id:O,type:"checkbox",className:Me.input,checked:y,onChange:V,disabled:M,readOnly:D,required:B,value:N,name:G,...A}),h?s.jsx("span",{className:Me.custom_icon,children:h}):s.jsx("svg",{className:Me.checkbox_svg,viewBox:"0 0 22 22","aria-hidden":"true",children:s.jsx("path",{fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:l?"M6,11 L16,11":"M5.5,11.3L9,14.8L20.2,3.3l0,0c-0.5-1-1.5-1.8-2.7-1.8h-13c-1.7,0-3,1.3-3,3v13c0,1.7,1.3,3,3,3h13 c1.7,0,3-1.3,3-3v-13c0-0.4-0.1-0.8-0.3-1.2"})})]}),!_&&J&&s.jsx("span",{className:K(Me.label_text,z.label),children:J})]}),r&&s.jsx("span",{className:K(Me.hint_text,z.label),children:r})]})});_t.displayName="Checkbox";const Js=({label:e,children:t,description:n,errorMessage:o,isInvalid:r=!1,orientation:i="vertical",className:a,value:l,defaultValue:d=[],onChange:u,isDisabled:f=!1,isReadOnly:g=!1,isRequired:_=!1,name:c,options:h,optionValueKey:p,optionLabelKey:v,optionDisabledKey:w,optionDescriptionKey:C})=>{const x=l!==void 0,[k,z]=m.useState(d),L=x?l:k,N=P=>{if(f||g)return;const A=L.includes(P)?L.filter(I=>I!==P):[...L,P];x||z(A),u?.(A)};return s.jsxs("div",{className:K(Me.checkbox_group,Me[i],{[Me.invalid]:r,[Me.disabled]:f,[Me.readonly]:g},a),role:"group","aria-required":_,"aria-invalid":r,children:[e&&s.jsxs("div",{className:Me.label,children:[e,_&&s.jsx("span",{className:Me.marca_requerido,children:" *"})]}),n&&s.jsx("div",{className:Me.description,children:n}),s.jsx(Ys.Provider,{value:{value:L,onChange:N,isDisabled:f,isReadOnly:g,isRequired:_,name:c},children:s.jsx("div",{className:K(Me.checkboxes,Me[i]),children:h&&h.length>0?h.map((P,A)=>{let I,O,q=!1,$;if(typeof P=="object"&&P!==null){const b=p??"value",S=v??"label",T=w??"isDisabled",F=C??"description",y=P[b],M=P[S];I=String(y!==void 0?y:A),O=M;const D=P[T];q=typeof D=="boolean"?D:!1;const B=P[F];$=typeof B=="string"?B:void 0}else I=String(P),O=P;return s.jsx(_t,{value:I,isDisabled:q,hint:$,children:O},I)}):t})}),o&&r&&s.jsx("div",{className:Me.error_message,children:o})]})};Js.displayName="CheckboxGroup";const Nt={tooltip:"_tooltip_myw27_1",tooltip_positioner:"_tooltip_positioner_myw27_53",enterAnimation:"_enterAnimation_myw27_1",exitAnimation:"_exitAnimation_myw27_1",arrow:"_arrow_myw27_81",size_sm:"_size_sm_myw27_91",size_md:"_size_md_myw27_101",size_lg:"_size_lg_myw27_111",variant_default:"_variant_default_myw27_121",variant_dark:"_variant_dark_myw27_141",variant_light:"_variant_light_myw27_153",variant_brand:"_variant_brand_myw27_165",variant_success:"_variant_success_myw27_181",variant_warning:"_variant_warning_myw27_193",variant_danger:"_variant_danger_myw27_205",variant_info:"_variant_info_myw27_217",fadeOnly:"_fadeOnly_myw27_1"};function Ft({content:e,children:t,placement:n="top",variant:o="default",size:r="md",offset:i=8,delayShow:a=100,delayHide:l=0,isDisabled:d=!1,showArrow:u=!1,maxWidth:f="320px",isInteractive:g=!1,className:_="",onOpen:c,onClose:h,isOpen:p,onOpenChange:v}){const[w,C]=m.useState(!1),x=m.useRef(null),k=p!==void 0?p:w,z=m.useCallback(D=>{d||(v?v(D):C(D),D?c?.():h?.())},[d,v,c,h]),{refs:L,floatingStyles:N,context:P,isPositioned:A}=po({open:k,onOpenChange:z,placement:n,strategy:"fixed",middleware:[oo(i+(u?8:0)),io({fallbackAxisSideDirection:"start",padding:8}),ro({padding:8}),u?Bc({element:x}):void 0].filter(Boolean),whileElementsMounted:eo}),I=lr(P,{delay:{open:a,close:g?200:l||100},enabled:!d,move:!1,handleClose:null}),O=dd(P,{enabled:!d}),q=go(P,{enabled:!d}),$=bo(P,{role:"tooltip"}),{getReferenceProps:b,getFloatingProps:S}=ho([I,O,q,$]),{isMounted:T,styles:F}=wo(P,{duration:{open:250,close:150},initial:{opacity:0,transform:"scale(0.95)"},open:{opacity:1,transform:"scale(1)"},close:{opacity:0,transform:"scale(0.95)"},common:{transitionTimingFunction:"cubic-bezier(0.16, 1, 0.3, 1)"}}),y=m.useMemo(()=>[Nt.tooltip,Nt[`size_${r}`],Nt[`variant_${o}`],_].filter(Boolean).join(" "),[r,o,_]),M=m.useMemo(()=>m.cloneElement(t,b({ref:L.setReference,...t.props})),[t,b,L.setReference]);return!e||d?t:s.jsxs(s.Fragment,{children:[M,T&&s.jsx(_o,{children:s.jsx("div",{ref:L.setFloating,className:Nt.tooltip_positioner,style:{...N,maxWidth:f,zIndex:9999,pointerEvents:"none"},children:s.jsxs("div",{className:y,style:{...F,pointerEvents:g?"auto":"none",visibility:A||!k?"visible":"hidden"},...S(),children:[e,u&&s.jsx(Rc,{ref:x,context:P,className:Nt.arrow})]})})})]})}const Ue={contenedor:"_contenedor_hurn6_1",contenedor_superior:"_contenedor_superior_hurn6_17",input_con_icono:"_input_con_icono_hurn6_35",icono_busqueda:"_icono_busqueda_hurn6_49",input_busqueda:"_input_busqueda_hurn6_75",contenedor_acciones_botones:"_contenedor_acciones_botones_hurn6_147",contenedor_acciones:"_contenedor_acciones_hurn6_147",columna:"_columna_hurn6_183",encabezados:"_encabezados_hurn6_201",boton_basico:"_boton_basico_hurn6_265",texto_filtros:"_texto_filtros_hurn6_289",menu_configuraciones:"_menu_configuraciones_hurn6_321",boton_excel:"_boton_excel_hurn6_349",contenedor_tabla:"_contenedor_tabla_hurn6_369",contenedor_datos:"_contenedor_datos_hurn6_387",datos:"_datos_hurn6_395",seleccionada:"_seleccionada_hurn6_431",boton_acciones:"_boton_acciones_hurn6_475"};function Lu(e,t,n=3){const o=Math.floor(n/2);let r=e-o;r<1&&(r=1),r+n-1>t&&(r=Math.max(1,t-n+1));const i=Math.min(n,t);return Array.from({length:i},(a,l)=>r+l)}function Pu(e,t){return t===0?0:e>=t?t-1:e<0?0:e}function Tu(e){return e?{asc:" ↑",desc:" ↓"}[e]??null:null}function gt(e,t){const n=new Map;t.getFlatHeaders().forEach(a=>n.set(a.column.id,a));const o=n.get(e);if(o)return ft(o.column.columnDef.header,o.getContext());const r=t.getAllLeafColumns().find(a=>a.id===e),i=r?.columnDef.header;return typeof i=="string"||typeof i=="number"?i:r?.id??e}function Qs(e,t){const n=e.getVisibleCells().find(o=>o.column.id===t);return n?ft(n.column.columnDef.cell,n.getContext()):null}function ea(e,t){return t?e.getVisibleCells().map(o=>o.column.id).includes(t):!1}function Ou(e,t,n){return e.getVisibleCells().filter(o=>o.column.id!=="actions"&&o.column.id!==t&&o.column.id!==n)}function qu(e,t){if(t===0)return"";if(t===1)return Lr(e[0].nombre.toLowerCase());if(t===2)return`${Lr(e[0].nombre.toLowerCase())}, ${e[1].nombre.toLowerCase()}`;const n=e.slice(0,2).map(r=>r.nombre.toLowerCase()),o=t-2;return`${Lr(n.join(", "))} y ${o>1?`otros ${o}`:"otro"} más`}function Lr(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function na(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase()}const ta=m.createContext(null),Pr=ta;function Vu({children:e,data:t,columns:n,controls:o,loading:r,primerasColumnas:i,tamanioPaginaInicial:a=10,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f=[],sinDatosProps:g}){const[_,c]=m.useState(""),h=Ed(_,200),p=yo("only screen and (max-width: 830px)"),[v,w]=m.useState({pageIndex:0,pageSize:a}),[C,x]=m.useState({}),k=m.useMemo(()=>{const y=[];if(f.length>0&&!p){const M={id:"select",header:({table:D})=>s.jsx(_t,{color:"secondary",isSelected:D.getIsAllPageRowsSelected(),isIndeterminate:D.getIsSomePageRowsSelected()&&!D.getIsAllPageRowsSelected(),onChange:B=>D.toggleAllPageRowsSelected(!!B)}),cell:({row:D})=>s.jsx(_t,{color:"primary",isSelected:D.getIsSelected(),isDisabled:!D.getCanSelect(),onChange:B=>D.toggleSelected(B)}),enableSorting:!1,enableHiding:!1};y.push(M)}if(y.push(...n),o?.length){const M={id:"actions",header:"Acciones",cell:D=>s.jsx("div",{className:Ue.contenedor_acciones,children:o.map(B=>s.jsx(Ft,{content:B.nombre,variant:"default",size:"sm",placement:"top",children:s.jsx("button",{type:"button",onClick:()=>B.evento(D.row.original),className:Ue.boton_acciones,children:B.icono})},B.id))}),enableSorting:!1,enableHiding:!1};y.push(M)}return y},[n,o,f,p]),z=m.useMemo(()=>{const y=k.map(D=>"accessorKey"in D?String(D.accessorKey):"id"in D?String(D.id):"").filter(Boolean),M=y.indexOf("actions");return M>-1&&M<y.length-1&&(y.splice(M,1),y.push("actions")),y},[k]),[L,N]=m.useState(z),P=m.useCallback((y,M,D)=>{if(!D)return!0;const B=na(D),G=y.getValue(M);return G==null?!1:na(String(G)).includes(B)},[]),A=Du({data:t,columns:k,state:{pagination:v,globalFilter:h,columnOrder:L,rowSelection:C},globalFilterFn:P,enableRowSelection:f.length>0,onRowSelectionChange:x,onPaginationChange:w,onColumnOrderChange:N,getCoreRowModel:xu(),getSortedRowModel:Nu(),getFilteredRowModel:Eu(),getPaginationRowModel:Mu(),autoResetPageIndex:!1}),I=A.getPageCount();m.useEffect(()=>{const y=Pu(v.pageIndex,I);y!==v.pageIndex&&w(M=>({...M,pageIndex:y}))},[I]),m.useEffect(()=>{h!==void 0&&A.setPageIndex(0)},[h]);const O=m.useMemo(()=>A.getAllLeafColumns().filter(y=>y.id!=="actions"&&y.id!=="select"&&y.getCanHide?.()),[A]),q=m.useCallback(y=>{const D=n.find(B=>"accessorKey"in B?B.accessorKey===y:B.id===y)?.header;return typeof D=="string"||typeof D=="number"?String(D):y},[n]),$=m.useCallback(()=>{A.setColumnVisibility({}),A.setPageSize(a),A.setPageIndex(0),A.resetRowSelection(),N(z)},[A,a,z]),b=m.useCallback(y=>{const M=Math.max(1,Math.min(200,y));A.setPageSize(M),A.setPageIndex(0)},[A]),S=m.useCallback(y=>{N(M=>typeof y=="function"?y(M):y)},[]),F={state:{ordenColumnas:L,table:A,columns:k,controls:o,loading:r,primerasColumnas:[String(i[0]),String(i[1])],inputBusqueda:_,setInputBusqueda:c,filtros:l,descargarExcel:d,actualizarTabla:u,selectorFilas:f,sinDatosProps:g},todasLasColumnas:O,etiquetaColumna:q,restaurarConfiguracion:$,cambiarPageSize:b,cambiarOrdenColumnas:S};return s.jsx(ta.Provider,{value:F,children:e})}function ju(){const e=m.useContext(Pr);if(!e)throw new Error("useTablaContext debe usarse dentro de TablaDatosProvider");return e}function Hn(){const e=m.useContext(Pr);return e||null}const An={contenedor:"_contenedor_1dhtd_1",popover:"_popover_1dhtd_9",popover_entrada:"_popover_entrada_1dhtd_45",popoverEntrada:"_popoverEntrada_1dhtd_1",popover_salida:"_popover_salida_1dhtd_53",popoverSalida:"_popoverSalida_1dhtd_1",ventana:"_ventana_1dhtd_109",panel:"_panel_1dhtd_127",panel_forward:"_panel_forward_1dhtd_145",panelForwardIn:"_panelForwardIn_1dhtd_1",panel_backward:"_panel_backward_1dhtd_153",panelBackwardIn:"_panelBackwardIn_1dhtd_1",header:"_header_1dhtd_209",titulo:"_titulo_1dhtd_233"};function oa(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6l6 6z"})})}function ra(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M9.29 15.88L13.17 12L9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42"})})}function Bu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M21.71 20.29L18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a1 1 0 0 0 1.42 0a1 1 0 0 0 0-1.39M11 18a7 7 0 1 1 7-7a7 7 0 0 1-7 7"})})}function Hu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"m2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.494v20.848a.5.5 0 0 1-.57.494L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-4zm-6.8 9L13 8h-2.4L9 10.286L7.4 8H5l2.8 4L5 16h2.4L9 13.714L10.6 16H13z"})})}function Gu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.145 17.704v-3.976c0-.381 0-.572-.044-.75a1.5 1.5 0 0 0-.192-.446c-.1-.155-.238-.286-.515-.548L3.578 7.43a2.648 2.648 0 0 1 1.82-4.572h13.189a2.664 2.664 0 0 1 1.852 4.579l-4.765 4.607c-.27.261-.405.392-.501.545a1.5 1.5 0 0 0-.187.441c-.044.176-.044.364-.044.74v3.935c0 .542 0 .813-.062 1.057a2 2 0 0 1-.641 1.027c-.192.163-.436.282-.923.52c-1.14.557-1.709.835-2.172.835a2 2 0 0 1-1.795-1.121c-.204-.416-.204-1.05-.204-2.318"})})}function Wu(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:[s.jsx("path",{fill:"currentColor",d:"M12.079 2.25c-4.794 0-8.734 3.663-9.118 8.333H2a.75.75 0 0 0-.528 1.283l1.68 1.666a.75.75 0 0 0 1.056 0l1.68-1.666a.75.75 0 0 0-.528-1.283h-.893c.38-3.831 3.638-6.833 7.612-6.833a7.66 7.66 0 0 1 6.537 3.643a.75.75 0 1 0 1.277-.786A9.16 9.16 0 0 0 12.08 2.25"}),s.jsx("path",{fill:"currentColor",d:"M20.841 10.467a.75.75 0 0 0-1.054 0L18.1 12.133a.75.75 0 0 0 .527 1.284h.899c-.381 3.83-3.651 6.833-7.644 6.833a7.7 7.7 0 0 1-6.565-3.644a.75.75 0 1 0-1.276.788a9.2 9.2 0 0 0 7.84 4.356c4.809 0 8.766-3.66 9.151-8.333H22a.75.75 0 0 0 .527-1.284z",opacity:".5"})]})}function Ku(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3"}),s.jsx("path",{d:"M13.765 2.152C13.398 2 12.932 2 12 2s-1.398 0-1.765.152a2 2 0 0 0-1.083 1.083c-.092.223-.129.484-.143.863a1.62 1.62 0 0 1-.79 1.353a1.62 1.62 0 0 1-1.567.008c-.336-.178-.579-.276-.82-.308a2 2 0 0 0-1.478.396C4.04 5.79 3.806 6.193 3.34 7s-.7 1.21-.751 1.605a2 2 0 0 0 .396 1.479c.148.192.355.353.676.555c.473.297.777.803.777 1.361s-.304 1.064-.777 1.36c-.321.203-.529.364-.676.556a2 2 0 0 0-.396 1.479c.052.394.285.798.75 1.605c.467.807.7 1.21 1.015 1.453a2 2 0 0 0 1.479.396c.24-.032.483-.13.819-.308a1.62 1.62 0 0 1 1.567.008c.483.28.77.795.79 1.353c.014.38.05.64.143.863a2 2 0 0 0 1.083 1.083C10.602 22 11.068 22 12 22s1.398 0 1.765-.152a2 2 0 0 0 1.083-1.083c.092-.223.129-.483.143-.863c.02-.558.307-1.074.79-1.353a1.62 1.62 0 0 1 1.567-.008c.336.178.579.276.819.308a2 2 0 0 0 1.479-.396c.315-.242.548-.646 1.014-1.453s.7-1.21.751-1.605a2 2 0 0 0-.396-1.479c-.148-.192-.355-.353-.676-.555A1.62 1.62 0 0 1 19.562 12c0-.558.304-1.064.777-1.36c.321-.203.529-.364.676-.556a2 2 0 0 0 .396-1.479c-.052-.394-.285-.798-.75-1.605c-.467-.807-.7-1.21-1.015-1.453a2 2 0 0 0-1.479-.396c-.24.032-.483.13-.82.308a1.62 1.62 0 0 1-1.566-.008a1.62 1.62 0 0 1-.79-1.353c-.014-.38-.05-.64-.143-.863a2 2 0 0 0-1.083-1.083Z"})]})})}function Uu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M256 448c-97.974 0-178.808-73.383-190.537-168.183l42.341-5.293c9.123 73.734 71.994 130.809 148.196 130.809c82.475 0 149.333-66.858 149.333-149.333S338.475 106.667 256 106.667c-50.747 0-95.581 25.312-122.567 64h79.9v42.666H64V64h42.667v71.31C141.866 91.812 195.685 64 256 64c106.039 0 192 85.961 192 192s-85.961 192-192 192",clipRule:"evenodd"})})}function Ru(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none",...e,children:[s.jsx("rect",{x:"6",y:"3.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"7.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"}),s.jsx("rect",{x:"6",y:"11.5",width:"4",height:"1",rx:"0.5",fill:"currentColor"})]})}function Xu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"4",height:"14",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"8",y:"3",width:"9",height:"14",rx:"1",fill:"currentColor",opacity:".3"})]})}function Yu(e){return s.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none",...e,children:[s.jsx("rect",{x:"3",y:"3",width:"14",height:"4",rx:"1",fill:"currentColor"}),s.jsx("rect",{x:"3",y:"8",width:"14",height:"9",rx:"1",fill:"currentColor",opacity:".3"})]})}function ia(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M11 13H6q-.425 0-.712-.288T5 12t.288-.712T6 11h5V6q0-.425.288-.712T12 5t.713.288T13 6v5h5q.425 0 .713.288T19 12t-.288.713T18 13h-5v5q0 .425-.288.713T12 19t-.712-.288T11 18z"})})}function Zu(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:s.jsx("path",{fill:"currentColor",d:"M7.5 12.5q-.213 0-.356-.144T7 11.999t.144-.356t.356-.143h9q.213 0 .356.144t.144.357t-.144.356t-.356.143z"})})}function Ju(e){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512",...e,children:s.jsx("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"})})}const Qu=({titulo:e,onBack:t})=>s.jsxs("header",{className:An.header,children:[s.jsx(rn,{isIconOnly:!0,variant:"light",onClick:t,"aria-label":"Regresar",children:s.jsx(oa,{})}),s.jsx("h3",{className:An.titulo,children:e})]}),Qn={contenedor:"_contenedor_1qz45_1",lista:"_lista_1qz45_13",item:"_item_1qz45_45",item_dragging:"_item_dragging_1qz45_75",icono_drag:"_icono_drag_1qz45_93",nombre:"_nombre_1qz45_129",checkbox:"_checkbox_1qz45_159"};function ef(){const e=Hn(),[t,n]=m.useState(null);if(!e)return null;const{state:o,todasLasColumnas:r,etiquetaColumna:i,cambiarOrdenColumnas:a}=e,{ordenColumnas:l}=o,d=g=>_=>{n(g),_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("text/plain",g)},u=g=>_=>{_.preventDefault(),!(!t||t===g)&&a?.(c=>{const h=[...c],p=h.indexOf(t),v=h.indexOf(g);return p===-1||v===-1?c:(h.splice(p,1),h.splice(v,0,t),h)})},f=()=>n(null);return s.jsx("div",{className:Qn.contenedor,children:s.jsx("ul",{className:Qn.lista,children:l.map(g=>{const _=r.find(v=>v.id===g);if(!_)return null;const c=_.getCanHide?.()??!0,h=_.getIsVisible(),p=t===_.id;return s.jsxs("li",{className:`${Qn.item} ${p?Qn.item_dragging:""}`,draggable:!0,onDragStart:d(_.id),onDragOver:u(_.id),onDrop:f,onDragEnd:f,children:[s.jsx("span",{className:Qn.icono_drag,"aria-label":"Arrastrar columna",children:s.jsx(Ru,{})}),s.jsx("span",{className:Qn.nombre,children:i(_.id)}),s.jsx(_t,{size:"md",color:"primary",isSelected:h,isDisabled:!c,onChange:v=>_.toggleVisibility(v),className:Qn.checkbox})]},_.id)})})})}const zt={contenido:"_contenido_1oed5_1",descripcion:"_descripcion_1oed5_15",control:"_control_1oed5_31",valor:"_valor_1oed5_45",input:"_input_1oed5_67"};function nf(){const e=Hn(),[t,n]=m.useState(""),o=m.useRef(null),r=e?.state.table?.getState().pagination.pageSize??10;if(m.useEffect(()=>n(String(r)),[r]),!e)return null;const{cambiarPageSize:i}=e,a=g=>Math.max(Tr,Math.min(Or,g)),l=g=>{const _=r+g;_>=Tr&&_<=Or&&i?.(_)},d=()=>{const g=parseInt(t,10),_=!isNaN(g)&&g>0?a(g):r;i?.(_),n(String(_))},u=g=>{({Enter:()=>{d(),o.current?.blur()},Escape:()=>{n(String(r)),o.current?.blur()},ArrowUp:()=>{g.preventDefault(),l(1),setTimeout(()=>o.current?.select(),0)},ArrowDown:()=>{g.preventDefault(),l(-1),setTimeout(()=>o.current?.select(),0)}})[g.key]?.()},f=g=>{const _=g.target.value;(_===""||/^\d+$/.test(_))&&n(_)};return s.jsxs("div",{className:zt.contenido,children:[s.jsx("p",{className:zt.descripcion,children:"Ajusta la cantidad de filas que se muestran por página en la tabla."}),s.jsxs("div",{className:zt.control,children:[s.jsx(rn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(-1),"aria-label":"Disminuir filas",disabled:r<=Tr,children:s.jsx(Zu,{style:{fontSize:"var(--gaps-6)"}})}),s.jsx("div",{className:zt.valor,children:s.jsx("input",{ref:o,type:"text",inputMode:"numeric",value:t,onChange:f,onKeyDown:u,onFocus:()=>o.current?.select(),onBlur:d,className:zt.input,"aria-label":"Número de filas por página"})}),s.jsx(rn,{isIconOnly:!0,radius:"lg",variant:"bordered",onClick:()=>l(1),"aria-label":"Aumentar filas",disabled:r>=Or,children:s.jsx(ia,{})})]})]})}const un={contenedor:"_contenedor_1syil_1",menu:"_menu_1syil_11",item:"_item_1syil_25",icono_contenedor:"_icono_contenedor_1syil_71",texto:"_texto_1syil_109",nombre:"_nombre_1syil_123",descripcion:"_descripcion_1syil_135",chevron:"_chevron_1syil_151",divider:"_divider_1syil_175"};function tf({navegar:e}){const t=Hn();return s.jsxs("div",{className:un.contenedor,children:[s.jsx("nav",{className:un.menu,children:sf.map(({id:n,icono:o,nombre:r,descripcion:i})=>s.jsxs("button",{className:un.item,onClick:()=>e(n),children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(o,{})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:r}),s.jsx("span",{className:un.descripcion,children:i})]}),s.jsx(ra,{className:un.chevron})]},n))}),s.jsx("div",{className:un.divider}),s.jsx("div",{className:un.menu,children:s.jsxs("button",{className:un.item,onClick:t?.restaurarConfiguracion,children:[s.jsx("div",{className:un.icono_contenedor,children:s.jsx(Uu,{})}),s.jsxs("div",{className:un.texto,children:[s.jsx("span",{className:un.nombre,children:"Restaurar configuración"}),s.jsx("span",{className:un.descripcion,children:"Volver a valores por defecto"})]})]})})]})}const Tr=1,Or=200,sa=250,of=200,rf={panelPrincipal:{component:tf},panelColumnas:{component:ef,titulo:"Columnas visibles"},panelFilas:{component:nf,titulo:"Filas por página"}},sf=[{id:"panelColumnas",icono:Xu,nombre:"Columnas visibles",descripcion:"Mostrar u ocultar columnas"},{id:"panelFilas",icono:Yu,nombre:"Filas por página",descripcion:"Ajustar cantidad de filas"}];function af(e,t,n){const o=m.useRef(n);o.current=n;const r=m.useRef(e);r.current=e;const i=m.useCallback(a=>{const l=a.target;o.current.some(u=>u.current?.contains(l))||r.current()},[]);m.useEffect(()=>{if(!t)return;const a=setTimeout(()=>{document.addEventListener("mousedown",i)},100);return()=>{clearTimeout(a),document.removeEventListener("mousedown",i)}},[t,i])}function aa(e,t){m.useEffect(()=>{if(!t)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,e])}function lf(e,t,n,{width:o,margin:r=0,offsetRight:i=0,offsetLeft:a=0,offsetTop:l=0,offsetBottom:d=0}){const[u,f]=m.useState({top:0,left:0}),g=yo("only screen and (max-width: 480px)");return m.useEffect(()=>{if(!n||!e.current)return;const _=()=>{const c=e.current.getBoundingClientRect();let h=c.bottom+l,p=0;if(g)p=window.innerWidth-o-r;else{const w=c.right-o+i-a;p=Math.max(r,Math.min(w,window.innerWidth-o-r))}const v=t.current?.offsetHeight||400;h+v>window.innerHeight-r&&(h=c.top-v-d,h<r&&(h=c.bottom+l)),f({top:h,left:p})};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[n,g,o,r,i,a,l,d,e,t]),u}function cf(e){m.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e])}function df(){const[e,t]=m.useState(!1),[n,o]=m.useState(!1),[r,i]=m.useState("panelPrincipal"),[a,l]=m.useState(null),d=m.useRef(null),u=m.useRef(null),f=m.useRef(null);cf(n),af(()=>_(),n,[d,u]),aa(()=>_(),n);const g=lf(d,u,n,{width:sa,offsetRight:6,offsetTop:-2});m.useEffect(()=>{e&&(o(!0),l(null))},[e]),m.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);function _(){n&&(t(!1),f.current=window.setTimeout(()=>{o(!1),i("panelPrincipal"),l(null)},of))}function c(v){l(v==="panelPrincipal"?"backward":"forward"),i(v)}const h=rf[r],p=h.component;return s.jsxs("div",{className:An.contenedor,children:[s.jsx(rn,{isIconOnly:!0,ref:d,variant:"light",onClick:()=>t(v=>!v),"aria-haspopup":"dialog","aria-expanded":e,children:s.jsx(Ku,{})}),n&&d.current&&pt.createPortal(s.jsx("div",{ref:u,className:`${An.popover} ${e?An.popover_entrada:An.popover_salida}`,role:"dialog",style:{top:`${g.top}px`,left:`${g.left}px`,width:sa},children:s.jsx("div",{className:An.ventana,children:s.jsxs("div",{className:K([An.panel,An[`panel_${a}`]]),children:[h.titulo&&s.jsx(Qu,{titulo:h.titulo,onBack:()=>c("panelPrincipal")}),s.jsx(p,{navegar:c})]},r)})}),document.body)]})}function uf(){const e=Hn();if(!e)return null;const{state:t}=e,{inputBusqueda:n,setInputBusqueda:o,filtros:r,actualizarTabla:i,descargarExcel:a}=t,{abrirFiltros:l,filtrosAplicados:d=[]}=r||{},u=d?.length||0;return s.jsxs("section",{className:Ue.contenedor_superior,children:[s.jsxs("div",{className:Ue.input_con_icono,children:[s.jsx(Bu,{className:Ue.icono_busqueda}),s.jsx("input",{type:"text",placeholder:"Buscar en tabla...",value:n??"",onChange:f=>o&&o(f.target.value),className:Ue.input_busqueda})]}),s.jsxs("div",{className:Ue.contenedor_acciones_botones,children:[s.jsxs("div",{className:Ue.contenedor_acciones,children:[i!==void 0&&s.jsxs(rn,{variant:"light",className:Ue.boton_basico,disabled:i?.cargando,onClick:i?.onClick,children:[s.jsx(Wu,{}),i?.cargando?"Actualizando...":"Actualizar tabla"]}),l!==void 0&&s.jsxs(rn,{onClick:l,variant:"light",className:Ue.boton_basico,children:[s.jsx(Gu,{})," Filtros"]}),u>0?s.jsxs("div",{className:Ue.texto_filtros,children:[s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{d:"M2 4h12M4 8h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),s.jsx("p",{children:qu(d,u)})]}):null]}),a!==void 0?s.jsxs(rn,{onClick:a,className:`${Ue.boton_basico} ${Ue.boton_excel}`,children:[s.jsx(Hu,{})," Excel"]}):null]}),s.jsx("div",{className:Ue.menu_configuraciones,children:s.jsx(df,{})})]})}const Gn={contenedor_paginacion:"_contenedor_paginacion_1di9q_1",info_paginacion:"_info_paginacion_1di9q_19",contenedor_botones:"_contenedor_botones_1di9q_35",boton_paginacion:"_boton_paginacion_1di9q_71",pagina_activa:"_pagina_activa_1di9q_89",boton_num_paginacion:"_boton_num_paginacion_1di9q_99"};function ff(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n}=t,o=n.getPrePaginationRowModel().rows.length,r=n.getPageCount()||1,{pageIndex:i}=n.getState().pagination,a=i+1,l=Lu(a,r),d=n.getCanPreviousPage(),u=n.getCanNextPage(),f=r>1,g=()=>{d&&n.previousPage()},_=()=>{u&&n.nextPage()},c=h=>{n.setPageIndex(h-1)};return s.jsxs("section",{className:Gn.contenedor_paginacion,children:[s.jsxs("p",{className:Gn.info_paginacion,children:["Documentos: ",o]}),f&&s.jsxs("div",{className:Gn.contenedor_botones,children:[d&&s.jsx(oa,{onClick:g,"aria-disabled":!d,className:Gn.boton_paginacion}),l.map(h=>s.jsx("button",{type:"button",onClick:()=>c(h),className:h===a?Gn.pagina_activa:Gn.boton_num_paginacion,children:h},h)),u&&s.jsx(ra,{onClick:_,"aria-disabled":!u,className:Gn.boton_paginacion})]}),s.jsxs("p",{className:Gn.info_paginacion,children:["Página ",a," de ",r]})]})}const Ne={contenedor_tabla_cards:"_contenedor_tabla_cards_1xee4_1",contenedor_card:"_contenedor_card_1xee4_11",contenedor_encabezado_card:"_contenedor_encabezado_card_1xee4_25",contenedor_columna_card:"_contenedor_columna_card_1xee4_47",card_label:"_card_label_1xee4_57",card_valor:"_card_valor_1xee4_69",card_segundo_valor:"_card_segundo_valor_1xee4_83",contenedor_contenido_cards:"_contenedor_contenido_cards_1xee4_93",contenedor_fila_card:"_contenedor_fila_card_1xee4_105",card_fila_label:"_card_fila_label_1xee4_119",card_fila_valor:"_card_fila_valor_1xee4_137",contenedor_acciones_card:"_contenedor_acciones_card_1xee4_153",boton_acciones:"_boton_acciones_1xee4_171",boton_card:"_boton_card_1xee4_207"};function la(e,t){if(t)return e.find(n=>n.accessorKey===t||n.id!==void 0&&n.id===String(t))}function ca(e){if(e)return e.id??e.accessorKey}const Dn={skeleton_elemento:"_skeleton_elemento_5jnrx_1",skeleton_elemento_encabezado:"_skeleton_elemento_encabezado_5jnrx_23",skeleton_elemento_encabezado_segundo:"_skeleton_elemento_encabezado_segundo_5jnrx_73",skeleton_elemento_contenido:"_skeleton_elemento_contenido_5jnrx_99",skeleton_accion:"_skeleton_accion_5jnrx_107"};function _f({filas:e,cantidadControles:t=0,table:n,idPrimeraColumna:o,idSegundaColumna:r}){const a=n.getAllLeafColumns().filter(d=>d.id!=="actions"&&d.id!==o&&d.id!==r),l=["25vw","30vw","20vw","28vw","22vw","26vw"];return s.jsx("section",{className:Ne.contenedor_tabla_cards,children:Array.from({length:e}).map((d,u)=>s.jsxs("article",{className:Ne.contenedor_card,children:[s.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[s.jsx("div",{className:Ne.contenedor_columna_card,children:o&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(o,n)}),s.jsx("div",{className:Ne.card_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado}`})})]})}),s.jsx("div",{className:Ne.contenedor_columna_card,children:r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(r,n)}),s.jsx("div",{className:Ne.card_segundo_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado_segundo}`})})]})})]}),s.jsx("div",{className:Ne.contenedor_contenido_cards,children:a.map((f,g)=>s.jsxs("div",{className:Ne.contenedor_fila_card,children:[s.jsx("div",{className:Ne.card_fila_label,children:gt(f.id,n)}),s.jsx("div",{className:Ne.card_fila_valor,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_contenido}`,style:{width:l[g%l.length]}})})]},f.id))}),t>0&&s.jsx("div",{className:Ne.contenedor_acciones_card,children:Array.from({length:Math.min(t,3)}).map((f,g)=>s.jsx("div",{className:Dn.skeleton_accion,children:s.jsx("div",{className:`${Dn.skeleton_elemento} ${Dn.skeleton_elemento_encabezado}`})},`accion-${g}`))})]},`skeleton-card-${u}`))})}const Wn={contenedor:"_contenedor_53kvd_1",envolvedor_cuadricula:"_envolvedor_cuadricula_53kvd_33",svg_cuadricula:"_svg_cuadricula_53kvd_61",envolvedor_contenido:"_envolvedor_contenido_53kvd_77",icono_carpeta:"_icono_carpeta_53kvd_97",titulo:"_titulo_53kvd_111",descripcion:"_descripcion_53kvd_129",boton_agregar:"_boton_agregar_53kvd_145"};function da(){const e=m.useContext(Pr),{sinDatosProps:t}=e?.state||{},{alAgregarRegistro:n,titulo:o="No se encontraron resultados",descripcion:r="No hay datos que coincidan con tus filtros. Intenta buscar por otra variable o agrega un nuevo registro.",etiquetaAccion:i="Agregar nuevo registro"}=t||{};return s.jsxs("div",{className:Wn.contenedor,children:[s.jsx(gf,{}),s.jsxs("div",{className:Wn.envolvedor_contenido,children:[s.jsx(pf,{}),s.jsx("h3",{className:Wn.titulo,children:o}),s.jsx("p",{className:Wn.descripcion,children:r}),n?s.jsxs(rn,{onClick:n,variant:"bordered",className:Wn.boton_agregar,children:[s.jsx(ia,{})," ",i]}):null]})]})}function gf(){return s.jsx("div",{className:Wn.envolvedor_cuadricula,children:s.jsxs("svg",{className:Wn.svg_cuadricula,width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("defs",{children:s.jsx("pattern",{id:"patronCuadricula",width:"40",height:"40",patternUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 40 0 L 0 0 0 40",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),s.jsx("rect",{width:"100%",height:"100%",fill:"url(#patronCuadricula)"})]})})}function pf(){return s.jsxs("svg",{className:Wn.icono_carpeta,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M10 25C10 22.2386 12.2386 20 15 20H40L50 30H85C87.7614 30 90 32.2386 90 35V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V25Z",fill:"var(--color-placeholder)"}),s.jsx("path",{d:"M10 40C10 37.2386 12.2386 35 15 35H85C87.7614 35 90 37.2386 90 40V80C90 82.7614 87.7614 85 85 85H15C12.2386 85 10 82.7614 10 80V40Z",fill:"var(--base)",stroke:"var(--color-placeholder)",strokeWidth:"2"}),s.jsx("circle",{cx:"35",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("circle",{cx:"55",cy:"60",r:"2.5",fill:"var(--color-primary-text)"}),s.jsx("path",{d:"M42 65H48",stroke:"var(--color-primary-text)",strokeWidth:"1.5",strokeLinecap:"round"}),s.jsx("circle",{cx:"78",cy:"78",r:"14",fill:"var(--brand-primary)"}),s.jsx("path",{d:"M78 71V85M71 78H85",stroke:"var(--base)",strokeWidth:"2.5",strokeLinecap:"round"})]})}const hf=({fila:e,controls:t})=>(t?.length??0)>0?s.jsx("div",{className:Ne.contenedor_acciones_card,children:t?.map(o=>s.jsxs("button",{type:"button",title:o.nombre,onClick:()=>o.evento(e.original),className:`${Ne.boton_acciones} ${Ne.boton_card}`,children:[o.icono," ",o.nombre]},o.id))}):null,mf=({columnasRestantes:e,table:t})=>e.length===0?null:s.jsx("div",{className:Ne.contenedor_contenido_cards,children:e.map(n=>s.jsxs("div",{className:Ne.contenedor_fila_card,children:[s.jsx("div",{className:Ne.card_fila_label,children:gt(n.column.id,t)}),s.jsx("div",{className:Ne.card_fila_valor,children:ft(n.column.columnDef.cell,n.getContext())})]},n.id))}),vf=({fila:e,table:t,idPrimeraColumna:n,idSegundaColumna:o})=>{const r=ea(e,n),i=ea(e,o);return s.jsxs("div",{className:Ne.contenedor_encabezado_card,children:[s.jsx("div",{className:Ne.contenedor_columna_card,children:n&&r&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(n,t)}),s.jsx("div",{className:Ne.card_valor,children:Qs(e,n)})]})}),s.jsx("div",{className:Ne.contenedor_columna_card,children:o&&i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:Ne.card_label,children:gt(o,t)}),s.jsx("div",{className:Ne.card_segundo_valor,children:Qs(e,o)})]})})]})};function bf(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n,controls:o,primerasColumnas:r,loading:i,columns:a}=t;if(!n)return null;const l=a&&r?la(a,r[0]):void 0,d=a&&r?la(a,r[1]):void 0,u=ca(l),f=ca(d);if(i)return s.jsx(_f,{filas:3,cantidadControles:o?.length??0,table:n,idPrimeraColumna:u,idSegundaColumna:f});const g=n.getRowModel().rows;return g.length===0?s.jsx("article",{className:Ne.contenedor_card,children:s.jsx(da,{})}):s.jsx("section",{className:Ne.contenedor_tabla_cards,children:g.map(_=>{const c=Ou(_,u,f);return s.jsxs("article",{className:Ne.contenedor_card,children:[s.jsx(vf,{fila:_,table:n,idPrimeraColumna:u,idSegundaColumna:f}),s.jsx(mf,{columnasRestantes:c,table:n}),s.jsx(hf,{fila:_,controls:o})]},_.id)})})}const ua={filas:"_filas_un2v3_1",columnas:"_columnas_un2v3_43"},wf=({columnas:e,filas:t})=>s.jsx(s.Fragment,{children:Array.from({length:t}).map((n,o)=>s.jsx("tr",{className:ua.filas,children:Array.from({length:e}).map((r,i)=>s.jsx("td",{className:ua.columnas},`sk-cell-${o}-${i}`))},`sk-row-${o}`))}),et={contenedor:"_contenedor_1mvgy_1",barra:"_barra_1mvgy_17",info:"_info_1mvgy_39",btn_cerrar:"_btn_cerrar_1mvgy_51",contador:"_contador_1mvgy_67",separador:"_separador_1mvgy_83",acciones:"_acciones_1mvgy_97"};function yf({totalSeleccionadas:e,acciones:t,filasSeleccionadas:n,onLimpiarSeleccion:o}){const[r,i]=m.useState(0),[a,l]=m.useState([]),[d,u]=m.useState([]),f=e>0,g=m.useRef(null);return aa(o,f),m.useEffect(()=>{f&&(i(e),l(t),u(n))},[e,t,n,f]),s.jsx(Tt,{mostrar:f,tipo:"escalar",className:et.contenedor,children:s.jsxs("div",{ref:g,className:et.barra,children:[s.jsxs("div",{className:et.info,children:[s.jsx(rn,{isIconOnly:!0,variant:"light",color:"default",size:"md",radius:"md",onClick:o,"aria-label":"Limpiar selección",className:et.btn_cerrar,children:s.jsx(Ju,{})}),s.jsxs("p",{className:et.contador,children:[r," filas seleccionadas"]})]}),s.jsx("div",{className:et.separador}),s.jsx("div",{className:et.acciones,children:a.map(_=>s.jsx("div",{children:_.componente(d)},_.id))})]})})}function Cf(){const e=Hn();if(!e)return null;const{state:t}=e,{table:n,loading:o,columns:r,selectorFilas:i=[]}=t;if(!n)return null;const a=n.getHeaderGroups(),l=n.getRowModel().rows,d=r?.length??0,u=n.getSelectedRowModel().rows,f=u.length,g=()=>{n.resetRowSelection()};return s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:Ue.contenedor_tabla,children:[s.jsx("thead",{children:a.map(_=>s.jsx("tr",{children:_.headers.map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("th",{className:Ue.encabezados,style:h,"data-columna":c.id,children:c.id==="select"?s.jsx("div",{children:ft(c.column.columnDef.header,c.getContext())}):s.jsxs("div",{onClick:c.column.getToggleSortingHandler(),children:[ft(c.column.columnDef.header,c.getContext()),Tu(c.column.getIsSorted())]})},c.id)})},_.id))}),s.jsx("tbody",{className:Ue.contenedor_datos,children:o?s.jsx(wf,{columnas:d,filas:10}):l.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:d,style:{backgroundColor:"var(--base)"},children:s.jsx(da,{})})}):l.map(_=>s.jsx("tr",{className:`${Ue.datos} ${_.getIsSelected()?Ue.seleccionada:""}`,children:_.getVisibleCells().map(c=>{const h=c.column.columnDef.meta?.style;return s.jsx("td",{className:Ue.columna,style:h,"data-columna":c.column.id,children:ft(c.column.columnDef.cell,c.getContext())},c.id)})},_.id))})]}),i?.length>0?s.jsx(yf,{totalSeleccionadas:f,acciones:i,filasSeleccionadas:u.map(_=>_.original),onLimpiarSeleccion:g}):null]})}function xf({id:e}){const t=yo("only screen and (max-width: 830px)");return s.jsxs("main",{className:Ue.contenedor,id:e,children:[s.jsx(uf,{}),t?s.jsx(bf,{}):s.jsx(Cf,{}),s.jsx(ff,{})]})}function Sf({id:e,...t}){return s.jsx(Vu,{...t,children:s.jsx(xf,{id:e})})}const Ae={contenedor_radio:"_contenedor_radio_87ox4_1",envoltorio_radio:"_envoltorio_radio_87ox4_15",contenedor_label:"_contenedor_label_87ox4_33",texto_label:"_texto_label_87ox4_47",texto_descripcion:"_texto_descripcion_87ox4_65",marca_requerido:"_marca_requerido_87ox4_77",radio:"_radio_87ox4_85",input:"_input_87ox4_115",circulo_radio:"_circulo_radio_87ox4_141",punto_radio:"_punto_radio_87ox4_177",invalido:"_invalido_87ox4_207",solo_lectura:"_solo_lectura_87ox4_215",deshabilitado:"_deshabilitado_87ox4_227",tam_sm:"_tam_sm_87ox4_289",tam_lg:"_tam_lg_87ox4_315",color_primary:"_color_primary_87ox4_341",color_secondary:"_color_secondary_87ox4_349",color_success:"_color_success_87ox4_357",color_warning:"_color_warning_87ox4_365",color_danger:"_color_danger_87ox4_373",variante_card:"_variante_card_87ox4_381",grupo_radio:"_grupo_radio_87ox4_531",encabezado_grupo:"_encabezado_grupo_87ox4_545",label_grupo:"_label_grupo_87ox4_559",descripcion_grupo:"_descripcion_grupo_87ox4_573",contenedor_radios:"_contenedor_radios_87ox4_583",orientacion_vertical:"_orientacion_vertical_87ox4_593",orientacion_horizontal:"_orientacion_horizontal_87ox4_601",mensaje_error:"_mensaje_error_87ox4_609",grupo_invalido:"_grupo_invalido_87ox4_621",grupo_deshabilitado:"_grupo_deshabilitado_87ox4_629",grupo_solo_lectura:"_grupo_solo_lectura_87ox4_653",seleccionado:"_seleccionado_87ox4_679"},fa=m.createContext(void 0),$f=()=>m.useContext(fa),qr=m.memo(m.forwardRef(({value:e,label:t,description:n,size:o="md",color:r="primary",customColor:i,variant:a="default",isDisabled:l=!1,isReadOnly:d=!1,isInvalid:u=!1,isRequired:f=!1,children:g,className:_="",onChange:c,...h},p)=>{const v=$f(),w=m.useId(),C=h.id||w,x=v?.name||h.name,k=v?.size||o,z=v?.color||r,L=v?.customColor||i,N=v?.variant||a,P=v?.isDisabled||l,A=v?.isReadOnly||d,I=v?.isInvalid||u,O=v?.isRequired||f,q=v?.value!==void 0?v.value===e:void 0,$=g||t,b=F=>{P||A||(v?.onChange&&v.onChange(e),c&&c(F))},S=[Ae.contenedor_radio,Ae[`tam_${k}`],!L&&Ae[`color_${z}`],Ae[`variante_${N}`],P&&Ae.deshabilitado,A&&Ae.solo_lectura,I&&Ae.invalido,q&&Ae.seleccionado,_].filter(Boolean).join(" "),T=L?{"--radio-custom-color":L}:void 0;return s.jsx("div",{className:S,style:T,children:s.jsxs("label",{className:Ae.envoltorio_radio,htmlFor:C,children:[s.jsxs("div",{className:Ae.radio,children:[s.jsx("input",{ref:p,type:"radio",id:C,name:x,value:e,checked:q,disabled:P,readOnly:A,required:O,"aria-invalid":I,className:Ae.input,onChange:b,...h}),s.jsx("div",{className:Ae.circulo_radio,children:s.jsx("div",{className:Ae.punto_radio})})]})," ",$&&s.jsxs("div",{className:Ae.contenedor_label,children:[s.jsxs("span",{className:Ae.texto_label,children:[$,f&&!v&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),n&&s.jsx("span",{className:Ae.texto_descripcion,children:n})]})]})})}));qr.displayName="Radio";const _a=({name:e,value:t,defaultValue:n,onChange:o,orientation:r="horizontal",label:i,description:a,isDisabled:l=!1,isReadOnly:d=!1,isRequired:u=!1,isInvalid:f=!1,errorMessage:g,size:_,color:c,customColor:h,variant:p,justifyContent:v="flex-start",children:w,className:C="",options:x,optionValueKey:k,optionLabelKey:z,optionDisabledKey:L,optionDescriptionKey:N})=>{const[P,A]=m.useState(String(n??"")),I=t!==void 0?String(t):P,q={name:e,value:I,onChange:S=>{l||d||(t===void 0&&A(S),o&&o(S))},size:_,color:c,customColor:h,variant:p,isDisabled:l,isReadOnly:d,isInvalid:f,isRequired:u},$=[Ae.grupo_radio,Ae[`orientacion_${r}`],f&&Ae.grupo_invalido,l&&Ae.grupo_deshabilitado,d&&Ae.grupo_solo_lectura,C].filter(Boolean).join(" "),b=v==="center"?"center":v==="flex-end"?"right":"left";return s.jsx(fa.Provider,{value:q,children:s.jsxs("div",{className:$,role:"radiogroup","aria-required":u,"aria-invalid":f,style:{textAlign:b},children:[i&&s.jsxs("div",{className:Ae.encabezado_grupo,children:[s.jsxs("label",{className:Ae.label_grupo,children:[i,u&&s.jsx("span",{className:Ae.marca_requerido,children:" *"})]}),a&&s.jsx("span",{className:Ae.descripcion_grupo,children:a})]}),s.jsx("div",{className:Ae.contenedor_radios,style:{justifyContent:v},children:x&&x.length>0?x.map((S,T)=>{let F,y,M=!1,D;if(typeof S=="object"&&S!==null){const B=k??"value",G=z??"label",V=L??"isDisabled",J=N??"description",U=S[B],pe=S[G];F=String(U!==void 0?U:T),y=pe;const ue=S[V];M=typeof ue=="boolean"?ue:!1;const se=S[J];D=typeof se=="string"?se:void 0}else F=String(S),y=S;return s.jsx(qr,{value:F,isDisabled:M,description:D,children:y},F)}):w}),f&&g&&s.jsx("span",{className:Ae.mensaje_error,children:g})]})})};_a.displayName="RadioGroup";const ln={backdrop:"_backdrop_1fyqe_1",visible:"_visible_1fyqe_37",drawer:"_drawer_1fyqe_57",posicion_right:"_posicion_right_1fyqe_123",drawer_detras:"_drawer_detras_1fyqe_155",posicion_left:"_posicion_left_1fyqe_163",posicion_top:"_posicion_top_1fyqe_203",posicion_bottom:"_posicion_bottom_1fyqe_243",radio_none:"_radio_none_1fyqe_283",radio_sm:"_radio_sm_1fyqe_291",radio_md:"_radio_md_1fyqe_311",radio_lg:"_radio_lg_1fyqe_331",radio_xl:"_radio_xl_1fyqe_351",tamano_sm:"_tamano_sm_1fyqe_451",tamano_md:"_tamano_md_1fyqe_461",tamano_lg:"_tamano_lg_1fyqe_471",tamano_xl:"_tamano_xl_1fyqe_481",tamano_full:"_tamano_full_1fyqe_491",encabezado:"_encabezado_1fyqe_551",titulo:"_titulo_1fyqe_571",boton_cerrar:"_boton_cerrar_1fyqe_591",contenido:"_contenido_1fyqe_645",pie:"_pie_1fyqe_657",loading_overlay:"_loading_overlay_1fyqe_677",spinner:"_spinner_1fyqe_701",spin:"_spin_1fyqe_701",loading_text:"_loading_text_1fyqe_731",resize_handle:"_resize_handle_1fyqe_743"},ga=m.forwardRef(({isOpen:e,onClose:t,position:n="right",size:o="md",title:r,showCloseButton:i=!0,closeOnBackdropClick:a=!0,closeOnEscape:l=!0,preventScroll:d=!0,header:u,footer:f,children:g,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",onOpen:v,backdropVariant:w="normal",borderRadius:C,resizable:x=!1,zIndex:k,getContainer:z},L)=>{const N=m.useRef(null),[P,A]=m.useState(!1),I=m.useCallback(()=>{P||(A(!0),setTimeout(()=>{t?.(),A(!1)},650))},[t,P]);m.useEffect(()=>{e&&A(!1)},[e]),m.useEffect(()=>{if(e){if(v?.(),d){const V=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",V>0&&(document.body.style.paddingRight=`${V}px`)}if(l){const V=J=>{J.key==="Escape"&&I()};return document.addEventListener("keydown",V),()=>{document.removeEventListener("keydown",V),d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{d&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,I,l,d,v]);const O=V=>{a&&V.target===N.current&&I()},q=C?ln[`radio_${C}`]:void 0,$=e&&!P,b=[ln.drawer,ln[`posicion_${n}`],ln[`tamano_${o}`],$&&ln.visible,q,_].filter(Boolean).join(" "),S=[ln.contenido,c].filter(Boolean).join(" "),T=[ln.backdrop,$&&ln.visible].filter(Boolean).join(" "),F=k||500,y={transparente:{opacity:0},sutil:{opacity:.2},normal:{opacity:.4},intermedio:{opacity:.6},intenso:{opacity:.8}},M=y[w]||y.normal,{opacity:D}=M,B={background:`rgb(0 0 0 / ${D})`,zIndex:F,...z&&{position:"absolute"}},G=s.jsx("div",{className:T,ref:N,onClick:O,style:B,children:s.jsxs("div",{ref:L,className:b,role:"dialog","aria-modal":"true","aria-labelledby":"drawer-title",children:[(r||u)&&s.jsx("div",{className:ln.encabezado,children:u||s.jsxs(s.Fragment,{children:[s.jsx("h2",{id:"drawer-title",className:ln.titulo,children:r}),i&&s.jsx("button",{type:"button",className:ln.boton_cerrar,onClick:I,"aria-label":"Cerrar",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]})}),s.jsx("div",{className:S,children:g}),f&&s.jsx("div",{className:ln.pie,children:f}),h&&s.jsxs("div",{className:ln.loading_overlay,children:[s.jsx("div",{className:ln.spinner}),s.jsx("span",{className:ln.loading_text,children:p})]}),x&&s.jsx("div",{className:ln.resize_handle})]})});if(z){const V=typeof z=="function"?z():z;if(V&&V instanceof HTMLElement)return pt.createPortal(G,V)}return G});ga.displayName="Drawer";const cn={backdrop:"_backdrop_mpzhi_1",visible:"_visible_mpzhi_37",centrado:"_centrado_mpzhi_61",modal:"_modal_mpzhi_69",tamano_sm:"_tamano_sm_mpzhi_143",tamano_md:"_tamano_md_mpzhi_151",tamano_lg:"_tamano_lg_mpzhi_159",tamano_xl:"_tamano_xl_mpzhi_167",tamano_formulario:"_tamano_formulario_mpzhi_175",tamano_full:"_tamano_full_mpzhi_183",tamano_auto:"_tamano_auto_mpzhi_191",encabezado:"_encabezado_mpzhi_201",contenedor_titulo_completo:"_contenedor_titulo_completo_mpzhi_215",contenedor_titulo_icono:"_contenedor_titulo_icono_mpzhi_225",boton_atras:"_boton_atras_mpzhi_237",icono_titulo:"_icono_titulo_mpzhi_279",titulo:"_titulo_mpzhi_293",contenido:"_contenido_mpzhi_313",pie:"_pie_mpzhi_325",loading_overlay:"_loading_overlay_mpzhi_345",spinner:"_spinner_mpzhi_369",spin:"_spin_mpzhi_369",loading_text:"_loading_text_mpzhi_399"},pa=m.forwardRef(({isOpen:e,onClose:t,size:n="md",title:o,titleIcon:r,closeOnBackdropClick:i=!1,closeOnEscape:a=!0,preventScroll:l=!0,isCentered:d=!0,header:u,footer:f,children:g,className:_="",contentClassName:c="",isLoading:h=!1,loadingMessage:p="Cargando...",backdropVariant:v="normal",showIconTitle:w=!1,onOpen:C},x)=>{const k=m.useRef(null),z=m.useCallback(()=>{h||t?.()},[t,h]);m.useEffect(()=>{if(e){if(C?.(),l){const $=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",$>0&&(document.body.style.paddingRight=`${$}px`)}if(a){const $=b=>{b.key==="Escape"&&z()};return document.addEventListener("keydown",$),()=>{document.removeEventListener("keydown",$),l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}return()=>{l&&(document.body.style.overflow="",document.body.style.paddingRight="")}}},[e,z,a,l,C]);const L=$=>{i&&$.target===k.current&&z()},N=[cn.backdrop,d&&cn.centrado,e&&cn.visible].filter(Boolean).join(" "),P=[cn.modal,cn[`tamano_${n}`],_].filter(Boolean).join(" "),A=[cn.contenido,c].filter(Boolean).join(" "),I={transparente:{opacity:0},sutil:{opacity:.3},normal:{opacity:.5},intermedio:{opacity:.7},intenso:{opacity:.9}},{opacity:O}=I[v]||I.normal,q={background:`rgb(0 0 0 / ${O})`};return s.jsx("div",{className:N,ref:k,onClick:L,style:q,children:s.jsxs("div",{ref:x,className:P,role:"dialog","aria-modal":"true","aria-labelledby":"modal-title",children:[(o||u)&&s.jsx("div",{className:cn.encabezado,children:s.jsx("div",{className:cn.contenedor_titulo_completo,children:u||s.jsx(s.Fragment,{children:s.jsxs("div",{className:cn.contenedor_titulo_icono,children:[w&&r!==void 0&&(typeof r=="string"?s.jsx("span",{className:cn.icono_titulo,children:r}):r),w&&r===void 0&&s.jsx("span",{className:cn.icono_titulo,children:"📄"}),s.jsx("h2",{id:"modal-title",className:cn.titulo,children:o})]})})})}),s.jsx("div",{className:A,children:g}),f&&s.jsx("div",{className:cn.pie,children:f}),h&&s.jsxs("div",{className:cn.loading_overlay,children:[s.jsx("div",{className:cn.spinner}),s.jsx("span",{className:cn.loading_text,children:p})]})]})})});pa.displayName="Modal";const bn={overlay:"_overlay_1jsdb_1",container:"_container_1jsdb_47",modal:"_modal_1jsdb_65",modal_closing:"_modal_closing_1jsdb_125",modal_detras:"_modal_detras_1jsdb_143",header:"_header_1jsdb_217",button_back:"_button_back_1jsdb_233",title_container:"_title_container_1jsdb_289",title_icon:"_title_icon_1jsdb_305",title:"_title_1jsdb_289",content:"_content_1jsdb_337",footer:"_footer_1jsdb_349"};function kf({modals:e,onClose:t}){const[n,o]=m.useState([]),[r,i]=m.useState(!1);m.useEffect(()=>{const _=()=>{i(window.innerWidth<=768)};return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const a=_=>{o(c=>[...c,_]),setTimeout(()=>{t(_),o(c=>c.filter(h=>h!==_))},300)};if(e.length===0)return null;const l=e.length-1,d=500,u=24,f=e.length*d+(e.length-1)*u,g=e.length>1?f/2-d/2-l*(d+u):0;return s.jsx("div",{className:bn.overlay,children:s.jsx("div",{className:bn.container,style:r?void 0:{transform:`translateX(${g}px)`},children:e.map((_,c)=>{const h=n.includes(_.id),p=c===e.length-1,v=[bn.modal,h&&bn.modal_closing,!p&&bn.modal_detras].filter(Boolean).join(" ");return s.jsxs("div",{className:v,children:[s.jsxs("div",{className:bn.header,children:[s.jsx("button",{type:"button",className:bn.button_back,onClick:()=>a(_.id),"aria-label":"Volver",children:s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:s.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),s.jsxs("div",{className:bn.title_container,children:[_.titleIcon&&s.jsx("span",{className:bn.title_icon,children:_.titleIcon}),s.jsx("h2",{className:bn.title,children:_.title})]})]}),s.jsx("div",{className:bn.content,children:_.content}),_.footer&&s.jsx("div",{className:bn.footer,children:_.footer})]},_.id)})})})}const Vr=m.createContext(null),jr=()=>{const e=m.useContext(Vr);if(!e)throw new Error("useDropdownContext debe usarse dentro de DropdownMenu o ContextMenu");return e},At=e=>e.type==="separator"||e.type==="label"?!1:"children"in e&&Array.isArray(e.children)&&e.children.length>0,ha=e=>e.type==="checkbox",ma=e=>e.type==="radio",va=e=>e.type==="separator",ba=e=>e.type==="label",ke={menu:"_menu_1v23n_1",variant_default:"_variant_default_1v23n_49",variant_elevated:"_variant_elevated_1v23n_59",variant_bordered:"_variant_bordered_1v23n_69",variant_glass:"_variant_glass_1v23n_83",size_sm:"_size_sm_1v23n_97",size_md:"_size_md_1v23n_113",size_lg:"_size_lg_1v23n_127",item:"_item_1v23n_143",disabled:"_disabled_1v23n_201",active:"_active_1v23n_203",loading:"_loading_1v23n_249",spinner_item:"_spinner_item_1v23n_261",spinItem:"_spinItem_1v23n_1",danger:"_danger_1v23n_293",has_submenu:"_has_submenu_1v23n_307",submenu_open:"_submenu_open_1v23n_315",indicator:"_indicator_1v23n_323",start_icon:"_start_icon_1v23n_353",content:"_content_1v23n_395",label_text:"_label_text_1v23n_413",description:"_description_1v23n_425",shortcut:"_shortcut_1v23n_443",end_icon:"_end_icon_1v23n_467",submenu_arrow:"_submenu_arrow_1v23n_497",separator:"_separator_1v23n_533",label:"_label_1v23n_413",menuEnter:"_menuEnter_1v23n_1",context_menu_trigger:"_context_menu_trigger_1v23n_667"},If=()=>s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("polyline",{points:"20 6 9 17 4 12"})}),Ef=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Mf=({marcado:e})=>s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),e&&s.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"})]}),Br=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=jr();if(va(e))return s.jsx("div",{className:K(ke.separator,i.classNames?.separator),role:"separator"});if(ba(e))return s.jsx("div",{className:K(ke.label,i.classNames?.label),role:"presentation","data-testid":"dropdown-label",children:e.label});const a=t===n,l=ha(e),d=ma(e),u=N=>{"isDisabled"in e&&e.isDisabled||(l?e.onCheckedChange?.(!e.isChecked):d&&i.onRadioChange?.(e.value),"onSelect"in e&&e.onSelect&&e.onSelect(N),i.closeOnSelect&&!At(e)&&i.cerrarMenu())},f=N=>{u(N)},g=N=>{"isDisabled"in e&&e.isDisabled||(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),u(N))},_=l?e.isChecked:!1,c=d?i.radioValue===e.value:!1,h="label"in e?e.label:void 0,p="description"in e?e.description:void 0,v="shortcut"in e?e.shortcut:void 0,w="startIcon"in e?e.startIcon:void 0,C="endIcon"in e?e.endIcon:void 0,x="isDisabled"in e?e.isDisabled:!1,k="isLoading"in e?e.isLoading:!1,z="isDanger"in e?e.isDanger:!1,L="className"in e?e.className:void 0;return s.jsxs("div",{ref:r,role:l?"menuitemcheckbox":d?"menuitemradio":"menuitem","aria-checked":l?_:d?c:void 0,"aria-disabled":x||k,tabIndex:a?0:-1,className:K(ke.item,ke[`size_${i.size}`],a&&ke.active,x&&ke.disabled,k&&ke.loading,z&&ke.danger,At(e)&&ke.has_submenu,L,i.classNames?.item),onClick:f,onKeyDown:g,...o(),children:[k?s.jsx("span",{className:ke.indicator,children:s.jsx("span",{className:ke.spinner_item})}):(l||d)&&s.jsxs("span",{className:ke.indicator,children:[l&&_&&s.jsx(If,{}),d&&s.jsx(Mf,{marcado:c})]}),!k&&w&&s.jsx("span",{className:ke.start_icon,children:w}),s.jsxs("span",{className:ke.content,children:[s.jsx("span",{className:ke.label_text,children:h}),p&&s.jsx("span",{className:ke.description,children:p})]}),v&&s.jsx("kbd",{className:ke.shortcut,children:v}),C&&s.jsx("span",{className:ke.end_icon,children:C}),At(e)&&s.jsx("span",{className:ke.submenu_arrow,children:s.jsx(Ef,{})})]})});Br.displayName="MenuItem";const Nf=()=>s.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Eo=({items:e,activeIndex:t,getItemProps:n,listRef:o})=>s.jsx(s.Fragment,{children:e.map((r,i)=>At(r)?s.jsx(Hr,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id):s.jsx(Br,{ref:a=>{o.current[i]=a},item:r,index:i,activeIndex:t,getItemProps:n},r.id))});Eo.displayName="MenuList";const Hr=m.forwardRef(({item:e,index:t,activeIndex:n,getItemProps:o},r)=>{const i=jr(),[a,l]=m.useState(!1),d=Yn(),u=os(),f=m.useRef([]),[g,_]=m.useState(null),{refs:c,floatingStyles:h,context:p,isPositioned:v}=po({nodeId:u,open:a,onOpenChange:l,placement:"right-start",middleware:[oo({mainAxis:4,alignmentAxis:-4}),io(),ro({padding:8})],whileElementsMounted:eo}),{isMounted:w,styles:C}=wo(p,{duration:i.disableAnimation?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(2px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(2px)"},common:{transitionTimingFunction:i.disableAnimation?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}}),x=lr(p,{enabled:!e.isDisabled,delay:{open:75},handleClose:ks({blockPointerEvents:!0})}),k=bo(p,{role:"menu"}),z=go(p,{bubbles:!0}),L=hr(p,{listRef:f,activeIndex:g,onNavigate:_,nested:!0}),{getReferenceProps:N,getFloatingProps:P,getItemProps:A}=ho([x,k,z,L]);m.useEffect(()=>{if(!d)return;const q=()=>l(!1);return d.events.on("click",q),()=>{d.events.off("click",q)}},[d]);const I=t===n,O=Ri([c.setReference,r]);return s.jsxs(rs,{id:u,children:[s.jsxs("div",{ref:O,role:"menuitem","aria-haspopup":"menu","aria-expanded":a,"aria-disabled":e.isDisabled,tabIndex:I?0:-1,className:K(ke.item,ke[`size_${i.size}`],I&&ke.active,e.isDisabled&&ke.disabled,e.isDanger&&ke.danger,ke.has_submenu,a&&ke.submenu_open,e.className,i.classNames?.item),...N(o()),children:[e.startIcon&&s.jsx("span",{className:ke.start_icon,children:e.startIcon}),s.jsxs("span",{className:ke.content,children:[s.jsx("span",{className:ke.label_text,children:e.label}),e.description&&s.jsx("span",{className:ke.description,children:e.description})]}),e.shortcut&&s.jsx("kbd",{className:ke.shortcut,children:e.shortcut}),s.jsx("span",{className:ke.submenu_arrow,children:s.jsx(Nf,{})})]}),w&&s.jsx(_o,{root:i.portalContainer,children:s.jsx(fr,{context:p,modal:!1,initialFocus:-1,returnFocus:!1,children:s.jsx("div",{ref:c.setFloating,style:{...h,pointerEvents:"none",zIndex:i.zIndex??"var(--z-dropdown)"},children:s.jsx("div",{className:K(ke.menu,ke[`variant_${i.variant}`],i.classNames?.menu),style:{...C,pointerEvents:"auto",visibility:v||!a?"visible":"hidden"},...P(),children:s.jsx(Eo,{items:e.children,activeIndex:g,getItemProps:A,listRef:f})})})})})]})});Hr.displayName="Submenu";const wa=m.forwardRef(({children:e,items:t,triggerAction:n="click",placement:o="bottom-start",variant:r="default",size:i="md",isDisabled:a=!1,offset:l=4,minWidth:d="180px",matchTriggerWidth:u=!1,disableAnimation:f=!1,closeOnClickOutside:g=!0,closeOnEscape:_=!0,closeOnSelect:c=!0,className:h,classNames:p,style:v,onOpen:w,onClose:C,onOpenChange:x,onContextMenu:k,isOpen:z,zIndex:L,portalContainer:N,radioValue:P,onRadioChange:A},I)=>{const[O,q]=m.useState(!1),[$,b]=m.useState(null),[S,T]=m.useState(0),F=m.useRef([]),y=m.useRef([]),M=os(),D=z!==void 0,B=D?z:O,G=m.useCallback(j=>{a&&j||(D||q(j),x?.(j),j?w?.():C?.())},[a,D,x,w,C]);m.useEffect(()=>{y.current=t.filter(j=>j.type!=="separator"&&j.type!=="label").map(j=>"label"in j&&typeof j.label=="string"?j.label:"")},[t]);const{refs:V,floatingStyles:J,context:U,isPositioned:pe}=po({nodeId:M,open:B,onOpenChange:G,placement:o,strategy:"fixed",middleware:[oo(l),io({fallbackAxisSideDirection:"start",padding:8}),ro({padding:8}),u?Ui({apply({rects:j,elements:H}){Object.assign(H.floating.style,{minWidth:`${j.reference.width}px`})}}):void 0].filter(Boolean),whileElementsMounted:eo}),ue=vs(U,{enabled:!a&&(n==="click"||n==="both"),toggle:!0}),se=lr(U,{enabled:!a&&n==="hover",delay:{open:150,close:150},handleClose:ks()}),he=go(U,{enabled:_||g,escapeKey:_,outsidePress:g}),fe=bo(U,{role:"menu"}),_e=hr(U,{listRef:F,activeIndex:$,onNavigate:b,loop:!0}),R=xs(U,{listRef:y,activeIndex:$,onMatch:b,enabled:B}),{getReferenceProps:te,getFloatingProps:oe,getItemProps:ae}=ho([ue,se,he,fe,_e,R]),{isMounted:ve,styles:ee}=wo(U,{duration:f?0:{open:250,close:200},initial:{opacity:0,transform:"scale(0.95) translateY(4px)"},open:{opacity:1,transform:"scale(1) translateY(0)"},close:{opacity:0,transform:"scale(0.95) translateY(4px)"},common:{transitionTimingFunction:f?void 0:"cubic-bezier(0.16, 1, 0.3, 1)"}});m.useImperativeHandle(I,()=>({open:()=>G(!0),close:()=>G(!1),toggle:()=>G(!B),isOpen:B}),[G,B]);const we=m.useMemo(()=>({radioValue:P,onRadioChange:A,cerrarMenu:()=>G(!1),closeOnSelect:c,size:i,variant:r,disableAnimation:f,classNames:p,portalContainer:N,zIndex:L}),[P,A,G,c,i,r,f,p,N,L]),Se=m.isValidElement(e)?e:null,le=Ri([V.setReference,Se?.ref||null]);if(!Se)return e!=null&&console.error("DropdownMenu: children debe ser un elemento React válido"),null;const ye=n==="contextmenu"||n==="both"?{onContextMenu:j=>{j.preventDefault();const H={x:j.clientX,y:j.clientY};k?.(j,H),G(!1),T(me=>me+1),requestAnimationFrame(()=>{V.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:H.x,y:H.y,top:H.y,left:H.x,right:H.x,bottom:H.y}}}),G(!0)})},onClick:()=>{B&&n==="contextmenu"&&G(!1)}}:{},W=m.cloneElement(e,te({...e.props,...ye,ref:le,"aria-haspopup":"menu","aria-expanded":B}));return s.jsx(Vr.Provider,{value:we,children:s.jsxs(rs,{id:M,children:[W,ve&&s.jsx(_o,{root:N,children:s.jsx(fr,{context:U,modal:!1,initialFocus:-1,returnFocus:!0,children:s.jsx("div",{ref:V.setFloating,style:{...J,zIndex:L??"var(--z-dropdown)",outline:"none",pointerEvents:"none"},children:s.jsx("div",{role:"menu","aria-orientation":"vertical",className:K(ke.menu,ke[`variant_${r}`],ke[`size_${i}`],h,p?.menu),style:{...ee,minWidth:d,...v,transform:[ee.transform,v?.transform].filter(Boolean).join(" "),pointerEvents:"auto",visibility:pe||!B?"visible":"hidden"},...oe(),children:s.jsx(Eo,{items:t,activeIndex:$,getItemProps:ae,listRef:F})},S)})})})]})})});wa.displayName="DropdownMenuInner";const Mo=m.forwardRef((e,t)=>s.jsx(Xc,{children:s.jsx(wa,{...e,ref:t})}));Mo.displayName="DropdownMenu";const ya=m.forwardRef(({isEnabled:e=!0,children:t,...n},o)=>s.jsx(Mo,{...n,ref:o,triggerAction:"contextmenu",isDisabled:!e||n.isDisabled,children:t}));ya.displayName="ContextMenu";const Ln={group_button:"_group_button_1srmq_1",full_width:"_full_width_1srmq_9",main_button:"_main_button_1srmq_14",dropdown_trigger:"_dropdown_trigger_1srmq_18",first_item:"_first_item_1srmq_23",last_item:"_last_item_1srmq_28",variant_bordered:"_variant_bordered_1srmq_33",variant_ghost:"_variant_ghost_1srmq_34",variant_faded:"_variant_faded_1srmq_35",disabled:"_disabled_1srmq_47",loading:"_loading_1srmq_47",chevron:"_chevron_1srmq_56",chevron_open:"_chevron_open_1srmq_62"},Ff=({label:e,onClick:t,items:n,variant:o="solid",color:r="primary",size:i="md",radius:a="md",isLoading:l=!1,isDisabled:d=!1,dropdownIcon:u,className:f,fullWidth:g=!1,..._})=>{const[c,h]=m.useState(!1),p=K(Ln.group_button,Ln[`variant_${o}`],g&&Ln.full_width,f),v=()=>s.jsx("div",{className:K(Ln.chevron,c&&Ln.chevron_open),children:s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:s.jsx("path",{d:"m6 9 6 6 6-6"})})});return s.jsxs("div",{className:p,children:[s.jsx(rn,{variant:o,color:r,size:i,radius:a,isLoading:l,isDisabled:d,onClick:t,className:K(Ln.main_button,Ln.first_item),..._,children:e}),n&&s.jsx(Mo,{items:n,triggerAction:"click",onOpenChange:h,placement:"bottom-end",isDisabled:d||l,variant:"default",size:i,matchTriggerWidth:!1,children:s.jsx(rn,{variant:o,color:r,size:i,radius:a,isDisabled:d||l,isIconOnly:!0,className:K(Ln.dropdown_trigger,Ln.last_item),"aria-label":"M�s acciones",children:u||v()})})]})},Ca=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),xa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12zm5.75 9L15 18l1.16-1.16l1.59 1.59l3.59-3.59l1.16 1.41z"})}),Sa=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M14.76 20.83L17.6 18l-2.84-2.83l1.41-1.41L19 16.57l2.83-2.81l1.41 1.41L20.43 18l2.81 2.83l-1.41 1.41L19 19.4l-2.83 2.84zM12 12v7.88c.04.3-.06.62-.29.83a.996.996 0 0 1-1.41 0L8.29 18.7a.99.99 0 0 1-.29-.83V12h-.03L2.21 4.62a1 1 0 0 1 .17-1.4c.19-.14.4-.22.62-.22h14c.22 0 .43.08.62.22a1 1 0 0 1 .17 1.4L12.03 12z"})}),$a=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}),ka=()=>s.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:s.jsx("polyline",{points:"9 18 15 12 9 6"})}),Xe={overlay:"_overlay_1esoc_1",backdrop:"_backdrop_1esoc_25",visible:"_visible_1esoc_47",layout:"_layout_1esoc_71",columna_acciones:"_columna_acciones_1esoc_139",boton_flotante:"_boton_flotante_1esoc_159",boton_primario:"_boton_primario_1esoc_233",boton_peligro:"_boton_peligro_1esoc_243",panel:"_panel_1esoc_261",encabezado:"_encabezado_1esoc_289",titulo:"_titulo_1esoc_307",contenido:"_contenido_1esoc_323",paginacion:"_paginacion_1esoc_337",texto_paginacion:"_texto_paginacion_1esoc_363"},zf={transparente:{background:"transparent"},sutil:{background:"rgb(0 0 0 / 20%)"},normal:{background:"rgb(0 0 0 / 40%)"},intenso:{background:"rgb(0 0 0 / 60%)"}},Af=({isOpen:e,onClose:t,onApply:n,onClear:o,title:r="Filtros",backdropVariant:i="sutil",closeOnBackdropClick:a=!0,allowBackdropInteraction:l=!1,getContainer:d,children:u})=>{const[f,g]=m.useState(!1),[_,c]=m.useState(0),h=l||i==="transparente",p=m.useCallback(()=>{f||(g(!0),setTimeout(()=>{t(),g(!1),c(0)},650))},[t,f]);m.useEffect(()=>{e&&g(!1)},[e]),m.useEffect(()=>{if(!e)return;const I=O=>O.key==="Escape"&&p();return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[e,p]);const v=m.useCallback(I=>{a&&I.target===I.currentTarget&&p()},[a,p]),w=m.useCallback(I=>{document.activeElement?.blur(),I?.()},[]),{pages:C,totalPages:x,hasPagination:k}=m.useMemo(()=>{const I=Array.isArray(u)?u:[u];return{pages:I,totalPages:I.length,hasPagination:I.length>1}},[u]),{background:z}=zf[i],L={background:z,pointerEvents:h?"none":"auto"},N=d?{position:"absolute"}:{},P=d?{position:"relative"}:{},A=s.jsxs("div",{className:Xe.overlay,role:"dialog","aria-modal":"true",style:N,children:[s.jsx("div",{className:`${Xe.backdrop} ${e&&!f?Xe.visible:""}`,style:L,onClick:v}),s.jsxs("div",{className:`${Xe.layout} ${e&&!f?Xe.visible:""}`,style:P,children:[s.jsxs("aside",{className:Xe.columna_acciones,children:[s.jsx(Ft,{content:"Cerrar",placement:"left",children:s.jsx("button",{className:Xe.boton_flotante,onClick:()=>w(p),"aria-label":"Cerrar panel",children:s.jsx(Ca,{})})}),s.jsx(Ft,{content:"Aplicar filtros",placement:"left",children:s.jsx("button",{className:`${Xe.boton_flotante} ${Xe.boton_primario}`,onClick:()=>w(n),children:s.jsx(xa,{})})}),s.jsx(Ft,{content:"Limpiar filtros",placement:"left",children:s.jsx("button",{className:`${Xe.boton_flotante} ${Xe.boton_peligro}`,onClick:()=>w(o),children:s.jsx(Sa,{})})}),k&&s.jsxs("div",{className:Xe.paginacion,children:[s.jsx("button",{className:Xe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.max(0,I-1)),disabled:_===0,"aria-label":"Página anterior",children:s.jsx($a,{})}),s.jsxs("span",{className:Xe.texto_paginacion,children:[_+1," / ",x]}),s.jsx("button",{className:Xe.boton_flotante,style:{width:36,height:36},onClick:()=>c(I=>Math.min(x-1,I+1)),disabled:_===x-1,"aria-label":"Página siguiente",children:s.jsx(ka,{})})]})]}),s.jsxs("main",{className:Xe.panel,children:[s.jsx("header",{className:Xe.encabezado,children:s.jsx("h2",{className:Xe.titulo,children:r})}),s.jsx("div",{className:Xe.contenido,children:s.jsx("div",{style:{animation:"fadeIn 0.3s ease"},children:C[_]},_)})]})]})]});if(d){const I=typeof d=="function"?d():d;if(I&&I instanceof HTMLElement)return pt.createPortal(A,I)}return A};Z.Badge=Rr,Z.BadgeVoz=qo,Z.Boton=rn,Z.Checkbox=_t,Z.CheckboxGroup=Js,Z.ContextMenu=ya,Z.Drawer=ga,Z.DropdownContext=Vr,Z.DropdownMenu=Mo,Z.GrabacionIcono=ii,Z.GroupButton=Ff,Z.IconoCerrar=Ca,Z.IconoDerecha=ka,Z.IconoFiltroAplicar=xa,Z.IconoFiltroLimpiar=Sa,Z.IconoIzquierda=$a,Z.InputDate=ri,Z.InputNumeric=oi,Z.InputText=Qr,Z.MenuItem=Br,Z.MenuList=Eo,Z.MicrofonoIcono=To,Z.Modal=pa,Z.ModalStack=kf,Z.PanelFiltros=Af,Z.Radio=qr,Z.RadioGroup=_a,Z.Select=Os,Z.Signature=Jr,Z.SonidoIcono=Oo,Z.Submenu=Hr,Z.TablaDatos=Sf,Z.TextArea=ai,Z.Toggle=Lo,Z.Tooltip=Ft,Z.Transicion=Tt,Z.esCheckbox=ha,Z.esLabel=ba,Z.esRadio=ma,Z.esSeparador=va,Z.fechaEnRango=il,Z.formatearFecha=Po,Z.formatearNumero=ht,Z.generarOpcionesAleatorias=Ld,Z.generarUsuariosPrueba=Pd,Z.obtenerFechaHoy=rl,Z.parsearNumero=ei,Z.procesarValidacion=ni,Z.redondearDecimales=ti,Z.restringirRango=Pt,Z.tieneHijos=At,Z.useCheckboxGroupContext=Zs,Z.useDropdownContext=jr,Z.useReconocimientoVoz=si,Z.useTablaContext=ju,Z.useTablaContextSafe=Hn,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})}));
29
29
  //# sourceMappingURL=index.umd.cjs.map